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 * Fundamental constants relating to firewire.
24 *
25 */
26
27#ifndef _NET_FIREWIRE_H_
28#define _NET_FIREWIRE_H_
29#include <sys/appleapiopts.h>
30
31#define FIREWIRE_MTU	4096
32
33/*
34 * The number of bytes in an firewire ethernet like address.
35 */
36#define	FIREWIRE_ADDR_LEN		8
37
38/*
39 * The number of bytes in the type field.
40 */
41#define	FIREWIRE_TYPE_LEN		2
42
43/*
44 * The length of the combined header.
45 */
46#define	FIREWIRE_HDR_LEN		(FIREWIRE_ADDR_LEN*2+FIREWIRE_TYPE_LEN)
47
48/*
49 * The minimum packet length.
50 */
51#define	FIREWIRE_MIN_LEN		64
52
53/*
54 * The maximum packet length.
55 */
56#define	FIREWIRE_MAX_LEN		4096
57
58/*
59 * A macro to validate a length with
60 */
61#define	FIREWIRE_IS_VALID_LEN(foo)	\
62	((foo) >= FIREWIRE_MIN_LEN && (foo) <= FIREWIRE_MAX_LEN)
63
64/*
65 * Structure for firewire header
66 */
67struct	firewire_header {
68	u_char	fw_dhost[FIREWIRE_ADDR_LEN];
69	u_char	fw_shost[FIREWIRE_ADDR_LEN];
70	u_short	fw_type;
71};
72
73#define	FWTYPE_IP		0x0800	/* IP protocol */
74#define FWTYPE_ARP		0x0806	/* Addr. resolution protocol */
75#define FWTYPE_IPV6		0x86dd	/* IPv6 */
76
77#define	FIREWIREMTU	(FIREWIRE_MAX_LEN-FIREWIRE_HDR_LEN)
78
79int firewire_attach_inet(ifnet_t ifp, protocol_family_t protocol_family);
80int firewire_attach_inet6(ifnet_t ifp, __unused protocol_family_t protocol_family);
81
82int firewire_ifattach(register ifnet_t ifp);
83void firewire_ifdetach(register ifnet_t ifp);
84
85#endif /* !_NET_FIREWIRE_H_ */
86