blob: 885f1fbcb864e6a14feda8a0a6df42e3c930af63 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Lec arp cache
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
Chas Williams1c9d3e72006-09-29 17:13:24 -07004 * Marko Kiiskila <mkiiskila@yahoo.com>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
Chas Williams1c9d3e72006-09-29 17:13:24 -07006#ifndef _LEC_ARP_H_
7#define _LEC_ARP_H_
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include <linux/atm.h>
9#include <linux/atmdev.h>
10#include <linux/if_ether.h>
11#include <linux/atmlec.h>
12
13struct lec_arp_table {
Chas Williamsd0732f62006-09-29 17:14:27 -070014 struct hlist_node next; /* Linked entry list */
Chas Williams1c9d3e72006-09-29 17:13:24 -070015 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 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Chas Williams1c9d3e72006-09-29 17:13:24 -070021 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
27 void (*old_close) (struct atm_vcc *vcc);
28 /* We want to see when this vcc gets closed */
29
30 unsigned long last_used; /* For expiry */
31 unsigned long timestamp; /* Used for various timestamping things:
32 * 1. FLUSH started
33 * (status=ESI_FLUSH_PENDING)
34 * 2. Counting to
35 * max_unknown_frame_time
36 * (status=ESI_ARP_PENDING||
37 * status=ESI_VC_PENDING)
38 */
39 unsigned char no_tries; /* No of times arp retry has been tried */
40 unsigned char status; /* Status of this entry */
41 unsigned short flags; /* Flags for this entry */
42 unsigned short packets_flooded; /* Data packets flooded */
43 unsigned long flush_tran_id; /* Transaction id in flush protocol */
44 struct timer_list timer; /* Arping timer */
45 struct lec_priv *priv; /* Pointer back */
46 u8 *tlvs;
47 u32 sizeoftlvs; /*
48 * LANE2: Each MAC address can have TLVs
49 * associated with it. sizeoftlvs tells the
50 * the length of the tlvs array
51 */
52 struct sk_buff_head tx_wait; /* wait queue for outgoing packets */
Linus Torvalds1da177e2005-04-16 15:20:36 -070053};
54
Chas Williams1c9d3e72006-09-29 17:13:24 -070055/*
56 * LANE2: Template tlv struct for accessing
57 * the tlvs in the lec_arp_table->tlvs array
58 */
59struct tlv {
60 u32 type;
61 u8 length;
62 u8 value[255];
Linus Torvalds1da177e2005-04-16 15:20:36 -070063};
64
65/* Status fields */
Chas Williams1c9d3e72006-09-29 17:13:24 -070066#define ESI_UNKNOWN 0 /*
67 * Next packet sent to this mac address
68 * causes ARP-request to be sent
69 */
70#define ESI_ARP_PENDING 1 /*
71 * There is no ATM address associated with this
72 * 48-bit address. The LE-ARP protocol is in
73 * progress.
74 */
75#define ESI_VC_PENDING 2 /*
76 * There is a valid ATM address associated with
77 * this 48-bit address but there is no VC set
78 * up to that ATM address. The signaling
79 * protocol is in process.
80 */
81#define ESI_FLUSH_PENDING 4 /*
82 * The LEC has been notified of the FLUSH_START
83 * status and it is assumed that the flush
84 * protocol is in process.
85 */
86#define ESI_FORWARD_DIRECT 5 /*
87 * Either the Path Switching Delay (C22) has
88 * elapsed or the LEC has notified the Mapping
89 * that the flush protocol has completed. In
90 * either case, it is safe to forward packets
91 * to this address via the data direct VC.
92 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070093
94/* Flag values */
95#define LEC_REMOTE_FLAG 0x0001
96#define LEC_PERMANENT_FLAG 0x0002
97
Chas Williams1c9d3e72006-09-29 17:13:24 -070098#endif /* _LEC_ARP_H_ */