Hi Florent,

You use:

     struct opts {
         int level;
         int name;
         int value;
     } myopts;

     myopts.level = SOL_SOCKET;
     myopts.name  = SO_REUSEPORT;
     myopts.value = 1;

But socket options (on this level) are a predefined struct. Here's an 
example from some code I am working on:

     struct sockopt sopt;

     /* some code removed */

     bzero(&sopt, sizeof(sopt));
     sopt.sopt_level = SOL_SOCKET;
     sopt.sopt_name = SO_SNDBUF;
     bufsiz = 128 * 1024;      /* XXX */
     sopt.sopt_val = &bufsiz;
     sopt.sopt_valsize = sizeof(bufsiz);

Hope this clears a few things up =)   (BTW, I'm not using netgraph after 
this code, but I know from reading the netgraph source that this struct 
sockopt is what is used).

        Doc


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

Reply via email to