1 #ifndef __LINUX_ATALK_H__
2 #define __LINUX_ATALK_H__
4 #include <linux/types.h>
5 #include <asm/byteorder.h>
8 * AppleTalk networking structures
10 * The following are directly referenced from the University Of Michigan
11 * netatalk for compatibility reasons.
13 #define ATPORT_FIRST 1
14 #define ATPORT_RESERVED 128
15 #define ATPORT_LAST 254 /* 254 is only legal on localtalk */
16 #define ATADDR_ANYNET (__u16)0
17 #define ATADDR_ANYNODE (__u8)0
18 #define ATADDR_ANYPORT (__u8)0
19 #define ATADDR_BCAST (__u8)255
21 #define DDP_MAXHOPS 15 /* 4 bits of hop counter */
23 #define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
31 sa_family_t sat_family
;
33 struct atalk_addr sat_addr
;
37 struct atalk_netrange
{
48 struct net_device
*dev
;
49 struct atalk_addr target
;
50 struct atalk_addr gateway
;
52 struct atalk_route
*next
;
56 * struct atalk_iface - AppleTalk Interface
57 * @dev - Network device associated with this interface
58 * @address - Our address
59 * @status - What are we doing?
60 * @nets - Associated direct netrange
61 * @next - next element in the list of interfaces
64 struct net_device
*dev
;
65 struct atalk_addr address
;
67 #define ATIF_PROBE 1 /* Probing for an address */
68 #define ATIF_PROBE_FAIL 2 /* Probe collided */
69 struct atalk_netrange nets
;
70 struct atalk_iface
*next
;
74 /* struct sock has to be the first member of atalk_sock */
78 unsigned char dest_node
;
79 unsigned char src_node
;
80 unsigned char dest_port
;
81 unsigned char src_port
;
84 static inline struct atalk_sock
*at_sk(struct sock
*sk
)
86 return (struct atalk_sock
*)sk
;
90 __be16 deh_len_hops
; /* lower 10 bits are length, next 4 - hops */
98 /* And netatalk apps expect to stick the type in themselves */
101 static __inline__
struct ddpehdr
*ddp_hdr(struct sk_buff
*skb
)
103 return (struct ddpehdr
*)skb_transport_header(skb
);
106 /* AppleTalk AARP headers */
109 #define AARP_HW_TYPE_ETHERNET 1
110 #define AARP_HW_TYPE_TOKENRING 2
114 #define AARP_PA_ALEN 4
116 #define AARP_REQUEST 1
119 __u8 hw_src
[ETH_ALEN
];
123 __u8 hw_dst
[ETH_ALEN
];
127 } __attribute__ ((packed
));
129 static __inline__
struct elapaarp
*aarp_hdr(struct sk_buff
*skb
)
131 return (struct elapaarp
*)skb_transport_header(skb
);
134 /* Not specified - how long till we drop a resolved entry */
135 #define AARP_EXPIRY_TIME (5 * 60 * HZ)
136 /* Size of hash table */
137 #define AARP_HASH_SIZE 16
138 /* Fast retransmission timer when resolving */
139 #define AARP_TICK_TIME (HZ / 5)
140 /* Send 10 requests then give up (2 seconds) */
141 #define AARP_RETRANSMIT_LIMIT 10
143 * Some value bigger than total retransmit time + a bit for last reply to
144 * appear and to stop continual requests
146 #define AARP_RESOLVE_TIME (10 * HZ)
148 extern struct datalink_proto
*ddp_dl
, *aarp_dl
;
149 extern void aarp_proto_init(void);
151 /* Inter module exports */
153 /* Give a device find its atif control structure */
154 static inline struct atalk_iface
*atalk_find_dev(struct net_device
*dev
)
156 return dev
->atalk_ptr
;
159 extern struct atalk_addr
*atalk_find_dev_addr(struct net_device
*dev
);
160 extern struct net_device
*atrtr_get_dev(struct atalk_addr
*sa
);
161 extern int aarp_send_ddp(struct net_device
*dev
,
163 struct atalk_addr
*sa
, void *hwaddr
);
164 extern void aarp_device_down(struct net_device
*dev
);
165 extern void aarp_probe_network(struct atalk_iface
*atif
);
166 extern int aarp_proxy_probe_network(struct atalk_iface
*atif
,
167 struct atalk_addr
*sa
);
168 extern void aarp_proxy_remove(struct net_device
*dev
,
169 struct atalk_addr
*sa
);
171 extern void aarp_cleanup_module(void);
173 extern struct hlist_head atalk_sockets
;
174 extern rwlock_t atalk_sockets_lock
;
176 extern struct atalk_route
*atalk_routes
;
177 extern rwlock_t atalk_routes_lock
;
179 extern struct atalk_iface
*atalk_interfaces
;
180 extern rwlock_t atalk_interfaces_lock
;
182 extern struct atalk_route atrtr_default
;
184 extern const struct file_operations atalk_seq_arp_fops
;
186 extern int sysctl_aarp_expiry_time
;
187 extern int sysctl_aarp_tick_time
;
188 extern int sysctl_aarp_retransmit_limit
;
189 extern int sysctl_aarp_resolve_time
;
192 extern void atalk_register_sysctl(void);
193 extern void atalk_unregister_sysctl(void);
195 #define atalk_register_sysctl() do { } while(0)
196 #define atalk_unregister_sysctl() do { } while(0)
199 #ifdef CONFIG_PROC_FS
200 extern int atalk_proc_init(void);
201 extern void atalk_proc_exit(void);
203 #define atalk_proc_init() ({ 0; })
204 #define atalk_proc_exit() do { } while(0)
205 #endif /* CONFIG_PROC_FS */
207 #endif /* __KERNEL__ */
208 #endif /* __LINUX_ATALK_H__ */