#include <net/ndrv.h>
net/ndrv.h
@(#)ndrv.h 1.1 (MacOSX) 6/10/43
Justin Walker - 970604
structsockaddr_ndrv
| unsigned char | snd_len | |
| unsigned char | snd_family | |
| unsigned char[16] | snd_name | from if.h |
macroNDRV_DEMUXTYPE_ETHERTYPE
#define NDRV_DEMUXTYPE_ETHERTYPE 4
macroNDRV_DEMUXTYPE_SAP
#define NDRV_DEMUXTYPE_SAP 5
macroNDRV_DEMUXTYPE_SNAP
#define NDRV_DEMUXTYPE_SNAP 6
macroNDRVPROTO_NDRV
#define NDRVPROTO_NDRV 0
structndrv_demux_desc
Struct: ndrv_demux_desc
Purpose:
To uniquely identify a packet based on its low-level framing information.
Fields:
type : type of protocol in data field, must be understood by
the interface family of the interface the socket is bound to
length : length of protocol data in "data" field
data : union of framing-specific data, in network byte order
ether_type : ethernet type in network byte order, assuming
ethernet type II framing
sap : first 3 bytes of sap header, network byte order
snap : first 5 bytes of snap header, network byte order
other : up to 28 bytes of protocol data for different protocol type
Examples:
1) 802.1x uses ether_type 0x888e, so the descriptor would be set as:
struct ndrv_demux_desc desc;
desc.type = NDRV_DEMUXTYPE_ETHERTYPE
desc.length = sizeof(unsigned short);
desc.ether_type = htons(0x888e);
2) AppleTalk uses SNAP 0x080007809B
struct ndrv_demux_desc desc;
desc.type = NDRV_DEMUXTYPE_SNAP;
desc.length = 5;
desc.data.snap[0] = 08;
desc.data.snap[1] = 00;
desc.data.snap[2] = 07;
desc.data.snap[3] = 80;
desc.data.snap[4] = 9B;
| u_int16_t | type | |||||||||||||
| u_int16_t | length | |||||||||||||
| unnamed union at net/ndrv.h:93:2 | data | |||||||||||||
| ||||||||||||||
macroNDRV_PROTOCOL_DESC_VERS
#define NDRV_PROTOCOL_DESC_VERS 1
structndrv_protocol_desc
Struct: ndrv_protocol_desc
Purpose:
Used to "bind" an NDRV socket so that packets that match
given protocol demux descriptions can be received:
Field:
version : must be NDRV_PROTOCOL_DESC_VERS
protocol_family : unique identifier for this protocol
demux_count : number of demux_list descriptors in demux_list; maximum of 10
demux_list : pointer to array of demux descriptors
| u_int32_t | version | |
| u_int32_t | protocol_family | |
| u_int32_t | demux_count | |
| struct ndrv_demux_desc * | demux_list |
macroNDRV_DMUX_MAX_DESCR
Max number of descriptions allowed by default
#define NDRV_DMUX_MAX_DESCR 1024
macroNRDV_MULTICAST_ADDRS_PER_SOCK
sysctl MIB tags at the kern.ipc.nrdv level
#define NRDV_MULTICAST_ADDRS_PER_SOCK 1
to toggle NDRV_DMUX_MAX_DESCR value