]>
git.saurik.com Git - apple/xnu.git/blob - bsd/net/firewire.h
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_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 License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 * Fundamental constants relating to FireWire network device.
32 #ifndef _NET_FIREWIRE_H_
33 #define _NET_FIREWIRE_H_
35 #include <sys/appleapiopts.h>
38 * The number of bytes in a FireWire EUI-64.
40 #define FIREWIRE_EUI64_LEN 8
43 * The number of bytes in the type field.
45 #define FIREWIRE_TYPE_LEN 2
48 * The length of the header provided by the FireWire network device.
50 #define FIREWIRE_HDR_LEN (FIREWIRE_EUI64_LEN*2+FIREWIRE_TYPE_LEN)
53 * The minimum packet length.
55 #define FIREWIRE_MIN_LEN 64
58 * The maximum packet length.
60 #define FIREWIRE_MAX_LEN 4096
63 * A macro to validate a length with
65 #define FIREWIRE_IS_VALID_LEN(foo) \
66 ((foo) >= FIREWIRE_MIN_LEN && (foo) <= FIREWIRE_MAX_LEN)
69 * Structure of header provided by the FireWire network device.
71 * The device uses a simplified header with just the non-changing
72 * EUI-64 addresses and ethernet type specified;
74 struct firewire_header
{
75 u_char firewire_dhost
[FIREWIRE_EUI64_LEN
];
76 u_char firewire_shost
[FIREWIRE_EUI64_LEN
];
77 u_short firewire_type
; /* ethertype */
81 * Format of FireWire EUI-64.
83 struct firewire_eui64
{
84 u_char octet
[FIREWIRE_EUI64_LEN
];
88 * Format of FireWire hardware address.
90 struct firewire_address
{
91 u_char eui64
[FIREWIRE_EUI64_LEN
];
94 u_int16_t unicastFifoHi
;
95 u_int32_t unicastFifoLo
;
98 #define FIREWIRE_ADDR_LEN 16 /* sizeof(struct firewire_address) */
101 #define FIREWIRE_MTU (FIREWIRE_MAX_LEN - FIREWIRE_HDR_LEN)
102 #define FIREWIRE_MIN (FIREWIRE_MIN_LEN - FIREWIRE_HDR_LEN)
104 #endif /* !_NET_FIREWIRE_H_ */