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"
45 static const char vat_tstr
[] = " [|vat]";
46 static const char rtp_tstr
[] = " [|rtp]";
47 static const char rtcp_tstr
[] = " [|rtcp]";
48 static const char udp_tstr
[] = " [|udp]";
51 nd_uint16_t rh_flags
; /* T:2 P:1 CNT:5 PT:8 */
52 nd_uint16_t rh_len
; /* length of message (in words) */
53 nd_uint32_t rh_ssrc
; /* synchronization src id */
57 nd_uint32_t upper
; /* more significant 32 bits */
58 nd_uint32_t lower
; /* less significant 32 bits */
65 ntp64 sr_ntp
; /* 64-bit ntp timestamp */
66 nd_uint32_t sr_ts
; /* reference media timestamp */
67 nd_uint32_t sr_np
; /* no. packets sent */
68 nd_uint32_t sr_nb
; /* no. bytes sent */
73 * Time stamps are middle 32-bits of ntp timestamp.
76 nd_uint32_t rr_srcid
; /* sender being reported */
77 nd_uint32_t rr_nl
; /* no. packets lost */
78 nd_uint32_t rr_ls
; /* extended last seq number received */
79 nd_uint32_t rr_dv
; /* jitter (delay variance) */
80 nd_uint32_t rr_lsr
; /* orig. ts from last rr from this src */
81 nd_uint32_t rr_dlsr
; /* time from recpt of last rr to xmit time */
85 #define RTCP_PT_SR 200
86 #define RTCP_PT_RR 201
87 #define RTCP_PT_SDES 202
88 #define RTCP_SDES_CNAME 1
89 #define RTCP_SDES_NAME 2
90 #define RTCP_SDES_EMAIL 3
91 #define RTCP_SDES_PHONE 4
92 #define RTCP_SDES_LOC 5
93 #define RTCP_SDES_TOOL 6
94 #define RTCP_SDES_NOTE 7
95 #define RTCP_SDES_PRIV 8
96 #define RTCP_PT_BYE 203
97 #define RTCP_PT_APP 204
100 vat_print(netdissect_options
*ndo
, const void *hdr
, register const struct udphdr
*up
)
105 ND_TCHECK_2((const u_int
*)hdr
);
106 ts
= EXTRACT_BE_U_2(hdr
);
107 if ((ts
& 0xf060) != 0) {
109 ND_TCHECK_2(up
->uh_ulen
);
110 ND_PRINT((ndo
, "udp/vt %u %d / %d",
111 (uint32_t)(EXTRACT_BE_U_2(up
->uh_ulen
) - sizeof(*up
)),
112 ts
& 0x3ff, ts
>> 10));
117 ND_TCHECK_4(&((const u_int
*)hdr
)[0]);
118 i0
= EXTRACT_BE_U_4(&((const u_int
*)hdr
)[0]);
119 ND_TCHECK_4(&((const u_int
*)hdr
)[1]);
120 i1
= EXTRACT_BE_U_4(&((const u_int
*)hdr
)[1]);
121 ND_TCHECK_2(up
->uh_ulen
);
122 ND_PRINT((ndo
, "udp/vat %u c%d %u%s",
123 (uint32_t)(EXTRACT_BE_U_2(up
->uh_ulen
) - sizeof(*up
) - 8),
125 i1
, i0
& 0x800000? "*" : ""));
128 ND_PRINT((ndo
, " f%d", (i0
>> 16) & 0x1f));
130 ND_PRINT((ndo
, " s%d", (i0
>> 24) & 0x3f));
134 ND_PRINT((ndo
, "%s", vat_tstr
));
138 rtp_print(netdissect_options
*ndo
, const void *hdr
, u_int len
,
139 register const struct udphdr
*up
)
142 const u_int
*ip
= (const u_int
*)hdr
;
143 u_int hasopt
, hasext
, contype
, hasmarker
, dlen
;
147 ND_TCHECK_4(&((const u_int
*)hdr
)[0]);
148 i0
= EXTRACT_BE_U_4(&((const u_int
*)hdr
)[0]);
149 ND_TCHECK_4(&((const u_int
*)hdr
)[1]);
150 i1
= EXTRACT_BE_U_4(&((const u_int
*)hdr
)[1]);
151 ND_TCHECK_2(up
->uh_ulen
);
152 dlen
= EXTRACT_BE_U_2(up
->uh_ulen
) - sizeof(*up
) - 8;
158 if ((i0
>> 30) == 1) {
159 /* rtp v1 - draft-ietf-avt-rtp-04 */
160 hasopt
= i0
& 0x800000;
161 contype
= (i0
>> 16) & 0x3f;
162 hasmarker
= i0
& 0x400000;
165 /* rtp v2 - RFC 3550 */
166 hasext
= i0
& 0x10000000;
167 contype
= (i0
>> 16) & 0x7f;
168 hasmarker
= i0
& 0x800000;
174 ND_PRINT((ndo
, "udp/%s %d c%d %s%s %d %u",
178 (hasopt
|| hasext
)? "+" : "",
182 if (ndo
->ndo_vflag
) {
183 ND_TCHECK_4(&((const u_int
*)hdr
)[2]);
184 ND_PRINT((ndo
, " %u", EXTRACT_BE_U_4(&((const u_int
*)hdr
)[2])));
189 i2
= EXTRACT_BE_U_4(ip
);
190 optlen
= (i2
>> 16) & 0xff;
191 if (optlen
== 0 || optlen
> len
) {
192 ND_PRINT((ndo
, " !opt"));
197 } while ((int)i2
>= 0);
202 i2
= EXTRACT_BE_U_4(ip
);
203 extlen
= (i2
& 0xffff) + 1;
205 ND_PRINT((ndo
, " !ext"));
211 if (contype
== 0x1f) /*XXX H.261 */
212 ND_PRINT((ndo
, " 0x%04x", EXTRACT_BE_U_4(ip
) >> 16));
216 ND_PRINT((ndo
, "%s", rtp_tstr
));
219 static const u_char
*
220 rtcp_print(netdissect_options
*ndo
, const u_char
*hdr
, const u_char
*ep
)
222 /* rtp v2 control (rtcp) */
223 const struct rtcp_rr
*rr
= 0;
224 const struct rtcp_sr
*sr
;
225 const struct rtcphdr
*rh
= (const struct rtcphdr
*)hdr
;
230 if ((const u_char
*)(rh
+ 1) > ep
)
233 len
= (EXTRACT_BE_U_2(rh
->rh_len
) + 1) * 4;
234 flags
= EXTRACT_BE_U_2(rh
->rh_flags
);
235 cnt
= (flags
>> 8) & 0x1f;
236 switch (flags
& 0xff) {
238 sr
= (const struct rtcp_sr
*)(rh
+ 1);
239 ND_PRINT((ndo
, " sr"));
240 if (len
!= cnt
* sizeof(*rr
) + sizeof(*sr
) + sizeof(*rh
))
241 ND_PRINT((ndo
, " [%d]", len
));
243 ND_PRINT((ndo
, " %u", EXTRACT_BE_U_4(rh
->rh_ssrc
)));
244 if ((const u_char
*)(sr
+ 1) > ep
)
247 ts
= (double)(EXTRACT_BE_U_4(sr
->sr_ntp
.upper
)) +
248 ((double)(EXTRACT_BE_U_4(sr
->sr_ntp
.lower
)) /
250 ND_PRINT((ndo
, " @%.2f %u %up %ub", ts
, EXTRACT_BE_U_4(sr
->sr_ts
),
251 EXTRACT_BE_U_4(sr
->sr_np
), EXTRACT_BE_U_4(sr
->sr_nb
)));
252 rr
= (const struct rtcp_rr
*)(sr
+ 1);
255 ND_PRINT((ndo
, " rr"));
256 if (len
!= cnt
* sizeof(*rr
) + sizeof(*rh
))
257 ND_PRINT((ndo
, " [%d]", len
));
258 rr
= (const struct rtcp_rr
*)(rh
+ 1);
260 ND_PRINT((ndo
, " %u", EXTRACT_BE_U_4(rh
->rh_ssrc
)));
263 ND_PRINT((ndo
, " sdes %d", len
));
265 ND_PRINT((ndo
, " %u", EXTRACT_BE_U_4(rh
->rh_ssrc
)));
269 ND_PRINT((ndo
, " bye %d", len
));
271 ND_PRINT((ndo
, " %u", EXTRACT_BE_U_4(rh
->rh_ssrc
)));
275 ND_PRINT((ndo
, " type-0x%x %d", flags
& 0xff, len
));
280 ND_PRINT((ndo
, " c%d", cnt
));
282 if ((const u_char
*)(rr
+ 1) > ep
)
286 ND_PRINT((ndo
, " %u", EXTRACT_BE_U_4(rr
->rr_srcid
)));
287 ts
= (double)(EXTRACT_BE_U_4(rr
->rr_lsr
)) / 65536.;
288 dts
= (double)(EXTRACT_BE_U_4(rr
->rr_dlsr
)) / 65536.;
289 ND_PRINT((ndo
, " %ul %us %uj @%.2f+%.2f",
290 EXTRACT_BE_U_4(rr
->rr_nl
) & 0x00ffffff,
291 EXTRACT_BE_U_4(rr
->rr_ls
),
292 EXTRACT_BE_U_4(rr
->rr_dv
), ts
, dts
));
297 ND_PRINT((ndo
, "%s", rtcp_tstr
));
301 static int udp_cksum(netdissect_options
*ndo
, register const struct ip
*ip
,
302 register const struct udphdr
*up
,
305 return nextproto4_cksum(ndo
, ip
, (const uint8_t *)(const void *)up
, len
, len
,
309 static int udp6_cksum(netdissect_options
*ndo
, const struct ip6_hdr
*ip6
,
310 const struct udphdr
*up
, u_int len
)
312 return nextproto6_cksum(ndo
, ip6
, (const uint8_t *)(const void *)up
, len
, len
,
317 udpipaddr_print(netdissect_options
*ndo
, const struct ip
*ip
, int sport
, int dport
)
319 const struct ip6_hdr
*ip6
;
322 ip6
= (const struct ip6_hdr
*)ip
;
327 if (ip6
->ip6_nxt
== IPPROTO_UDP
) {
329 ND_PRINT((ndo
, "%s > %s: ",
330 ip6addr_string(ndo
, &ip6
->ip6_src
),
331 ip6addr_string(ndo
, &ip6
->ip6_dst
)));
333 ND_PRINT((ndo
, "%s.%s > %s.%s: ",
334 ip6addr_string(ndo
, &ip6
->ip6_src
),
335 udpport_string(ndo
, sport
),
336 ip6addr_string(ndo
, &ip6
->ip6_dst
),
337 udpport_string(ndo
, dport
)));
341 ND_PRINT((ndo
, "%s > %s: ",
342 udpport_string(ndo
, sport
),
343 udpport_string(ndo
, dport
)));
347 if (EXTRACT_U_1(ip
->ip_p
) == IPPROTO_UDP
) {
349 ND_PRINT((ndo
, "%s > %s: ",
350 ipaddr_string(ndo
, &ip
->ip_src
),
351 ipaddr_string(ndo
, &ip
->ip_dst
)));
353 ND_PRINT((ndo
, "%s.%s > %s.%s: ",
354 ipaddr_string(ndo
, &ip
->ip_src
),
355 udpport_string(ndo
, sport
),
356 ipaddr_string(ndo
, &ip
->ip_dst
),
357 udpport_string(ndo
, dport
)));
361 ND_PRINT((ndo
, "%s > %s: ",
362 udpport_string(ndo
, sport
),
363 udpport_string(ndo
, dport
)));
370 udp_print(netdissect_options
*ndo
, register const u_char
*bp
, u_int length
,
371 register const u_char
*bp2
, int fragmented
)
373 register const struct udphdr
*up
;
374 register const struct ip
*ip
;
375 register const u_char
*cp
;
376 register const u_char
*ep
= bp
+ length
;
377 uint16_t sport
, dport
, ulen
;
378 register const struct ip6_hdr
*ip6
;
380 if (ep
> ndo
->ndo_snapend
)
381 ep
= ndo
->ndo_snapend
;
382 up
= (const struct udphdr
*)bp
;
383 ip
= (const struct ip
*)bp2
;
385 ip6
= (const struct ip6_hdr
*)bp2
;
388 if (!ND_TTEST(up
->uh_dport
)) {
389 udpipaddr_print(ndo
, ip
, -1, -1);
393 sport
= EXTRACT_BE_U_2(up
->uh_sport
);
394 dport
= EXTRACT_BE_U_2(up
->uh_dport
);
396 if (length
< sizeof(struct udphdr
)) {
397 udpipaddr_print(ndo
, ip
, sport
, dport
);
398 ND_PRINT((ndo
, "truncated-udp %d", length
));
401 if (!ND_TTEST(up
->uh_ulen
)) {
402 udpipaddr_print(ndo
, ip
, sport
, dport
);
405 ulen
= EXTRACT_BE_U_2(up
->uh_ulen
);
406 if (ulen
< sizeof(struct udphdr
)) {
407 udpipaddr_print(ndo
, ip
, sport
, dport
);
408 ND_PRINT((ndo
, "truncated-udplength %d", ulen
));
411 ulen
-= sizeof(struct udphdr
);
412 length
-= sizeof(struct udphdr
);
416 cp
= (const u_char
*)(up
+ 1);
417 if (cp
> ndo
->ndo_snapend
) {
418 udpipaddr_print(ndo
, ip
, sport
, dport
);
422 if (ndo
->ndo_packettype
) {
423 register const struct sunrpc_msg
*rp
;
424 enum sunrpc_msg_type direction
;
426 switch (ndo
->ndo_packettype
) {
429 udpipaddr_print(ndo
, ip
, sport
, dport
);
430 vat_print(ndo
, (const void *)(up
+ 1), up
);
434 udpipaddr_print(ndo
, ip
, sport
, dport
);
435 wb_print(ndo
, (const void *)(up
+ 1), length
);
439 rp
= (const struct sunrpc_msg
*)(up
+ 1);
440 direction
= (enum sunrpc_msg_type
) EXTRACT_BE_U_4(&rp
->rm_direction
);
441 if (direction
== SUNRPC_CALL
)
442 sunrpc_print(ndo
, (const u_char
*)rp
, length
,
445 nfsreply_print(ndo
, (const u_char
*)rp
, length
,
446 (const u_char
*)ip
); /*XXX*/
450 udpipaddr_print(ndo
, ip
, sport
, dport
);
451 rtp_print(ndo
, (const void *)(up
+ 1), length
, up
);
455 udpipaddr_print(ndo
, ip
, sport
, dport
);
457 cp
= rtcp_print(ndo
, cp
, ep
);
461 udpipaddr_print(ndo
, ip
, sport
, dport
);
462 snmp_print(ndo
, (const u_char
*)(up
+ 1), length
);
466 udpipaddr_print(ndo
, ip
, sport
, dport
);
471 udpipaddr_print(ndo
, ip
, sport
, dport
);
472 tftp_print(ndo
, cp
, length
);
476 udpipaddr_print(ndo
, ip
, sport
, dport
);
477 aodv_print(ndo
, (const u_char
*)(up
+ 1), length
,
482 udpipaddr_print(ndo
, ip
, sport
, dport
);
483 radius_print(ndo
, cp
, length
);
487 udpipaddr_print(ndo
, ip
, sport
, dport
);
488 vxlan_print(ndo
, (const u_char
*)(up
+ 1), length
);
493 udpipaddr_print(ndo
, ip
, sport
, dport
);
494 pgm_print(ndo
, cp
, length
, bp2
);
497 udpipaddr_print(ndo
, ip
, sport
, dport
);
498 lmp_print(ndo
, cp
, length
);
504 udpipaddr_print(ndo
, ip
, sport
, dport
);
505 if (!ndo
->ndo_qflag
) {
506 register const struct sunrpc_msg
*rp
;
507 enum sunrpc_msg_type direction
;
509 rp
= (const struct sunrpc_msg
*)(up
+ 1);
510 if (ND_TTEST(rp
->rm_direction
)) {
511 direction
= (enum sunrpc_msg_type
) EXTRACT_BE_U_4(&rp
->rm_direction
);
512 if (dport
== NFS_PORT
&& direction
== SUNRPC_CALL
) {
513 ND_PRINT((ndo
, "NFS request xid %u ", EXTRACT_BE_U_4(&rp
->rm_xid
)));
514 nfsreq_noaddr_print(ndo
, (const u_char
*)rp
, length
,
518 if (sport
== NFS_PORT
&& direction
== SUNRPC_REPLY
) {
519 ND_PRINT((ndo
, "NFS reply xid %u ", EXTRACT_BE_U_4(&rp
->rm_xid
)));
520 nfsreply_noaddr_print(ndo
, (const u_char
*)rp
, length
,
525 if (dport
== SUNRPC_PORT
&& direction
== SUNRPC_CALL
) {
526 sunrpc_print((const u_char
*)rp
, length
, (const u_char
*)ip
);
533 if (ndo
->ndo_vflag
&& !ndo
->ndo_Kflag
&& !fragmented
) {
534 /* Check the checksum, if possible. */
535 uint16_t sum
, udp_sum
;
538 * XXX - do this even if vflag == 1?
539 * TCP does, and we do so for UDP-over-IPv6.
541 if (IP_V(ip
) == 4 && (ndo
->ndo_vflag
> 1)) {
542 udp_sum
= EXTRACT_BE_U_2(up
->uh_sum
);
544 ND_PRINT((ndo
, "[no cksum] "));
545 } else if (ND_TTEST2(cp
[0], length
)) {
546 sum
= udp_cksum(ndo
, ip
, up
, length
+ sizeof(struct udphdr
));
549 ND_PRINT((ndo
, "[bad udp cksum 0x%04x -> 0x%04x!] ",
551 in_cksum_shouldbe(udp_sum
, sum
)));
553 ND_PRINT((ndo
, "[udp sum ok] "));
556 else if (IP_V(ip
) == 6 && ip6
->ip6_plen
) {
557 /* for IPv6, UDP checksum is mandatory */
558 if (ND_TTEST2(cp
[0], length
)) {
559 sum
= udp6_cksum(ndo
, ip6
, up
, length
+ sizeof(struct udphdr
));
560 udp_sum
= EXTRACT_BE_U_2(up
->uh_sum
);
563 ND_PRINT((ndo
, "[bad udp cksum 0x%04x -> 0x%04x!] ",
565 in_cksum_shouldbe(udp_sum
, sum
)));
567 ND_PRINT((ndo
, "[udp sum ok] "));
572 if (!ndo
->ndo_qflag
) {
573 if (IS_SRC_OR_DST_PORT(NAMESERVER_PORT
))
574 domain_print(ndo
, (const u_char
*)(up
+ 1), length
, 0);
575 else if (IS_SRC_OR_DST_PORT(MULTICASTDNS_PORT
))
576 domain_print(ndo
, (const u_char
*)(up
+ 1), length
, 1);
577 else if (IS_SRC_OR_DST_PORT(TIMED_PORT
))
578 timed_print(ndo
, (const u_char
*)(up
+ 1));
579 else if (IS_SRC_OR_DST_PORT(TFTP_PORT
))
580 tftp_print(ndo
, (const u_char
*)(up
+ 1), length
);
581 else if (IS_SRC_OR_DST_PORT(BOOTPC_PORT
) || IS_SRC_OR_DST_PORT(BOOTPS_PORT
))
582 bootp_print(ndo
, (const u_char
*)(up
+ 1), length
);
583 else if (IS_SRC_OR_DST_PORT(RIP_PORT
))
584 rip_print(ndo
, (const u_char
*)(up
+ 1), length
);
585 else if (IS_SRC_OR_DST_PORT(AODV_PORT
))
586 aodv_print(ndo
, (const u_char
*)(up
+ 1), length
,
588 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT
))
589 isakmp_print(ndo
, (const u_char
*)(up
+ 1), length
, bp2
);
590 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_NATT
))
591 isakmp_rfc3948_print(ndo
, (const u_char
*)(up
+ 1), length
, bp2
);
592 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER1
) || IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER2
))
593 isakmp_print(ndo
, (const u_char
*)(up
+ 1), length
, bp2
);
594 else if (IS_SRC_OR_DST_PORT(SNMP_PORT
) || IS_SRC_OR_DST_PORT(SNMPTRAP_PORT
))
595 snmp_print(ndo
, (const u_char
*)(up
+ 1), length
);
596 else if (IS_SRC_OR_DST_PORT(NTP_PORT
))
597 ntp_print(ndo
, (const u_char
*)(up
+ 1), length
);
598 else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT
) || IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT
))
599 krb_print(ndo
, (const void *)(up
+ 1));
600 else if (IS_SRC_OR_DST_PORT(L2TP_PORT
))
601 l2tp_print(ndo
, (const u_char
*)(up
+ 1), length
);
603 else if (IS_SRC_OR_DST_PORT(NETBIOS_NS_PORT
))
604 nbt_udp137_print(ndo
, (const u_char
*)(up
+ 1), length
);
605 else if (IS_SRC_OR_DST_PORT(NETBIOS_DGRAM_PORT
))
606 nbt_udp138_print(ndo
, (const u_char
*)(up
+ 1), length
);
608 else if (dport
== VAT_PORT
)
609 vat_print(ndo
, (const void *)(up
+ 1), up
);
610 else if (IS_SRC_OR_DST_PORT(ZEPHYR_SRV_PORT
) || IS_SRC_OR_DST_PORT(ZEPHYR_CLT_PORT
))
611 zephyr_print(ndo
, (const void *)(up
+ 1), length
);
613 * Since there are 10 possible ports to check, I think
614 * a <> test would be more efficient
616 else if ((sport
>= RX_PORT_LOW
&& sport
<= RX_PORT_HIGH
) ||
617 (dport
>= RX_PORT_LOW
&& dport
<= RX_PORT_HIGH
))
618 rx_print(ndo
, (const void *)(up
+ 1), length
, sport
, dport
,
619 (const u_char
*) ip
);
620 else if (IS_SRC_OR_DST_PORT(RIPNG_PORT
))
621 ripng_print(ndo
, (const u_char
*)(up
+ 1), length
);
622 else if (IS_SRC_OR_DST_PORT(DHCP6_SERV_PORT
) || IS_SRC_OR_DST_PORT(DHCP6_CLI_PORT
))
623 dhcp6_print(ndo
, (const u_char
*)(up
+ 1), length
);
624 else if (IS_SRC_OR_DST_PORT(AHCP_PORT
))
625 ahcp_print(ndo
, (const u_char
*)(up
+ 1), length
);
626 else if (IS_SRC_OR_DST_PORT(BABEL_PORT
) || IS_SRC_OR_DST_PORT(BABEL_PORT_OLD
))
627 babel_print(ndo
, (const u_char
*)(up
+ 1), length
);
628 else if (IS_SRC_OR_DST_PORT(HNCP_PORT
))
629 hncp_print(ndo
, (const u_char
*)(up
+ 1), length
);
631 * Kludge in test for whiteboard packets.
633 else if (dport
== WB_PORT
)
634 wb_print(ndo
, (const void *)(up
+ 1), length
);
635 else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT
))
636 cisco_autorp_print(ndo
, (const void *)(up
+ 1), length
);
637 else if (IS_SRC_OR_DST_PORT(RADIUS_PORT
) ||
638 IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT
) ||
639 IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT
) ||
640 IS_SRC_OR_DST_PORT(RADIUS_NEW_ACCOUNTING_PORT
) ||
641 IS_SRC_OR_DST_PORT(RADIUS_CISCO_COA_PORT
) ||
642 IS_SRC_OR_DST_PORT(RADIUS_COA_PORT
) )
643 radius_print(ndo
, (const u_char
*)(up
+1), length
);
644 else if (dport
== HSRP_PORT
)
645 hsrp_print(ndo
, (const u_char
*)(up
+ 1), length
);
646 else if (IS_SRC_OR_DST_PORT(LWRES_PORT
))
647 lwres_print(ndo
, (const u_char
*)(up
+ 1), length
);
648 else if (IS_SRC_OR_DST_PORT(LDP_PORT
))
649 ldp_print(ndo
, (const u_char
*)(up
+ 1), length
);
650 else if (IS_SRC_OR_DST_PORT(OLSR_PORT
))
651 olsr_print(ndo
, (const u_char
*)(up
+ 1), length
,
652 (IP_V(ip
) == 6) ? 1 : 0);
653 else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT
))
654 lspping_print(ndo
, (const u_char
*)(up
+ 1), length
);
655 else if (dport
== BFD_CONTROL_PORT
||
656 dport
== BFD_ECHO_PORT
)
657 bfd_print(ndo
, (const u_char
*)(up
+1), length
, dport
);
658 else if (IS_SRC_OR_DST_PORT(LMP_PORT
))
659 lmp_print(ndo
, (const u_char
*)(up
+ 1), length
);
660 else if (IS_SRC_OR_DST_PORT(VQP_PORT
))
661 vqp_print(ndo
, (const u_char
*)(up
+ 1), length
);
662 else if (IS_SRC_OR_DST_PORT(SFLOW_PORT
))
663 sflow_print(ndo
, (const u_char
*)(up
+ 1), length
);
664 else if (dport
== LWAPP_CONTROL_PORT
)
665 lwapp_control_print(ndo
, (const u_char
*)(up
+ 1), length
, 1);
666 else if (sport
== LWAPP_CONTROL_PORT
)
667 lwapp_control_print(ndo
, (const u_char
*)(up
+ 1), length
, 0);
668 else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT
))
669 lwapp_data_print(ndo
, (const u_char
*)(up
+ 1), length
);
670 else if (IS_SRC_OR_DST_PORT(SIP_PORT
))
671 sip_print(ndo
, (const u_char
*)(up
+ 1), length
);
672 else if (IS_SRC_OR_DST_PORT(SYSLOG_PORT
))
673 syslog_print(ndo
, (const u_char
*)(up
+ 1), length
);
674 else if (IS_SRC_OR_DST_PORT(OTV_PORT
))
675 otv_print(ndo
, (const u_char
*)(up
+ 1), length
);
676 else if (IS_SRC_OR_DST_PORT(VXLAN_PORT
))
677 vxlan_print(ndo
, (const u_char
*)(up
+ 1), length
);
678 else if (IS_SRC_OR_DST_PORT(GENEVE_PORT
))
679 geneve_print(ndo
, (const u_char
*)(up
+ 1), length
);
680 else if (IS_SRC_OR_DST_PORT(LISP_CONTROL_PORT
))
681 lisp_print(ndo
, (const u_char
*)(up
+ 1), length
);
682 else if (IS_SRC_OR_DST_PORT(VXLAN_GPE_PORT
))
683 vxlan_gpe_print(ndo
, (const u_char
*)(up
+ 1), length
);
684 else if (ND_TTEST(((const struct LAP
*)cp
)->type
) &&
685 ((const struct LAP
*)cp
)->type
== lapDDP
&&
686 (atalk_port(sport
) || atalk_port(dport
))) {
688 ND_PRINT((ndo
, "kip "));
689 llap_print(ndo
, cp
, length
);
692 ND_PRINT((ndo
, "UDP, bad length %u > %u",
695 ND_PRINT((ndo
, "UDP, length %u", ulen
));
699 ND_PRINT((ndo
, "UDP, bad length %u > %u",
702 ND_PRINT((ndo
, "UDP, length %u", ulen
));
707 ND_PRINT((ndo
, "%s", udp_tstr
));
713 * c-style: whitesmith