Florent Parent writes:
> > Btw, where could I find some examples on parsing setsockopt() calls to
> > selected nodes, if such thing is possible at all?
> >
> 
> Here's how I do it on a ksocket node (patch on ksocket is required unless 
> you're using -CURRENT. Check thread on "netgraph: how to setsockopt on 
> ksocket node ?". )
> 
> struct opts {
>     int level;
>     int name;
>     int value;
> } myopts = { SOL_SOCKET, SO_REUSEADDR, 1 };
> 
> if ( (ret = NgSendMsg(cs, epath, NGM_KSOCKET_COOKIE, NGM_KSOCKET_SETOPT,
>                       (struct ng_ksocket_sockopt *)&myopts, 
> sizeof(myopts))) < 0) {
>     fprintf(stderr, "%s Cannot setopt the ksocket node: %s\n",
>             epath, strerror(errno));
>     return (-1);
> }

Plus, you need 4.5-stable for this to work because of
a bug that was recently fixed.

-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to