0

I need to sniff my traffic.

I've found some related posts: Monitor Network Traffic Mac

How to get network adapter stats in linux/Mac OSX?

And I've had a look at the MenuMeters project

But it implements only common information about traffic: amount of loaded bytes e.t.c

I am going to analyze source code of the wireshark

So I need to create a class that implements protocol:

@protocol NetworkMonitor

- (void)systemWillRequestUrl:(NSURL *)url;
- (BOOL)shouldSystemLoadUrl:(NSURL *)url;
// e.t.c.

@end

Could somebody give me information how can I do this, or point me to some open source projects, sniffers or something like this?

Community
  • 1
  • 1
BergP
  • 3,453
  • 4
  • 33
  • 58
  • The easiest (and that's still not easy) would be to use built-in libraries like libpcap. – zneak May 24 '14 at 07:23

1 Answers1

0

Can you build on top of nettop(command line utility). It provides lot of useful data that MenuMeter or Mac's Activity monitor doesn't provides.

nettop //displays network usage per application with lot of details
nettop (press h) //displays help menu
nettop (press c) //collapse and display brief info on network usage

Further reference

Sairam Krish
  • 10,158
  • 3
  • 55
  • 67