NG_IFACE(8)

NAME
ng_iface - interface netgraph node type

SYNOPSIS
#include <netgraph/ng_iface.h>

DESCRIPTION
An iface node is both a netgraph node and a system networking interface. When an ng_iface node is created, a new point-to-point interface appears which is accessible via ifconfig(8). The new interfaces are named ng0, ng1, etc. The node is assigned the same name as its interface, unless the name already exists, in which case the node remains unnamed.

An ng_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.

The currently supported protocols are IP, IPX, AppleTalk, and NS. In the KLD module, only support for IP is compiled in by default.

An ng_iface node supports the Berkeley Packet Filter (BPF).

HOOKS
This node type supports the following hooks:

inet
    Transmission and reception of IP packets.

ipx Transmission and reception of IPX packets.

atalk
    Transmission and reception of AppleTalk packets.

ns  Transmission and reception of NS packets.

CONTROL MESSAGES
This node type supports the generic control messages, plus the following:

NGM_IFACE_GET_IFNAME
    Returns the name of the interface corresponding to this node in a struct ng_iface_ifname:

        struct ng_iface_ifname {
          char  ngif_name[NG_IFACE_IFACE_NAME_MAX + 1];
        };

NGM_IFACE_GET_IFADDRS
    Returns the list of addresses associated with this interface. The list is returned in the same format as the SIOCGIFCONF ioctl().

NGM_CISCO_GET_IPADDR
    This message is defined by the ng_cisco(8) node type; see ng_cisco(8) for a description.

SHUTDOWN
Because it is currently not possible to remove a system networking interface in FreeBSD, ng_iface nodes are persistent. That is, once created they are never destroyed. The receipt of a NGM_SHUTDOWN control message disconnects all hooks but does not remove the node.

SEE ALSO
bpf(4), netgraph(4), ifconfig(8), ng_cisco(8), ng_ppp(8), ng_rfc1490(8), ngctl(8).

HISTORY
The ng_iface node type was implemented in FreeBSD 4.0.

AUTHORS
Archie Cobbs <archie@whistle.com>