29 #ifndef ROHC_PROTOCOLS_TCP_H 30 #define ROHC_PROTOCOLS_TCP_H 43 #define ROHC_PACKET_TYPE_IR 0xFD 44 #define ROHC_PACKET_TYPE_IR_CR 0xfc 45 #define ROHC_PACKET_TYPE_IR_DYN 0xF8 58 #define ROHC_TCP_MAX_IP_HDRS 2U 67 #define ROHC_TCP_MAX_IP_EXT_HDRS 5U 76 #define MAX_TCP_OPTION_INDEX 15U 87 #define ROHC_TCP_OPTS_MAX_PROTO 40U 102 #define ROHC_TCP_OPTS_MAX 15U 121 #if WORDS_BIGENDIAN == 1 142 } __attribute__((packed));
146 #define RSF_RST_ONLY 0x04 147 #define RSF_SYN_ONLY 0x02 148 #define RSF_FIN_ONLY 0x01 149 #define RSF_NONE 0x00 177 #define TCP_OLEN_MSS 4U 179 #define TCP_OLEN_WS 3U 181 #define TCP_OLEN_SACK_PERM 2U 184 #define TCP_OLEN_TS 10U 190 #define TCP_INDEX_NOP 0U 191 #define TCP_INDEX_EOL 1U 192 #define TCP_INDEX_MSS 2U 193 #define TCP_INDEX_WS 3U 194 #define TCP_INDEX_TS 4U 195 #define TCP_INDEX_SACK_PERM 5U 196 #define TCP_INDEX_SACK 6U 197 #define TCP_INDEX_GENERIC7 7U 198 #define TCP_INDEX_GENERIC8 8U 199 #define TCP_INDEX_GENERIC9 9U 200 #define TCP_INDEX_GENERIC10 10U 201 #define TCP_INDEX_GENERIC11 11U 202 #define TCP_INDEX_GENERIC12 12U 203 #define TCP_INDEX_GENERIC13 13U 204 #define TCP_INDEX_GENERIC14 14U 205 #define TCP_INDEX_GENERIC15 15U 222 #define TCP_SACK_BLOCKS_MAX_NR 4U 230 } __attribute__((packed));
245 #if WORDS_BIGENDIAN == 1 246 uint8_t version_flag:1;
275 #if WORDS_BIGENDIAN == 1 278 uint8_t ip_id_behavior:2;
280 uint8_t ip_ecn_flags:2;
299 #if WORDS_BIGENDIAN == 1 302 uint8_t ip_id_behavior:2;
304 uint8_t ip_ecn_flags:2;
324 #if WORDS_BIGENDIAN == 1 326 uint8_t ip_id_behavior:2;
330 uint8_t ip_ecn_flags:2;
389 #if WORDS_BIGENDIAN == 1 390 uint8_t version_flag:1;
392 uint8_t flow_label_enc_discriminator:1;
401 uint32_t src_addr[4];
402 uint32_t dst_addr[4];
413 #if WORDS_BIGENDIAN == 1 414 uint8_t version_flag:1;
416 uint8_t flow_label_enc_discriminator:1;
417 uint8_t flow_label1:4;
426 uint32_t src_addr[4];
427 uint32_t dst_addr[4];
438 #if WORDS_BIGENDIAN == 1 440 uint8_t ip_ecn_flags:2;
456 #if WORDS_BIGENDIAN == 1 458 uint8_t ip_ecn_flags:2;
460 uint8_t fl_enc_flag:1;
479 #if WORDS_BIGENDIAN == 1 481 uint8_t ip_ecn_flags:2;
483 uint8_t fl_enc_flag:1;
484 uint8_t flow_label1:4;
520 #if WORDS_BIGENDIAN == 1 522 uint8_t ack_stride_flag:1;
525 uint8_t tcp_res_flags:4;
527 uint8_t tcp_ecn_flags:2;
578 #if WORDS_BIGENDIAN == 1 580 uint8_t window_presence:1;
581 uint8_t list_present:1;
582 uint8_t src_port_presence:2;
583 uint8_t dst_port_presence:2;
584 uint8_t ack_stride_flag:1;
586 uint8_t ack_presence:1;
587 uint8_t urp_presence:1;
636 #if WORDS_BIGENDIAN == 1 638 uint8_t discriminator:7;
639 uint8_t ttl_hopl_outer_flag:1;
647 uint8_t seq_indicator:2;
648 uint8_t ack_indicator:2;
649 uint8_t ack_stride_indicator:1;
650 uint8_t window_indicator:1;
651 uint8_t ip_id_indicator:1;
652 uint8_t urg_ptr_present:1;
656 uint8_t dscp_present:1;
657 uint8_t ttl_hopl_present:1;
658 uint8_t list_present:1;
659 uint8_t ip_id_behavior:2;
663 uint8_t header_crc:7;
719 #if WORDS_BIGENDIAN == 1 720 uint8_t discriminator:6;
725 uint8_t header_crc:3;
735 } __attribute__((packed))
rnd_1_t;
746 #if WORDS_BIGENDIAN == 1 747 uint8_t discriminator:4;
748 uint8_t seq_num_scaled:4;
751 uint8_t header_crc:3;
760 } __attribute__((packed))
rnd_2_t;
771 #if WORDS_BIGENDIAN == 1 772 uint8_t discriminator:1;
777 uint8_t header_crc:3;
787 } __attribute__((packed))
rnd_3_t;
798 #if WORDS_BIGENDIAN == 1 799 uint8_t discriminator:4;
800 uint8_t ack_num_scaled:4;
803 uint8_t header_crc:3;
812 } __attribute__((packed))
rnd_4_t;
823 #if WORDS_BIGENDIAN == 1 824 uint8_t discriminator:3;
827 uint32_t header_crc:3;
845 } __attribute__((packed))
rnd_5_t;
856 #if WORDS_BIGENDIAN == 1 857 uint8_t discriminator:4;
858 uint8_t header_crc:3;
866 #if WORDS_BIGENDIAN == 1 868 uint8_t seq_num_scaled:4;
874 } __attribute__((packed))
rnd_6_t;
885 #if WORDS_BIGENDIAN == 1 886 uint8_t discriminator:6;
895 #if WORDS_BIGENDIAN == 1 898 uint8_t header_crc:3;
905 } __attribute__((packed))
rnd_7_t;
916 #if WORDS_BIGENDIAN == 1 917 uint8_t discriminator:5;
919 uint8_t list_present:1;
920 uint16_t header_crc:7;
942 } __attribute__((packed))
rnd_8_t;
953 #if WORDS_BIGENDIAN == 1 954 uint8_t discriminator:4;
961 #if WORDS_BIGENDIAN == 1 964 uint8_t header_crc:3;
971 } __attribute__((packed))
seq_1_t;
982 #if WORDS_BIGENDIAN == 1 983 uint16_t discriminator:5;
986 uint16_t seq_num_scaled:4;
989 uint8_t header_crc:3;
1000 } __attribute__((packed))
seq_2_t;
1011 #if WORDS_BIGENDIAN == 1 1012 uint8_t discriminator:4;
1019 #if WORDS_BIGENDIAN == 1 1022 uint8_t header_crc:3;
1029 } __attribute__((packed))
seq_3_t;
1040 #if WORDS_BIGENDIAN == 1 1041 uint8_t discriminator:1;
1042 uint8_t ack_num_scaled:4;
1046 uint8_t header_crc:3;
1056 } __attribute__((packed))
seq_4_t;
1067 #if WORDS_BIGENDIAN == 1 1068 uint8_t discriminator:4;
1076 #if WORDS_BIGENDIAN == 1 1079 uint8_t header_crc:3;
1086 } __attribute__((packed))
seq_5_t;
1097 #if WORDS_BIGENDIAN == 1 1098 uint16_t discriminator:5;
1099 uint16_t seq_num_scaled1:3;
1100 uint16_t seq_num_scaled2:1;
1109 #if WORDS_BIGENDIAN == 1 1112 uint8_t header_crc:3;
1119 } __attribute__((packed))
seq_6_t;
1130 #if WORDS_BIGENDIAN == 1 1131 uint8_t discriminator:4;
1139 uint8_t header_crc:3;
1152 } __attribute__((packed))
seq_7_t;
1163 #if WORDS_BIGENDIAN == 1 1164 uint8_t discriminator:4;
1166 uint8_t list_present:1;
1167 uint8_t header_crc:7;
1195 } __attribute__((packed))
seq_8_t;
1204 __attribute__((warn_unused_result,
const));
1207 __attribute__((warn_unused_result,
const));
1221 return "sequential";
1223 return "sequential swapped";
1227 return "constant zero";
1229 return "unknown IP-ID behavior";
1251 return "Window Scale";
1253 return "SACK permitted";
uint8_t ecn_flags
Definition: tcp.h:136
uint8_t rsf_flags
Definition: tcp.h:602
uint32_t ts
Definition: tcp.h:228
uint8_t ack_num1
Definition: tcp.h:1185
uint8_t psh_flag
Definition: tcp.h:835
uint8_t discriminator
Definition: tcp.h:1104
uint8_t ttl_hopl_present
Definition: tcp.h:685
uint16_t window
Definition: tcp.h:138
The rnd_1 compressed packet format.
Definition: tcp.h:717
The TCP replicate part.
Definition: tcp.h:576
uint8_t flow_label_enc_discriminator
Definition: tcp.h:396
uint8_t rsf_flags
Definition: tcp.h:928
uint8_t ack_presence
Definition: tcp.h:607
uint8_t ip_ecn_flags
Definition: tcp.h:463
uint8_t list_present
Definition: tcp.h:927
The rnd_6 compressed packet format.
Definition: tcp.h:854
uint8_t ip_id_behavior
Definition: tcp.h:306
uint8_t version_flag
Definition: tcp.h:250
uint8_t ack_num1
Definition: tcp.h:779
uint8_t psh_flag
Definition: tcp.h:731
uint16_t flow_label2
Definition: tcp.h:492
The Selective Acknowlegment TCP option.
Definition: tcp.h:214
uint8_t ack_num2
Definition: tcp.h:781
uint8_t ip_ecn_flags
Definition: tcp.h:309
uint8_t ip_id
Definition: tcp.h:1105
uint8_t reserved2
Definition: tcp.h:465
uint8_t protocol
Definition: tcp.h:252
uint8_t urp_presence
Definition: tcp.h:606
uint8_t discriminator
Definition: tcp.h:806
uint8_t ecn_used
Definition: tcp.h:932
uint8_t version_flag
Definition: tcp.h:398
uint8_t discriminator
Definition: tcp.h:863
uint8_t ip_id_behavior
Definition: tcp.h:683
uint8_t df
Definition: tcp.h:691
The rnd_2 compressed packet format.
Definition: tcp.h:744
uint8_t reserved
Definition: tcp.h:249
uint32_t block_end
Definition: tcp.h:217
uint8_t msn
Definition: tcp.h:834
uint16_t msn
Definition: tcp.h:609
uint8_t discriminator
Definition: tcp.h:1179
uint8_t msn
Definition: tcp.h:902
uint8_t next_header
Definition: tcp.h:376
uint8_t ack_zero
Definition: tcp.h:535
uint8_t ip_id_indicator
Definition: tcp.h:676
The rnd_8 compressed packet format.
Definition: tcp.h:914
uint8_t flow_label_enc_discriminator
Definition: tcp.h:420
uint8_t reserved
Definition: tcp.h:490
uint8_t ip_id
Definition: tcp.h:957
uint16_t dst_port
Definition: tcp.h:118
uint8_t psh_flag
Definition: tcp.h:1052
uint8_t header_crc
Definition: tcp.h:755
uint16_t ack_num
Definition: tcp.h:1018
uint8_t version_flag
Definition: tcp.h:422
uint8_t urg_flag
Definition: tcp.h:682
uint8_t list_present
Definition: tcp.h:1181
uint8_t msn
Definition: tcp.h:997
uint8_t seq_num_scaled
Definition: tcp.h:870
uint8_t psh_flag
Definition: tcp.h:603
uint8_t ack_flag
Definition: tcp.h:541
uint16_t seq_num
Definition: tcp.h:1075
The IPv6 static part, flow_label encoded with 1+20 bits.
Definition: tcp.h:411
uint8_t discriminator
Definition: tcp.h:992
uint16_t ack_num
Definition: tcp.h:865
uint8_t psh_flag
Definition: tcp.h:1115
uint16_t msn
Definition: tcp.h:545
uint8_t seq_num1
Definition: tcp.h:837
uint8_t window1
Definition: tcp.h:1141
The rnd_7 compressed packet format.
Definition: tcp.h:883
uint8_t psh_flag
Definition: tcp.h:783
uint8_t ack_num1
Definition: tcp.h:840
uint8_t window2
Definition: tcp.h:1143
uint8_t rsf_flags
Definition: tcp.h:1189
uint8_t dscp
Definition: tcp.h:443
The rnd_4 compressed packet format.
Definition: tcp.h:796
uint8_t ttl_hopl
Definition: tcp.h:1182
uint8_t ttl_hopl
Definition: tcp.h:288
uint8_t discriminator
Definition: tcp.h:1050
uint8_t discriminator
Definition: tcp.h:958
uint8_t reserved1
Definition: tcp.h:467
The TCP static part.
Definition: tcp.h:506
uint8_t df
Definition: tcp.h:307
uint8_t ip_id
Definition: tcp.h:1178
The rnd_5 compressed packet format.
Definition: tcp.h:821
uint8_t ack_stride_flag
Definition: tcp.h:536
The IPv6 dynamic part.
Definition: tcp.h:436
uint8_t ttl_flag
Definition: tcp.h:333
uint8_t src_port_presence
Definition: tcp.h:596
uint8_t ack_stride_flag
Definition: tcp.h:594
uint8_t psh_flag
Definition: tcp.h:861
uint8_t length
Definition: tcp.h:369
uint8_t ecn_used
Definition: tcp.h:601
uint8_t window_indicator
Definition: tcp.h:677
uint32_t seq_num
Definition: tcp.h:546
uint8_t ecn_used
Definition: tcp.h:1186
uint8_t flow_label1
Definition: tcp.h:488
uint8_t msn
Definition: tcp.h:809
uint8_t psh_flag
Definition: tcp.h:1183
The rnd_3 compressed packet format.
Definition: tcp.h:769
uint8_t ip_ecn_flags
Definition: tcp.h:336
uint8_t flow_label1
Definition: tcp.h:419
uint16_t ip_id
Definition: tcp.h:313
uint8_t window3
Definition: tcp.h:1145
uint8_t urg_flag
Definition: tcp.h:135
uint8_t ecn_used
Definition: tcp.h:687
uint8_t reserved
Definition: tcp.h:335
uint8_t ack_num1
Definition: tcp.h:890
The seq_1 compressed packet format.
Definition: tcp.h:951
uint8_t reserved
Definition: tcp.h:688
uint8_t ip_id1
Definition: tcp.h:991
uint16_t src_port
Definition: tcp.h:117
static char * tcp_ip_id_behavior_get_descr(const tcp_ip_id_behavior_t ip_id_behavior)
Get a string that describes the given IP-ID behavior.
Definition: tcp.h:1216
uint8_t header_crc
Definition: tcp.h:1147
uint8_t ip_id
Definition: tcp.h:1015
uint8_t reserved
Definition: tcp.h:599
The IPv4 dynamic part without IP-ID field.
Definition: tcp.h:273
uint8_t fl_enc_flag
Definition: tcp.h:489
The seq_6 compressed packet format.
Definition: tcp.h:1095
uint8_t fl_enc_flag
Definition: tcp.h:466
uint8_t ip_id_behavior
Definition: tcp.h:334
uint16_t ack_num
Definition: tcp.h:938
uint16_t ack_num
Definition: tcp.h:1146
uint8_t ttl_hopl
Definition: tcp.h:312
uint8_t psh_flag
Definition: tcp.h:756
uint8_t msn1
Definition: tcp.h:930
uint8_t discriminator
Definition: tcp.h:1016
uint8_t discriminator
Definition: tcp.h:1072
uint16_t src_port
Definition: tcp.h:508
uint8_t seq_num_scaled
Definition: tcp.h:753
uint16_t urg_ptr
Definition: tcp.h:140
uint8_t ip_ecn_flags
Definition: tcp.h:442
uint8_t list_present
Definition: tcp.h:684
uint8_t header_crc
Definition: tcp.h:1114
uint8_t rsf_flags
Definition: tcp.h:539
uint8_t discriminator
Definition: tcp.h:754
rohc_tcp_option_type_t
Definition: tcp.h:172
uint16_t checksum
Definition: tcp.h:139
uint32_t block_start
Definition: tcp.h:216
uint16_t seq_num2
Definition: tcp.h:729
uint8_t ttl_hopl
Definition: tcp.h:445
uint8_t urg_flag
Definition: tcp.h:542
uint8_t psh_flag
Definition: tcp.h:934
uint8_t urg_flag
Definition: tcp.h:605
The TCP dynamic part.
Definition: tcp.h:518
The seq_2 compressed packet format.
Definition: tcp.h:980
The IPv6 static part, null flow_label encoded with 1 bit.
Definition: tcp.h:387
uint8_t ecn_used
Definition: tcp.h:537
uint8_t dst_port_presence
Definition: tcp.h:595
uint8_t ack_num2
Definition: tcp.h:842
The IPv6 replicate part with short Flow Label.
Definition: tcp.h:454
uint8_t options[0]
Definition: tcp.h:141
The IPv4 dynamic part with IP-ID field.
Definition: tcp.h:297
uint8_t tcp_res_flags
Definition: tcp.h:533
uint8_t header_crc
Definition: tcp.h:900
static char * tcp_opt_get_descr(const uint8_t opt_type)
Get a string that describes the given option type.
Definition: tcp.h:1240
uint8_t header_crc
Definition: tcp.h:1081
The seq_8 compressed packet format.
Definition: tcp.h:1161
uint8_t res_flags
Definition: tcp.h:130
uint8_t next_header
Definition: tcp.h:425
uint8_t data_offset
Definition: tcp.h:131
The TCP base header without options.
Definition: tcp.h:115
uint8_t psh_flag
Definition: tcp.h:996
uint8_t psh_flag
Definition: tcp.h:901
uint8_t seq_num_scaled2
Definition: tcp.h:1106
uint16_t seq_num
Definition: tcp.h:937
The IPv4 static part.
Definition: tcp.h:243
uint8_t header_crc
Definition: tcp.h:807
uint8_t dscp
Definition: tcp.h:337
uint8_t header_crc
Definition: tcp.h:782
The IPv6 replicate part with long Flow Label.
Definition: tcp.h:477
uint16_t dst_port
Definition: tcp.h:509
uint8_t ttl_hopl
Definition: tcp.h:933
uint16_t flow_label2
Definition: tcp.h:424
uint32_t ack_num
Definition: tcp.h:120
uint8_t msn
Definition: tcp.h:1026
uint8_t psh_flag
Definition: tcp.h:1148
uint8_t ack_stride_indicator
Definition: tcp.h:678
uint8_t next_header
Definition: tcp.h:400
The seq_7 compressed packet format.
Definition: tcp.h:1128
uint8_t tcp_ecn_flags
Definition: tcp.h:543
uint8_t length
Definition: tcp.h:353
uint8_t discriminator
Definition: tcp.h:1142
uint32_t seq_num
Definition: tcp.h:119
uint8_t psh_flag
Definition: tcp.h:672
uint16_t ack_num
Definition: tcp.h:1108
uint16_t window
Definition: tcp.h:894
uint8_t seq_num2
Definition: tcp.h:839
uint8_t rsf_flags
Definition: tcp.h:132
uint8_t msn
Definition: tcp.h:1116
uint8_t msn
Definition: tcp.h:968
uint8_t msn
Definition: tcp.h:757
The seq_4 compressed packet format.
Definition: tcp.h:1038
uint8_t header_crc
Definition: tcp.h:1180
uint8_t msn
Definition: tcp.h:670
uint8_t ip_id
Definition: tcp.h:1144
uint8_t header_crc
Definition: tcp.h:838
uint8_t ip_ecn_flags
Definition: tcp.h:285
uint8_t reserved
Definition: tcp.h:308
uint8_t psh_flag
Definition: tcp.h:540
uint8_t seq_num2
Definition: tcp.h:1190
uint8_t urg_ptr_present
Definition: tcp.h:675
uint8_t discriminator
Definition: tcp.h:891
uint8_t ttl_hopl_outer_flag
Definition: tcp.h:667
uint8_t psh_flag
Definition: tcp.h:967
uint8_t discriminator
Definition: tcp.h:836
The seq_5 compressed packet format.
Definition: tcp.h:1065
uint8_t length
Definition: tcp.h:377
uint8_t msn
Definition: tcp.h:1053
uint8_t rsf_flags
Definition: tcp.h:671
uint8_t dscp
Definition: tcp.h:487
uint32_t dst_addr
Definition: tcp.h:254
uint16_t seq_num
Definition: tcp.h:960
uint8_t ip_id_behavior
Definition: tcp.h:282
The IPv4 replicate part.
Definition: tcp.h:322
The seq_3 compressed packet format.
Definition: tcp.h:1009
uint8_t next_header
Definition: tcp.h:368
uint8_t header_crc
Definition: tcp.h:1024
uint8_t seq_num1
Definition: tcp.h:1188
uint32_t src_addr
Definition: tcp.h:253
uint8_t ack_num2
Definition: tcp.h:1187
uint8_t psh_flag
Definition: tcp.h:808
uint8_t dscp
Definition: tcp.h:310
uint8_t header_crc
Definition: tcp.h:862
uint8_t ip_id2
Definition: tcp.h:994
uint8_t dscp_present
Definition: tcp.h:686
uint8_t df
Definition: tcp.h:332
uint8_t reserved
Definition: tcp.h:284
uint8_t discriminator
Definition: tcp.h:780
uint8_t ip_id
Definition: tcp.h:1048
uint8_t next_header
Definition: tcp.h:360
uint8_t msn
Definition: tcp.h:784
uint16_t ack_num
Definition: tcp.h:1074
uint8_t discriminator
Definition: tcp.h:929
rohc_tcp_chain_t
The different chains used by the TCP profile.
Definition: tcp.h:160
uint8_t reserved2
Definition: tcp.h:395
uint8_t ack_flag
Definition: tcp.h:673
uint8_t next_header
Definition: tcp.h:352
uint8_t psh_flag
Definition: tcp.h:133
uint8_t length
Definition: tcp.h:361
uint8_t seq_indicator
Definition: tcp.h:680
uint8_t msn
Definition: tcp.h:1184
uint8_t window_presence
Definition: tcp.h:598
uint32_t seq_num
Definition: tcp.h:610
uint8_t ack_flag
Definition: tcp.h:604
uint8_t msn
Definition: tcp.h:732
uint8_t msn2
Definition: tcp.h:935
uint8_t header_crc
Definition: tcp.h:1051
uint8_t psh_flag
Definition: tcp.h:1025
tcp_ip_id_behavior_t
Definition: tcp.h:259
uint8_t dscp
Definition: tcp.h:286
uint8_t seq_num1
Definition: tcp.h:727
uint8_t ack_num_scaled
Definition: tcp.h:1049
uint8_t msn
Definition: tcp.h:1083
uint8_t urp_zero
Definition: tcp.h:534
The Common compressed packet format.
Definition: tcp.h:634
uint8_t reserved
Definition: tcp.h:421
uint8_t ack_num_scaled
Definition: tcp.h:805
uint8_t seq_num3
Definition: tcp.h:841
uint8_t header_crc
Definition: tcp.h:931
uint8_t msn
Definition: tcp.h:1149
uint8_t psh_flag
Definition: tcp.h:1082
uint8_t ip_ecn_flags
Definition: tcp.h:486
uint8_t header_crc
Definition: tcp.h:730
uint8_t list_present
Definition: tcp.h:597
uint8_t header_crc
Definition: tcp.h:995
uint8_t df
Definition: tcp.h:283
uint8_t ack_indicator
Definition: tcp.h:679
uint8_t header_crc
Definition: tcp.h:690
uint8_t ack_flag
Definition: tcp.h:134
uint8_t msn
Definition: tcp.h:871
uint8_t reserved1
Definition: tcp.h:397
uint32_t ts_reply
Definition: tcp.h:229
uint8_t ip_id
Definition: tcp.h:1071
uint8_t discriminator
Definition: tcp.h:668
uint8_t seq_num_scaled
Definition: tcp.h:993
uint16_t ack_num2
Definition: tcp.h:892
uint8_t seq_num_scaled1
Definition: tcp.h:1103
uint8_t header_crc
Definition: tcp.h:966
uint8_t dscp
Definition: tcp.h:464
uint8_t discriminator
Definition: tcp.h:728