Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * Lec arp cache | |
1da177e4 | 3 | * |
1c9d3e72 | 4 | * Marko Kiiskila <mkiiskila@yahoo.com> |
1da177e4 | 5 | */ |
1c9d3e72 CW |
6 | #ifndef _LEC_ARP_H_ |
7 | #define _LEC_ARP_H_ | |
1da177e4 LT |
8 | #include <linux/atm.h> |
9 | #include <linux/atmdev.h> | |
10 | #include <linux/if_ether.h> | |
11 | #include <linux/atmlec.h> | |
12 | ||
13 | struct lec_arp_table { | |
d0732f64 | 14 | struct hlist_node next; /* Linked entry list */ |
1c9d3e72 CW |
15 | unsigned char atm_addr[ATM_ESA_LEN]; /* Atm address */ |
16 | unsigned char mac_addr[ETH_ALEN]; /* Mac address */ | |
17 | int is_rdesc; /* Mac address is a route descriptor */ | |
18 | struct atm_vcc *vcc; /* Vcc this entry is attached */ | |
19 | struct atm_vcc *recv_vcc; /* Vcc we receive data from */ | |
1da177e4 | 20 | |
1c9d3e72 CW |
21 | void (*old_push) (struct atm_vcc *vcc, struct sk_buff *skb); |
22 | /* Push that leads to daemon */ | |
23 | ||
24 | void (*old_recv_push) (struct atm_vcc *vcc, struct sk_buff *skb); | |
25 | /* Push that leads to daemon */ | |
26 | ||
1c9d3e72 CW |
27 | unsigned long last_used; /* For expiry */ |
28 | unsigned long timestamp; /* Used for various timestamping things: | |
29 | * 1. FLUSH started | |
30 | * (status=ESI_FLUSH_PENDING) | |
31 | * 2. Counting to | |
32 | * max_unknown_frame_time | |
33 | * (status=ESI_ARP_PENDING|| | |
34 | * status=ESI_VC_PENDING) | |
35 | */ | |
36 | unsigned char no_tries; /* No of times arp retry has been tried */ | |
37 | unsigned char status; /* Status of this entry */ | |
38 | unsigned short flags; /* Flags for this entry */ | |
39 | unsigned short packets_flooded; /* Data packets flooded */ | |
40 | unsigned long flush_tran_id; /* Transaction id in flush protocol */ | |
41 | struct timer_list timer; /* Arping timer */ | |
42 | struct lec_priv *priv; /* Pointer back */ | |
43 | u8 *tlvs; | |
44 | u32 sizeoftlvs; /* | |
45 | * LANE2: Each MAC address can have TLVs | |
46 | * associated with it. sizeoftlvs tells the | |
47 | * the length of the tlvs array | |
48 | */ | |
49 | struct sk_buff_head tx_wait; /* wait queue for outgoing packets */ | |
1da177e4 LT |
50 | }; |
51 | ||
1c9d3e72 CW |
52 | /* |
53 | * LANE2: Template tlv struct for accessing | |
54 | * the tlvs in the lec_arp_table->tlvs array | |
55 | */ | |
56 | struct tlv { | |
57 | u32 type; | |
58 | u8 length; | |
59 | u8 value[255]; | |
1da177e4 LT |
60 | }; |
61 | ||
62 | /* Status fields */ | |
1c9d3e72 CW |
63 | #define ESI_UNKNOWN 0 /* |
64 | * Next packet sent to this mac address | |
65 | * causes ARP-request to be sent | |
66 | */ | |
67 | #define ESI_ARP_PENDING 1 /* | |
68 | * There is no ATM address associated with this | |
69 | * 48-bit address. The LE-ARP protocol is in | |
70 | * progress. | |
71 | */ | |
72 | #define ESI_VC_PENDING 2 /* | |
73 | * There is a valid ATM address associated with | |
74 | * this 48-bit address but there is no VC set | |
75 | * up to that ATM address. The signaling | |
76 | * protocol is in process. | |
77 | */ | |
78 | #define ESI_FLUSH_PENDING 4 /* | |
79 | * The LEC has been notified of the FLUSH_START | |
80 | * status and it is assumed that the flush | |
81 | * protocol is in process. | |
82 | */ | |
83 | #define ESI_FORWARD_DIRECT 5 /* | |
84 | * Either the Path Switching Delay (C22) has | |
85 | * elapsed or the LEC has notified the Mapping | |
86 | * that the flush protocol has completed. In | |
87 | * either case, it is safe to forward packets | |
88 | * to this address via the data direct VC. | |
89 | */ | |
1da177e4 LT |
90 | |
91 | /* Flag values */ | |
92 | #define LEC_REMOTE_FLAG 0x0001 | |
93 | #define LEC_PERMANENT_FLAG 0x0002 | |
94 | ||
1c9d3e72 | 95 | #endif /* _LEC_ARP_H_ */ |