title: Get router mac (without system call for ARP) in Objective-C
body: <p>Ok - I am writing a daemon in Objective C that checks the connected router mac address every 5 seconds. </p>
  
  <p>I am completely new to objective C, and I am looking for a better way to do what I'm already doing. </p>
  
  <p>I'm currently calling "arp -a" and parsing the results via "Task":</p>
  
  <pre><code>NSTask *task;
  task = [[NSTask alloc] init];
  [task setLaunchPath: @"/usr/sbin/arp"];
  
  NSArray *arguments;
  arguments = [NSArray arrayWithObjects: @"-a", nil];
  [task setArguments: arguments]; 
  
  NSPipe *pipe;
  pipe = [NSPipe pipe];
  [task setStandardOutput: pipe];
  
  NSFileHandle *file;
  file = [pipe fileHandleForReading];
  
  [task launch];
  
  NSData *data;
  data = [file readDataToEndOfFile];
  </code></pre>
  
  <p>I'm afraid that this isn't very efficient. </p>
  
  <p>Any suggestions? I am running this codeblock once every 5 seconds.</p>