lec_arpc.h 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Lec arp cache
  3. * Marko Kiiskila mkiiskila@yahoo.com
  4. *
  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 lec_arp_table *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. void (*old_close)(struct atm_vcc *vcc);
  24. /* We want to see when this
  25. * vcc gets closed */
  26. unsigned long last_used; /* For expiry */
  27. unsigned long timestamp; /* Used for various timestamping
  28. * 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
  37. 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; /* LANE2: Each MAC address can have TLVs */
  45. u32 sizeoftlvs; /* associated with it. sizeoftlvs tells the */
  46. /* the length of the tlvs array */
  47. struct sk_buff_head tx_wait; /* wait queue for outgoing packets */
  48. };
  49. struct tlv { /* LANE2: Template tlv struct for accessing */
  50. /* the tlvs in the lec_arp_table->tlvs array*/
  51. u32 type;
  52. u8 length;
  53. u8 value[255];
  54. };
  55. /* Status fields */
  56. #define ESI_UNKNOWN 0 /*
  57. * Next packet sent to this mac address
  58. * causes ARP-request to be sent
  59. */
  60. #define ESI_ARP_PENDING 1 /*
  61. * There is no ATM address associated with this
  62. * 48-bit address. The LE-ARP protocol is in
  63. * progress.
  64. */
  65. #define ESI_VC_PENDING 2 /*
  66. * There is a valid ATM address associated with
  67. * this 48-bit address but there is no VC set
  68. * up to that ATM address. The signaling
  69. * protocol is in process.
  70. */
  71. #define ESI_FLUSH_PENDING 4 /*
  72. * The LEC has been notified of the FLUSH_START
  73. * status and it is assumed that the flush
  74. * protocol is in process.
  75. */
  76. #define ESI_FORWARD_DIRECT 5 /*
  77. * Either the Path Switching Delay (C22) has
  78. * elapsed or the LEC has notified the Mapping
  79. * that the flush protocol has completed. In
  80. * either case, it is safe to forward packets
  81. * to this address via the data direct VC.
  82. */
  83. /* Flag values */
  84. #define LEC_REMOTE_FLAG 0x0001
  85. #define LEC_PERMANENT_FLAG 0x0002
  86. #endif