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