Discussion:
IP_RECVTTL socket option.
Matthew N. Dodd
2003-04-29 22:15:30 UTC
Permalink
I've committed the IP_RECVTTL socket option to FreeBSD.

(From ip(4))
%%%
If the IP_RECVTTL option is enabled on a SOCK_DGRAM socket, the
recvmsg(2) call will return the IP TTL (time to live) field for a UDP
datagram. The msg_control field in the msghdr structure points to a
buffer that contains a cmsghdr structure followed by the TTL. The cms-
ghdr fields have the following values:

cmsg_len = sizeof(u_char)
cmsg_level = IPPROTO_IP
cmsg_type = IP_RECVTTL
%%%

This is needed for things like:

http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt

It would be useful of NetBSD and OpenBSD provided this feature as well.
--
| Matthew N. Dodd | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD |
| winter-***@public.gmane.org | 2 x '84 Volvo 245DL | ix86,sparc,pmax |
| http://www.jurai.net/~winter | For Great Justice! | ISO8802.5 4ever |

---------------------------------------------------------------------
The BSD APIs Discussion Mailing List
To unsubscribe:
send "unsubscribe bsd-api-discuss" to majordomo-of7zbby7T3pWk0Htik3J/***@public.gmane.org
itojun-MMLKt5r8Ll2sTnJN9+
2003-04-30 06:45:23 UTC
Permalink
Post by Matthew N. Dodd
I've committed the IP_RECVTTL socket option to FreeBSD.
(From ip(4))
%%%
If the IP_RECVTTL option is enabled on a SOCK_DGRAM socket, the
recvmsg(2) call will return the IP TTL (time to live) field for a UDP
datagram. The msg_control field in the msghdr structure points to a
buffer that contains a cmsghdr structure followed by the TTL. The cms-
cmsg_len = sizeof(u_char)
cmsg_level = IPPROTO_IP
cmsg_type = IP_RECVTTL
%%%
http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt
It would be useful of NetBSD and OpenBSD provided this feature as well.
FYI, IPv6 counterpart (IPV6_{RECV,}HOPLIMIT in 2292bis API) uses
cmsg_len = sizeof(int). not sure why it is not u_int8_t.

any reason why you don't support it for SOCK_RAW?

itojun

---------------------------------------------------------------------
The BSD APIs Discussion Mailing List
To unsubscribe:
send "unsubscribe bsd-api-discuss" to majordomo-of7zbby7T3pWk0Htik3J/***@public.gmane.org
Loading...