32 #ifndef PCP_MSG_STRUCT_H_INCLUDED 33 #define PCP_MSG_STRUCT_H_INCLUDED 35 #define PCP_OPCODE_ANNOUNCE 0 36 #define PCP_OPCODE_MAP 1 37 #define PCP_OPCODE_PEER 2 39 #define PCP_OPCODE_SADSCP 3 45 #define PCP_ERR_UNSUPP_VERSION 1 51 #define PCP_ERR_NOT_AUTHORIZED 2 58 #define PCP_ERR_MALFORMED_REQUEST 3 63 #define PCP_ERR_UNSUPP_OPCODE 4 67 #define PCP_ERR_UNSUPP_OPTION 5 73 #define PCP_ERR_MALFORMED_OPTION 6 78 #define PCP_ERR_NETWORK_FAILURE 7 84 #define PCP_ERR_NO_RESOURCES 8 96 #define PCP_ERR_UNSUPP_PROTOCOL 9 101 #define PCP_ERR_USER_EX_QUOTA 10 106 #define PCP_ERR_CANNOT_PROVIDE_EXTERNAL 11 116 #define PCP_ERR_ADDRESS_MISMATCH 12 123 #define PCP_ERR_EXCESSIVE_REMOTE_PEERS 13 135 PCP_OPTION_FLOW_PRIORITY = 4,
142 typedef struct pcp_request {
152 #define PCP_COMMON_REQUEST_SIZE (24) 156 typedef struct pcp_response {
169 #define PCP_COMMON_RESPONSE_SIZE (24) 173 typedef struct pcp_options_hdr {
180 #define PCP_OPTION_HDR_SIZE (4) 184 typedef struct pcp_map_v2 {
195 #define PCP_MAP_V2_SIZE (36) 199 typedef struct pcp_map_v1 {
209 #define PCP_MAP_V1_SIZE (24) 213 typedef struct pcp_peer_v1 {
226 #define PCP_PEER_V1_SIZE (44) 230 typedef struct pcp_peer_v2 {
244 #define PCP_PEER_V2_SIZE (56) 248 typedef struct pcp_sadscp_req {
255 #define PCP_SADSCP_REQ_SIZE (14) 258 typedef struct pcp_sadscp_resp {
264 #define PCP_SADSCP_MASK ((1<<6)-1) 268 typedef struct pcp_prefer_fail_option {
273 } pcp_prefer_fail_option_t;
275 #define PCP_PREFER_FAIL_OPTION_SIZE (4) 278 typedef struct pcp_3rd_party_option{
284 } pcp_3rd_party_option_t;
286 #define PCP_3RD_PARTY_OPTION_SIZE (20) 290 typedef struct pcp_flow_priority_option{
300 } pcp_flow_priority_option_t;
302 #define PCP_DSCP_MASK ((1<<6)-1) 303 #define PCP_FLOW_PRIORITY_OPTION_SIZE (8) 307 typedef struct pcp_filter_option {
315 }pcp_filter_option_t;
317 #define PCP_FILTER_OPTION_SIZE (24)
enum pcp_options pcp_options_t
boost::endian::big_uint32_t ip