diff --git a/print-sctp.c b/print-sctp.c index 2302bacb7..4aaceba7c 100644 --- a/print-sctp.c +++ b/print-sctp.c @@ -114,6 +114,7 @@ #define SCTP_I_DATA 0x40 #define SCTP_ASCONF_ACK 0x80 #define SCTP_RE_CONFIG 0x82 +#define SCTP_PAD_CHUNK 0x84 #define SCTP_FORWARD_CUM_TSN 0xc0 #define SCTP_ASCONF 0xc1 #define SCTP_I_FORWARD_TSN 0xc2 @@ -136,6 +137,7 @@ static const struct tok sctp_chunkid_str[] = { { SCTP_SHUTDOWN_COMPLETE, "SHUTDOWN COMPLETE" }, { SCTP_I_DATA, "I-DATA" }, { SCTP_RE_CONFIG, "RE-CONFIG" }, + { SCTP_PAD_CHUNK, "PAD" }, { SCTP_FORWARD_CUM_TSN, "FOR CUM TSN" }, { SCTP_ASCONF, "ASCONF" }, { SCTP_ASCONF_ACK, "ASCONF-ACK" }, diff --git a/tests/TESTLIST b/tests/TESTLIST index a76942ee5..e60348cc9 100644 --- a/tests/TESTLIST +++ b/tests/TESTLIST @@ -67,6 +67,11 @@ sctp-asconf-6 sctp-asconf-6.pcap sctp-asconf-6.out sctp-asconf-6-v sctp-asconf-6.pcap sctp-asconf-6-v.out -v sctp-asconf-6-vv sctp-asconf-6.pcap sctp-asconf-6-vv.out -vv +# PAD tests +sctp-pad sctp-pad.pcap sctp-pad.out +sctp-pad-v sctp-pad.pcap sctp-pad-v.out -v +sctp-pad-vv sctp-pad.pcap sctp-pad-vv.out -vv + # BGP tests bgp_vpn_attrset bgp_vpn_attrset.pcap bgp_vpn_attrset.out -v mpbgp-linklocal-nexthop mpbgp-linklocal-nexthop.pcap mpbgp-linklocal-nexthop.out -v diff --git a/tests/sctp-pad-v.out b/tests/sctp-pad-v.out new file mode 100644 index 000000000..f2abb6550 --- /dev/null +++ b/tests/sctp-pad-v.out @@ -0,0 +1,60 @@ + 1 15:21:08.215897 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto SCTP (132), length 100) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [INIT] [init tag: 413521971] [rwnd: 106496] [OS: 10] [MIS: 65535] [init TSN: 2253051237] + 2 15:21:08.215923 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto SCTP (132), length 388) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [INIT ACK] [init tag: 145384071] [rwnd: 106496] [OS: 10] [MIS: 10] [init TSN: 4266748061] + 3 15:21:08.215940 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto SCTP (132), length 328) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [COOKIE ECHO] + 4 15:21:08.215959 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto SCTP (132), length 36) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [COOKIE ACK] + 5 15:21:09.986643 IP (tos 0x2,ECT(0), ttl 64, id 1, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.169.57694 > 10.0.0.169.31337: sctp (1) [HB REQ] + 6 15:21:09.986673 IP (tos 0x2,ECT(0), ttl 64, id 31167, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.169.31337 > 10.0.0.169.57694: sctp (1) [HB ACK] + 7 15:21:10.338722 IP (tos 0x2,ECT(0), ttl 64, id 31168, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.169.31337 > 10.0.0.169.57694: sctp (1) [HB REQ] + 8 15:21:10.338734 IP (tos 0x2,ECT(0), ttl 64, id 2, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.169.57694 > 10.0.0.169.31337: sctp (1) [HB ACK] + 9 15:21:11.106508 IP (tos 0x2,ECT(0), ttl 64, id 3, offset 0, flags [DF], proto SCTP (132), length 92) + 192.168.122.1.57694 > 192.168.122.1.31337: sctp (1) [HB REQ] + 10 15:21:11.106570 IP (tos 0x2,ECT(0), ttl 64, id 31169, offset 0, flags [DF], proto SCTP (132), length 92) + 192.168.122.1.31337 > 192.168.122.1.57694: sctp (1) [HB ACK] + 11 15:21:11.618660 IP (tos 0x2,ECT(0), ttl 64, id 4, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.192.57694 > 10.0.0.192.31337: sctp (1) [HB REQ] + 12 15:21:11.618665 IP (tos 0x2,ECT(0), ttl 64, id 31170, offset 0, flags [DF], proto SCTP (132), length 92) + 192.168.122.1.31337 > 192.168.122.1.57694: sctp (1) [HB REQ] + 13 15:21:11.618678 IP (tos 0x2,ECT(0), ttl 64, id 31171, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.192.31337 > 10.0.0.192.57694: sctp (1) [HB ACK] + 14 15:21:11.618695 IP (tos 0x2,ECT(0), ttl 64, id 5, offset 0, flags [DF], proto SCTP (132), length 92) + 192.168.122.1.57694 > 192.168.122.1.31337: sctp (1) [HB ACK] + 15 15:21:12.642329 IP (tos 0x2,ECT(0), ttl 64, id 31172, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.192.31337 > 10.0.0.192.57694: sctp (1) [HB REQ] + 16 15:21:12.642340 IP (tos 0x2,ECT(0), ttl 64, id 6, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.192.57694 > 10.0.0.192.31337: sctp (1) [HB ACK] + 17 15:21:13.410696 IP (tos 0x2,ECT(0), ttl 64, id 31173, offset 0, flags [DF], proto SCTP (132), length 1220) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB REQ] , (2) [PAD] + 18 15:21:13.410716 IP (tos 0x2,ECT(0), ttl 64, id 7, offset 0, flags [DF], proto SCTP (132), length 1220) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB REQ] , (2) [PAD] + 19 15:21:13.410727 IP (tos 0x2,ECT(0), ttl 64, id 8, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB ACK] + 20 15:21:13.410732 IP (tos 0x2,ECT(0), ttl 64, id 31174, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB ACK] + 21 15:21:13.410736 IP (tos 0x2,ECT(0), ttl 64, id 31175, offset 0, flags [DF], proto SCTP (132), length 1252) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB REQ] , (2) [PAD] + 22 15:21:13.410739 IP (tos 0x2,ECT(0), ttl 64, id 9, offset 0, flags [DF], proto SCTP (132), length 1252) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB REQ] , (2) [PAD] + 23 15:21:13.410743 IP (tos 0x2,ECT(0), ttl 64, id 10, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB ACK] + 24 15:21:13.410746 IP (tos 0x2,ECT(0), ttl 64, id 31176, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB ACK] + 25 15:21:13.410750 IP (tos 0x2,ECT(0), ttl 64, id 31177, offset 0, flags [DF], proto SCTP (132), length 1284) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB REQ] , (2) [PAD] + 26 15:21:13.410754 IP (tos 0x2,ECT(0), ttl 64, id 11, offset 0, flags [DF], proto SCTP (132), length 1284) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB REQ] , (2) [PAD] + 27 15:21:13.410757 IP (tos 0x2,ECT(0), ttl 64, id 12, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB ACK] + 28 15:21:13.410760 IP (tos 0x2,ECT(0), ttl 64, id 31178, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB ACK] + 29 15:21:13.410763 IP (tos 0x2,ECT(0), ttl 64, id 31179, offset 0, flags [DF], proto SCTP (132), length 1316) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB REQ] , (2) [PAD] + 30 15:21:13.410767 IP (tos 0x2,ECT(0), ttl 64, id 13, offset 0, flags [DF], proto SCTP (132), length 1316) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB REQ] , (2) [PAD] diff --git a/tests/sctp-pad-vv.out b/tests/sctp-pad-vv.out new file mode 100644 index 000000000..17c360caa --- /dev/null +++ b/tests/sctp-pad-vv.out @@ -0,0 +1,98 @@ + 1 15:21:08.215897 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto SCTP (132), length 100) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp + 1) [INIT] [init tag: 413521971] [rwnd: 106496] [OS: 10] [MIS: 65535] [init TSN: 2253051237] + 2 15:21:08.215923 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto SCTP (132), length 388) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp + 1) [INIT ACK] [init tag: 145384071] [rwnd: 106496] [OS: 10] [MIS: 10] [init TSN: 4266748061] + 3 15:21:08.215940 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto SCTP (132), length 328) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp + 1) [COOKIE ECHO] + 4 15:21:08.215959 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto SCTP (132), length 36) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp + 1) [COOKIE ACK] + 5 15:21:09.986643 IP (tos 0x2,ECT(0), ttl 64, id 1, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.169.57694 > 10.0.0.169.31337: sctp + 1) [HB REQ] + 6 15:21:09.986673 IP (tos 0x2,ECT(0), ttl 64, id 31167, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.169.31337 > 10.0.0.169.57694: sctp + 1) [HB ACK] + 7 15:21:10.338722 IP (tos 0x2,ECT(0), ttl 64, id 31168, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.169.31337 > 10.0.0.169.57694: sctp + 1) [HB REQ] + 8 15:21:10.338734 IP (tos 0x2,ECT(0), ttl 64, id 2, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.169.57694 > 10.0.0.169.31337: sctp + 1) [HB ACK] + 9 15:21:11.106508 IP (tos 0x2,ECT(0), ttl 64, id 3, offset 0, flags [DF], proto SCTP (132), length 92) + 192.168.122.1.57694 > 192.168.122.1.31337: sctp + 1) [HB REQ] + 10 15:21:11.106570 IP (tos 0x2,ECT(0), ttl 64, id 31169, offset 0, flags [DF], proto SCTP (132), length 92) + 192.168.122.1.31337 > 192.168.122.1.57694: sctp + 1) [HB ACK] + 11 15:21:11.618660 IP (tos 0x2,ECT(0), ttl 64, id 4, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.192.57694 > 10.0.0.192.31337: sctp + 1) [HB REQ] + 12 15:21:11.618665 IP (tos 0x2,ECT(0), ttl 64, id 31170, offset 0, flags [DF], proto SCTP (132), length 92) + 192.168.122.1.31337 > 192.168.122.1.57694: sctp + 1) [HB REQ] + 13 15:21:11.618678 IP (tos 0x2,ECT(0), ttl 64, id 31171, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.192.31337 > 10.0.0.192.57694: sctp + 1) [HB ACK] + 14 15:21:11.618695 IP (tos 0x2,ECT(0), ttl 64, id 5, offset 0, flags [DF], proto SCTP (132), length 92) + 192.168.122.1.57694 > 192.168.122.1.31337: sctp + 1) [HB ACK] + 15 15:21:12.642329 IP (tos 0x2,ECT(0), ttl 64, id 31172, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.192.31337 > 10.0.0.192.57694: sctp + 1) [HB REQ] + 16 15:21:12.642340 IP (tos 0x2,ECT(0), ttl 64, id 6, offset 0, flags [DF], proto SCTP (132), length 92) + 10.0.0.192.57694 > 10.0.0.192.31337: sctp + 1) [HB ACK] + 17 15:21:13.410696 IP (tos 0x2,ECT(0), ttl 64, id 31173, offset 0, flags [DF], proto SCTP (132), length 1220) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp + 1) [HB REQ] + 2) [PAD] + 18 15:21:13.410716 IP (tos 0x2,ECT(0), ttl 64, id 7, offset 0, flags [DF], proto SCTP (132), length 1220) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp + 1) [HB REQ] + 2) [PAD] + 19 15:21:13.410727 IP (tos 0x2,ECT(0), ttl 64, id 8, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp + 1) [HB ACK] + 20 15:21:13.410732 IP (tos 0x2,ECT(0), ttl 64, id 31174, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp + 1) [HB ACK] + 21 15:21:13.410736 IP (tos 0x2,ECT(0), ttl 64, id 31175, offset 0, flags [DF], proto SCTP (132), length 1252) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp + 1) [HB REQ] + 2) [PAD] + 22 15:21:13.410739 IP (tos 0x2,ECT(0), ttl 64, id 9, offset 0, flags [DF], proto SCTP (132), length 1252) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp + 1) [HB REQ] + 2) [PAD] + 23 15:21:13.410743 IP (tos 0x2,ECT(0), ttl 64, id 10, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp + 1) [HB ACK] + 24 15:21:13.410746 IP (tos 0x2,ECT(0), ttl 64, id 31176, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp + 1) [HB ACK] + 25 15:21:13.410750 IP (tos 0x2,ECT(0), ttl 64, id 31177, offset 0, flags [DF], proto SCTP (132), length 1284) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp + 1) [HB REQ] + 2) [PAD] + 26 15:21:13.410754 IP (tos 0x2,ECT(0), ttl 64, id 11, offset 0, flags [DF], proto SCTP (132), length 1284) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp + 1) [HB REQ] + 2) [PAD] + 27 15:21:13.410757 IP (tos 0x2,ECT(0), ttl 64, id 12, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp + 1) [HB ACK] + 28 15:21:13.410760 IP (tos 0x2,ECT(0), ttl 64, id 31178, offset 0, flags [DF], proto SCTP (132), length 92) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp + 1) [HB ACK] + 29 15:21:13.410763 IP (tos 0x2,ECT(0), ttl 64, id 31179, offset 0, flags [DF], proto SCTP (132), length 1316) + 127.0.0.1.31337 > 127.0.0.1.57694: sctp + 1) [HB REQ] + 2) [PAD] + 30 15:21:13.410767 IP (tos 0x2,ECT(0), ttl 64, id 13, offset 0, flags [DF], proto SCTP (132), length 1316) + 127.0.0.1.57694 > 127.0.0.1.31337: sctp + 1) [HB REQ] + 2) [PAD] diff --git a/tests/sctp-pad.out b/tests/sctp-pad.out new file mode 100644 index 000000000..86b282704 --- /dev/null +++ b/tests/sctp-pad.out @@ -0,0 +1,30 @@ + 1 15:21:08.215897 IP 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [INIT] [init tag: 413521971] [rwnd: 106496] [OS: 10] [MIS: 65535] [init TSN: 2253051237] + 2 15:21:08.215923 IP 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [INIT ACK] [init tag: 145384071] [rwnd: 106496] [OS: 10] [MIS: 10] [init TSN: 4266748061] + 3 15:21:08.215940 IP 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [COOKIE ECHO] + 4 15:21:08.215959 IP 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [COOKIE ACK] + 5 15:21:09.986643 IP 10.0.0.169.57694 > 10.0.0.169.31337: sctp (1) [HB REQ] + 6 15:21:09.986673 IP 10.0.0.169.31337 > 10.0.0.169.57694: sctp (1) [HB ACK] + 7 15:21:10.338722 IP 10.0.0.169.31337 > 10.0.0.169.57694: sctp (1) [HB REQ] + 8 15:21:10.338734 IP 10.0.0.169.57694 > 10.0.0.169.31337: sctp (1) [HB ACK] + 9 15:21:11.106508 IP 192.168.122.1.57694 > 192.168.122.1.31337: sctp (1) [HB REQ] + 10 15:21:11.106570 IP 192.168.122.1.31337 > 192.168.122.1.57694: sctp (1) [HB ACK] + 11 15:21:11.618660 IP 10.0.0.192.57694 > 10.0.0.192.31337: sctp (1) [HB REQ] + 12 15:21:11.618665 IP 192.168.122.1.31337 > 192.168.122.1.57694: sctp (1) [HB REQ] + 13 15:21:11.618678 IP 10.0.0.192.31337 > 10.0.0.192.57694: sctp (1) [HB ACK] + 14 15:21:11.618695 IP 192.168.122.1.57694 > 192.168.122.1.31337: sctp (1) [HB ACK] + 15 15:21:12.642329 IP 10.0.0.192.31337 > 10.0.0.192.57694: sctp (1) [HB REQ] + 16 15:21:12.642340 IP 10.0.0.192.57694 > 10.0.0.192.31337: sctp (1) [HB ACK] + 17 15:21:13.410696 IP 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB REQ] , (2) [PAD] + 18 15:21:13.410716 IP 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB REQ] , (2) [PAD] + 19 15:21:13.410727 IP 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB ACK] + 20 15:21:13.410732 IP 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB ACK] + 21 15:21:13.410736 IP 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB REQ] , (2) [PAD] + 22 15:21:13.410739 IP 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB REQ] , (2) [PAD] + 23 15:21:13.410743 IP 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB ACK] + 24 15:21:13.410746 IP 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB ACK] + 25 15:21:13.410750 IP 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB REQ] , (2) [PAD] + 26 15:21:13.410754 IP 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB REQ] , (2) [PAD] + 27 15:21:13.410757 IP 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB ACK] + 28 15:21:13.410760 IP 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB ACK] + 29 15:21:13.410763 IP 127.0.0.1.31337 > 127.0.0.1.57694: sctp (1) [HB REQ] , (2) [PAD] + 30 15:21:13.410767 IP 127.0.0.1.57694 > 127.0.0.1.31337: sctp (1) [HB REQ] , (2) [PAD] diff --git a/tests/sctp-pad.pcap b/tests/sctp-pad.pcap new file mode 100644 index 000000000..8515f8f97 Binary files /dev/null and b/tests/sctp-pad.pcap differ