|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: ! 26: /* ! 27: * Copyright (c) 1988, 1989 Apple Computer, Inc. ! 28: * ! 29: * The information contained herein is subject to change without ! 30: * notice and should not be construed as a commitment by Apple ! 31: * Computer, Inc. Apple Computer, Inc. assumes no responsibility ! 32: * for any errors that may appear. ! 33: * ! 34: * Confidential and Proprietary to Apple Computer, Inc. ! 35: */ ! 36: ! 37: /* "@(#)at_pat.h: 2.0, 1.8; 10/4/93; Copyright 1988-89, Apple Computer, Inc." */ ! 38: ! 39: /* This is header for the PAT module. This contains a table of pointers that ! 40: * should get initialized with the BNET stuff and the ethernet driver. The ! 41: * number of interfaces supported should be communicated. Should include ! 42: * mbuf.h, if.h, socket.h ! 43: * ! 44: * Author: R. C. Venkatraman ! 45: * Date : 2/29/88 ! 46: */ ! 47: ! 48: typedef struct { ! 49: unsigned char dst[6]; ! 50: unsigned char src[6]; ! 51: unsigned short len; ! 52: } enet_header_t; ! 53: ! 54: typedef struct { ! 55: unsigned char dst_sap; ! 56: unsigned char src_sap; ! 57: unsigned char control; ! 58: unsigned char protocol[5]; ! 59: } llc_header_t; ! 60: ! 61: #define ENET_LLC_SIZE (sizeof(enet_header_t)+sizeof(llc_header_t)) ! 62: #define SNAP_UI 0x03 /* bits 11000000 reversed!! */ ! 63: #define SNAP_AT_SAP 0xaa ! 64: #define SNAP_PROTO_AT {0x08, 0x00, 0x07, 0x80, 0x9B} ! 65: #define SNAP_PROTO_AARP {0x00, 0x00, 0x00, 0x80, 0xF3} ! 66: #define SNAP_HDR_AT {SNAP_AT_SAP, SNAP_AT_SAP, SNAP_UI, SNAP_PROTO_AT} ! 67: #define SNAP_HDR_AARP {SNAP_AT_SAP, SNAP_AT_SAP, SNAP_UI, SNAP_PROTO_AARP} ! 68: ! 69: #define LLC_PROTO_EQUAL(a1, a2) \ ! 70: ((*((unsigned long *)(a1)) == *((unsigned long *)(a2))) && \ ! 71: (a1[4] == a2[4]) \ ! 72: ) ! 73: ! 74: /* PAT data structures and control codes */ ! 75: ! 76: #define MAX_MCASTS 25 /*#multicast addrs tracked per i/f */ ! 77: ! 78: typedef struct pat_unit { ! 79: int state; /* PAT state */ ! 80: caddr_t context; /* Context pointer for upstream */ ! 81: int (*aarp_func)(); /* Function to be called for passing */ ! 82: /* AARP packets up. */ ! 83: int (*addr_check)();/* Function to be called for checking */ ! 84: /* destination address for an incoming */ ! 85: /* packet. */ ! 86: void *nddp; /* Pointer to NDD struct for this driver*/ ! 87: int elapno; /* corresponding entry in elap_specifics */ ! 88: /* array for tracking registered mcast ! 89: addrs, only uniqe portion tracked */ ! 90: unsigned char mcast[MAX_MCASTS]; ! 91: void *xddpq; ! 92: void *xarpq; ! 93: char xflag; ! 94: char xunit; ! 95: char xtype; ! 96: char xpad; ! 97: int xaddrlen; ! 98: char xaddr[6]; ! 99: char xname[8]; ! 100: } pat_unit_t; ! 101: ! 102: #define PAT_REG_CONTEXT 1 ! 103: #define PAT_REG_ELAPQ 2 ! 104: #define PAT_REG_AARP_UPSTREAM 3 ! 105: #define PAT_REG_CHECKADDR 4 ! 106: #define PAT_REG_MCAST 5 ! 107: #define PAT_UNREG_MCAST 6 ! 108: #define PAT_UNREG_ALL_MCAST 7 ! 109: ! 110: /* multicast tracking */ ! 111: #define MCAST_TRACK_ADD 1 ! 112: #define MCAST_TRACK_DELETE 2 ! 113: #define MCAST_TRACK_CHECK 3 ! 114: ! 115: /* PAT states */ ! 116: #define PAT_FREE 0 ! 117: #define PAT_OFFLINE 1 ! 118: #define PAT_ONLINE 2
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.