2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
22 /* Copyright (c) 1997, 1998 Apple Computer, Inc. All Rights Reserved */
24 * @(#)ndrv.h 1.1 (MacOSX) 6/10/43
25 * Justin Walker - 970604
35 unsigned char snd_len
;
36 unsigned char snd_family
;
37 unsigned char snd_name
[IFNAMSIZ
]; /* from if.h */
41 * Support for user-mode protocol handlers
44 #define NDRV_DEMUXTYPE_ETHERTYPE DLIL_DESC_ETYPE2
45 #define NDRV_DEMUXTYPE_SAP DLIL_DESC_SAP
46 #define NDRV_DEMUXTYPE_SNAP DLIL_DESC_SNAP
48 #define NDRVPROTO_NDRV 0
51 * Struct: ndrv_demux_desc
53 * To uniquely identify a packet based on its low-level framing information.
56 * type : type of protocol in data field, must be understood by
57 * the interface family of the interface the socket is bound to
58 * length : length of protocol data in "data" field
59 * data : union of framing-specific data, in network byte order
60 * ether_type : ethernet type in network byte order, assuming
61 * ethernet type II framing
62 * sap : first 3 bytes of sap header, network byte order
63 * snap : first 5 bytes of snap header, network byte order
64 * other : up to 28 bytes of protocol data for different protocol type
67 * 1) 802.1x uses ether_type 0x888e, so the descriptor would be set as:
68 * struct ndrv_demux_desc desc;
69 * desc.type = NDRV_DEMUXTYPE_ETHERTYPE
70 * desc.length = sizeof(unsigned short);
71 * desc.ether_type = htons(0x888e);
72 * 2) AppleTalk uses SNAP 0x080007809B
73 * struct ndrv_demux_desc desc;
74 * desc.type = NDRV_DEMUXTYPE_SNAP;
76 * desc.data.snap[0] = 08;
77 * desc.data.snap[1] = 00;
78 * desc.data.snap[2] = 07;
79 * desc.data.snap[3] = 80;
80 * desc.data.snap[4] = 9B;
82 struct ndrv_demux_desc
95 #define NDRV_PROTOCOL_DESC_VERS 1
98 * Struct: ndrv_protocol_desc
100 * Used to "bind" an NDRV socket so that packets that match
101 * given protocol demux descriptions can be received:
103 * version : must be NDRV_PROTOCOL_DESC_VERS
104 * protocol_family : unique identifier for this protocol
105 * demux_count : number of demux_list descriptors in demux_list
106 * demux_list : pointer to array of demux descriptors
108 struct ndrv_protocol_desc
111 u_int32_t protocol_family
;
112 u_int32_t demux_count
;
113 struct ndrv_demux_desc
* demux_list
;
116 #define SOL_NDRVPROTO NDRVPROTO_NDRV /* Use this socket level */
117 /* NDRV_DMXSPEC 0x01 Obsolete */
118 #define NDRV_DELDMXSPEC 0x02 /* Delete the registered protocol */
119 /* NDRV_DMXSPECCNT 0x03 Obsolete */
120 #define NDRV_SETDMXSPEC 0x04 /* Set the protocol spec */
123 /* Additional Kernel APIs */
124 struct ifnet
* ndrv_get_ifp(caddr_t ndrv_pcb
);
127 #endif /* _NET_NDRV_H */