Discover local address from socketfilter
Discover local address from socketfilter
- Subject: Discover local address from socketfilter
- From: Christopher Vitale <email@hidden>
- Date: Thu, 03 Nov 2005 17:51:02 -0500
- Thread-topic: Discover local address from socketfilter
Hello,
I need to capture all socket tuple information for UDP pkts in a
socketfilter. I need to use a socketfilter because I'm also recording socket
level data. A normal UDP application, like dig, doesn't trip connect or
notify events, as is expect for a protocol which isn't connection oriented.
The sf_data_out_func callback lists the foreign address and port in the *to
sockaddr_in, but the local interface hasn't been determined at this point.
sock_getsockname returns all zeroes . If I call sock_bind with INADDR_ANY
I'll get a port, but, of course, no local address. Calling sock_connect
breaks my DNS lookups; I'm still looking into this problem.
The interface function ifaddr_withroute looks promising, but I'm failing an
assert in route.c (radar #4328386). Given a destination ip, I need the
address that is determined in in_pcbladdr.
I don't have to worry about VPNs or NAT munging anything afterwards.
Any ideas?
Thanks,
vitale
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden