Date: Wed, 06 Feb 2002 10:10:15 -0500 From: Florent Parent <Florent.Parent@viagenie.qc.ca> To: Marko Zec <zec@tel.fer.hr>, freebsd-net@FreeBSD.ORG Subject: Re: ng_dummy - netgraph traffic shaping node Message-ID: <14420000.1013008215@blues.viagenie.qc.ca> In-Reply-To: <3C5E9DFE.4AEB55BE@tel.fer.hr> References: <Pine.BSF.4.21.0202011012400.67160-100000@InterJet.elischer.org> <3C5E9DFE.4AEB55BE@tel.fer.hr>
next in thread | previous in thread | raw e-mail | index | archive | help
--On 2002-02-04 15:43:10 +0100 zec@tel.fer.hr wrote:
> 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);
}
Florent
--
Florent Parent
Viagénie http://www.viagenie.qc.ca
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14420000.1013008215>
