2 * AppleTalk networking structures
4 * The following are directly referenced from the University Of Michigan
5 * netatalk for compatibility reasons.
8 #ifndef __LINUX_ATALK_H__
9 #define __LINUX_ATALK_H__
11 #define ATPORT_FIRST 1
12 #define ATPORT_RESERVED 128
13 #define ATPORT_LAST 254 /* 254 is only legal on localtalk */
14 #define ATADDR_ANYNET (__u16)0
15 #define ATADDR_ANYNODE (__u8)0
16 #define ATADDR_ANYPORT (__u8)0
17 #define ATADDR_BCAST (__u8)255
19 #define DDP_MAXHOPS 15 /* 4 bits of hop counter */
21 #define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
31 sa_family_t sat_family
;
33 struct at_addr sat_addr
;
47 struct at_addr target
;
48 struct at_addr gateway
;
50 struct atalk_route
*next
;
56 struct at_addr address
; /* Our address */
57 int status
; /* What are we doing? */
58 #define ATIF_PROBE 1 /* Probing for an address */
59 #define ATIF_PROBE_FAIL 2 /* Probe collided */
60 struct netrange nets
; /* Associated direct netrange */
61 struct atalk_iface
*next
;
66 unsigned short dest_net
;
67 unsigned short src_net
;
68 unsigned char dest_node
;
69 unsigned char src_node
;
70 unsigned char dest_port
;
71 unsigned char src_port
;
76 #include <asm/byteorder.h>
80 #ifdef __LITTLE_ENDIAN_BITFIELD
81 __u16 deh_len
:10, deh_hops
:4, deh_pad
:2;
83 __u16 deh_pad
:2, deh_hops
:4, deh_len
:10;
92 /* And netatalk apps expect to stick the type in themselves */
96 * Don't drop the struct into the struct above. You'll get some
102 #ifdef __LITTLE_ENDIAN_BITFIELD
103 __u16 deh_len
:10, deh_hops
:4, deh_pad
:2;
105 __u16 deh_pad
:2, deh_hops
:4, deh_len
:10;
115 #ifdef __LITTLE_ENDIAN_BITFIELD
116 __u16 dsh_len
:10, dsh_pad
:6;
118 __u16 dsh_pad
:6, dsh_len
:10;
122 /* And netatalk apps expect to stick the type in themselves */
125 /* AppleTalk AARP headers */
130 #define AARP_HW_TYPE_ETHERNET 1
131 #define AARP_HW_TYPE_TOKENRING 2
135 #define AARP_PA_ALEN 4
137 #define AARP_REQUEST 1
140 __u8 hw_src
[ETH_ALEN
] __attribute__ ((packed
));
141 __u8 pa_src_zero
__attribute__ ((packed
));
142 __u16 pa_src_net
__attribute__ ((packed
));
143 __u8 pa_src_node
__attribute__ ((packed
));
144 __u8 hw_dst
[ETH_ALEN
] __attribute__ ((packed
));
145 __u8 pa_dst_zero
__attribute__ ((packed
));
146 __u16 pa_dst_net
__attribute__ ((packed
));
147 __u8 pa_dst_node
__attribute__ ((packed
));
150 #define AARP_EXPIRY_TIME (5*60*HZ) /* Not specified - how long till we drop a resolved entry */
151 #define AARP_HASH_SIZE 16 /* Size of hash table */
152 #define AARP_TICK_TIME (HZ/5) /* Fast retransmission timer when resolving */
153 #define AARP_RETRANSMIT_LIMIT 10 /* Send 10 requests then give up (2 seconds) */
154 #define AARP_RESOLVE_TIME (10*HZ) /* Some value bigger than total retransmit time + a bit for last reply to appear and to stop continual requests */
156 extern struct datalink_proto
*ddp_dl
, *aarp_dl
;
157 extern void aarp_proto_init(void);
158 /* Inter module exports */
161 * Give a device find its atif control structure
164 extern __inline__
struct atalk_iface
*atalk_find_dev(struct device
*dev
)
166 return dev
->atalk_ptr
;
169 extern struct at_addr
*atalk_find_dev_addr(struct device
*dev
);
170 extern struct device
*atrtr_get_dev(struct at_addr
*sa
);
171 extern int aarp_send_ddp(struct device
*dev
,struct sk_buff
*skb
, struct at_addr
*sa
, void *hwaddr
);
172 extern void aarp_send_probe(struct device
*dev
, struct at_addr
*addr
);
173 extern void aarp_device_down(struct device
*dev
);
176 extern void aarp_cleanup_module(void);
179 #endif /* __KERNEL__ */
180 #endif /* __LINUX_ATALK_H__ */