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