+ * 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;
+ */
+struct ndrv_demux_desc {
+ u_int16_t type;
+ u_int16_t length;
+ union{
+ u_int16_t ether_type;
+ u_int8_t sap[3];
+ u_int8_t snap[5];
+ u_int8_t other[28];
+ } data;
+};
+
+#define NDRV_PROTOCOL_DESC_VERS 1
+
+/*
+ * 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