• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: determining if connection is local
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Follow-Ups:
    • Re: determining if connection is local
      • From: Joshua Graessley <email@hidden>
References: 
 >determining if connection is local (From: Chaz McGarvey <email@hidden>)

  • Prev by Date: determining if connection is local
  • Next by Date: Re: determining if connection is local
  • Previous by thread: determining if connection is local
  • Next by thread: Re: determining if connection is local
  • Index(es):
    • Date
    • Thread