lec_arpc.h 2.9 KB

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