Re: determining if connection is local
Re: determining if connection is local
- Subject: Re: determining if connection is local
- From: "Justin C. Walker" <email@hidden>
- Date: Wed, 24 Sep 2003 23:39:59 -0700
On Wednesday, September 24, 2003, at 11:17 PM, Chaz McGarvey wrote:
Hello:
Using BSD sockets, I'm looking for a way to determine of a recently
accept()ed socket corresponds to a connection from the same computer.
I would know how to do this if I knew how to get a list of all the
possible IP addresses for the computer.
Sure. Commands like netstat and ifconfig can get that list. For one,
there's a sysctl that gives you the list. In addition, there's a
('obsolete') ioctl (SIOCGCONF) that will do it. Check the darwin
source (network_cmds project). Also, the book by W. Richard Stevens
(Unix Network Programming, V1, 2nd Ed, Prentice Hall) is a great aid in
figuring out this kind of question for BSD-derived systems. There's
code on his website (
http://www.kohala.com) that comes from his book.
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | It's not whether you win or
lose...
| It's whether *I* win or lose.
*--------------------------------------*-------------------------------*
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.