home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / darwin / darwinx86.iso / usr / include / netat / at_pat.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-30  |  2.2 KB  |  65 lines

  1. /*
  2.  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  3.  *
  4.  * @APPLE_LICENSE_HEADER_START@
  5.  * 
  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.
  11.  * 
  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
  18.  * under the License.
  19.  * 
  20.  * @APPLE_LICENSE_HEADER_END@
  21.  */
  22.  
  23. /*
  24.  *    Copyright (c) 1988, 1989 Apple Computer, Inc. 
  25.  */
  26.  
  27. #ifndef _NETAT_AT_PAT_H_
  28. #define _NETAT_AT_PAT_H_
  29.  
  30. /* This is header for the PAT module. This contains a table of pointers that 
  31.  * should get initialized with the BNET stuff and the ethernet driver. The 
  32.  * number of interfaces supported should be communicated. Should include
  33.  * mbuf.h, if.h, socket.h
  34.  *
  35.  * Author: R. C. Venkatraman
  36.  * Date  : 2/29/88 
  37.  */
  38.  
  39. typedef struct {
  40.     unsigned char dst[6];
  41.     unsigned char src[6];
  42.     unsigned short len;
  43. } enet_header_t;
  44.  
  45. typedef struct {
  46.     unsigned char dst_sap;
  47.     unsigned char src_sap;
  48.     unsigned char control;
  49.     unsigned char protocol[5];
  50. } llc_header_t;
  51.  
  52. #define ENET_LLC_SIZE (sizeof(enet_header_t)+sizeof(llc_header_t))
  53. #define SNAP_UI        0x03  /* bits 11000000 reversed!! */
  54. #define SNAP_AT_SAP    0xaa
  55. #define SNAP_PROTO_AT    {0x08, 0x00, 0x07, 0x80, 0x9B}
  56. #define SNAP_PROTO_AARP    {0x00, 0x00, 0x00, 0x80, 0xF3}
  57. #define SNAP_HDR_AT    {SNAP_AT_SAP, SNAP_AT_SAP, SNAP_UI, SNAP_PROTO_AT}
  58. #define SNAP_HDR_AARP    {SNAP_AT_SAP, SNAP_AT_SAP, SNAP_UI, SNAP_PROTO_AARP}
  59.  
  60. #define LLC_PROTO_EQUAL(a1, a2)                                         \
  61.         ((*((unsigned long *)(a1)) == *((unsigned long *)(a2))) &&      \
  62.      (a1[4] == a2[4])                                \
  63.     )
  64. #endif /* _NETAT_AT_PAT_H_ */
  65.