]> The Tcpdump Group git mirrors - tcpdump/blob - print-udp.c
fix partial checksum errors in DCCP decoder, IPv4 case
[tcpdump] / print-udp.c
1 /*
2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
3 * The Regents of the University of California. All rights reserved.
4 *
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
16 * written permission.
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.
20 */
21
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25
26 #include <tcpdump-stdinc.h>
27
28 #ifdef SEGSIZE
29 #undef SEGSIZE
30 #endif
31
32 #include <stdio.h>
33 #include <string.h>
34
35 #include "interface.h"
36 #include "addrtoname.h"
37 #include "extract.h"
38 #include "appletalk.h"
39
40 #include "udp.h"
41
42 #include "ip.h"
43 #ifdef INET6
44 #include "ip6.h"
45 #endif
46 #include "ipproto.h"
47 #include "rpc_auth.h"
48 #include "rpc_msg.h"
49
50 #include "nameser.h"
51 #include "nfs.h"
52 #include "bootp.h"
53
54 struct rtcphdr {
55 u_int16_t rh_flags; /* T:2 P:1 CNT:5 PT:8 */
56 u_int16_t rh_len; /* length of message (in words) */
57 u_int32_t rh_ssrc; /* synchronization src id */
58 };
59
60 typedef struct {
61 u_int32_t upper; /* more significant 32 bits */
62 u_int32_t lower; /* less significant 32 bits */
63 } ntp64;
64
65 /*
66 * Sender report.
67 */
68 struct rtcp_sr {
69 ntp64 sr_ntp; /* 64-bit ntp timestamp */
70 u_int32_t sr_ts; /* reference media timestamp */
71 u_int32_t sr_np; /* no. packets sent */
72 u_int32_t sr_nb; /* no. bytes sent */
73 };
74
75 /*
76 * Receiver report.
77 * Time stamps are middle 32-bits of ntp timestamp.
78 */
79 struct rtcp_rr {
80 u_int32_t rr_srcid; /* sender being reported */
81 u_int32_t rr_nl; /* no. packets lost */
82 u_int32_t rr_ls; /* extended last seq number received */
83 u_int32_t rr_dv; /* jitter (delay variance) */
84 u_int32_t rr_lsr; /* orig. ts from last rr from this src */
85 u_int32_t rr_dlsr; /* time from recpt of last rr to xmit time */
86 };
87
88 /*XXX*/
89 #define RTCP_PT_SR 200
90 #define RTCP_PT_RR 201
91 #define RTCP_PT_SDES 202
92 #define RTCP_SDES_CNAME 1
93 #define RTCP_SDES_NAME 2
94 #define RTCP_SDES_EMAIL 3
95 #define RTCP_SDES_PHONE 4
96 #define RTCP_SDES_LOC 5
97 #define RTCP_SDES_TOOL 6
98 #define RTCP_SDES_NOTE 7
99 #define RTCP_SDES_PRIV 8
100 #define RTCP_PT_BYE 203
101 #define RTCP_PT_APP 204
102
103 static void
104 vat_print(const void *hdr, register const struct udphdr *up)
105 {
106 /* vat/vt audio */
107 u_int ts = *(u_int16_t *)hdr;
108 if ((ts & 0xf060) != 0) {
109 /* probably vt */
110 (void)printf("udp/vt %u %d / %d",
111 (u_int32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up)),
112 ts & 0x3ff, ts >> 10);
113 } else {
114 /* probably vat */
115 u_int32_t i0 = EXTRACT_32BITS(&((u_int *)hdr)[0]);
116 u_int32_t i1 = EXTRACT_32BITS(&((u_int *)hdr)[1]);
117 printf("udp/vat %u c%d %u%s",
118 (u_int32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8),
119 i0 & 0xffff,
120 i1, i0 & 0x800000? "*" : "");
121 /* audio format */
122 if (i0 & 0x1f0000)
123 printf(" f%d", (i0 >> 16) & 0x1f);
124 if (i0 & 0x3f000000)
125 printf(" s%d", (i0 >> 24) & 0x3f);
126 }
127 }
128
129 static void
130 rtp_print(const void *hdr, u_int len, register const struct udphdr *up)
131 {
132 /* rtp v1 or v2 */
133 u_int *ip = (u_int *)hdr;
134 u_int hasopt, hasext, contype, hasmarker;
135 u_int32_t i0 = EXTRACT_32BITS(&((u_int *)hdr)[0]);
136 u_int32_t i1 = EXTRACT_32BITS(&((u_int *)hdr)[1]);
137 u_int dlen = EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8;
138 const char * ptype;
139
140 ip += 2;
141 len >>= 2;
142 len -= 2;
143 hasopt = 0;
144 hasext = 0;
145 if ((i0 >> 30) == 1) {
146 /* rtp v1 */
147 hasopt = i0 & 0x800000;
148 contype = (i0 >> 16) & 0x3f;
149 hasmarker = i0 & 0x400000;
150 ptype = "rtpv1";
151 } else {
152 /* rtp v2 */
153 hasext = i0 & 0x10000000;
154 contype = (i0 >> 16) & 0x7f;
155 hasmarker = i0 & 0x800000;
156 dlen -= 4;
157 ptype = "rtp";
158 ip += 1;
159 len -= 1;
160 }
161 printf("udp/%s %d c%d %s%s %d %u",
162 ptype,
163 dlen,
164 contype,
165 (hasopt || hasext)? "+" : "",
166 hasmarker? "*" : "",
167 i0 & 0xffff,
168 i1);
169 if (vflag) {
170 printf(" %u", EXTRACT_32BITS(&((u_int *)hdr)[2]));
171 if (hasopt) {
172 u_int i2, optlen;
173 do {
174 i2 = ip[0];
175 optlen = (i2 >> 16) & 0xff;
176 if (optlen == 0 || optlen > len) {
177 printf(" !opt");
178 return;
179 }
180 ip += optlen;
181 len -= optlen;
182 } while ((int)i2 >= 0);
183 }
184 if (hasext) {
185 u_int i2, extlen;
186 i2 = ip[0];
187 extlen = (i2 & 0xffff) + 1;
188 if (extlen > len) {
189 printf(" !ext");
190 return;
191 }
192 ip += extlen;
193 }
194 if (contype == 0x1f) /*XXX H.261 */
195 printf(" 0x%04x", ip[0] >> 16);
196 }
197 }
198
199 static const u_char *
200 rtcp_print(const u_char *hdr, const u_char *ep)
201 {
202 /* rtp v2 control (rtcp) */
203 struct rtcp_rr *rr = 0;
204 struct rtcp_sr *sr;
205 struct rtcphdr *rh = (struct rtcphdr *)hdr;
206 u_int len;
207 u_int16_t flags;
208 int cnt;
209 double ts, dts;
210 if ((u_char *)(rh + 1) > ep) {
211 printf(" [|rtcp]");
212 return (ep);
213 }
214 len = (EXTRACT_16BITS(&rh->rh_len) + 1) * 4;
215 flags = EXTRACT_16BITS(&rh->rh_flags);
216 cnt = (flags >> 8) & 0x1f;
217 switch (flags & 0xff) {
218 case RTCP_PT_SR:
219 sr = (struct rtcp_sr *)(rh + 1);
220 printf(" sr");
221 if (len != cnt * sizeof(*rr) + sizeof(*sr) + sizeof(*rh))
222 printf(" [%d]", len);
223 if (vflag)
224 printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc));
225 if ((u_char *)(sr + 1) > ep) {
226 printf(" [|rtcp]");
227 return (ep);
228 }
229 ts = (double)(EXTRACT_32BITS(&sr->sr_ntp.upper)) +
230 ((double)(EXTRACT_32BITS(&sr->sr_ntp.lower)) /
231 4294967296.0);
232 printf(" @%.2f %u %up %ub", ts, EXTRACT_32BITS(&sr->sr_ts),
233 EXTRACT_32BITS(&sr->sr_np), EXTRACT_32BITS(&sr->sr_nb));
234 rr = (struct rtcp_rr *)(sr + 1);
235 break;
236 case RTCP_PT_RR:
237 printf(" rr");
238 if (len != cnt * sizeof(*rr) + sizeof(*rh))
239 printf(" [%d]", len);
240 rr = (struct rtcp_rr *)(rh + 1);
241 if (vflag)
242 printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc));
243 break;
244 case RTCP_PT_SDES:
245 printf(" sdes %d", len);
246 if (vflag)
247 printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc));
248 cnt = 0;
249 break;
250 case RTCP_PT_BYE:
251 printf(" bye %d", len);
252 if (vflag)
253 printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc));
254 cnt = 0;
255 break;
256 default:
257 printf(" type-0x%x %d", flags & 0xff, len);
258 cnt = 0;
259 break;
260 }
261 if (cnt > 1)
262 printf(" c%d", cnt);
263 while (--cnt >= 0) {
264 if ((u_char *)(rr + 1) > ep) {
265 printf(" [|rtcp]");
266 return (ep);
267 }
268 if (vflag)
269 printf(" %u", EXTRACT_32BITS(&rr->rr_srcid));
270 ts = (double)(EXTRACT_32BITS(&rr->rr_lsr)) / 65536.;
271 dts = (double)(EXTRACT_32BITS(&rr->rr_dlsr)) / 65536.;
272 printf(" %ul %us %uj @%.2f+%.2f",
273 EXTRACT_32BITS(&rr->rr_nl) & 0x00ffffff,
274 EXTRACT_32BITS(&rr->rr_ls),
275 EXTRACT_32BITS(&rr->rr_dv), ts, dts);
276 }
277 return (hdr + len);
278 }
279
280 static int udp_cksum(register const struct ip *ip,
281 register const struct udphdr *up,
282 register u_int len)
283 {
284 return nextproto4_cksum(ip, (const u_int8_t *)(void *)up, len, len,
285 IPPROTO_UDP);
286 }
287
288 #ifdef INET6
289 static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up,
290 u_int len)
291 {
292 return (nextproto6_cksum(ip6, (const u_int8_t *)(void *)up, len,
293 IPPROTO_UDP));
294 }
295 #endif
296
297 static void
298 udpipaddr_print(const struct ip *ip, int sport, int dport)
299 {
300 #ifdef INET6
301 const struct ip6_hdr *ip6;
302
303 if (IP_V(ip) == 6)
304 ip6 = (const struct ip6_hdr *)ip;
305 else
306 ip6 = NULL;
307
308 if (ip6) {
309 if (ip6->ip6_nxt == IPPROTO_UDP) {
310 if (sport == -1) {
311 (void)printf("%s > %s: ",
312 ip6addr_string(&ip6->ip6_src),
313 ip6addr_string(&ip6->ip6_dst));
314 } else {
315 (void)printf("%s.%s > %s.%s: ",
316 ip6addr_string(&ip6->ip6_src),
317 udpport_string(sport),
318 ip6addr_string(&ip6->ip6_dst),
319 udpport_string(dport));
320 }
321 } else {
322 if (sport != -1) {
323 (void)printf("%s > %s: ",
324 udpport_string(sport),
325 udpport_string(dport));
326 }
327 }
328 } else
329 #endif /*INET6*/
330 {
331 if (ip->ip_p == IPPROTO_UDP) {
332 if (sport == -1) {
333 (void)printf("%s > %s: ",
334 ipaddr_string(&ip->ip_src),
335 ipaddr_string(&ip->ip_dst));
336 } else {
337 (void)printf("%s.%s > %s.%s: ",
338 ipaddr_string(&ip->ip_src),
339 udpport_string(sport),
340 ipaddr_string(&ip->ip_dst),
341 udpport_string(dport));
342 }
343 } else {
344 if (sport != -1) {
345 (void)printf("%s > %s: ",
346 udpport_string(sport),
347 udpport_string(dport));
348 }
349 }
350 }
351 }
352
353 void
354 udp_print(register const u_char *bp, u_int length,
355 register const u_char *bp2, int fragmented)
356 {
357 register const struct udphdr *up;
358 register const struct ip *ip;
359 register const u_char *cp;
360 register const u_char *ep = bp + length;
361 u_int16_t sport, dport, ulen;
362 #ifdef INET6
363 register const struct ip6_hdr *ip6;
364 #endif
365
366 if (ep > snapend)
367 ep = snapend;
368 up = (struct udphdr *)bp;
369 ip = (struct ip *)bp2;
370 #ifdef INET6
371 if (IP_V(ip) == 6)
372 ip6 = (struct ip6_hdr *)bp2;
373 else
374 ip6 = NULL;
375 #endif /*INET6*/
376 cp = (u_char *)(up + 1);
377 if (!TTEST(up->uh_dport)) {
378 udpipaddr_print(ip, -1, -1);
379 (void)printf("[|udp]");
380 return;
381 }
382
383 sport = EXTRACT_16BITS(&up->uh_sport);
384 dport = EXTRACT_16BITS(&up->uh_dport);
385
386 if (length < sizeof(struct udphdr)) {
387 udpipaddr_print(ip, sport, dport);
388 (void)printf("truncated-udp %d", length);
389 return;
390 }
391 length -= sizeof(struct udphdr);
392
393 if (cp > snapend) {
394 udpipaddr_print(ip, sport, dport);
395 (void)printf("[|udp]");
396 return;
397 }
398
399 ulen = EXTRACT_16BITS(&up->uh_ulen);
400 if (ulen < 8) {
401 udpipaddr_print(ip, sport, dport);
402 (void)printf("truncated-udplength %d", ulen);
403 return;
404 }
405 if (packettype) {
406 register struct sunrpc_msg *rp;
407 enum sunrpc_msg_type direction;
408
409 switch (packettype) {
410
411 case PT_VAT:
412 udpipaddr_print(ip, sport, dport);
413 vat_print((void *)(up + 1), up);
414 break;
415
416 case PT_WB:
417 udpipaddr_print(ip, sport, dport);
418 wb_print((void *)(up + 1), length);
419 break;
420
421 case PT_RPC:
422 rp = (struct sunrpc_msg *)(up + 1);
423 direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction);
424 if (direction == SUNRPC_CALL)
425 sunrpcrequest_print((u_char *)rp, length,
426 (u_char *)ip);
427 else
428 nfsreply_print((u_char *)rp, length,
429 (u_char *)ip); /*XXX*/
430 break;
431
432 case PT_RTP:
433 udpipaddr_print(ip, sport, dport);
434 rtp_print((void *)(up + 1), length, up);
435 break;
436
437 case PT_RTCP:
438 udpipaddr_print(ip, sport, dport);
439 while (cp < ep)
440 cp = rtcp_print(cp, ep);
441 break;
442
443 case PT_SNMP:
444 udpipaddr_print(ip, sport, dport);
445 snmp_print((const u_char *)(up + 1), length);
446 break;
447
448 case PT_CNFP:
449 udpipaddr_print(ip, sport, dport);
450 cnfp_print(cp, (const u_char *)ip);
451 break;
452
453 case PT_TFTP:
454 udpipaddr_print(ip, sport, dport);
455 tftp_print(cp, length);
456 break;
457
458 case PT_AODV:
459 udpipaddr_print(ip, sport, dport);
460 aodv_print((const u_char *)(up + 1), length,
461 #ifdef INET6
462 ip6 != NULL);
463 #else
464 0);
465 #endif
466 break;
467
468 case PT_RADIUS:
469 udpipaddr_print(ip, sport, dport);
470 radius_print(cp, length);
471 break;
472
473 case PT_VXLAN:
474 udpipaddr_print(ip, sport, dport);
475 vxlan_print((const u_char *)(up + 1), length);
476 break;
477
478 case PT_PGM:
479 case PT_PGM_ZMTP1:
480 udpipaddr_print(ip, sport, dport);
481 pgm_print(cp, length, bp2);
482 break;
483 case PT_LMP:
484 udpipaddr_print(ip, sport, dport);
485 lmp_print(cp, length);
486 break;
487 }
488 return;
489 }
490
491 if (!qflag) {
492 register struct sunrpc_msg *rp;
493 enum sunrpc_msg_type direction;
494
495 rp = (struct sunrpc_msg *)(up + 1);
496 if (TTEST(rp->rm_direction)) {
497 direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction);
498 if (dport == NFS_PORT && direction == SUNRPC_CALL) {
499 nfsreq_print((u_char *)rp, length,
500 (u_char *)ip);
501 return;
502 }
503 if (sport == NFS_PORT && direction == SUNRPC_REPLY) {
504 nfsreply_print((u_char *)rp, length,
505 (u_char *)ip);
506 return;
507 }
508 #ifdef notdef
509 if (dport == SUNRPC_PORT && direction == SUNRPC_CALL) {
510 sunrpcrequest_print((u_char *)rp, length, (u_char *)ip);
511 return;
512 }
513 #endif
514 }
515 if (TTEST(((struct LAP *)cp)->type) &&
516 ((struct LAP *)cp)->type == lapDDP &&
517 (atalk_port(sport) || atalk_port(dport))) {
518 if (vflag)
519 fputs("kip ", stdout);
520 llap_print(cp, length);
521 return;
522 }
523 }
524 udpipaddr_print(ip, sport, dport);
525
526 if (vflag && !Kflag && !fragmented) {
527 /* Check the checksum, if possible. */
528 u_int16_t sum, udp_sum;
529
530 /*
531 * XXX - do this even if vflag == 1?
532 * TCP does, and we do so for UDP-over-IPv6.
533 */
534 if (IP_V(ip) == 4 && (vflag > 1)) {
535 udp_sum = EXTRACT_16BITS(&up->uh_sum);
536 if (udp_sum == 0) {
537 (void)printf("[no cksum] ");
538 } else if (TTEST2(cp[0], length)) {
539 sum = udp_cksum(ip, up, length + sizeof(struct udphdr));
540
541 if (sum != 0) {
542 (void)printf("[bad udp cksum 0x%04x -> 0x%04x!] ",
543 udp_sum,
544 in_cksum_shouldbe(udp_sum, sum));
545 } else
546 (void)printf("[udp sum ok] ");
547 }
548 }
549 #ifdef INET6
550 else if (IP_V(ip) == 6 && ip6->ip6_plen) {
551 /* for IPv6, UDP checksum is mandatory */
552 if (TTEST2(cp[0], length)) {
553 sum = udp6_cksum(ip6, up, length + sizeof(struct udphdr));
554 udp_sum = EXTRACT_16BITS(&up->uh_sum);
555
556 if (sum != 0) {
557 (void)printf("[bad udp cksum 0x%04x -> 0x%04x!] ",
558 udp_sum,
559 in_cksum_shouldbe(udp_sum, sum));
560 } else
561 (void)printf("[udp sum ok] ");
562 }
563 }
564 #endif
565 }
566
567 if (!qflag) {
568 #define ISPORT(p) (dport == (p) || sport == (p))
569 if (ISPORT(NAMESERVER_PORT))
570 ns_print((const u_char *)(up + 1), length, 0);
571 else if (ISPORT(MULTICASTDNS_PORT))
572 ns_print((const u_char *)(up + 1), length, 1);
573 else if (ISPORT(TIMED_PORT))
574 timed_print((const u_char *)(up + 1));
575 else if (ISPORT(TFTP_PORT))
576 tftp_print((const u_char *)(up + 1), length);
577 else if (ISPORT(IPPORT_BOOTPC) || ISPORT(IPPORT_BOOTPS))
578 bootp_print((const u_char *)(up + 1), length);
579 else if (ISPORT(RIP_PORT))
580 rip_print((const u_char *)(up + 1), length);
581 else if (ISPORT(AODV_PORT))
582 aodv_print((const u_char *)(up + 1), length,
583 #ifdef INET6
584 ip6 != NULL);
585 #else
586 0);
587 #endif
588 else if (ISPORT(ISAKMP_PORT))
589 isakmp_print(gndo, (const u_char *)(up + 1), length, bp2);
590 else if (ISPORT(ISAKMP_PORT_NATT))
591 isakmp_rfc3948_print(gndo, (const u_char *)(up + 1), length, bp2);
592 #if 1 /*???*/
593 else if (ISPORT(ISAKMP_PORT_USER1) || ISPORT(ISAKMP_PORT_USER2))
594 isakmp_print(gndo, (const u_char *)(up + 1), length, bp2);
595 #endif
596 else if (ISPORT(SNMP_PORT) || ISPORT(SNMPTRAP_PORT))
597 snmp_print((const u_char *)(up + 1), length);
598 else if (ISPORT(NTP_PORT))
599 ntp_print((const u_char *)(up + 1), length);
600 else if (ISPORT(KERBEROS_PORT) || ISPORT(KERBEROS_SEC_PORT))
601 krb_print((const void *)(up + 1));
602 else if (ISPORT(L2TP_PORT))
603 l2tp_print((const u_char *)(up + 1), length);
604 #ifdef TCPDUMP_DO_SMB
605 else if (ISPORT(NETBIOS_NS_PORT))
606 nbt_udp137_print((const u_char *)(up + 1), length);
607 else if (ISPORT(NETBIOS_DGRAM_PORT))
608 nbt_udp138_print((const u_char *)(up + 1), length);
609 #endif
610 else if (dport == VAT_PORT)
611 vat_print((const void *)(up + 1), up);
612 else if (ISPORT(ZEPHYR_SRV_PORT) || ISPORT(ZEPHYR_CLT_PORT))
613 zephyr_print((const void *)(up + 1), length);
614 /*
615 * Since there are 10 possible ports to check, I think
616 * a <> test would be more efficient
617 */
618 else if ((sport >= RX_PORT_LOW && sport <= RX_PORT_HIGH) ||
619 (dport >= RX_PORT_LOW && dport <= RX_PORT_HIGH))
620 rx_print((const void *)(up + 1), length, sport, dport,
621 (u_char *) ip);
622 #ifdef INET6
623 else if (ISPORT(RIPNG_PORT))
624 ripng_print((const u_char *)(up + 1), length);
625 else if (ISPORT(DHCP6_SERV_PORT) || ISPORT(DHCP6_CLI_PORT))
626 dhcp6_print((const u_char *)(up + 1), length);
627 else if (ISPORT(AHCP_PORT))
628 ahcp_print((const u_char *)(up + 1), length);
629 else if (ISPORT(BABEL_PORT) || ISPORT(BABEL_PORT_OLD))
630 babel_print((const u_char *)(up + 1), length);
631 #endif /*INET6*/
632 /*
633 * Kludge in test for whiteboard packets.
634 */
635 else if (dport == WB_PORT)
636 wb_print((const void *)(up + 1), length);
637 else if (ISPORT(CISCO_AUTORP_PORT))
638 cisco_autorp_print((const void *)(up + 1), length);
639 else if (ISPORT(RADIUS_PORT) ||
640 ISPORT(RADIUS_NEW_PORT) ||
641 ISPORT(RADIUS_ACCOUNTING_PORT) ||
642 ISPORT(RADIUS_NEW_ACCOUNTING_PORT) )
643 radius_print((const u_char *)(up+1), length);
644 else if (dport == HSRP_PORT)
645 hsrp_print((const u_char *)(up + 1), length);
646 else if (ISPORT(LWRES_PORT))
647 lwres_print((const u_char *)(up + 1), length);
648 else if (ISPORT(LDP_PORT))
649 ldp_print((const u_char *)(up + 1), length);
650 else if (ISPORT(OLSR_PORT))
651 olsr_print((const u_char *)(up + 1), length,
652 #if INET6
653 (IP_V(ip) == 6) ? 1 : 0);
654 #else
655 0);
656 #endif
657 else if (ISPORT(MPLS_LSP_PING_PORT))
658 lspping_print((const u_char *)(up + 1), length);
659 else if (dport == BFD_CONTROL_PORT ||
660 dport == BFD_ECHO_PORT )
661 bfd_print((const u_char *)(up+1), length, dport);
662 else if (ISPORT(LMP_PORT))
663 lmp_print((const u_char *)(up + 1), length);
664 else if (ISPORT(VQP_PORT))
665 vqp_print((const u_char *)(up + 1), length);
666 else if (ISPORT(SFLOW_PORT))
667 sflow_print((const u_char *)(up + 1), length);
668 else if (dport == LWAPP_CONTROL_PORT)
669 lwapp_control_print((const u_char *)(up + 1), length, 1);
670 else if (sport == LWAPP_CONTROL_PORT)
671 lwapp_control_print((const u_char *)(up + 1), length, 0);
672 else if (ISPORT(LWAPP_DATA_PORT))
673 lwapp_data_print((const u_char *)(up + 1), length);
674 else if (ISPORT(SIP_PORT))
675 sip_print((const u_char *)(up + 1), length);
676 else if (ISPORT(SYSLOG_PORT))
677 syslog_print((const u_char *)(up + 1), length);
678 else if (ISPORT(OTV_PORT))
679 otv_print((const u_char *)(up + 1), length);
680 else if (ISPORT(VXLAN_PORT))
681 vxlan_print((const u_char *)(up + 1), length);
682 else
683 (void)printf("UDP, length %u",
684 (u_int32_t)(ulen - sizeof(*up)));
685 #undef ISPORT
686 } else
687 (void)printf("UDP, length %u", (u_int32_t)(ulen - sizeof(*up)));
688 }
689
690
691 /*
692 * Local Variables:
693 * c-style: whitesmith
694 * c-basic-offset: 8
695 * End:
696 */
697