lec_arpc.h 3.0 KB

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