Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jul 2004 12:38:48 -0700
From:      Julian Elischer <julian@elischer.org>
To:        "Sifalakis, Manolis" <mjs@v6testbed.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Communication driver framework ?
Message-ID:  <40F6DD48.4050605@elischer.org>
In-Reply-To: <40F6ADBE.80809@v6testbed.net>
References:  <40F6ADBE.80809@v6testbed.net>

next in thread | previous in thread | raw e-mail | index | archive | help


Sifalakis, Manolis wrote:

> Hello all,
>
> I am new to the list as well as "under the FreeBSD-hood" and this is 
> my first posting so pls forgive me if this has been asked 1000 times 
> before (I did not manage to find it in the archive).
>
> We re planning to implement a programmable router framework for 
> FreeBSD, and basically we need to have a piece of code between the NIC 
> driver(s) and the protocol stack to pull out and push (back) in the 
> forwarding path network packets (and possibly do some low level 
> routing among the NIC interfaces there).
>
> As a result I would like to ask if there is a communications driver 
> framework similar to NDIS -bleah- (in M$ Win) or STREAMS (in the 
> -early- ATT unix flavors), in FreeBSD. It would be significantly more 
> efficient and portable if we did not have to hard code in the kernel 
> our "intermediate" driver.
>
> Thanks in advance for reading ... even more for replying ;) 


You are almost certainly looking for netgraph
There are also examples of it's usage in /usr/share/examples/netgraph

It is in the same ecological niche as "STREAMS"
You don't say what revision of FReeBSD you are using..
the version of netgraph in 5.x is under mre development and has changed 
slightly fo SMP reasons..
You may however be able to easily back-port any 5.x nodes that you need 
if they are not in 4.x.

Note also that by default nodes are loadable as modules if you include 
the right 'magic' bits.
See /usr/src/sys/netgraph/ng_sample for an example of how to build your 
own node.
The framework also has an extensible configuration mechanism that lets 
you make
asci configuration requests to any node that supports it without having 
to write a new configuration tool.
mpd(8) is a port.

man 4 netgraph

for a list of other man pages..

julian@julian:man -k netgraph
NgMkSockNode(3), NgNameNode(3), NgSendMsg(3), NgSendAsciiMsg(3), 
NgSendMsgReply(
3), NgRecvMsg(3), NgAllocRecvMsg(3), NgRecvAsciiMsg(3), 
NgAllocRecvAsciiMsg(3),
NgSendData(3), NgRecvData(3), NgAllocRecvData(3), NgSetDebug(3), 
NgSetErrLog(3)
- netgraph user library
i4bing(4)                - isdn4bsd NetGraph ISDN B-channel interface driver
netgraph(4)              - graph based kernel networking subsystem
ng_UI(4)                 - UI netgraph node type
ng_async(4)              - asynchronous framing netgraph node type
ng_bpf(4)                - Berkeley packet filter netgraph node type
ng_bridge(4)             - Ethernet bridging netgraph node type
ng_cisco(4)              - Cisco HDLC protocol netgraph node type
ng_echo(4)               - netgraph echo node type
ng_etf(4)                - Ethertype filtering netgraph node type
ng_ether(4)              - Ethernet netgraph node type
ng_frame_relay(4)        - frame relay netgraph node type
ng_hole(4)               - netgraph discard node type
ng_iface(4)              - interface netgraph node type
ng_ksocket(4)            - kernel socket netgraph node type
ng_l2tp(4)               - L2TP protocol netgraph node type
ng_lmi(4)                - frame relay LMI protocol netgraph node type
ng_mppc(4)               - Microsoft MPPC/MPPE compression and 
encryption netgra
ph node type
ng_one2many(4)           - packet multiplexing netgraph node type
ng_ppp(4)                - PPP protocol netgraph node type
ng_pppoe(4)              - RFC 2516 PPPOE protocol netgraph node type
ng_pptpgre(4)            - PPTP GRE protocol netgraph node type
ng_rfc1490(4)            - RFC 1490 netgraph node type
ng_socket(4)             - netgraph socket node type
ng_tee(4)                - netgraph ``tee'' node type
ng_tty(4)                - netgraph node type that is also a line discipline
ng_vjc(4)                - Van Jacobson compression netgraph node type
ng_vlan(4)               - IEEE 802.1Q VLAN tagging netgraph node type
ngctl(8)                 - netgraph control utility
nghook(8)                - connect to a netgraph(4) node
mpd(8)                   - netgraph multi-link PPP daemon
julian@julian:

>
>
> -- Manolis.
>
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to 
> "freebsd-hackers-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40F6DD48.4050605>