]> git.saurik.com Git - apple/xnu.git/blob - bsd/netat/at_pat.h
xnu-344.21.74.tar.gz
[apple/xnu.git] / bsd / netat / at_pat.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25
26 /*
27 * Copyright (c) 1988, 1989 Apple Computer, Inc.
28 */
29
30 #ifndef _NETAT_AT_PAT_H_
31 #define _NETAT_AT_PAT_H_
32 #include <sys/appleapiopts.h>
33
34 /* This is header for the PAT module. This contains a table of pointers that
35 * should get initialized with the BNET stuff and the ethernet driver. The
36 * number of interfaces supported should be communicated. Should include
37 * mbuf.h, if.h, socket.h
38 *
39 * Author: R. C. Venkatraman
40 * Date : 2/29/88
41 */
42
43 typedef struct {
44 unsigned char dst[6];
45 unsigned char src[6];
46 unsigned short len;
47 } enet_header_t;
48
49 typedef struct {
50 unsigned char dst_sap;
51 unsigned char src_sap;
52 unsigned char control;
53 unsigned char protocol[5];
54 } llc_header_t;
55
56 #define ENET_LLC_SIZE (sizeof(enet_header_t)+sizeof(llc_header_t))
57 #define SNAP_UI 0x03 /* bits 11000000 reversed!! */
58 #define SNAP_AT_SAP 0xaa
59 #define SNAP_PROTO_AT {0x08, 0x00, 0x07, 0x80, 0x9B}
60 #define SNAP_PROTO_AARP {0x00, 0x00, 0x00, 0x80, 0xF3}
61 #define SNAP_HDR_AT {SNAP_AT_SAP, SNAP_AT_SAP, SNAP_UI, SNAP_PROTO_AT}
62 #define SNAP_HDR_AARP {SNAP_AT_SAP, SNAP_AT_SAP, SNAP_UI, SNAP_PROTO_AARP}
63
64 #define LLC_PROTO_EQUAL(a1, a2) \
65 ((*((unsigned long *)(a1)) == *((unsigned long *)(a2))) && \
66 (a1[4] == a2[4]) \
67 )
68 #endif /* _NETAT_AT_PAT_H_ */