Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | /* * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_OSREFERENCE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the * License may not be used to create, or enable the creation or * redistribution of, unlawful or unlicensed copies of an Apple operating * system, or to circumvent, violate, or enable the circumvention or * violation of, any terms of an Apple operating system software license * agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_OSREFERENCE_HEADER_END@ */ /* * Fundamental constants relating to FireWire network device. */ #ifndef _NET_FIREWIRE_H_ #define _NET_FIREWIRE_H_ #include <sys/appleapiopts.h> /* * The number of bytes in a FireWire EUI-64. */ #define FIREWIRE_EUI64_LEN 8 /* * The number of bytes in the type field. */ #define FIREWIRE_TYPE_LEN 2 /* * The length of the header provided by the FireWire network device. */ #define FIREWIRE_HDR_LEN (FIREWIRE_EUI64_LEN*2+FIREWIRE_TYPE_LEN) /* * The minimum packet length. */ #define FIREWIRE_MIN_LEN 64 /* * The maximum packet length. */ #define FIREWIRE_MAX_LEN 4096 /* * A macro to validate a length with */ #define FIREWIRE_IS_VALID_LEN(foo) \ ((foo) >= FIREWIRE_MIN_LEN && (foo) <= FIREWIRE_MAX_LEN) /* * Structure of header provided by the FireWire network device. * * The device uses a simplified header with just the non-changing * EUI-64 addresses and ethernet type specified; */ struct firewire_header { u_char firewire_dhost[FIREWIRE_EUI64_LEN]; u_char firewire_shost[FIREWIRE_EUI64_LEN]; u_short firewire_type; /* ethertype */ }; /* * Format of FireWire EUI-64. */ struct firewire_eui64 { u_char octet[FIREWIRE_EUI64_LEN]; }; /* * Format of FireWire hardware address. */ struct firewire_address { u_char eui64[FIREWIRE_EUI64_LEN]; u_char maxRec; u_char spd; u_int16_t unicastFifoHi; u_int32_t unicastFifoLo; }; #define FIREWIRE_ADDR_LEN 16 /* sizeof(struct firewire_address) */ #define FIREWIRE_MTU (FIREWIRE_MAX_LEN - FIREWIRE_HDR_LEN) #define FIREWIRE_MIN (FIREWIRE_MIN_LEN - FIREWIRE_HDR_LEN) #endif /* !_NET_FIREWIRE_H_ */ |