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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -