2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the University of California,
13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 /* \summary: UDP printer */
28 #include "netdissect-stdinc.h"
30 #include "netdissect.h"
31 #include "addrtoname.h"
33 #include "appletalk.h"
47 nd_uint16_t rh_flags
; /* T:2 P:1 CNT:5 PT:8 */
48 nd_uint16_t rh_len
; /* length of message (in words) */
49 nd_uint32_t rh_ssrc
; /* synchronization src id */
53 nd_uint32_t upper
; /* more significant 32 bits */
54 nd_uint32_t lower
; /* less significant 32 bits */
61 ntp64 sr_ntp
; /* 64-bit ntp timestamp */
62 nd_uint32_t sr_ts
; /* reference media timestamp */
63 nd_uint32_t sr_np
; /* no. packets sent */
64 nd_uint32_t sr_nb
; /* no. bytes sent */
69 * Time stamps are middle 32-bits of ntp timestamp.
72 nd_uint32_t rr_srcid
; /* sender being reported */
73 nd_uint32_t rr_nl
; /* no. packets lost */
74 nd_uint32_t rr_ls
; /* extended last seq number received */
75 nd_uint32_t rr_dv
; /* jitter (delay variance) */
76 nd_uint32_t rr_lsr
; /* orig. ts from last rr from this src */
77 nd_uint32_t rr_dlsr
; /* time from recpt of last rr to xmit time */
81 #define RTCP_PT_SR 200
82 #define RTCP_PT_RR 201
83 #define RTCP_PT_SDES 202
84 #define RTCP_SDES_CNAME 1
85 #define RTCP_SDES_NAME 2
86 #define RTCP_SDES_EMAIL 3
87 #define RTCP_SDES_PHONE 4
88 #define RTCP_SDES_LOC 5
89 #define RTCP_SDES_TOOL 6
90 #define RTCP_SDES_NOTE 7
91 #define RTCP_SDES_PRIV 8
92 #define RTCP_PT_BYE 203
93 #define RTCP_PT_APP 204
96 vat_print(netdissect_options
*ndo
, const void *hdr
, u_int length
)
101 ndo
->ndo_protocol
= "vat";
103 ND_PRINT("udp/va/vat, length %u < 2", length
);
106 ND_TCHECK_2((const u_int
*)hdr
);
107 ts
= GET_BE_U_2(hdr
);
108 if ((ts
& 0xf060) != 0) {
110 ND_PRINT("udp/vt %u %u / %u",
112 ts
& 0x3ff, ts
>> 10);
118 ND_PRINT("udp/vat, length %u < 8", length
);
121 ND_TCHECK_4(&((const u_int
*)hdr
)[0]);
122 i0
= GET_BE_U_4(&((const u_int
*)hdr
)[0]);
123 ND_TCHECK_4(&((const u_int
*)hdr
)[1]);
124 i1
= GET_BE_U_4(&((const u_int
*)hdr
)[1]);
125 ND_PRINT("udp/vat %u c%u %u%s",
128 i1
, i0
& 0x800000? "*" : "");
131 ND_PRINT(" f%u", (i0
>> 16) & 0x1f);
133 ND_PRINT(" s%u", (i0
>> 24) & 0x3f);
142 rtp_print(netdissect_options
*ndo
, const void *hdr
, u_int len
)
145 const u_int
*ip
= (const u_int
*)hdr
;
146 u_int hasopt
, hasext
, contype
, hasmarker
, dlen
;
150 ndo
->ndo_protocol
= "rtp";
152 ND_PRINT("udp/rtp, length %u < 8", len
);
155 ND_TCHECK_4(&((const u_int
*)hdr
)[0]);
156 i0
= GET_BE_U_4(&((const u_int
*)hdr
)[0]);
157 ND_TCHECK_4(&((const u_int
*)hdr
)[1]);
158 i1
= GET_BE_U_4(&((const u_int
*)hdr
)[1]);
165 if ((i0
>> 30) == 1) {
166 /* rtp v1 - draft-ietf-avt-rtp-04 */
167 hasopt
= i0
& 0x800000;
168 contype
= (i0
>> 16) & 0x3f;
169 hasmarker
= i0
& 0x400000;
172 /* rtp v2 - RFC 3550 */
174 ND_PRINT("udp/rtp, length %u < 12", dlen
+ 8);
177 hasext
= i0
& 0x10000000;
178 contype
= (i0
>> 16) & 0x7f;
179 hasmarker
= i0
& 0x800000;
185 ND_PRINT("udp/%s %u c%u %s%s %u %u",
189 (hasopt
|| hasext
)? "+" : "",
193 if (ndo
->ndo_vflag
) {
194 ND_TCHECK_4(&((const u_int
*)hdr
)[2]);
195 ND_PRINT(" %u", GET_BE_U_4(&((const u_int
*)hdr
)[2]));
201 optlen
= (i2
>> 16) & 0xff;
202 if (optlen
== 0 || optlen
> len
) {
208 } while ((int)i2
>= 0);
214 extlen
= (i2
& 0xffff) + 1;
222 if (contype
== 0x1f) /*XXX H.261 */
223 ND_PRINT(" 0x%04x", GET_BE_U_4(ip
) >> 16);
231 static const u_char
*
232 rtcp_print(netdissect_options
*ndo
, const u_char
*hdr
, const u_char
*ep
)
234 /* rtp v2 control (rtcp) */
235 const struct rtcp_rr
*rr
= 0;
236 const struct rtcp_sr
*sr
;
237 const struct rtcphdr
*rh
= (const struct rtcphdr
*)hdr
;
243 ndo
->ndo_protocol
= "rtcp";
244 if ((const u_char
*)(rh
+ 1) > ep
)
247 len
= (GET_BE_U_2(rh
->rh_len
) + 1) * 4;
248 flags
= GET_BE_U_2(rh
->rh_flags
);
249 cnt
= (flags
>> 8) & 0x1f;
250 switch (flags
& 0xff) {
252 sr
= (const struct rtcp_sr
*)(rh
+ 1);
254 if (len
!= cnt
* sizeof(*rr
) + sizeof(*sr
) + sizeof(*rh
))
255 ND_PRINT(" [%u]", len
);
257 ND_PRINT(" %u", GET_BE_U_4(rh
->rh_ssrc
));
258 if ((const u_char
*)(sr
+ 1) > ep
)
261 ts
= (double)(GET_BE_U_4(sr
->sr_ntp
.upper
)) +
262 ((double)(GET_BE_U_4(sr
->sr_ntp
.lower
)) /
264 ND_PRINT(" @%.2f %u %up %ub", ts
, GET_BE_U_4(sr
->sr_ts
),
265 GET_BE_U_4(sr
->sr_np
), GET_BE_U_4(sr
->sr_nb
));
266 rr
= (const struct rtcp_rr
*)(sr
+ 1);
270 if (len
!= cnt
* sizeof(*rr
) + sizeof(*rh
))
271 ND_PRINT(" [%u]", len
);
272 rr
= (const struct rtcp_rr
*)(rh
+ 1);
274 ND_PRINT(" %u", GET_BE_U_4(rh
->rh_ssrc
));
277 ND_PRINT(" sdes %u", len
);
279 ND_PRINT(" %u", GET_BE_U_4(rh
->rh_ssrc
));
283 ND_PRINT(" bye %u", len
);
285 ND_PRINT(" %u", GET_BE_U_4(rh
->rh_ssrc
));
289 ND_PRINT(" type-0x%x %u", flags
& 0xff, len
);
294 ND_PRINT(" c%u", cnt
);
296 if ((const u_char
*)(rr
+ 1) > ep
)
300 ND_PRINT(" %u", GET_BE_U_4(rr
->rr_srcid
));
301 ts
= (double)(GET_BE_U_4(rr
->rr_lsr
)) / 65536.;
302 dts
= (double)(GET_BE_U_4(rr
->rr_dlsr
)) / 65536.;
303 ND_PRINT(" %ul %us %uj @%.2f+%.2f",
304 GET_BE_U_4(rr
->rr_nl
) & 0x00ffffff,
305 GET_BE_U_4(rr
->rr_ls
),
306 GET_BE_U_4(rr
->rr_dv
), ts
, dts
);
316 static uint16_t udp_cksum(netdissect_options
*ndo
, const struct ip
*ip
,
317 const struct udphdr
*up
,
320 return nextproto4_cksum(ndo
, ip
, (const uint8_t *)(const void *)up
, len
, len
,
324 static uint16_t udp6_cksum(netdissect_options
*ndo
, const struct ip6_hdr
*ip6
,
325 const struct udphdr
*up
, u_int len
)
327 return nextproto6_cksum(ndo
, ip6
, (const uint8_t *)(const void *)up
, len
, len
,
332 udpipaddr_print(netdissect_options
*ndo
, const struct ip
*ip
, int sport
, int dport
)
334 const struct ip6_hdr
*ip6
;
337 ip6
= (const struct ip6_hdr
*)ip
;
342 if (GET_U_1(ip6
->ip6_nxt
) == IPPROTO_UDP
) {
344 ND_PRINT("%s > %s: ",
345 ip6addr_string(ndo
, ip6
->ip6_src
),
346 ip6addr_string(ndo
, ip6
->ip6_dst
));
348 ND_PRINT("%s.%s > %s.%s: ",
349 ip6addr_string(ndo
, ip6
->ip6_src
),
350 udpport_string(ndo
, (uint16_t)sport
),
351 ip6addr_string(ndo
, ip6
->ip6_dst
),
352 udpport_string(ndo
, (uint16_t)dport
));
356 ND_PRINT("%s > %s: ",
357 udpport_string(ndo
, (uint16_t)sport
),
358 udpport_string(ndo
, (uint16_t)dport
));
362 if (GET_U_1(ip
->ip_p
) == IPPROTO_UDP
) {
364 ND_PRINT("%s > %s: ",
365 ipaddr_string(ndo
, ip
->ip_src
),
366 ipaddr_string(ndo
, ip
->ip_dst
));
368 ND_PRINT("%s.%s > %s.%s: ",
369 ipaddr_string(ndo
, ip
->ip_src
),
370 udpport_string(ndo
, (uint16_t)sport
),
371 ipaddr_string(ndo
, ip
->ip_dst
),
372 udpport_string(ndo
, (uint16_t)dport
));
376 ND_PRINT("%s > %s: ",
377 udpport_string(ndo
, (uint16_t)sport
),
378 udpport_string(ndo
, (uint16_t)dport
));
385 udp_print(netdissect_options
*ndo
, const u_char
*bp
, u_int length
,
386 const u_char
*bp2
, int fragmented
, u_int ttl_hl
)
388 const struct udphdr
*up
;
391 const u_char
*ep
= ndo
->ndo_snapend
;
392 uint16_t sport
, dport
;
394 const struct ip6_hdr
*ip6
;
396 ndo
->ndo_protocol
= "udp";
397 up
= (const struct udphdr
*)bp
;
398 ip
= (const struct ip
*)bp2
;
400 ip6
= (const struct ip6_hdr
*)bp2
;
403 if (!ND_TTEST_2(up
->uh_dport
)) {
404 udpipaddr_print(ndo
, ip
, -1, -1);
408 sport
= GET_BE_U_2(up
->uh_sport
);
409 dport
= GET_BE_U_2(up
->uh_dport
);
411 if (length
< sizeof(struct udphdr
)) {
412 udpipaddr_print(ndo
, ip
, sport
, dport
);
413 ND_PRINT("truncated-udp %u", length
);
416 if (!ND_TTEST_2(up
->uh_ulen
)) {
417 udpipaddr_print(ndo
, ip
, sport
, dport
);
420 ulen
= GET_BE_U_2(up
->uh_ulen
);
422 * IPv6 Jumbo Datagrams; see RFC 2675.
423 * If the length is zero, and the length provided to us is
424 * > 65535, use the provided length as the length.
426 if (ulen
== 0 && length
> 65535)
428 if (ulen
< sizeof(struct udphdr
)) {
429 udpipaddr_print(ndo
, ip
, sport
, dport
);
430 ND_PRINT("truncated-udplength %u", ulen
);
433 ulen
-= sizeof(struct udphdr
);
434 length
-= sizeof(struct udphdr
);
438 cp
= (const u_char
*)(up
+ 1);
439 if (cp
> ndo
->ndo_snapend
) {
440 udpipaddr_print(ndo
, ip
, sport
, dport
);
444 if (ndo
->ndo_packettype
) {
445 const struct sunrpc_msg
*rp
;
446 enum sunrpc_msg_type direction
;
448 switch (ndo
->ndo_packettype
) {
451 udpipaddr_print(ndo
, ip
, sport
, dport
);
452 vat_print(ndo
, (const void *)(up
+ 1), length
);
456 udpipaddr_print(ndo
, ip
, sport
, dport
);
457 wb_print(ndo
, (const u_char
*)(up
+ 1), length
);
461 rp
= (const struct sunrpc_msg
*)(up
+ 1);
462 ND_TCHECK_4(rp
->rm_direction
);
463 direction
= (enum sunrpc_msg_type
) GET_BE_U_4(rp
->rm_direction
);
464 if (direction
== SUNRPC_CALL
)
465 sunrpc_print(ndo
, (const u_char
*)rp
, length
,
468 nfsreply_print(ndo
, (const u_char
*)rp
, length
,
469 (const u_char
*)ip
); /*XXX*/
473 udpipaddr_print(ndo
, ip
, sport
, dport
);
474 rtp_print(ndo
, (const void *)(up
+ 1), length
);
478 udpipaddr_print(ndo
, ip
, sport
, dport
);
480 cp
= rtcp_print(ndo
, cp
, ep
);
484 udpipaddr_print(ndo
, ip
, sport
, dport
);
485 snmp_print(ndo
, (const u_char
*)(up
+ 1), length
);
489 udpipaddr_print(ndo
, ip
, sport
, dport
);
494 udpipaddr_print(ndo
, ip
, sport
, dport
);
495 tftp_print(ndo
, cp
, length
);
499 udpipaddr_print(ndo
, ip
, sport
, dport
);
500 aodv_print(ndo
, (const u_char
*)(up
+ 1), length
,
505 udpipaddr_print(ndo
, ip
, sport
, dport
);
506 radius_print(ndo
, cp
, length
);
510 udpipaddr_print(ndo
, ip
, sport
, dport
);
511 vxlan_print(ndo
, (const u_char
*)(up
+ 1), length
);
516 udpipaddr_print(ndo
, ip
, sport
, dport
);
517 pgm_print(ndo
, cp
, length
, bp2
);
520 udpipaddr_print(ndo
, ip
, sport
, dport
);
521 lmp_print(ndo
, cp
, length
);
524 udpipaddr_print(ndo
, ip
, sport
, dport
);
525 ptp_print(ndo
, cp
, length
);
528 udpipaddr_print(ndo
, ip
, sport
, dport
);
529 someip_print(ndo
, cp
, length
);
532 udpipaddr_print(ndo
, ip
, sport
, dport
);
533 domain_print(ndo
, (const u_char
*)(up
+ 1), length
, 0);
539 udpipaddr_print(ndo
, ip
, sport
, dport
);
540 if (!ndo
->ndo_qflag
) {
541 const struct sunrpc_msg
*rp
;
542 enum sunrpc_msg_type direction
;
544 rp
= (const struct sunrpc_msg
*)(up
+ 1);
545 if (ND_TTEST_4(rp
->rm_direction
)) {
546 direction
= (enum sunrpc_msg_type
) GET_BE_U_4(rp
->rm_direction
);
547 if (dport
== NFS_PORT
&& direction
== SUNRPC_CALL
) {
548 ND_PRINT("NFS request xid %u ",
549 GET_BE_U_4(rp
->rm_xid
));
550 nfsreq_noaddr_print(ndo
, (const u_char
*)rp
, length
,
554 if (sport
== NFS_PORT
&& direction
== SUNRPC_REPLY
) {
555 ND_PRINT("NFS reply xid %u ",
556 GET_BE_U_4(rp
->rm_xid
));
557 nfsreply_noaddr_print(ndo
, (const u_char
*)rp
, length
,
562 if (dport
== SUNRPC_PORT
&& direction
== SUNRPC_CALL
) {
563 sunrpc_print((const u_char
*)rp
, length
, (const u_char
*)ip
);
570 if (ndo
->ndo_vflag
&& !ndo
->ndo_Kflag
&& !fragmented
) {
571 /* Check the checksum, if possible. */
572 uint16_t sum
, udp_sum
;
575 * XXX - do this even if vflag == 1?
576 * TCP does, and we do so for UDP-over-IPv6.
578 if (IP_V(ip
) == 4 && (ndo
->ndo_vflag
> 1)) {
579 ND_TCHECK_2(up
->uh_sum
);
580 udp_sum
= GET_BE_U_2(up
->uh_sum
);
582 ND_PRINT("[no cksum] ");
583 } else if (ND_TTEST_LEN(cp
, length
)) {
584 sum
= udp_cksum(ndo
, ip
, up
, length
+ sizeof(struct udphdr
));
587 ND_PRINT("[bad udp cksum 0x%04x -> 0x%04x!] ",
589 in_cksum_shouldbe(udp_sum
, sum
));
591 ND_PRINT("[udp sum ok] ");
594 else if (IP_V(ip
) == 6) {
595 /* for IPv6, UDP checksum is mandatory */
596 if (ND_TTEST_LEN(cp
, length
)) {
597 sum
= udp6_cksum(ndo
, ip6
, up
, length
+ sizeof(struct udphdr
));
598 ND_TCHECK_2(up
->uh_sum
);
599 udp_sum
= GET_BE_U_2(up
->uh_sum
);
602 ND_PRINT("[bad udp cksum 0x%04x -> 0x%04x!] ",
604 in_cksum_shouldbe(udp_sum
, sum
));
606 ND_PRINT("[udp sum ok] ");
611 if (!ndo
->ndo_qflag
) {
612 if (IS_SRC_OR_DST_PORT(NAMESERVER_PORT
))
613 domain_print(ndo
, (const u_char
*)(up
+ 1), length
, 0);
614 else if (IS_SRC_OR_DST_PORT(MULTICASTDNS_PORT
))
615 domain_print(ndo
, (const u_char
*)(up
+ 1), length
, 1);
616 else if (IS_SRC_OR_DST_PORT(TIMED_PORT
))
617 timed_print(ndo
, (const u_char
*)(up
+ 1));
618 else if (IS_SRC_OR_DST_PORT(TFTP_PORT
))
619 tftp_print(ndo
, (const u_char
*)(up
+ 1), length
);
620 else if (IS_SRC_OR_DST_PORT(BOOTPC_PORT
) || IS_SRC_OR_DST_PORT(BOOTPS_PORT
))
621 bootp_print(ndo
, (const u_char
*)(up
+ 1), length
);
622 else if (IS_SRC_OR_DST_PORT(RIP_PORT
))
623 rip_print(ndo
, (const u_char
*)(up
+ 1), length
);
624 else if (IS_SRC_OR_DST_PORT(AODV_PORT
))
625 aodv_print(ndo
, (const u_char
*)(up
+ 1), length
,
627 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT
))
628 isakmp_print(ndo
, (const u_char
*)(up
+ 1), length
, bp2
);
629 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_NATT
))
630 isakmp_rfc3948_print(ndo
, (const u_char
*)(up
+ 1), length
, bp2
, IP_V(ip
), fragmented
, ttl_hl
);
631 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER1
) || IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER2
))
632 isakmp_print(ndo
, (const u_char
*)(up
+ 1), length
, bp2
);
633 else if (IS_SRC_OR_DST_PORT(SNMP_PORT
) || IS_SRC_OR_DST_PORT(SNMPTRAP_PORT
))
634 snmp_print(ndo
, (const u_char
*)(up
+ 1), length
);
635 else if (IS_SRC_OR_DST_PORT(NTP_PORT
))
636 ntp_print(ndo
, (const u_char
*)(up
+ 1), length
);
637 else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT
) || IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT
))
638 krb_print(ndo
, (const u_char
*)(up
+ 1));
639 else if (IS_SRC_OR_DST_PORT(L2TP_PORT
))
640 l2tp_print(ndo
, (const u_char
*)(up
+ 1), length
);
642 else if (IS_SRC_OR_DST_PORT(NETBIOS_NS_PORT
))
643 nbt_udp137_print(ndo
, (const u_char
*)(up
+ 1), length
);
644 else if (IS_SRC_OR_DST_PORT(NETBIOS_DGRAM_PORT
))
645 nbt_udp138_print(ndo
, (const u_char
*)(up
+ 1), length
);
647 else if (dport
== VAT_PORT
)
648 vat_print(ndo
, (const void *)(up
+ 1), length
);
649 else if (IS_SRC_OR_DST_PORT(ZEPHYR_SRV_PORT
) || IS_SRC_OR_DST_PORT(ZEPHYR_CLT_PORT
))
650 zephyr_print(ndo
, (const u_char
*)(up
+ 1), length
);
652 * Since there are 10 possible ports to check, I think
653 * a <> test would be more efficient
655 else if ((sport
>= RX_PORT_LOW
&& sport
<= RX_PORT_HIGH
) ||
656 (dport
>= RX_PORT_LOW
&& dport
<= RX_PORT_HIGH
))
657 rx_print(ndo
, (const u_char
*)(up
+ 1), length
, sport
, dport
,
658 (const u_char
*) ip
);
659 else if (IS_SRC_OR_DST_PORT(RIPNG_PORT
))
660 ripng_print(ndo
, (const u_char
*)(up
+ 1), length
);
661 else if (IS_SRC_OR_DST_PORT(DHCP6_SERV_PORT
) || IS_SRC_OR_DST_PORT(DHCP6_CLI_PORT
))
662 dhcp6_print(ndo
, (const u_char
*)(up
+ 1), length
);
663 else if (IS_SRC_OR_DST_PORT(AHCP_PORT
))
664 ahcp_print(ndo
, (const u_char
*)(up
+ 1), length
);
665 else if (IS_SRC_OR_DST_PORT(BABEL_PORT
) || IS_SRC_OR_DST_PORT(BABEL_PORT_OLD
))
666 babel_print(ndo
, (const u_char
*)(up
+ 1), length
);
667 else if (IS_SRC_OR_DST_PORT(HNCP_PORT
))
668 hncp_print(ndo
, (const u_char
*)(up
+ 1), length
);
670 * Kludge in test for whiteboard packets.
672 else if (dport
== WB_PORT
)
673 wb_print(ndo
, (const u_char
*)(up
+ 1), length
);
674 else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT
))
675 cisco_autorp_print(ndo
, (const u_char
*)(up
+ 1), length
);
676 else if (IS_SRC_OR_DST_PORT(RADIUS_PORT
) ||
677 IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT
) ||
678 IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT
) ||
679 IS_SRC_OR_DST_PORT(RADIUS_NEW_ACCOUNTING_PORT
) ||
680 IS_SRC_OR_DST_PORT(RADIUS_CISCO_COA_PORT
) ||
681 IS_SRC_OR_DST_PORT(RADIUS_COA_PORT
) )
682 radius_print(ndo
, (const u_char
*)(up
+1), length
);
683 else if (dport
== HSRP_PORT
)
684 hsrp_print(ndo
, (const u_char
*)(up
+ 1), length
);
685 else if (IS_SRC_OR_DST_PORT(LWRES_PORT
))
686 lwres_print(ndo
, (const u_char
*)(up
+ 1), length
);
687 else if (IS_SRC_OR_DST_PORT(LDP_PORT
))
688 ldp_print(ndo
, (const u_char
*)(up
+ 1), length
);
689 else if (IS_SRC_OR_DST_PORT(OLSR_PORT
))
690 olsr_print(ndo
, (const u_char
*)(up
+ 1), length
,
691 (IP_V(ip
) == 6) ? 1 : 0);
692 else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT
))
693 lspping_print(ndo
, (const u_char
*)(up
+ 1), length
);
694 else if (sport
== BCM_LI_PORT
)
695 bcm_li_print(ndo
, (const u_char
*)(up
+1), length
);
696 else if (dport
== BFD_CONTROL_PORT
||
697 dport
== BFD_MULTIHOP_PORT
||
698 dport
== BFD_LAG_PORT
||
699 dport
== BFD_ECHO_PORT
)
700 bfd_print(ndo
, (const u_char
*)(up
+1), length
, dport
);
701 else if (IS_SRC_OR_DST_PORT(LMP_PORT
))
702 lmp_print(ndo
, (const u_char
*)(up
+ 1), length
);
703 else if (IS_SRC_OR_DST_PORT(VQP_PORT
))
704 vqp_print(ndo
, (const u_char
*)(up
+ 1), length
);
705 else if (IS_SRC_OR_DST_PORT(SFLOW_PORT
))
706 sflow_print(ndo
, (const u_char
*)(up
+ 1), length
);
707 else if (dport
== LWAPP_CONTROL_PORT
)
708 lwapp_control_print(ndo
, (const u_char
*)(up
+ 1), length
, 1);
709 else if (sport
== LWAPP_CONTROL_PORT
)
710 lwapp_control_print(ndo
, (const u_char
*)(up
+ 1), length
, 0);
711 else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT
))
712 lwapp_data_print(ndo
, (const u_char
*)(up
+ 1), length
);
713 else if (IS_SRC_OR_DST_PORT(SIP_PORT
))
714 sip_print(ndo
, (const u_char
*)(up
+ 1), length
);
715 else if (IS_SRC_OR_DST_PORT(SYSLOG_PORT
))
716 syslog_print(ndo
, (const u_char
*)(up
+ 1), length
);
717 else if (IS_SRC_OR_DST_PORT(OTV_PORT
))
718 otv_print(ndo
, (const u_char
*)(up
+ 1), length
);
719 else if (IS_SRC_OR_DST_PORT(VXLAN_PORT
))
720 vxlan_print(ndo
, (const u_char
*)(up
+ 1), length
);
721 else if (IS_SRC_OR_DST_PORT(GENEVE_PORT
))
722 geneve_print(ndo
, (const u_char
*)(up
+ 1), length
);
723 else if (IS_SRC_OR_DST_PORT(LISP_CONTROL_PORT
))
724 lisp_print(ndo
, (const u_char
*)(up
+ 1), length
);
725 else if (IS_SRC_OR_DST_PORT(VXLAN_GPE_PORT
))
726 vxlan_gpe_print(ndo
, (const u_char
*)(up
+ 1), length
);
727 else if (IS_SRC_OR_DST_PORT(ZEP_PORT
))
728 zep_print(ndo
, (const u_char
*)(up
+ 1), length
);
729 else if (IS_SRC_OR_DST_PORT(MPLS_PORT
))
730 mpls_print(ndo
, (const u_char
*)(up
+ 1), length
);
731 else if (ND_TTEST_1(((const struct LAP
*)cp
)->type
) &&
732 GET_U_1(((const struct LAP
*)cp
)->type
) == lapDDP
&&
733 (atalk_port(sport
) || atalk_port(dport
))) {
736 llap_print(ndo
, cp
, length
);
737 } else if (IS_SRC_OR_DST_PORT(PTP_EVENT_PORT
) ||
738 IS_SRC_OR_DST_PORT(PTP_GENERAL_PORT
)) {
739 ptp_print(ndo
, cp
, length
);
740 } else if (IS_SRC_OR_DST_PORT(SOMEIP_PORT
))
741 someip_print(ndo
, (const u_char
*)(up
+ 1), length
);
744 ND_PRINT("UDP, bad length %u > %u",
747 ND_PRINT("UDP, length %u", ulen
);
751 ND_PRINT("UDP, bad length %u > %u",
754 ND_PRINT("UDP, length %u", ulen
);