15 #ifndef included_vnet_sctp_packet_h 16 #define included_vnet_sctp_packet_h 86 h->
src_port = clib_host_to_net_u16 (src_port);
92 return (clib_net_to_host_u16 (h->
src_port));
98 h->
dst_port = clib_host_to_net_u16 (dst_port);
104 return (clib_net_to_host_u16 (h->
dst_port));
122 h->
checksum = clib_host_to_net_u32 (checksum);
128 return (clib_net_to_host_u32 (h->
checksum));
265 #define CHUNK_TYPE_MASK 0xFF000000 266 #define CHUNK_TYPE_SHIFT 24 268 #define CHUNK_FLAGS_MASK 0x00FF0000 269 #define CHUNK_FLAGS_SHIFT 16 271 #define CHUNK_UBIT_MASK 0x00040000 272 #define CHUNK_UBIT_SHIFT 18 274 #define CHUNK_BBIT_MASK 0x00020000 275 #define CHUNK_BBIT_SHIFT 17 277 #define CHUNK_EBIT_MASK 0x00010000 278 #define CHUNK_EBIT_SHIFT 16 280 #define CHUNK_LENGTH_MASK 0x0000FFFF 281 #define CHUNK_LENGTH_SHIFT 0 462 p->
tsn = clib_host_to_net_u32 (tsn);
468 return (clib_net_to_host_u32 (p->
tsn));
474 p->
stream_id = clib_host_to_net_u16 (stream_id);
480 return (clib_net_to_host_u16 (p->
stream_id));
486 p->
stream_seq = clib_host_to_net_u16 (stream_seq);
492 return (clib_net_to_host_u16 (p->
stream_seq));
498 p->
payload_id = clib_host_to_net_u32 (payload_id);
504 return (clib_net_to_host_u32 (p->
payload_id));
510 if (base_length % 4 == 0)
513 return (4 - base_length % 4);
516 #define INBOUND_STREAMS_COUNT 1 517 #define OUTBOUND_STREAMS_COUNT 1 699 #define SHA1_OUTPUT_LENGTH 20 776 #define SCTP_IPV4_ADDRESS_TYPE 5 777 #define SCTP_IPV4_ADDRESS_TYPE_LENGTH 8 778 #define SCTP_IPV6_ADDRESS_TYPE 6 779 #define SCTP_IPV6_ADDRESS_TYPE_LENGTH 20 780 #define SCTP_STATE_COOKIE_TYPE 7 781 #define SCTP_UNRECOGNIZED_TYPE 8 782 #define SCTP_COOKIE_PRESERVATIVE_TYPE 9 783 #define SCTP_COOKIE_PRESERVATIVE_TYPE_LENGTH 8 784 #define SCTP_HOSTNAME_ADDRESS_TYPE 11 785 #define SCTP_SUPPORTED_ADDRESS_TYPES 12 914 #define FQDN_MAX_LENGTH 256 958 #define MAX_SUPPORTED_ADDRESS_TYPES 3 998 #define INVALID_STREAM_IDENTIFIER 1 999 #define MISSING_MANDATORY_PARAMETER 2 1000 #define STALE_COOKIE_ERROR 3 1001 #define OUT_OF_RESOURCE 4 1002 #define UNRESOLVABLE_ADDRESS 5 1003 #define UNRECOGNIZED_CHUNK_TYPE 6 1004 #define INVALID_MANDATORY_PARAMETER 7 1005 #define UNRECOGNIZED_PARAMETER 8 1006 #define NO_USER_DATA 9 1007 #define COOKIE_RECEIVED_WHILE_SHUTTING_DOWN 10 1008 #define RESTART_OF_ASSOCIATION_WITH_NEW_ADDR 11 1009 #define USER_INITIATED_ABORT 12 1010 #define PROTOCOL_VIOLATION 13 1129 u32 cumulative_tsn_ack)
1145 s->
a_rwnd = clib_host_to_net_u32 (a_rwnd);
1151 return clib_net_to_host_u32 (s->
a_rwnd);
1156 u16 gap_ack_blocks_count)
1177 u16 duplicate_tsn_count)
1226 h->
hb_info = clib_host_to_net_u16 (1);
1228 h->
hb_info = clib_host_to_net_u64 (hb_info);
static u32 vnet_sctp_get_cumulative_tsn_ack(sctp_selective_ack_chunk_t *s)
sctp_chunks_common_hdr_t chunk_hdr
static u16 vnet_sctp_get_stream_id(sctp_payload_data_chunk_t *p)
static void vnet_sctp_set_stream_id(sctp_payload_data_chunk_t *p, u16 stream_id)
static void vnet_sctp_set_ebit(sctp_chunks_common_hdr_t *h)
static void vnet_sctp_set_stream_seq(sctp_payload_data_chunk_t *p, u16 stream_seq)
sctp_state_cookie_param_t cookie
static void vnet_sctp_set_gap_ack_blocks_count(sctp_selective_ack_chunk_t *s, u16 gap_ack_blocks_count)
static void vnet_sctp_set_hb_ack_info(sctp_hb_ack_chunk_t *h, sctp_hb_info_param_t *hb_info)
sctp_opt_params_hdr_t param_hdr
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
sctp_chunks_common_hdr_t chunk_hdr
static u8 vnet_sctp_get_ebit(sctp_chunks_common_hdr_t *h)
sctp_chunks_common_hdr_t chunk_hdr
#define MAX_SUPPORTED_ADDRESS_TYPES
#define SCTP_HOSTNAME_ADDRESS_TYPE
static void vnet_sctp_set_hb_request_info(sctp_hb_req_chunk_t *h, sctp_hb_info_param_t *hb_info)
static void vnet_sctp_set_tsn_last_received_chunk(sctp_shutdown_association_chunk_t *s, u32 tsn_last_chunk)
#define SHA1_OUTPUT_LENGTH
sctp_chunks_common_hdr_t chunk_hdr
static u16 vnet_get_sctp_dst_port(sctp_header_t *h)
static u32 vnet_sctp_get_tsn(sctp_payload_data_chunk_t *p)
static u32 vnet_get_sctp_checksum(sctp_header_t *h)
sctp_chunks_common_hdr_t chunk_hdr
static void vnet_sctp_common_hdr_params_host_to_net(sctp_chunks_common_hdr_t *h)
u16 * gap_ack_block_start
sctp_chunks_common_hdr_t chunk_hdr
static void vnet_sctp_set_arwnd(sctp_selective_ack_chunk_t *s, u32 a_rwnd)
static void vnet_sctp_set_tbit(sctp_abort_chunk_t *a)
static void vnet_sctp_set_cumulative_tsn_ack(sctp_selective_ack_chunk_t *s, u32 cumulative_tsn_ack)
static u16 vnet_sctp_get_duplicate_tsn_count(sctp_selective_ack_chunk_t *s)
static void vnet_sctp_set_chunk_type(sctp_chunks_common_hdr_t *h, sctp_chunk_type t)
sctp_opt_params_hdr_t param_hdr
static void vnet_sctp_set_duplicate_tsn_count(sctp_selective_ack_chunk_t *s, u16 duplicate_tsn_count)
static void vnet_sctp_common_hdr_params_net_to_host(sctp_chunks_common_hdr_t *h)
#define SCTP_STATE_COOKIE_TYPE
static u32 vnet_sctp_get_cookie_preservative(sctp_cookie_preservative_param_t *c)
static void vnet_sctp_set_ipv4_address(sctp_ipv4_addr_param_t *a, ip4_address_t address)
static void vnet_sctp_set_state_cookie(sctp_state_cookie_param_t *s)
static u8 vnet_sctp_get_ubit(sctp_chunks_common_hdr_t *h)
sctp_init_chunk_t sctp_init_ack_chunk_t
static u16 vnet_get_sctp_src_port(sctp_header_t *h)
static u8 vnet_sctp_get_bbit(sctp_chunks_common_hdr_t *h)
sctp_opt_params_hdr_t param_hdr
#define SCTP_IPV6_ADDRESS_TYPE
static void vnet_sctp_set_tsn(sctp_payload_data_chunk_t *p, u32 tsn)
static void vnet_set_sctp_dst_port(sctp_header_t *h, u16 dst_port)
static u8 vnet_sctp_get_chunk_type(sctp_chunks_common_hdr_t *h)
static u32 vnet_sctp_get_ipv4_address(sctp_ipv4_addr_param_t *a)
sctp_hb_req_chunk_t sctp_hb_ack_chunk_t
sctp_chunks_common_hdr_t common_hdr
sctp_chunks_common_hdr_t chunk_hdr
#define UNRECOGNIZED_PARAMETER
static void vnet_sctp_set_heartbeat_info(sctp_hb_info_param_t *h, u64 hb_info, u16 hb_info_length)
sctp_opt_params_hdr_t param_hdr
static u16 vnet_sctp_get_gap_ack_blocks_count(sctp_selective_ack_chunk_t *s)
char hostname[FQDN_MAX_LENGTH]
static void vnet_sctp_fill_shutdown_ack(sctp_shutdown_ack_chunk_t *s)
sctp_opt_params_hdr_t param_hdr
manual_print typedef address
#define CHUNK_LENGTH_SHIFT
manual_print typedef u8 ip6_address[16]
static u16 vnet_sctp_calculate_padding(u16 base_length)
static void vnet_sctp_set_ubit(sctp_chunks_common_hdr_t *h)
static void vnet_sctp_set_ipv6_address(sctp_ipv6_addr_param_t *a, ip6_address_t address)
sctp_chunks_common_hdr_t chunk_hdr
static void * clib_mem_alloc(uword size)
static void vnet_sctp_set_unrecognized_param(sctp_unrecognized_param_t *u)
sctp_hb_info_param_t hb_info
static void vnet_sctp_set_cookie_preservative(sctp_cookie_preservative_param_t *c, u32 life_span_inc)
sctp_opt_params_hdr_t param_hdr
static void vnet_set_sctp_verification_tag(sctp_header_t *h, u32 verification_tag)
#define SCTP_IPV4_ADDRESS_TYPE
static void vnet_sctp_set_payload_id(sctp_payload_data_chunk_t *p, u32 payload_id)
static u32 vnet_sctp_get_payload_id(sctp_payload_data_chunk_t *p)
sctp_chunks_common_hdr_t chunk_hdr
u16 address_type[MAX_SUPPORTED_ADDRESS_TYPES]
static u16 vnet_sctp_get_chunk_length(sctp_chunks_common_hdr_t *h)
static void vnet_sctp_unset_tbit(sctp_abort_chunk_t *a)
static u32 vnet_get_sctp_verification_tag(sctp_header_t *h)
sctp_opt_params_hdr_t param_hdr
static u16 vnet_sctp_get_stream_seq(sctp_payload_data_chunk_t *p)
sctp_opt_params_hdr_t param_hdr
#define SCTP_COOKIE_PRESERVATIVE_TYPE
u16 outbound_streams_count
static void vnet_sctp_set_bbit(sctp_chunks_common_hdr_t *h)
static void vnet_set_sctp_src_port(sctp_header_t *h, u16 src_port)
static ip6_address_t vnet_sctp_get_ipv6_address(sctp_ipv6_addr_param_t *a)
sctp_chunks_common_hdr_t chunk_hdr
static void vnet_sctp_set_supported_address_types(sctp_supported_addr_types_param_t *s)
sctp_opt_params_hdr_t param_hdr
static void vnet_sctp_set_chunk_length(sctp_chunks_common_hdr_t *h, u16 length)
static void vnet_sctp_set_hostname_address(sctp_hostname_param_t *h, char *hostname)
#define CHUNK_LENGTH_MASK
static u32 vnet_sctp_get_arwnd(sctp_selective_ack_chunk_t *s)
sctp_chunks_common_hdr_t chunk_hdr
static void vnet_set_sctp_checksum(sctp_header_t *h, u32 checksum)
#define SCTP_SUPPORTED_ADDRESS_TYPES