Anyone has an example on how to setsockopt on a ksocket node in netgraph?
struct opts {
int level;
int name;
int value;
} myopts = { SOL_SOCKET, SO_REUSEADDR, 1
};
ret = NgSendMsg(cs, epath, NGM_KSOCKET_COOKIE, NGM_KSOCKET_SETOPT,
--On 2002-01-17 19:11:45 +0100 [EMAIL PROTECTED] wrote:
>
>>ret = NgSendMsg(cs, epath, NGM_KSOCKET_COOKIE, NGM_KSOCKET_SETOPT,
>> (struct ng_ksocket_sockopt *)&myopts,
>> sizeof(myopts)));
>>
>> return error 14 "Bad address".
>
> Could it be that your path to the no
--On 2002-01-17 18:16:08 -0800 [EMAIL PROTECTED] wrote:
> Florent Parent writes:
>> Anyone has an example on how to setsockopt on a ksocket node in netgraph?
>>
>> struct opts {
>> int level;
>> int name;
>> int value;
>>
--On 2002-01-18 11:55:09 +0100 [EMAIL PROTECTED] wrote:
> 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 =
error = sosetopt(so, &sopt);
break;
}
Florent.
--
Florent Parent
Viagénie http://www.viagenie.qc.ca
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message
a 'struct sockopt'
as argument. From a quick glance, the socket functions that are concerned
are sosetopt() and sogetopt().
> If so, your fix looks like the right onw.
I will test the NGM_KSOCKET_GETOPT code path as I suspect that a similar
fix will be required.
Florent.
--
Flo
et_sockopt *)&myopts,
sizeof(myopts))) < 0) {
fprintf(stderr, "%s Cannot setopt the ksocket node: %s\n",
epath, strerror(errno));
return (-1);
}
Florent
--
Florent Parent
Viagénie http://www.viagenie.qc.ca
To Unsubscribe: send mail to [EMAIL PROTECTED]
wit