Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / tcpdump / print-udp.c
blob52f5186bb3dfc38a30dbe3b0e96a3df82571e57b
1 /* $NetBSD$ */
3 /*
4 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that: (1) source code distributions
9 * retain the above copyright notice and this paragraph in its entirety, (2)
10 * distributions including binary code include the above copyright notice and
11 * this paragraph in its entirety in the documentation or other materials
12 * provided with the distribution, and (3) all advertising materials mentioning
13 * features or use of this software display the following acknowledgement:
14 * ``This product includes software developed by the University of California,
15 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
16 * the University nor the names of its contributors may be used to endorse
17 * or promote products derived from this software without specific prior
18 * written permission.
19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
24 #include <sys/cdefs.h>
25 #ifndef lint
26 #if 0
27 static const char rcsid[] _U_ =
28 "@(#) Header: /tcpdump/master/tcpdump/print-udp.c,v 1.138.2.1 2007/03/28 07:45:46 hannes Exp (LBL)";
29 #else
30 __RCSID("$NetBSD: tcpdump2rcsid.ex,v 1.1 2001/06/25 20:09:58 itojun Exp $");
31 #endif
32 #endif
34 #ifdef HAVE_CONFIG_H
35 #include "config.h"
36 #endif
38 #include <tcpdump-stdinc.h>
40 #ifdef SEGSIZE
41 #undef SEGSIZE
42 #endif
43 #include <arpa/tftp.h>
45 #include <stdio.h>
46 #include <string.h>
48 #include "interface.h"
49 #include "addrtoname.h"
50 #include "extract.h"
51 #include "appletalk.h"
53 #include "udp.h"
55 #include "ip.h"
56 #ifdef INET6
57 #include "ip6.h"
58 #endif
59 #include "ipproto.h"
60 #include "rpc_auth.h"
61 #include "rpc_msg.h"
63 #include "nameser.h"
64 #include "nfs.h"
65 #include "bootp.h"
67 struct rtcphdr {
68 u_int16_t rh_flags; /* T:2 P:1 CNT:5 PT:8 */
69 u_int16_t rh_len; /* length of message (in words) */
70 u_int32_t rh_ssrc; /* synchronization src id */
73 typedef struct {
74 u_int32_t upper; /* more significant 32 bits */
75 u_int32_t lower; /* less significant 32 bits */
76 } ntp64;
79 * Sender report.
81 struct rtcp_sr {
82 ntp64 sr_ntp; /* 64-bit ntp timestamp */
83 u_int32_t sr_ts; /* reference media timestamp */
84 u_int32_t sr_np; /* no. packets sent */
85 u_int32_t sr_nb; /* no. bytes sent */
89 * Receiver report.
90 * Time stamps are middle 32-bits of ntp timestamp.
92 struct rtcp_rr {
93 u_int32_t rr_srcid; /* sender being reported */
94 u_int32_t rr_nl; /* no. packets lost */
95 u_int32_t rr_ls; /* extended last seq number received */
96 u_int32_t rr_dv; /* jitter (delay variance) */
97 u_int32_t rr_lsr; /* orig. ts from last rr from this src */
98 u_int32_t rr_dlsr; /* time from recpt of last rr to xmit time */
101 /*XXX*/
102 #define RTCP_PT_SR 200
103 #define RTCP_PT_RR 201
104 #define RTCP_PT_SDES 202
105 #define RTCP_SDES_CNAME 1
106 #define RTCP_SDES_NAME 2
107 #define RTCP_SDES_EMAIL 3
108 #define RTCP_SDES_PHONE 4
109 #define RTCP_SDES_LOC 5
110 #define RTCP_SDES_TOOL 6
111 #define RTCP_SDES_NOTE 7
112 #define RTCP_SDES_PRIV 8
113 #define RTCP_PT_BYE 203
114 #define RTCP_PT_APP 204
116 static void
117 vat_print(const void *hdr, register const struct udphdr *up)
119 /* vat/vt audio */
120 u_int ts = *(u_int16_t *)hdr;
121 if ((ts & 0xf060) != 0) {
122 /* probably vt */
123 (void)printf("udp/vt %u %d / %d",
124 (u_int32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up)),
125 ts & 0x3ff, ts >> 10);
126 } else {
127 /* probably vat */
128 u_int32_t i0 = EXTRACT_32BITS(&((u_int *)hdr)[0]);
129 u_int32_t i1 = EXTRACT_32BITS(&((u_int *)hdr)[1]);
130 printf("udp/vat %u c%d %u%s",
131 (u_int32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8),
132 i0 & 0xffff,
133 i1, i0 & 0x800000? "*" : "");
134 /* audio format */
135 if (i0 & 0x1f0000)
136 printf(" f%d", (i0 >> 16) & 0x1f);
137 if (i0 & 0x3f000000)
138 printf(" s%d", (i0 >> 24) & 0x3f);
142 static void
143 rtp_print(const void *hdr, u_int len, register const struct udphdr *up)
145 /* rtp v1 or v2 */
146 u_int *ip = (u_int *)hdr;
147 u_int hasopt, hasext, contype, hasmarker;
148 u_int32_t i0 = EXTRACT_32BITS(&((u_int *)hdr)[0]);
149 u_int32_t i1 = EXTRACT_32BITS(&((u_int *)hdr)[1]);
150 u_int dlen = EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8;
151 const char * ptype;
153 ip += 2;
154 len >>= 2;
155 len -= 2;
156 hasopt = 0;
157 hasext = 0;
158 if ((i0 >> 30) == 1) {
159 /* rtp v1 */
160 hasopt = i0 & 0x800000;
161 contype = (i0 >> 16) & 0x3f;
162 hasmarker = i0 & 0x400000;
163 ptype = "rtpv1";
164 } else {
165 /* rtp v2 */
166 hasext = i0 & 0x10000000;
167 contype = (i0 >> 16) & 0x7f;
168 hasmarker = i0 & 0x800000;
169 dlen -= 4;
170 ptype = "rtp";
171 ip += 1;
172 len -= 1;
174 printf("udp/%s %d c%d %s%s %d %u",
175 ptype,
176 dlen,
177 contype,
178 (hasopt || hasext)? "+" : "",
179 hasmarker? "*" : "",
180 i0 & 0xffff,
181 i1);
182 if (vflag) {
183 printf(" %u", EXTRACT_32BITS(&((u_int *)hdr)[2]));
184 if (hasopt) {
185 u_int i2, optlen;
186 do {
187 i2 = ip[0];
188 optlen = (i2 >> 16) & 0xff;
189 if (optlen == 0 || optlen > len) {
190 printf(" !opt");
191 return;
193 ip += optlen;
194 len -= optlen;
195 } while ((int)i2 >= 0);
197 if (hasext) {
198 u_int i2, extlen;
199 i2 = ip[0];
200 extlen = (i2 & 0xffff) + 1;
201 if (extlen > len) {
202 printf(" !ext");
203 return;
205 ip += extlen;
207 if (contype == 0x1f) /*XXX H.261 */
208 printf(" 0x%04x", ip[0] >> 16);
212 static const u_char *
213 rtcp_print(const u_char *hdr, const u_char *ep)
215 /* rtp v2 control (rtcp) */
216 struct rtcp_rr *rr = 0;
217 struct rtcp_sr *sr;
218 struct rtcphdr *rh = (struct rtcphdr *)hdr;
219 u_int len;
220 u_int16_t flags;
221 int cnt;
222 double ts, dts;
223 if ((u_char *)(rh + 1) > ep) {
224 printf(" [|rtcp]");
225 return (ep);
227 len = (EXTRACT_16BITS(&rh->rh_len) + 1) * 4;
228 flags = EXTRACT_16BITS(&rh->rh_flags);
229 cnt = (flags >> 8) & 0x1f;
230 switch (flags & 0xff) {
231 case RTCP_PT_SR:
232 sr = (struct rtcp_sr *)(rh + 1);
233 printf(" sr");
234 if (len != cnt * sizeof(*rr) + sizeof(*sr) + sizeof(*rh))
235 printf(" [%d]", len);
236 if (vflag)
237 printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc));
238 if ((u_char *)(sr + 1) > ep) {
239 printf(" [|rtcp]");
240 return (ep);
242 ts = (double)(EXTRACT_32BITS(&sr->sr_ntp.upper)) +
243 ((double)(EXTRACT_32BITS(&sr->sr_ntp.lower)) /
244 4294967296.0);
245 printf(" @%.2f %u %up %ub", ts, EXTRACT_32BITS(&sr->sr_ts),
246 EXTRACT_32BITS(&sr->sr_np), EXTRACT_32BITS(&sr->sr_nb));
247 rr = (struct rtcp_rr *)(sr + 1);
248 break;
249 case RTCP_PT_RR:
250 printf(" rr");
251 if (len != cnt * sizeof(*rr) + sizeof(*rh))
252 printf(" [%d]", len);
253 rr = (struct rtcp_rr *)(rh + 1);
254 if (vflag)
255 printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc));
256 break;
257 case RTCP_PT_SDES:
258 printf(" sdes %d", len);
259 if (vflag)
260 printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc));
261 cnt = 0;
262 break;
263 case RTCP_PT_BYE:
264 printf(" bye %d", len);
265 if (vflag)
266 printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc));
267 cnt = 0;
268 break;
269 default:
270 printf(" type-0x%x %d", flags & 0xff, len);
271 cnt = 0;
272 break;
274 if (cnt > 1)
275 printf(" c%d", cnt);
276 while (--cnt >= 0) {
277 if ((u_char *)(rr + 1) > ep) {
278 printf(" [|rtcp]");
279 return (ep);
281 if (vflag)
282 printf(" %u", EXTRACT_32BITS(&rr->rr_srcid));
283 ts = (double)(EXTRACT_32BITS(&rr->rr_lsr)) / 65536.;
284 dts = (double)(EXTRACT_32BITS(&rr->rr_dlsr)) / 65536.;
285 printf(" %ul %us %uj @%.2f+%.2f",
286 EXTRACT_32BITS(&rr->rr_nl) & 0x00ffffff,
287 EXTRACT_32BITS(&rr->rr_ls),
288 EXTRACT_32BITS(&rr->rr_dv), ts, dts);
290 return (hdr + len);
293 static int udp_cksum(register const struct ip *ip,
294 register const struct udphdr *up,
295 register u_int len)
297 union phu {
298 struct phdr {
299 u_int32_t src;
300 u_int32_t dst;
301 u_char mbz;
302 u_char proto;
303 u_int16_t len;
304 } ph;
305 u_int16_t pa[6];
306 } phu;
307 register const u_int16_t *sp;
309 /* pseudo-header.. */
310 phu.ph.len = htons((u_int16_t)len);
311 phu.ph.mbz = 0;
312 phu.ph.proto = IPPROTO_UDP;
313 memcpy(&phu.ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t));
314 if (IP_HL(ip) == 5)
315 memcpy(&phu.ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t));
316 else
317 phu.ph.dst = ip_finddst(ip);
319 sp = &phu.pa[0];
320 return in_cksum((u_short *)up, len,
321 sp[0]+sp[1]+sp[2]+sp[3]+sp[4]+sp[5]);
324 #ifdef INET6
325 static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up,
326 u_int len)
328 size_t i;
329 register const u_int16_t *sp;
330 u_int32_t sum;
331 union {
332 struct {
333 struct in6_addr ph_src;
334 struct in6_addr ph_dst;
335 u_int32_t ph_len;
336 u_int8_t ph_zero[3];
337 u_int8_t ph_nxt;
338 } ph;
339 u_int16_t pa[20];
340 } phu;
342 /* pseudo-header */
343 memset(&phu, 0, sizeof(phu));
344 phu.ph.ph_src = ip6->ip6_src;
345 phu.ph.ph_dst = ip6->ip6_dst;
346 phu.ph.ph_len = htonl(len);
347 phu.ph.ph_nxt = IPPROTO_UDP;
349 sum = 0;
350 for (i = 0; i < sizeof(phu.pa) / sizeof(phu.pa[0]); i++)
351 sum += phu.pa[i];
353 sp = (const u_int16_t *)up;
355 for (i = 0; i < (len & ~1); i += 2)
356 sum += *sp++;
358 if (len & 1)
359 sum += htons((*(const u_int8_t *)sp) << 8);
361 while (sum > 0xffff)
362 sum = (sum & 0xffff) + (sum >> 16);
363 sum = ~sum & 0xffff;
365 return (sum);
367 #endif
369 static void
370 udpipaddr_print(const struct ip *ip, int sport, int dport)
372 #ifdef INET6
373 const struct ip6_hdr *ip6;
375 if (IP_V(ip) == 6)
376 ip6 = (const struct ip6_hdr *)ip;
377 else
378 ip6 = NULL;
380 if (ip6) {
381 if (ip6->ip6_nxt == IPPROTO_UDP) {
382 if (sport == -1) {
383 (void)printf("%s > %s: ",
384 ip6addr_string(&ip6->ip6_src),
385 ip6addr_string(&ip6->ip6_dst));
386 } else {
387 (void)printf("%s.%s > %s.%s: ",
388 ip6addr_string(&ip6->ip6_src),
389 udpport_string(sport),
390 ip6addr_string(&ip6->ip6_dst),
391 udpport_string(dport));
393 } else {
394 if (sport != -1) {
395 (void)printf("%s > %s: ",
396 udpport_string(sport),
397 udpport_string(dport));
400 } else
401 #endif /*INET6*/
403 if (ip->ip_p == IPPROTO_UDP) {
404 if (sport == -1) {
405 (void)printf("%s > %s: ",
406 ipaddr_string(&ip->ip_src),
407 ipaddr_string(&ip->ip_dst));
408 } else {
409 (void)printf("%s.%s > %s.%s: ",
410 ipaddr_string(&ip->ip_src),
411 udpport_string(sport),
412 ipaddr_string(&ip->ip_dst),
413 udpport_string(dport));
415 } else {
416 if (sport != -1) {
417 (void)printf("%s > %s: ",
418 udpport_string(sport),
419 udpport_string(dport));
425 void
426 udp_print(register const u_char *bp, u_int length,
427 register const u_char *bp2, int fragmented)
429 register const struct udphdr *up;
430 register const struct ip *ip;
431 register const u_char *cp;
432 register const u_char *ep = bp + length;
433 u_int16_t sport, dport, ulen;
434 #ifdef INET6
435 register const struct ip6_hdr *ip6;
436 #endif
438 if (ep > snapend)
439 ep = snapend;
440 up = (struct udphdr *)bp;
441 ip = (struct ip *)bp2;
442 #ifdef INET6
443 if (IP_V(ip) == 6)
444 ip6 = (struct ip6_hdr *)bp2;
445 else
446 ip6 = NULL;
447 #endif /*INET6*/
448 cp = (u_char *)(up + 1);
449 if (!TTEST(up->uh_dport)) {
450 udpipaddr_print(ip, -1, -1);
451 (void)printf("[|udp]");
452 return;
455 sport = EXTRACT_16BITS(&up->uh_sport);
456 dport = EXTRACT_16BITS(&up->uh_dport);
458 if (length < sizeof(struct udphdr)) {
459 udpipaddr_print(ip, sport, dport);
460 (void)printf("truncated-udp %d", length);
461 return;
463 length -= sizeof(struct udphdr);
465 if (cp > snapend) {
466 udpipaddr_print(ip, sport, dport);
467 (void)printf("[|udp]");
468 return;
471 ulen = EXTRACT_16BITS(&up->uh_ulen);
472 if (ulen < 8) {
473 udpipaddr_print(ip, sport, dport);
474 (void)printf("truncated-udplength %d", ulen);
475 return;
477 if (packettype) {
478 register struct sunrpc_msg *rp;
479 enum sunrpc_msg_type direction;
481 switch (packettype) {
483 case PT_VAT:
484 udpipaddr_print(ip, sport, dport);
485 vat_print((void *)(up + 1), up);
486 break;
488 case PT_WB:
489 udpipaddr_print(ip, sport, dport);
490 wb_print((void *)(up + 1), length);
491 break;
493 case PT_RPC:
494 rp = (struct sunrpc_msg *)(up + 1);
495 direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction);
496 if (direction == SUNRPC_CALL)
497 sunrpcrequest_print((u_char *)rp, length,
498 (u_char *)ip);
499 else
500 nfsreply_print((u_char *)rp, length,
501 (u_char *)ip); /*XXX*/
502 break;
504 case PT_RTP:
505 udpipaddr_print(ip, sport, dport);
506 rtp_print((void *)(up + 1), length, up);
507 break;
509 case PT_RTCP:
510 udpipaddr_print(ip, sport, dport);
511 while (cp < ep)
512 cp = rtcp_print(cp, ep);
513 break;
515 case PT_SNMP:
516 udpipaddr_print(ip, sport, dport);
517 snmp_print((const u_char *)(up + 1), length);
518 break;
520 case PT_CNFP:
521 udpipaddr_print(ip, sport, dport);
522 cnfp_print(cp, (const u_char *)ip);
523 break;
525 case PT_TFTP:
526 udpipaddr_print(ip, sport, dport);
527 tftp_print(cp, length);
528 break;
530 case PT_AODV:
531 udpipaddr_print(ip, sport, dport);
532 aodv_print((const u_char *)(up + 1), length,
533 #ifdef INET6
534 ip6 != NULL);
535 #else
537 #endif
538 break;
540 return;
543 if (!qflag) {
544 register struct sunrpc_msg *rp;
545 enum sunrpc_msg_type direction;
547 rp = (struct sunrpc_msg *)(up + 1);
548 if (TTEST(rp->rm_direction)) {
549 direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction);
550 if (dport == NFS_PORT && direction == SUNRPC_CALL) {
551 nfsreq_print((u_char *)rp, length,
552 (u_char *)ip);
553 return;
555 if (sport == NFS_PORT && direction == SUNRPC_REPLY) {
556 nfsreply_print((u_char *)rp, length,
557 (u_char *)ip);
558 return;
560 #ifdef notdef
561 if (dport == SUNRPC_PORT && direction == SUNRPC_CALL) {
562 sunrpcrequest_print((u_char *)rp, length, (u_char *)ip);
563 return;
565 #endif
567 if (TTEST(((struct LAP *)cp)->type) &&
568 ((struct LAP *)cp)->type == lapDDP &&
569 (atalk_port(sport) || atalk_port(dport))) {
570 if (vflag)
571 fputs("kip ", stdout);
572 llap_print(cp, length);
573 return;
576 udpipaddr_print(ip, sport, dport);
578 if (IP_V(ip) == 4 && (vflag > 1) && !fragmented) {
579 int sum = up->uh_sum;
580 if (sum == 0) {
581 (void)printf("[no cksum] ");
582 } else if (TTEST2(cp[0], length)) {
583 sum = udp_cksum(ip, up, length + sizeof(struct udphdr));
584 if (sum != 0)
585 (void)printf("[bad udp cksum %x!] ", sum);
586 else
587 (void)printf("[udp sum ok] ");
590 #ifdef INET6
591 if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) {
592 int sum = up->uh_sum;
593 /* for IPv6, UDP checksum is mandatory */
594 if (TTEST2(cp[0], length)) {
595 sum = udp6_cksum(ip6, up, length + sizeof(struct udphdr));
596 if (sum != 0)
597 (void)printf("[bad udp cksum %x!] ", sum);
598 else
599 (void)printf("[udp sum ok] ");
602 #endif
604 if (!qflag) {
605 #define ISPORT(p) (dport == (p) || sport == (p))
606 if (ISPORT(NAMESERVER_PORT))
607 ns_print((const u_char *)(up + 1), length, 0);
608 else if (ISPORT(MULTICASTDNS_PORT))
609 ns_print((const u_char *)(up + 1), length, 1);
610 else if (ISPORT(TIMED_PORT))
611 timed_print((const u_char *)(up + 1));
612 else if (ISPORT(TFTP_PORT))
613 tftp_print((const u_char *)(up + 1), length);
614 else if (ISPORT(IPPORT_BOOTPC) || ISPORT(IPPORT_BOOTPS))
615 bootp_print((const u_char *)(up + 1), length);
616 else if (ISPORT(RIP_PORT))
617 rip_print((const u_char *)(up + 1), length);
618 else if (ISPORT(AODV_PORT))
619 aodv_print((const u_char *)(up + 1), length,
620 #ifdef INET6
621 ip6 != NULL);
622 #else
624 #endif
625 else if (ISPORT(ISAKMP_PORT))
626 isakmp_print(gndo, (const u_char *)(up + 1), length, bp2);
627 else if (ISPORT(ISAKMP_PORT_NATT))
628 isakmp_rfc3948_print(gndo, (const u_char *)(up + 1), length, bp2);
629 #if 1 /*???*/
630 else if (ISPORT(ISAKMP_PORT_USER1) || ISPORT(ISAKMP_PORT_USER2))
631 isakmp_print(gndo, (const u_char *)(up + 1), length, bp2);
632 #endif
633 else if (ISPORT(SNMP_PORT) || ISPORT(SNMPTRAP_PORT))
634 snmp_print((const u_char *)(up + 1), length);
635 else if (ISPORT(NTP_PORT))
636 ntp_print((const u_char *)(up + 1), length);
637 else if (ISPORT(KERBEROS_PORT) || ISPORT(KERBEROS_SEC_PORT))
638 krb_print((const void *)(up + 1));
639 else if (ISPORT(L2TP_PORT))
640 l2tp_print((const u_char *)(up + 1), length);
641 #ifdef TCPDUMP_DO_SMB
642 else if (ISPORT(NETBIOS_NS_PORT))
643 nbt_udp137_print((const u_char *)(up + 1), length);
644 else if (ISPORT(NETBIOS_DGRAM_PORT))
645 nbt_udp138_print((const u_char *)(up + 1), length);
646 #endif
647 else if (dport == 3456)
648 vat_print((const void *)(up + 1), up);
649 else if (ISPORT(ZEPHYR_SRV_PORT) || ISPORT(ZEPHYR_CLT_PORT))
650 zephyr_print((const void *)(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((const void *)(up + 1), length, sport, dport,
658 (u_char *) ip);
659 #ifdef INET6
660 else if (ISPORT(RIPNG_PORT))
661 ripng_print((const u_char *)(up + 1), length);
662 else if (ISPORT(DHCP6_SERV_PORT) || ISPORT(DHCP6_CLI_PORT)) {
663 dhcp6_print((const u_char *)(up + 1), length);
665 #endif /*INET6*/
667 * Kludge in test for whiteboard packets.
669 else if (dport == 4567)
670 wb_print((const void *)(up + 1), length);
671 else if (ISPORT(CISCO_AUTORP_PORT))
672 cisco_autorp_print((const void *)(up + 1), length);
673 else if (ISPORT(RADIUS_PORT) ||
674 ISPORT(RADIUS_NEW_PORT) ||
675 ISPORT(RADIUS_ACCOUNTING_PORT) ||
676 ISPORT(RADIUS_NEW_ACCOUNTING_PORT) )
677 radius_print((const u_char *)(up+1), length);
678 else if (dport == HSRP_PORT)
679 hsrp_print((const u_char *)(up + 1), length);
680 else if (ISPORT(LWRES_PORT))
681 lwres_print((const u_char *)(up + 1), length);
682 else if (ISPORT(LDP_PORT))
683 ldp_print((const u_char *)(up + 1), length);
684 else if (ISPORT(OLSR_PORT))
685 olsr_print((const u_char *)(up + 1), length);
686 else if (ISPORT(MPLS_LSP_PING_PORT))
687 lspping_print((const u_char *)(up + 1), length);
688 else if (dport == BFD_CONTROL_PORT ||
689 dport == BFD_ECHO_PORT )
690 bfd_print((const u_char *)(up+1), length, dport);
691 else if (ISPORT(LMP_PORT))
692 lmp_print((const u_char *)(up + 1), length);
693 else if (ISPORT(SIP_PORT))
694 sip_print((const u_char *)(up + 1), length);
695 else if (ISPORT(SYSLOG_PORT))
696 syslog_print((const u_char *)(up + 1), length);
697 else
698 (void)printf("UDP, length %u",
699 (u_int32_t)(ulen - sizeof(*up)));
700 #undef ISPORT
701 } else
702 (void)printf("UDP, length %u", (u_int32_t)(ulen - sizeof(*up)));
707 * Local Variables:
708 * c-style: whitesmith
709 * c-basic-offset: 8
710 * End: