From owner-freebsd-net Tue Apr 9 12:56:22 2002 Delivered-To: freebsd-net@freebsd.org Received: from mel-rto7.wanadoo.fr (smtp-out-7.wanadoo.fr [193.252.19.26]) by hub.freebsd.org (Postfix) with ESMTP id 7C82F37B416 for ; Tue, 9 Apr 2002 12:56:13 -0700 (PDT) Received: from mel-rta7.wanadoo.fr (193.252.19.61) by mel-rto7.wanadoo.fr; 9 Apr 2002 21:56:08 +0200 Received: from spe (80.11.164.190) by mel-rta7.wanadoo.fr; 9 Apr 2002 21:56:08 +0200 Message-ID: <006401c1e000$9fa977f0$020110ac@SPE> From: "Sebastien Petit" To: "Julian Elischer" Cc: References: Subject: Re: Netgraph question Date: Tue, 9 Apr 2002 21:56:21 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 Disposition-Notification-To: "Sebastien Petit" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Ok julian, So I must write loadd with ng_ether for the moment and wait for ng_etf include in FreeBSD 4.x. I can modify my code after if ng_etf is available... Last question, when I write a packet on the lower hook, must I include a CRC32 field at the end of the ethernet packet ? I create a little test program for connecting lower <-> upper, but doesn't seem to work, what is wrong ? #include #include #include #include #include #include #include #define HOOKNAME "myhook" #define HOOKNAME2 "myhook2" int main(int argc, char **argv) { int csock, dsock; struct ngm_connect ngc; struct ngm_connect ngc2; int bytesread; char buf[4096]; char hookname[4096]; fd_set fds; u_short *csum; NgMkSockNode(NULL, &csock, &dsock); snprintf(ngc.path, sizeof(ngc.path), "xl0:"); snprintf(ngc.ourhook, sizeof(ngc.ourhook), HOOKNAME); snprintf(ngc.peerhook, sizeof(ngc.peerhook), "upper"); NgSendMsg(csock, ".", NGM_GENERIC_COOKIE, NGM_CONNECT, &ngc, sizeof(ngc)); snprintf(ngc2.path, sizeof(ngc2.path), "xl0:"); snprintf(ngc2.ourhook, sizeof(ngc2.ourhook), HOOKNAME2); snprintf(ngc2.peerhook, sizeof(ngc2.peerhook), "lower"); NgSendMsg(csock, ".", NGM_GENERIC_COOKIE, NGM_CONNECT, &ngc2, sizeof(ngc2)); for (;;) { bzero(buf, sizeof(buf)); bytesread = NgRecvData(dsock, buf, sizeof(buf), hookname); if (! strcmp(hookname, "myhook")) { printf("%s !\n", hookname); NgSendData(dsock, HOOKNAME2, buf, bytesread); } if (! strcmp(hookname, "myhook2")) { printf("%s !\n", hookname); NgSendData(dsock, HOOKNAME, buf, bytesread); } } } Thanks, Sebastien. -- spe@selectbourse.net ----- Original Message ----- From: "Julian Elischer" To: "Sebastien Petit" Cc: Sent: Tuesday, April 09, 2002 9:35 PM Subject: Re: Netgraph question > there is a node called etf (ethertype filter) > that can allow different nodes to share an ethernet interface > The ppp daemon needs to be modified a bit to be able to use it.. > > Brian, what does it take to allow one to specify a different node and > hook? > I.e. > > if I hook an ethertype filter onto the interface and set it up > to send pppoe to hook A and everything else to hook B is there soem way I > can tell PPP to uset node etf0:B rather than fxp0:orphans? > > The etf type is not MFC'd to 4.x yet.. > I need to do that! thanks for reminding me.. > > > > On Tue, 9 Apr 2002, Sebastien Petit wrote: > > > Hi, > > > > Actually I rewrote loadd (a load balancing daemon) for running with > > netgraph. In the original version, loadd use Divert sockets with ipfw > > for taking incoming/outgoing traffic. What node I must use for doing > > the same thing ? I try to use ng_ether but if I do that, People that > > run pppoe on the same device as load balancing can't use it. > > > > Any idea ? > > > > Sebastien. > > -- > > spe@selectbourse.net > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message