Merge pull request #822 from dimmo/print-mpls-over-udp

Print MPLS-over-UDP.
This commit is contained in:
Guy Harris 2020-02-08 13:43:34 -08:00 committed by GitHub
commit e703ccc5bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 0 deletions

View File

@ -716,6 +716,8 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length,
vxlan_gpe_print(ndo, (const u_char *)(up + 1), length);
else if (IS_SRC_OR_DST_PORT(ZEP_PORT))
zep_print(ndo, (const u_char *)(up + 1), length);
else if (IS_SRC_OR_DST_PORT(MPLS_PORT))
mpls_print(ndo, (const u_char *)(up + 1), length);
else if (ND_TTEST_1(((const struct LAP *)cp)->type) &&
GET_U_1(((const struct LAP *)cp)->type) == lapDDP &&
(atalk_port(sport) || atalk_port(dport))) {

View File

@ -76,6 +76,8 @@ lspping-fec-rsvp-v lspping-fec-rsvp.pcap lspping-fec-rsvp-v.out -v
lspping-fec-rsvp-vv lspping-fec-rsvp.pcap lspping-fec-rsvp-vv.out -vv
mpls-traceroute mpls-traceroute.pcap mpls-traceroute.out
mpls-traceroute-v mpls-traceroute.pcap mpls-traceroute-v.out -v
mpls-over-udp mpls-over-udp.pcap mpls-over-udp.out
mpls-over-udp-v mpls-over-udp.pcap mpls-over-udp-v.out -v
# OSPF tests
ospf-gmpls ospf-gmpls.pcap ospf-gmpls.out -v

View File

@ -0,0 +1,8 @@
1 19:10:12.233047 IP (tos 0x0, ttl 64, id 26479, offset 0, flags [none], proto UDP (17), length 116)
10.100.12.170.58699 > 10.100.13.157.6635: MPLS (label 21, exp 0, [S], ttl 63)
IP (tos 0x0, ttl 63, id 26479, offset 0, flags [DF], proto ICMP (1), length 84)
10.3.0.10 > 10.1.0.10: ICMP echo request, id 42731, seq 16, length 64
2 19:10:12.233101 IP (tos 0x0, ttl 64, id 46612, offset 0, flags [none], proto UDP (17), length 116)
10.100.13.157.51348 > 10.100.12.170.6635: MPLS (label 46, exp 0, [S], ttl 63)
IP (tos 0x0, ttl 63, id 46612, offset 0, flags [none], proto ICMP (1), length 84)
10.1.0.10 > 10.3.0.10: ICMP echo reply, id 42731, seq 16, length 64

2
tests/mpls-over-udp.out Normal file
View File

@ -0,0 +1,2 @@
1 19:10:12.233047 IP 10.100.12.170.58699 > 10.100.13.157.6635: MPLS (label 21, exp 0, [S], ttl 63) IP 10.3.0.10 > 10.1.0.10: ICMP echo request, id 42731, seq 16, length 64
2 19:10:12.233101 IP 10.100.13.157.51348 > 10.100.12.170.6635: MPLS (label 46, exp 0, [S], ttl 63) IP 10.1.0.10 > 10.3.0.10: ICMP echo reply, id 42731, seq 16, length 64

BIN
tests/mpls-over-udp.pcap Normal file

Binary file not shown.

3
udp.h
View File

@ -203,6 +203,9 @@ struct udphdr {
#ifndef SFLOW_PORT
#define SFLOW_PORT 6343 /* https://sflow.org/developers/specifications.php */
#endif
#ifndef MPLS_PORT
#define MPLS_PORT 6635 /* RFC 7510 */
#endif
#ifndef BABEL_PORT
#define BABEL_PORT 6696 /* RFC 6126 errata */
#endif