RAW socket under netgraph

Zanetta Serena serena.zanetta at guest.telecomitalia.it
Tue Feb 16 17:04:09 UTC 2010


Hi,
I am trying to implement the raw socket mechanism under Netgraph by setting the ng_ksocket node type as a raw socket. My purpose is to fill "by hand" the IP and UDP headers and then forward the so created packet to the raw socket to be delivered to the appropriate next hop.
I suppose I need to set the socket options as:
setsockopt(sd,IPPROTO_IP,IP_HDRINCL,...).
I found that the equivalent in the Netgraph is the control message "setopt". I've tried to set the options as:
ngctl msg node_name: setopt {level=IPPROTO_IP name=IP_HDRINCL  value=}
but it doesn't work. Also I don't know exactly which is the value of the "value" parameter. I would ask you how to set the options for the raw socket and if it is correct to type that command line.
Thank you,
Serena



More information about the freebsd-net mailing list