atmmpc.h 4.1 KB

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