c - OSX equivalent for IP_RECVERR -
i'm trying port traceroute program linux osx, , i'm having trouble finding ip_recverr equivalent.
the way people packet parsing is:
setsockopt (sock, ipproto_ipv4, ip_recverr, &on, sizeof (on))
and when packet comes in along lines of:
sock_extended_err* err = nullptr; (cmsghdr* cmsg = cmsg_firsthdr(&msg); cmsg; cmsg = cmsg_nxthdr(&msg, cmsg)) { switch (cmsg->cmsg_level) { case ipproto_ipv4: if (cmsg->cmsg_type == ip_recverr) { err = (sock_extended_err*)csmsg_data(cmsg); } break; } }
there isn't sock_extended_err on osx problematic. need know if have had error, , error originated.
sorry os x not supporting extended ip_recverr
socket capabilities.
you can use: #ifdef ip_recverr
to make build on os x recverr/errqueue don't exist.
but if looking particular code execution, think have port ip_recverr
socket capability & msg_errqueue
in mac os x. thats sound "i got new things play". happy coding.
Comments
Post a Comment