atmmpc.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef _ATMMPC_H_
  2. #define _ATMMPC_H_
  3. #include <linux/atmapi.h>
  4. #include <linux/atmioc.h>
  5. #include <linux/atm.h>
  6. #define ATMMPC_CTRL _IO('a', ATMIOC_MPOA)
  7. #define ATMMPC_DATA _IO('a', ATMIOC_MPOA+1)
  8. #define MPC_SOCKET_INGRESS 1
  9. #define MPC_SOCKET_EGRESS 2
  10. struct atmmpc_ioc {
  11. int dev_num;
  12. __be32 ipaddr; /* the IP address of the shortcut */
  13. int type; /* ingress or egress */
  14. };
  15. typedef struct in_ctrl_info {
  16. uint8_t Last_NHRP_CIE_code;
  17. uint8_t Last_Q2931_cause_value;
  18. uint8_t eg_MPC_ATM_addr[ATM_ESA_LEN];
  19. __be32 tag;
  20. __be32 in_dst_ip; /* IP address this ingress MPC sends packets to */
  21. uint16_t holding_time;
  22. uint32_t request_id;
  23. } in_ctrl_info;
  24. typedef struct eg_ctrl_info {
  25. uint8_t DLL_header[256];
  26. uint8_t DH_length;
  27. __be32 cache_id;
  28. __be32 tag;
  29. __be32 mps_ip;
  30. __be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */
  31. uint8_t in_MPC_data_ATM_addr[ATM_ESA_LEN];
  32. uint16_t holding_time;
  33. } eg_ctrl_info;
  34. struct mpc_parameters {
  35. uint16_t mpc_p1; /* Shortcut-Setup Frame Count */
  36. uint16_t mpc_p2; /* Shortcut-Setup Frame Time */
  37. uint8_t mpc_p3[8]; /* Flow-detection Protocols */
  38. uint16_t mpc_p4; /* MPC Initial Retry Time */
  39. uint16_t mpc_p5; /* MPC Retry Time Maximum */
  40. uint16_t mpc_p6; /* Hold Down Time */
  41. } ;
  42. struct k_message {
  43. uint16_t type;
  44. __be32 ip_mask;
  45. uint8_t MPS_ctrl[ATM_ESA_LEN];
  46. union {
  47. in_ctrl_info in_info;
  48. eg_ctrl_info eg_info;
  49. struct mpc_parameters params;
  50. } content;
  51. struct atm_qos qos;
  52. } __ATM_API_ALIGN;
  53. struct llc_snap_hdr {
  54. /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */
  55. uint8_t dsap; /* Destination Service Access Point (0xAA) */
  56. uint8_t ssap; /* Source Service Access Point (0xAA) */
  57. uint8_t ui; /* Unnumbered Information (0x03) */
  58. uint8_t org[3]; /* Organizational identification (0x000000) */
  59. uint8_t type[2]; /* Ether type (for IP) (0x0800) */
  60. };
  61. /* TLVs this MPC recognizes */
  62. #define TLV_MPOA_DEVICE_TYPE 0x00a03e2a
  63. /* MPOA device types in MPOA Device Type TLV */
  64. #define NON_MPOA 0
  65. #define MPS 1
  66. #define MPC 2
  67. #define MPS_AND_MPC 3
  68. /* MPC parameter defaults */
  69. #define MPC_P1 10 /* Shortcut-Setup Frame Count */
  70. #define MPC_P2 1 /* Shortcut-Setup Frame Time */
  71. #define MPC_P3 0 /* Flow-detection Protocols */
  72. #define MPC_P4 5 /* MPC Initial Retry Time */
  73. #define MPC_P5 40 /* MPC Retry Time Maximum */
  74. #define MPC_P6 160 /* Hold Down Time */
  75. #define HOLDING_TIME_DEFAULT 1200 /* same as MPS-p7 */
  76. /* MPC constants */
  77. #define MPC_C1 2 /* Retry Time Multiplier */
  78. #define MPC_C2 60 /* Initial Keep-Alive Lifetime */
  79. /* Message types - to MPOA daemon */
  80. #define SND_MPOA_RES_RQST 201
  81. #define SET_MPS_CTRL_ADDR 202
  82. #define SND_MPOA_RES_RTRY 203 /* Different type in a retry due to req id */
  83. #define STOP_KEEP_ALIVE_SM 204
  84. #define EGRESS_ENTRY_REMOVED 205
  85. #define SND_EGRESS_PURGE 206
  86. #define DIE 207 /* tell the daemon to exit() */
  87. #define DATA_PLANE_PURGE 208 /* Data plane purge because of egress cache hit miss or dead MPS */
  88. #define OPEN_INGRESS_SVC 209
  89. /* Message types - from MPOA daemon */
  90. #define MPOA_TRIGGER_RCVD 101
  91. #define MPOA_RES_REPLY_RCVD 102
  92. #define INGRESS_PURGE_RCVD 103
  93. #define EGRESS_PURGE_RCVD 104
  94. #define MPS_DEATH 105
  95. #define CACHE_IMPOS_RCVD 106
  96. #define SET_MPC_CTRL_ADDR 107 /* Our MPC's control ATM address */
  97. #define SET_MPS_MAC_ADDR 108
  98. #define CLEAN_UP_AND_EXIT 109
  99. #define SET_MPC_PARAMS 110 /* MPC configuration parameters */
  100. /* Message types - bidirectional */
  101. #define RELOAD 301 /* kill -HUP the daemon for reload */
  102. #endif /* _ATMMPC_H_ */