8 struct dn_ifaddr __rcu
*ifa_next
;
9 struct dn_dev
*ifa_dev
;
14 char ifa_label
[IFNAMSIZ
];
18 #define DN_DEV_S_RU 0 /* Run - working normally */
19 #define DN_DEV_S_CR 1 /* Circuit Rejected */
20 #define DN_DEV_S_DS 2 /* Data Link Start */
21 #define DN_DEV_S_RI 3 /* Routing Layer Initialize */
22 #define DN_DEV_S_RV 4 /* Routing Layer Verify */
23 #define DN_DEV_S_RC 5 /* Routing Layer Complete */
24 #define DN_DEV_S_OF 6 /* Off */
25 #define DN_DEV_S_HA 7 /* Halt */
29 * The dn_dev_parms structure contains the set of parameters
30 * for each device (hence inclusion in the dn_dev structure)
31 * and an array is used to store the default types of supported
32 * device (in dn_dev.c).
34 * The type field matches the ARPHRD_ constants and is used in
35 * searching the list for supported devices when new devices
38 * The mode field is used to find out if a device is broadcast,
39 * multipoint, or pointopoint. Please note that DECnet thinks
40 * different ways about devices to the rest of the kernel
41 * so the normal IFF_xxx flags are invalid here. For devices
42 * which can be any combination of the previously mentioned
43 * attributes, you can set this on a per device basis by
44 * installing an up() routine.
46 * The device state field, defines the initial state in which the
47 * device will come up. In the dn_dev structure, it is the actual
50 * Things have changed here. I've killed timer1 since it's a user space
51 * issue for a user space routing deamon to sort out. The kernel does
52 * not need to be bothered with it.
55 * t2 - Rate limit timer, min time between routing and hello messages
56 * t3 - Hello timer, send hello messages when it expires
59 * up() - Called to initialize device, return value can veto use of
61 * down() - Called to turn device off when it goes down
62 * timer3() - Called once for each ifaddr when timer 3 goes off
64 * sysctl - Hook for sysctl things
68 int type
; /* ARPHRD_xxx */
69 int mode
; /* Broadcast, Unicast, Mulitpoint */
70 #define DN_DEV_BCAST 1
71 #define DN_DEV_UCAST 2
72 #define DN_DEV_MPOINT 4
73 int state
; /* Initial state */
74 int forwarding
; /* 0=EndNode, 1=L1Router, 2=L2Router */
75 unsigned long t2
; /* Default value of t2 */
76 unsigned long t3
; /* Default value of t3 */
77 int priority
; /* Priority to be a router */
78 char *name
; /* Name for sysctl */
79 int (*up
)(struct net_device
*);
80 void (*down
)(struct net_device
*);
81 void (*timer3
)(struct net_device
*, struct dn_ifaddr
*ifa
);
87 struct dn_ifaddr __rcu
*ifa_list
;
88 struct net_device
*dev
;
89 struct dn_dev_parms parms
;
91 struct timer_list timer
;
93 struct neigh_parms
*neigh_parms
;
95 struct neighbour
*router
; /* Default router on circuit */
96 struct neighbour
*peer
; /* Peer on pointopoint links */
97 unsigned long uptime
; /* Time device went up in jiffies */
100 struct dn_short_packet
{
107 struct dn_long_packet
{
121 /*------------------------- DRP - Routing messages ---------------------*/
123 struct endnode_hello_message
{
138 struct rtnode_hello_message
{
151 extern void dn_dev_init(void);
152 extern void dn_dev_cleanup(void);
154 extern int dn_dev_ioctl(unsigned int cmd
, void __user
*arg
);
156 extern void dn_dev_devices_off(void);
157 extern void dn_dev_devices_on(void);
159 extern void dn_dev_init_pkt(struct sk_buff
*skb
);
160 extern void dn_dev_veri_pkt(struct sk_buff
*skb
);
161 extern void dn_dev_hello(struct sk_buff
*skb
);
163 extern void dn_dev_up(struct net_device
*);
164 extern void dn_dev_down(struct net_device
*);
166 extern int dn_dev_set_default(struct net_device
*dev
, int force
);
167 extern struct net_device
*dn_dev_get_default(void);
168 extern int dn_dev_bind_default(__le16
*addr
);
170 extern int register_dnaddr_notifier(struct notifier_block
*nb
);
171 extern int unregister_dnaddr_notifier(struct notifier_block
*nb
);
173 static inline int dn_dev_islocal(struct net_device
*dev
, __le16 addr
)
175 struct dn_dev
*dn_db
;
176 struct dn_ifaddr
*ifa
;
180 dn_db
= rcu_dereference(dev
->dn_ptr
);
182 printk(KERN_DEBUG
"dn_dev_islocal: Called for non DECnet device\n");
186 for (ifa
= rcu_dereference(dn_db
->ifa_list
);
188 ifa
= rcu_dereference(ifa
->ifa_next
))
189 if ((addr
^ ifa
->ifa_local
) == 0) {
198 #endif /* _NET_DN_DEV_H */