ipnet, lo0 - ipnet device driver
/dev/ipnet/*, /dev/lo0
The ipnet device driver creates, removes and manages nodes in the /dev/ipnet/ namespace.
A node is created in /dev/ipnet for every IP interface on the system, including interfaces that exist only in software and for which there is no hardware device. The ipnet device also provides access to all IP traffic to and from the system. To provide access to packets that are internally looped-back in IP, the ipnet driver creates a /dev/lo0 DLPI device.
Device nodes created in /dev/ipnet are DLPI style-1 devices. All M_PROTO and M_PCPROTO-type messages are interpreted as DLPI primitives. Because the device is read-only and packets can only be observed by opening them, the following subset of DLPI primitives is supported:
DL_INFO_REQ DL_BIND_REQ DL_UNBIND_REQ DL_PROMISCON_REQ DL_PROMISCOFF_REQ DLIOCRAW
The values returned by the driver in the DL_INFO_ACK primitive in response to the DL_INFO_REQ are:
The devices in /dev/ipnet/ and /dev/lo0 can only be bound to IP_DL_SAP, IP6_DL_SAP or 0. Binding to anything other than these returns DL_ERROR_ACK and DL_BAD_SAP. If sap 0 binds to DL_BIND_REQ, IPv6 and IPv4 traffic are returned.
For /dev/ipnet/* devices, the DL_PROMISCON_REQ and DL_PROMISCOFF_REQ primitives with the DL_PROMISC_PHYS flag set in the dl_level field enables/disables the reception of all packets. When disabled, only packets with addresses matching any of the configured addresses on the IP interface are received. When used with the DL_PROMISC_MULTI flag set, reception of all multicast group addresses can be enabled/disabled. DL_PROMISC_PHYS and DL_PROMISC_MULTI have no effect for /dev/lo0. When the DL_PROMISC_SAP flag is set, reception of all IPv4/IPv6 can be enabled/disabled.
The DLIOCRAW ioctl is supported but has no effect on the data returned from the device.
The DL_IOC_IPNET_INFO ioctl enables/disables the inclusion of an ipnet header that is prepended to the IP header when receiving packet data. When enabled, a non-zero integer is returned reflecting the current DL_IOC_IPNET_INFO version. The ipnet header returned is of fixed length and has the following format:
uint8_t dli_version; /* Current version */ uint8_t dli_ipver; /* IP version */ uint16_t dli_len; /* sizeof dl_ipnetinfo_t */ uint64_t dli_srczone; /* Source of zoneid where known. */ uint64_t dli_dstzone; /* Destination zoneid where known. */
If you program to this interface, you may need to access the dl_ipnetinfo_t data-structure that's defined in <sys/dlpi.h>:
typedef struct dl_ipnetinfo { uint8_t dli_version; /* DL_IPNETINFO_* version */ uint8_t dli_ipver; /* packet IP header version */ uint16_t dli_len; /* length of dl_ipnetinfo_t */ uint32_t dli_pad; /* alignment pad */ uint64_t dli_srczone; /* packet source zone ID (if any) */ uint64_t dli_dstzone; /* packet dest zone ID (if any) */ } dl_ipnetinfo_t;
/dev/ipnet/*, /dev/lo0
/kernel/drv/ipnet.conf
See attributes(5) for descriptions of the following attributes:
|
attributes(5), dlpi(7P)
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |