atmmpc.h 4.1 KB

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