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"
46 uint16_t rh_flags
; /* T:2 P:1 CNT:5 PT:8 */
47 uint16_t rh_len
; /* length of message (in words) */
48 uint32_t rh_ssrc
; /* synchronization src id */
52 uint32_t upper
; /* more significant 32 bits */
53 uint32_t lower
; /* less significant 32 bits */
60 ntp64 sr_ntp
; /* 64-bit ntp timestamp */
61 uint32_t sr_ts
; /* reference media timestamp */
62 uint32_t sr_np
; /* no. packets sent */
63 uint32_t sr_nb
; /* no. bytes sent */
68 * Time stamps are middle 32-bits of ntp timestamp.
71 uint32_t rr_srcid
; /* sender being reported */
72 uint32_t rr_nl
; /* no. packets lost */
73 uint32_t rr_ls
; /* extended last seq number received */
74 uint32_t rr_dv
; /* jitter (delay variance) */
75 uint32_t rr_lsr
; /* orig. ts from last rr from this src */
76 uint32_t rr_dlsr
; /* time from recpt of last rr to xmit time */
80 #define RTCP_PT_SR 200
81 #define RTCP_PT_RR 201
82 #define RTCP_PT_SDES 202
83 #define RTCP_SDES_CNAME 1
84 #define RTCP_SDES_NAME 2
85 #define RTCP_SDES_EMAIL 3
86 #define RTCP_SDES_PHONE 4
87 #define RTCP_SDES_LOC 5
88 #define RTCP_SDES_TOOL 6
89 #define RTCP_SDES_NOTE 7
90 #define RTCP_SDES_PRIV 8
91 #define RTCP_PT_BYE 203
92 #define RTCP_PT_APP 204
95 vat_print(netdissect_options
*ndo
, const void *hdr
, register const struct udphdr
*up
)
98 u_int ts
= EXTRACT_16BITS(hdr
);
99 if ((ts
& 0xf060) != 0) {
101 ND_PRINT((ndo
, "udp/vt %u %d / %d",
102 (uint32_t)(EXTRACT_16BITS(&up
->uh_ulen
) - sizeof(*up
)),
103 ts
& 0x3ff, ts
>> 10));
106 uint32_t i0
= EXTRACT_32BITS(&((const u_int
*)hdr
)[0]);
107 uint32_t i1
= EXTRACT_32BITS(&((const u_int
*)hdr
)[1]);
108 ND_PRINT((ndo
, "udp/vat %u c%d %u%s",
109 (uint32_t)(EXTRACT_16BITS(&up
->uh_ulen
) - sizeof(*up
) - 8),
111 i1
, i0
& 0x800000? "*" : ""));
114 ND_PRINT((ndo
, " f%d", (i0
>> 16) & 0x1f));
116 ND_PRINT((ndo
, " s%d", (i0
>> 24) & 0x3f));
121 rtp_print(netdissect_options
*ndo
, const void *hdr
, u_int len
,
122 register const struct udphdr
*up
)
125 const u_int
*ip
= (const u_int
*)hdr
;
126 u_int hasopt
, hasext
, contype
, hasmarker
;
127 uint32_t i0
= EXTRACT_32BITS(&((const u_int
*)hdr
)[0]);
128 uint32_t i1
= EXTRACT_32BITS(&((const u_int
*)hdr
)[1]);
129 u_int dlen
= EXTRACT_16BITS(&up
->uh_ulen
) - sizeof(*up
) - 8;
137 if ((i0
>> 30) == 1) {
138 /* rtp v1 - draft-ietf-avt-rtp-04 */
139 hasopt
= i0
& 0x800000;
140 contype
= (i0
>> 16) & 0x3f;
141 hasmarker
= i0
& 0x400000;
144 /* rtp v2 - RFC 3550 */
145 hasext
= i0
& 0x10000000;
146 contype
= (i0
>> 16) & 0x7f;
147 hasmarker
= i0
& 0x800000;
153 ND_PRINT((ndo
, "udp/%s %d c%d %s%s %d %u",
157 (hasopt
|| hasext
)? "+" : "",
161 if (ndo
->ndo_vflag
) {
162 ND_PRINT((ndo
, " %u", EXTRACT_32BITS(&((const u_int
*)hdr
)[2])));
166 i2
= EXTRACT_32BITS(ip
);
167 optlen
= (i2
>> 16) & 0xff;
168 if (optlen
== 0 || optlen
> len
) {
169 ND_PRINT((ndo
, " !opt"));
174 } while ((int)i2
>= 0);
178 i2
= EXTRACT_32BITS(ip
);
179 extlen
= (i2
& 0xffff) + 1;
181 ND_PRINT((ndo
, " !ext"));
186 if (contype
== 0x1f) /*XXX H.261 */
187 ND_PRINT((ndo
, " 0x%04x", EXTRACT_32BITS(ip
) >> 16));
191 static const u_char
*
192 rtcp_print(netdissect_options
*ndo
, const u_char
*hdr
, const u_char
*ep
)
194 /* rtp v2 control (rtcp) */
195 const struct rtcp_rr
*rr
= 0;
196 const struct rtcp_sr
*sr
;
197 const struct rtcphdr
*rh
= (const struct rtcphdr
*)hdr
;
202 if ((const u_char
*)(rh
+ 1) > ep
) {
203 ND_PRINT((ndo
, " [|rtcp]"));
206 len
= (EXTRACT_16BITS(&rh
->rh_len
) + 1) * 4;
207 flags
= EXTRACT_16BITS(&rh
->rh_flags
);
208 cnt
= (flags
>> 8) & 0x1f;
209 switch (flags
& 0xff) {
211 sr
= (const struct rtcp_sr
*)(rh
+ 1);
212 ND_PRINT((ndo
, " sr"));
213 if (len
!= cnt
* sizeof(*rr
) + sizeof(*sr
) + sizeof(*rh
))
214 ND_PRINT((ndo
, " [%d]", len
));
216 ND_PRINT((ndo
, " %u", EXTRACT_32BITS(&rh
->rh_ssrc
)));
217 if ((const u_char
*)(sr
+ 1) > ep
) {
218 ND_PRINT((ndo
, " [|rtcp]"));
221 ts
= (double)(EXTRACT_32BITS(&sr
->sr_ntp
.upper
)) +
222 ((double)(EXTRACT_32BITS(&sr
->sr_ntp
.lower
)) /
224 ND_PRINT((ndo
, " @%.2f %u %up %ub", ts
, EXTRACT_32BITS(&sr
->sr_ts
),
225 EXTRACT_32BITS(&sr
->sr_np
), EXTRACT_32BITS(&sr
->sr_nb
)));
226 rr
= (const struct rtcp_rr
*)(sr
+ 1);
229 ND_PRINT((ndo
, " rr"));
230 if (len
!= cnt
* sizeof(*rr
) + sizeof(*rh
))
231 ND_PRINT((ndo
, " [%d]", len
));
232 rr
= (const struct rtcp_rr
*)(rh
+ 1);
234 ND_PRINT((ndo
, " %u", EXTRACT_32BITS(&rh
->rh_ssrc
)));
237 ND_PRINT((ndo
, " sdes %d", len
));
239 ND_PRINT((ndo
, " %u", EXTRACT_32BITS(&rh
->rh_ssrc
)));
243 ND_PRINT((ndo
, " bye %d", len
));
245 ND_PRINT((ndo
, " %u", EXTRACT_32BITS(&rh
->rh_ssrc
)));
249 ND_PRINT((ndo
, " type-0x%x %d", flags
& 0xff, len
));
254 ND_PRINT((ndo
, " c%d", cnt
));
256 if ((const u_char
*)(rr
+ 1) > ep
) {
257 ND_PRINT((ndo
, " [|rtcp]"));
261 ND_PRINT((ndo
, " %u", EXTRACT_32BITS(&rr
->rr_srcid
)));
262 ts
= (double)(EXTRACT_32BITS(&rr
->rr_lsr
)) / 65536.;
263 dts
= (double)(EXTRACT_32BITS(&rr
->rr_dlsr
)) / 65536.;
264 ND_PRINT((ndo
, " %ul %us %uj @%.2f+%.2f",
265 EXTRACT_32BITS(&rr
->rr_nl
) & 0x00ffffff,
266 EXTRACT_32BITS(&rr
->rr_ls
),
267 EXTRACT_32BITS(&rr
->rr_dv
), ts
, dts
));
272 static int udp_cksum(netdissect_options
*ndo
, register const struct ip
*ip
,
273 register const struct udphdr
*up
,
276 return nextproto4_cksum(ndo
, ip
, (const uint8_t *)(const void *)up
, len
, len
,
280 static int udp6_cksum(netdissect_options
*ndo
, const struct ip6_hdr
*ip6
,
281 const struct udphdr
*up
, u_int len
)
283 return nextproto6_cksum(ndo
, ip6
, (const uint8_t *)(const void *)up
, len
, len
,
288 udpipaddr_print(netdissect_options
*ndo
, const struct ip
*ip
, int sport
, int dport
)
290 const struct ip6_hdr
*ip6
;
293 ip6
= (const struct ip6_hdr
*)ip
;
298 if (ip6
->ip6_nxt
== IPPROTO_UDP
) {
300 ND_PRINT((ndo
, "%s > %s: ",
301 ip6addr_string(ndo
, &ip6
->ip6_src
),
302 ip6addr_string(ndo
, &ip6
->ip6_dst
)));
304 ND_PRINT((ndo
, "%s.%s > %s.%s: ",
305 ip6addr_string(ndo
, &ip6
->ip6_src
),
306 udpport_string(ndo
, sport
),
307 ip6addr_string(ndo
, &ip6
->ip6_dst
),
308 udpport_string(ndo
, dport
)));
312 ND_PRINT((ndo
, "%s > %s: ",
313 udpport_string(ndo
, sport
),
314 udpport_string(ndo
, dport
)));
318 if (ip
->ip_p
== IPPROTO_UDP
) {
320 ND_PRINT((ndo
, "%s > %s: ",
321 ipaddr_string(ndo
, &ip
->ip_src
),
322 ipaddr_string(ndo
, &ip
->ip_dst
)));
324 ND_PRINT((ndo
, "%s.%s > %s.%s: ",
325 ipaddr_string(ndo
, &ip
->ip_src
),
326 udpport_string(ndo
, sport
),
327 ipaddr_string(ndo
, &ip
->ip_dst
),
328 udpport_string(ndo
, dport
)));
332 ND_PRINT((ndo
, "%s > %s: ",
333 udpport_string(ndo
, sport
),
334 udpport_string(ndo
, dport
)));
341 udp_print(netdissect_options
*ndo
, register const u_char
*bp
, u_int length
,
342 register const u_char
*bp2
, int fragmented
)
344 register const struct udphdr
*up
;
345 register const struct ip
*ip
;
346 register const u_char
*cp
;
347 register const u_char
*ep
= bp
+ length
;
348 uint16_t sport
, dport
, ulen
;
349 register const struct ip6_hdr
*ip6
;
351 if (ep
> ndo
->ndo_snapend
)
352 ep
= ndo
->ndo_snapend
;
353 up
= (const struct udphdr
*)bp
;
354 ip
= (const struct ip
*)bp2
;
356 ip6
= (const struct ip6_hdr
*)bp2
;
359 if (!ND_TTEST(up
->uh_dport
)) {
360 udpipaddr_print(ndo
, ip
, -1, -1);
361 ND_PRINT((ndo
, "[|udp]"));
365 sport
= EXTRACT_16BITS(&up
->uh_sport
);
366 dport
= EXTRACT_16BITS(&up
->uh_dport
);
368 if (length
< sizeof(struct udphdr
)) {
369 udpipaddr_print(ndo
, ip
, sport
, dport
);
370 ND_PRINT((ndo
, "truncated-udp %d", length
));
373 ulen
= EXTRACT_16BITS(&up
->uh_ulen
);
374 if (ulen
< sizeof(struct udphdr
)) {
375 udpipaddr_print(ndo
, ip
, sport
, dport
);
376 ND_PRINT((ndo
, "truncated-udplength %d", ulen
));
379 ulen
-= sizeof(struct udphdr
);
380 length
-= sizeof(struct udphdr
);
384 cp
= (const u_char
*)(up
+ 1);
385 if (cp
> ndo
->ndo_snapend
) {
386 udpipaddr_print(ndo
, ip
, sport
, dport
);
387 ND_PRINT((ndo
, "[|udp]"));
391 if (ndo
->ndo_packettype
) {
392 register const struct sunrpc_msg
*rp
;
393 enum sunrpc_msg_type direction
;
395 switch (ndo
->ndo_packettype
) {
398 udpipaddr_print(ndo
, ip
, sport
, dport
);
399 vat_print(ndo
, (const void *)(up
+ 1), up
);
403 udpipaddr_print(ndo
, ip
, sport
, dport
);
404 wb_print(ndo
, (const void *)(up
+ 1), length
);
408 rp
= (const struct sunrpc_msg
*)(up
+ 1);
409 direction
= (enum sunrpc_msg_type
)EXTRACT_32BITS(&rp
->rm_direction
);
410 if (direction
== SUNRPC_CALL
)
411 sunrpcrequest_print(ndo
, (const u_char
*)rp
, length
,
414 nfsreply_print(ndo
, (const u_char
*)rp
, length
,
415 (const u_char
*)ip
); /*XXX*/
419 udpipaddr_print(ndo
, ip
, sport
, dport
);
420 rtp_print(ndo
, (const void *)(up
+ 1), length
, up
);
424 udpipaddr_print(ndo
, ip
, sport
, dport
);
426 cp
= rtcp_print(ndo
, cp
, ep
);
430 udpipaddr_print(ndo
, ip
, sport
, dport
);
431 snmp_print(ndo
, (const u_char
*)(up
+ 1), length
);
435 udpipaddr_print(ndo
, ip
, sport
, dport
);
440 udpipaddr_print(ndo
, ip
, sport
, dport
);
441 tftp_print(ndo
, cp
, length
);
445 udpipaddr_print(ndo
, ip
, sport
, dport
);
446 aodv_print(ndo
, (const u_char
*)(up
+ 1), length
,
451 udpipaddr_print(ndo
, ip
, sport
, dport
);
452 radius_print(ndo
, cp
, length
);
456 udpipaddr_print(ndo
, ip
, sport
, dport
);
457 vxlan_print(ndo
, (const u_char
*)(up
+ 1), length
);
462 udpipaddr_print(ndo
, ip
, sport
, dport
);
463 pgm_print(ndo
, cp
, length
, bp2
);
466 udpipaddr_print(ndo
, ip
, sport
, dport
);
467 lmp_print(ndo
, cp
, length
);
473 udpipaddr_print(ndo
, ip
, sport
, dport
);
474 if (!ndo
->ndo_qflag
) {
475 register const struct sunrpc_msg
*rp
;
476 enum sunrpc_msg_type direction
;
478 rp
= (const struct sunrpc_msg
*)(up
+ 1);
479 if (ND_TTEST(rp
->rm_direction
)) {
480 direction
= (enum sunrpc_msg_type
)EXTRACT_32BITS(&rp
->rm_direction
);
481 if (dport
== NFS_PORT
&& direction
== SUNRPC_CALL
) {
482 ND_PRINT((ndo
, "NFS request xid %u ", EXTRACT_32BITS(&rp
->rm_xid
)));
483 nfsreq_print_noaddr(ndo
, (const u_char
*)rp
, length
,
487 if (sport
== NFS_PORT
&& direction
== SUNRPC_REPLY
) {
488 ND_PRINT((ndo
, "NFS reply xid %u ", EXTRACT_32BITS(&rp
->rm_xid
)));
489 nfsreply_print_noaddr(ndo
, (const u_char
*)rp
, length
,
494 if (dport
== SUNRPC_PORT
&& direction
== SUNRPC_CALL
) {
495 sunrpcrequest_print((const u_char
*)rp
, length
, (const u_char
*)ip
);
502 if (ndo
->ndo_vflag
&& !ndo
->ndo_Kflag
&& !fragmented
) {
503 /* Check the checksum, if possible. */
504 uint16_t sum
, udp_sum
;
507 * XXX - do this even if vflag == 1?
508 * TCP does, and we do so for UDP-over-IPv6.
510 if (IP_V(ip
) == 4 && (ndo
->ndo_vflag
> 1)) {
511 udp_sum
= EXTRACT_16BITS(&up
->uh_sum
);
513 ND_PRINT((ndo
, "[no cksum] "));
514 } else if (ND_TTEST2(cp
[0], length
)) {
515 sum
= udp_cksum(ndo
, ip
, up
, length
+ sizeof(struct udphdr
));
518 ND_PRINT((ndo
, "[bad udp cksum 0x%04x -> 0x%04x!] ",
520 in_cksum_shouldbe(udp_sum
, sum
)));
522 ND_PRINT((ndo
, "[udp sum ok] "));
525 else if (IP_V(ip
) == 6 && ip6
->ip6_plen
) {
526 /* for IPv6, UDP checksum is mandatory */
527 if (ND_TTEST2(cp
[0], length
)) {
528 sum
= udp6_cksum(ndo
, ip6
, up
, length
+ sizeof(struct udphdr
));
529 udp_sum
= EXTRACT_16BITS(&up
->uh_sum
);
532 ND_PRINT((ndo
, "[bad udp cksum 0x%04x -> 0x%04x!] ",
534 in_cksum_shouldbe(udp_sum
, sum
)));
536 ND_PRINT((ndo
, "[udp sum ok] "));
541 if (!ndo
->ndo_qflag
) {
542 if (IS_SRC_OR_DST_PORT(NAMESERVER_PORT
))
543 ns_print(ndo
, (const u_char
*)(up
+ 1), length
, 0);
544 else if (IS_SRC_OR_DST_PORT(MULTICASTDNS_PORT
))
545 ns_print(ndo
, (const u_char
*)(up
+ 1), length
, 1);
546 else if (IS_SRC_OR_DST_PORT(TIMED_PORT
))
547 timed_print(ndo
, (const u_char
*)(up
+ 1));
548 else if (IS_SRC_OR_DST_PORT(TFTP_PORT
))
549 tftp_print(ndo
, (const u_char
*)(up
+ 1), length
);
550 else if (IS_SRC_OR_DST_PORT(BOOTPC_PORT
) || IS_SRC_OR_DST_PORT(BOOTPS_PORT
))
551 bootp_print(ndo
, (const u_char
*)(up
+ 1), length
);
552 else if (IS_SRC_OR_DST_PORT(RIP_PORT
))
553 rip_print(ndo
, (const u_char
*)(up
+ 1), length
);
554 else if (IS_SRC_OR_DST_PORT(AODV_PORT
))
555 aodv_print(ndo
, (const u_char
*)(up
+ 1), length
,
557 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT
))
558 isakmp_print(ndo
, (const u_char
*)(up
+ 1), length
, bp2
);
559 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_NATT
))
560 isakmp_rfc3948_print(ndo
, (const u_char
*)(up
+ 1), length
, bp2
);
562 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER1
) || IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER2
))
563 isakmp_print(ndo
, (const u_char
*)(up
+ 1), length
, bp2
);
565 else if (IS_SRC_OR_DST_PORT(SNMP_PORT
) || IS_SRC_OR_DST_PORT(SNMPTRAP_PORT
))
566 snmp_print(ndo
, (const u_char
*)(up
+ 1), length
);
567 else if (IS_SRC_OR_DST_PORT(NTP_PORT
))
568 ntp_print(ndo
, (const u_char
*)(up
+ 1), length
);
569 else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT
) || IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT
))
570 krb_print(ndo
, (const void *)(up
+ 1));
571 else if (IS_SRC_OR_DST_PORT(L2TP_PORT
))
572 l2tp_print(ndo
, (const u_char
*)(up
+ 1), length
);
574 else if (IS_SRC_OR_DST_PORT(NETBIOS_NS_PORT
))
575 nbt_udp137_print(ndo
, (const u_char
*)(up
+ 1), length
);
576 else if (IS_SRC_OR_DST_PORT(NETBIOS_DGRAM_PORT
))
577 nbt_udp138_print(ndo
, (const u_char
*)(up
+ 1), length
);
579 else if (dport
== VAT_PORT
)
580 vat_print(ndo
, (const void *)(up
+ 1), up
);
581 else if (IS_SRC_OR_DST_PORT(ZEPHYR_SRV_PORT
) || IS_SRC_OR_DST_PORT(ZEPHYR_CLT_PORT
))
582 zephyr_print(ndo
, (const void *)(up
+ 1), length
);
584 * Since there are 10 possible ports to check, I think
585 * a <> test would be more efficient
587 else if ((sport
>= RX_PORT_LOW
&& sport
<= RX_PORT_HIGH
) ||
588 (dport
>= RX_PORT_LOW
&& dport
<= RX_PORT_HIGH
))
589 rx_print(ndo
, (const void *)(up
+ 1), length
, sport
, dport
,
590 (const u_char
*) ip
);
591 else if (IS_SRC_OR_DST_PORT(RIPNG_PORT
))
592 ripng_print(ndo
, (const u_char
*)(up
+ 1), length
);
593 else if (IS_SRC_OR_DST_PORT(DHCP6_SERV_PORT
) || IS_SRC_OR_DST_PORT(DHCP6_CLI_PORT
))
594 dhcp6_print(ndo
, (const u_char
*)(up
+ 1), length
);
595 else if (IS_SRC_OR_DST_PORT(AHCP_PORT
))
596 ahcp_print(ndo
, (const u_char
*)(up
+ 1), length
);
597 else if (IS_SRC_OR_DST_PORT(BABEL_PORT
) || IS_SRC_OR_DST_PORT(BABEL_PORT_OLD
))
598 babel_print(ndo
, (const u_char
*)(up
+ 1), length
);
599 else if (IS_SRC_OR_DST_PORT(HNCP_PORT
))
600 hncp_print(ndo
, (const u_char
*)(up
+ 1), length
);
602 * Kludge in test for whiteboard packets.
604 else if (dport
== WB_PORT
)
605 wb_print(ndo
, (const void *)(up
+ 1), length
);
606 else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT
))
607 cisco_autorp_print(ndo
, (const void *)(up
+ 1), length
);
608 else if (IS_SRC_OR_DST_PORT(RADIUS_PORT
) ||
609 IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT
) ||
610 IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT
) ||
611 IS_SRC_OR_DST_PORT(RADIUS_NEW_ACCOUNTING_PORT
) ||
612 IS_SRC_OR_DST_PORT(RADIUS_CISCO_COA_PORT
) ||
613 IS_SRC_OR_DST_PORT(RADIUS_COA_PORT
) )
614 radius_print(ndo
, (const u_char
*)(up
+1), length
);
615 else if (dport
== HSRP_PORT
)
616 hsrp_print(ndo
, (const u_char
*)(up
+ 1), length
);
617 else if (IS_SRC_OR_DST_PORT(LWRES_PORT
))
618 lwres_print(ndo
, (const u_char
*)(up
+ 1), length
);
619 else if (IS_SRC_OR_DST_PORT(LDP_PORT
))
620 ldp_print(ndo
, (const u_char
*)(up
+ 1), length
);
621 else if (IS_SRC_OR_DST_PORT(OLSR_PORT
))
622 olsr_print(ndo
, (const u_char
*)(up
+ 1), length
,
623 (IP_V(ip
) == 6) ? 1 : 0);
624 else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT
))
625 lspping_print(ndo
, (const u_char
*)(up
+ 1), length
);
626 else if (dport
== BFD_CONTROL_PORT
||
627 dport
== BFD_ECHO_PORT
)
628 bfd_print(ndo
, (const u_char
*)(up
+1), length
, dport
);
629 else if (IS_SRC_OR_DST_PORT(LMP_PORT
))
630 lmp_print(ndo
, (const u_char
*)(up
+ 1), length
);
631 else if (IS_SRC_OR_DST_PORT(VQP_PORT
))
632 vqp_print(ndo
, (const u_char
*)(up
+ 1), length
);
633 else if (IS_SRC_OR_DST_PORT(SFLOW_PORT
))
634 sflow_print(ndo
, (const u_char
*)(up
+ 1), length
);
635 else if (dport
== LWAPP_CONTROL_PORT
)
636 lwapp_control_print(ndo
, (const u_char
*)(up
+ 1), length
, 1);
637 else if (sport
== LWAPP_CONTROL_PORT
)
638 lwapp_control_print(ndo
, (const u_char
*)(up
+ 1), length
, 0);
639 else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT
))
640 lwapp_data_print(ndo
, (const u_char
*)(up
+ 1), length
);
641 else if (IS_SRC_OR_DST_PORT(SIP_PORT
))
642 sip_print(ndo
, (const u_char
*)(up
+ 1), length
);
643 else if (IS_SRC_OR_DST_PORT(SYSLOG_PORT
))
644 syslog_print(ndo
, (const u_char
*)(up
+ 1), length
);
645 else if (IS_SRC_OR_DST_PORT(OTV_PORT
))
646 otv_print(ndo
, (const u_char
*)(up
+ 1), length
);
647 else if (IS_SRC_OR_DST_PORT(VXLAN_PORT
))
648 vxlan_print(ndo
, (const u_char
*)(up
+ 1), length
);
649 else if (IS_SRC_OR_DST_PORT(GENEVE_PORT
))
650 geneve_print(ndo
, (const u_char
*)(up
+ 1), length
);
651 else if (IS_SRC_OR_DST_PORT(LISP_CONTROL_PORT
))
652 lisp_print(ndo
, (const u_char
*)(up
+ 1), length
);
653 else if (IS_SRC_OR_DST_PORT(VXLAN_GPE_PORT
))
654 vxlan_gpe_print(ndo
, (const u_char
*)(up
+ 1), length
);
655 else if (ND_TTEST(((const struct LAP
*)cp
)->type
) &&
656 ((const struct LAP
*)cp
)->type
== lapDDP
&&
657 (atalk_port(sport
) || atalk_port(dport
))) {
659 ND_PRINT((ndo
, "kip "));
660 llap_print(ndo
, cp
, length
);
663 ND_PRINT((ndo
, "UDP, bad length %u > %u",
666 ND_PRINT((ndo
, "UDP, length %u", ulen
));
670 ND_PRINT((ndo
, "UDP, bad length %u > %u",
673 ND_PRINT((ndo
, "UDP, length %u", ulen
));
680 * c-style: whitesmith