Re: SimplePing TTL
Re: SimplePing TTL
- Subject: Re: SimplePing TTL
- From: Aaron Ballman <email@hidden>
- Date: Thu, 22 Jul 2004 11:46:42 -0500
I am attempting to re-work the SimplePing example code into a
traceroute implementation, however one vital part which I can't seem
to find is the TTL field. How do I set the TTL for an outgoing ICMP
packet?
The TTL is in the packet header which you can set by using
setsockopt. It'll look something like this:
int ttl = 64;
int err = setsockopt( mSocket, IPPROTO_IP, IP_TTL, (char *)&ttl,
sizeof( ttl ) );
You set the option after you have created the socket descriptor but
before you've sent the packet.
HTH!
~Aaron
--
--
According to jailer Mike Fostquel, the captured nerds are model
prisoners. "They made a crude but listenable crystal radio out of a
light bulb, a crayon, a square of toilet paper, and a rock. They say
they'll have Linux on it by next week. They seem to be having a
really good time. Tell ya the truth, I'll hate to see 'em go." --
About Jailed Linux Users
_______________________________________________
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.