• 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: Joshua Graessley <email@hidden>
  • Date: Thu, 25 Sep 2003 11:21:38 -0700

Please don't use the ioctl directly, it's difficult to get right. If
you're going to use that, try getifaddrs instead. As Quinn noted, you
shouldn't do this for "security".

-josh

On Sep 24, 2003, at 11:39 PM, Justin C. Walker wrote:

> 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.

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.

References: 
 >Re: determining if connection is local (From: "Justin C. Walker" <email@hidden>)

  • Prev by Date: Apple-approved way to listen on well known ports?
  • Next by Date: Using BSD sockets with MacOS 8 and 9
  • Previous by thread: Re: determining if connection is local
  • Next by thread: Re: determining if connection is local
  • Index(es):
    • Date
    • Thread