1 #ifndef __LINUX_ATALK_H__
2 #define __LINUX_ATALK_H__
6 #include <uapi/linux/atalk.h>
9 struct net_device *dev;
10 struct atalk_addr target;
11 struct atalk_addr gateway;
13 struct atalk_route *next;
17 * struct atalk_iface - AppleTalk Interface
18 * @dev - Network device associated with this interface
19 * @address - Our address
20 * @status - What are we doing?
21 * @nets - Associated direct netrange
22 * @next - next element in the list of interfaces
25 struct net_device *dev;
26 struct atalk_addr address;
28 #define ATIF_PROBE 1 /* Probing for an address */
29 #define ATIF_PROBE_FAIL 2 /* Probe collided */
30 struct atalk_netrange nets;
31 struct atalk_iface *next;
35 /* struct sock has to be the first member of atalk_sock */
39 unsigned char dest_node;
40 unsigned char src_node;
41 unsigned char dest_port;
42 unsigned char src_port;
45 static inline struct atalk_sock *at_sk(struct sock *sk)
47 return (struct atalk_sock *)sk;
51 __be16 deh_len_hops; /* lower 10 bits are length, next 4 - hops */
59 /* And netatalk apps expect to stick the type in themselves */
62 static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb)
64 return (struct ddpehdr *)skb_transport_header(skb);
67 /* AppleTalk AARP headers */
70 #define AARP_HW_TYPE_ETHERNET 1
71 #define AARP_HW_TYPE_TOKENRING 2
75 #define AARP_PA_ALEN 4
77 #define AARP_REQUEST 1
80 __u8 hw_src[ETH_ALEN];
84 __u8 hw_dst[ETH_ALEN];
88 } __attribute__ ((packed));
90 static __inline__ struct elapaarp *aarp_hdr(struct sk_buff *skb)
92 return (struct elapaarp *)skb_transport_header(skb);
95 /* Not specified - how long till we drop a resolved entry */
96 #define AARP_EXPIRY_TIME (5 * 60 * HZ)
97 /* Size of hash table */
98 #define AARP_HASH_SIZE 16
99 /* Fast retransmission timer when resolving */
100 #define AARP_TICK_TIME (HZ / 5)
101 /* Send 10 requests then give up (2 seconds) */
102 #define AARP_RETRANSMIT_LIMIT 10
104 * Some value bigger than total retransmit time + a bit for last reply to
105 * appear and to stop continual requests
107 #define AARP_RESOLVE_TIME (10 * HZ)
109 extern struct datalink_proto *ddp_dl, *aarp_dl;
110 extern void aarp_proto_init(void);
112 /* Inter module exports */
114 /* Give a device find its atif control structure */
115 static inline struct atalk_iface *atalk_find_dev(struct net_device *dev)
117 return dev->atalk_ptr;
120 extern struct atalk_addr *atalk_find_dev_addr(struct net_device *dev);
121 extern struct net_device *atrtr_get_dev(struct atalk_addr *sa);
122 extern int aarp_send_ddp(struct net_device *dev,
124 struct atalk_addr *sa, void *hwaddr);
125 extern void aarp_device_down(struct net_device *dev);
126 extern void aarp_probe_network(struct atalk_iface *atif);
127 extern int aarp_proxy_probe_network(struct atalk_iface *atif,
128 struct atalk_addr *sa);
129 extern void aarp_proxy_remove(struct net_device *dev,
130 struct atalk_addr *sa);
132 extern void aarp_cleanup_module(void);
134 extern struct hlist_head atalk_sockets;
135 extern rwlock_t atalk_sockets_lock;
137 extern struct atalk_route *atalk_routes;
138 extern rwlock_t atalk_routes_lock;
140 extern struct atalk_iface *atalk_interfaces;
141 extern rwlock_t atalk_interfaces_lock;
143 extern struct atalk_route atrtr_default;
145 extern const struct file_operations atalk_seq_arp_fops;
147 extern int sysctl_aarp_expiry_time;
148 extern int sysctl_aarp_tick_time;
149 extern int sysctl_aarp_retransmit_limit;
150 extern int sysctl_aarp_resolve_time;
153 extern void atalk_register_sysctl(void);
154 extern void atalk_unregister_sysctl(void);
156 #define atalk_register_sysctl() do { } while(0)
157 #define atalk_unregister_sysctl() do { } while(0)
160 #ifdef CONFIG_PROC_FS
161 extern int atalk_proc_init(void);
162 extern void atalk_proc_exit(void);
164 #define atalk_proc_init() ({ 0; })
165 #define atalk_proc_exit() do { } while(0)
166 #endif /* CONFIG_PROC_FS */
168 #endif /* __LINUX_ATALK_H__ */