diff options
author | archie <archie@FreeBSD.org> | 2000-03-13 19:19:48 +0000 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 2000-03-13 19:19:48 +0000 |
commit | 3c6de034ba7c4287ddac1e6cec18922195da9fe8 (patch) | |
tree | 2f34cb5c2199ea881a8e269a8a11d8c891458667 /sys/modules/netgraph | |
parent | 6c3f33821c89afaa95bdd52d9eab7a57eead2b50 (diff) | |
download | FreeBSD-src-3c6de034ba7c4287ddac1e6cec18922195da9fe8.zip FreeBSD-src-3c6de034ba7c4287ddac1e6cec18922195da9fe8.tar.gz |
- Document updates in iface netgraph node type functionality
- Remove makefile hacks for opt_inet.h, etc: the KLD now supports
whatever address families your kernel was compiled with automagically
Diffstat (limited to 'sys/modules/netgraph')
-rw-r--r-- | sys/modules/netgraph/iface/Makefile | 26 | ||||
-rw-r--r-- | sys/modules/netgraph/iface/ng_iface.4 | 83 | ||||
-rw-r--r-- | sys/modules/netgraph/iface/ng_iface.8 | 83 |
3 files changed, 103 insertions, 89 deletions
diff --git a/sys/modules/netgraph/iface/Makefile b/sys/modules/netgraph/iface/Makefile index cc5cc1e..23a067d 100644 --- a/sys/modules/netgraph/iface/Makefile +++ b/sys/modules/netgraph/iface/Makefile @@ -2,32 +2,8 @@ # $Whistle: Makefile,v 1.2 1999/01/19 19:39:21 archie Exp $ KMOD= ng_iface -SRCS= ng_iface.c opt_inet.h opt_atalk.h opt_ipx.h +SRCS= ng_iface.c MAN8= ng_iface.8 KMODDEPS= netgraph -IFACE_INET?= 1 # 0/1 - requires INET configured in kernel -IFACE_NETATALK?= 0 # 0/1 - requires NETATALK configured in kernel -IFACE_IPX?= 0 # 0/1 - requires IPX configured in kernel - -CFLAGS+= ${PROTOS} - -opt_inet.h: - touch opt_inet.h -.if ${IFACE_INET} > 0 - echo "#define INET 1" > opt_inet.h -.endif - -opt_atalk.h: - touch opt_atalk.h -.if ${IFACE_NETATALK} > 0 - echo "#define NETATALK ${IFACE_NETATALK}" > opt_atalk.h -.endif - -opt_ipx.h: - touch opt_ipx.h -.if ${IFACE_IPX} > 0 - echo "#define IPX ${IFACE_IPX}" > opt_ipx.h -.endif - .include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/iface/ng_iface.4 b/sys/modules/netgraph/iface/ng_iface.4 index 40c6f88..d56ead9 100644 --- a/sys/modules/netgraph/iface/ng_iface.4 +++ b/sys/modules/netgraph/iface/ng_iface.4 @@ -47,39 +47,55 @@ An .Nm iface node is both a netgraph node and a system networking interface. When an -.Nm -node is created, a new point-to-point interface appears which is accessible via +.Nm iface +node is created, a new interface appears which is accessible via .Xr ifconfig 8 . -The new interfaces are named +.Nm Iface +node interfaces are named .Dv ng0 , .Dv ng1 , -etc. The node is assigned the same name as its interface, unless the name +etc. +When a node is shutdown, the corresponding interface is removed +and the interface name becomes available for reuse by future +.Nm iface +nodes; new nodes always take the first unused interface. +The node itself is assigned the same name as its interface, unless the name already exists, in which case the node remains unnamed. .Pp An -.Nm +.Nm iface node has a single hook corresponding to each supported protocol. Packets transmitted via the interface flow out the corresponding protocol-specific hook. Similarly, packets received on a hook appear on the interface as -packets received in the corresponding protocol. -.Pp -The currently supported protocols are IP, IPX, AppleTalk, and NS. -In the KLD module, only support for IP is compiled in by default. +packets received into the corresponding protocol stack. +The currently supported protocols are IP, IPv6, AppleTalk, IPX, ATM, +NATM, and NS. .Pp An -.Nm -node supports the Berkeley Packet Filter (BPF). +.Nm iface +node be configured as a point-to-point interface or a broadcast interface. +The configuration can only be changed when the interface is down. +The default mode is point-to-point. +.Pp +.Nm Iface +nodes support the Berkeley Packet Filter (BPF). .Sh HOOKS This node type supports the following hooks: .Pp .Bl -tag -width foobar .It Dv inet Transmission and reception of IP packets. -.It Dv ipx -Transmission and reception of IPX packets. +.It Dv inet6 +Transmission and reception of IPv6 packets. .It Dv atalk Transmission and reception of AppleTalk packets. +.It Dv ipx +Transmission and reception of IPX packets. +.It Dv atm +Transmission and reception of ATM packets. +.It Dv natm +Transmission and reception of NATM packets. .It Dv ns Transmission and reception of NS packets. .El @@ -94,11 +110,12 @@ struct ng_iface_ifname { char ngif_name[NG_IFACE_IFACE_NAME_MAX + 1]; }; .Ed -.It Dv NGM_IFACE_GET_IFADDRS -Returns the list of addresses associated with this interface. -The list is returned in the same format as the -.Dv SIOCGIFCONF -.Fn ioctl . +.It Dv NGM_IFACE_POINT2POINT +Set the interface to point-to-point mode. +The interface must not currently be up. +.It Dv NGM_IFACE_BROADCAST +Set the interface to broadcast mode. +The interface must not currently be up. .It Dv NGM_CISCO_GET_IPADDR This message is defined by the .Xr ng_cisco 8 @@ -107,28 +124,30 @@ node type; see for a description. .El .Sh SHUTDOWN -Because it is currently not possible to remove a system networking -interface in -.Fx , -.Nm -nodes are -.Em persistent. -That is, once created they are never destroyed. -The receipt of a +This node shuts down upon receipt of a .Dv NGM_SHUTDOWN -control message disconnects all hooks but does not remove the node. +control message. The associated interface is removed and becomes available +for use by future +.Nm iface +nodes. +.Pp +Unlike most other node types, an +.Nm iface +node does +.Em not +go away when all hooks have been disconnected; rather, and explicit +.Dv NGM_SHUTDOWN +control message is required. .Sh SEE ALSO .Xr bpf 4 , .Xr netgraph 4 , .Xr ifconfig 8 , .Xr ng_cisco 8 , -.Xr ng_ppp 8 , -.Xr ng_rfc1490 8 , -.Xr ngctl 8 . +.Xr ngctl 8 .Sh HISTORY The -.Nm +.Nm iface node type was implemented in .Fx 4.0 . -.Sh AUTHORS +.Sh AUTHOR .An Archie Cobbs Aq archie@whistle.com diff --git a/sys/modules/netgraph/iface/ng_iface.8 b/sys/modules/netgraph/iface/ng_iface.8 index 40c6f88..d56ead9 100644 --- a/sys/modules/netgraph/iface/ng_iface.8 +++ b/sys/modules/netgraph/iface/ng_iface.8 @@ -47,39 +47,55 @@ An .Nm iface node is both a netgraph node and a system networking interface. When an -.Nm -node is created, a new point-to-point interface appears which is accessible via +.Nm iface +node is created, a new interface appears which is accessible via .Xr ifconfig 8 . -The new interfaces are named +.Nm Iface +node interfaces are named .Dv ng0 , .Dv ng1 , -etc. The node is assigned the same name as its interface, unless the name +etc. +When a node is shutdown, the corresponding interface is removed +and the interface name becomes available for reuse by future +.Nm iface +nodes; new nodes always take the first unused interface. +The node itself is assigned the same name as its interface, unless the name already exists, in which case the node remains unnamed. .Pp An -.Nm +.Nm iface node has a single hook corresponding to each supported protocol. Packets transmitted via the interface flow out the corresponding protocol-specific hook. Similarly, packets received on a hook appear on the interface as -packets received in the corresponding protocol. -.Pp -The currently supported protocols are IP, IPX, AppleTalk, and NS. -In the KLD module, only support for IP is compiled in by default. +packets received into the corresponding protocol stack. +The currently supported protocols are IP, IPv6, AppleTalk, IPX, ATM, +NATM, and NS. .Pp An -.Nm -node supports the Berkeley Packet Filter (BPF). +.Nm iface +node be configured as a point-to-point interface or a broadcast interface. +The configuration can only be changed when the interface is down. +The default mode is point-to-point. +.Pp +.Nm Iface +nodes support the Berkeley Packet Filter (BPF). .Sh HOOKS This node type supports the following hooks: .Pp .Bl -tag -width foobar .It Dv inet Transmission and reception of IP packets. -.It Dv ipx -Transmission and reception of IPX packets. +.It Dv inet6 +Transmission and reception of IPv6 packets. .It Dv atalk Transmission and reception of AppleTalk packets. +.It Dv ipx +Transmission and reception of IPX packets. +.It Dv atm +Transmission and reception of ATM packets. +.It Dv natm +Transmission and reception of NATM packets. .It Dv ns Transmission and reception of NS packets. .El @@ -94,11 +110,12 @@ struct ng_iface_ifname { char ngif_name[NG_IFACE_IFACE_NAME_MAX + 1]; }; .Ed -.It Dv NGM_IFACE_GET_IFADDRS -Returns the list of addresses associated with this interface. -The list is returned in the same format as the -.Dv SIOCGIFCONF -.Fn ioctl . +.It Dv NGM_IFACE_POINT2POINT +Set the interface to point-to-point mode. +The interface must not currently be up. +.It Dv NGM_IFACE_BROADCAST +Set the interface to broadcast mode. +The interface must not currently be up. .It Dv NGM_CISCO_GET_IPADDR This message is defined by the .Xr ng_cisco 8 @@ -107,28 +124,30 @@ node type; see for a description. .El .Sh SHUTDOWN -Because it is currently not possible to remove a system networking -interface in -.Fx , -.Nm -nodes are -.Em persistent. -That is, once created they are never destroyed. -The receipt of a +This node shuts down upon receipt of a .Dv NGM_SHUTDOWN -control message disconnects all hooks but does not remove the node. +control message. The associated interface is removed and becomes available +for use by future +.Nm iface +nodes. +.Pp +Unlike most other node types, an +.Nm iface +node does +.Em not +go away when all hooks have been disconnected; rather, and explicit +.Dv NGM_SHUTDOWN +control message is required. .Sh SEE ALSO .Xr bpf 4 , .Xr netgraph 4 , .Xr ifconfig 8 , .Xr ng_cisco 8 , -.Xr ng_ppp 8 , -.Xr ng_rfc1490 8 , -.Xr ngctl 8 . +.Xr ngctl 8 .Sh HISTORY The -.Nm +.Nm iface node type was implemented in .Fx 4.0 . -.Sh AUTHORS +.Sh AUTHOR .An Archie Cobbs Aq archie@whistle.com |