print-udp.c (75118) | print-udp.c (98527) |
---|---|
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 --- 4 unchanged lines hidden (view full) --- 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 * | 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 --- 4 unchanged lines hidden (view full) --- 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 * $FreeBSD: head/contrib/tcpdump/print-udp.c 75118 2001-04-03 07:50:46Z fenner $ | 21 * $FreeBSD: head/contrib/tcpdump/print-udp.c 98527 2002-06-21 00:49:02Z fenner $ |
22 */ 23 24#ifndef lint 25static const char rcsid[] = | 22 */ 23 24#ifndef lint 25static const char rcsid[] = |
26 "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.90 2000/12/23 20:55:22 guy Exp $ (LBL)"; | 26 "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.101 2001/10/08 21:25:24 fenner Exp $ (LBL)"; |
27#endif 28 29#ifdef HAVE_CONFIG_H 30#include "config.h" 31#endif 32 33#include <sys/param.h> 34#include <sys/time.h> --- 16 unchanged lines hidden (view full) --- 51 52#include "udp.h" 53 54#include "ip.h" 55#ifdef INET6 56#include "ip6.h" 57#endif 58 | 27#endif 28 29#ifdef HAVE_CONFIG_H 30#include "config.h" 31#endif 32 33#include <sys/param.h> 34#include <sys/time.h> --- 16 unchanged lines hidden (view full) --- 51 52#include "udp.h" 53 54#include "ip.h" 55#ifdef INET6 56#include "ip6.h" 57#endif 58 |
59#ifdef NOERROR 60#undef NOERROR /* Solaris sucks */ 61#endif 62#ifdef T_UNSPEC 63#undef T_UNSPEC /* SINIX does too */ 64#endif | |
65#include "nameser.h" 66#include "nfs.h" 67#include "bootp.h" 68 69struct rtcphdr { 70 u_int16_t rh_flags; /* T:2 P:1 CNT:5 PT:8 */ 71 u_int16_t rh_len; /* length of message (in words) */ 72 u_int32_t rh_ssrc; /* synchronization src id */ --- 44 unchanged lines hidden (view full) --- 117 118static void 119vat_print(const void *hdr, u_int len, register const struct udphdr *up) 120{ 121 /* vat/vt audio */ 122 u_int ts = *(u_int16_t *)hdr; 123 if ((ts & 0xf060) != 0) { 124 /* probably vt */ | 59#include "nameser.h" 60#include "nfs.h" 61#include "bootp.h" 62 63struct rtcphdr { 64 u_int16_t rh_flags; /* T:2 P:1 CNT:5 PT:8 */ 65 u_int16_t rh_len; /* length of message (in words) */ 66 u_int32_t rh_ssrc; /* synchronization src id */ --- 44 unchanged lines hidden (view full) --- 111 112static void 113vat_print(const void *hdr, u_int len, register const struct udphdr *up) 114{ 115 /* vat/vt audio */ 116 u_int ts = *(u_int16_t *)hdr; 117 if ((ts & 0xf060) != 0) { 118 /* probably vt */ |
125 (void)printf(" udp/vt %u %d / %d", | 119 (void)printf("udp/vt %u %d / %d", |
126 (u_int32_t)(ntohs(up->uh_ulen) - sizeof(*up)), 127 ts & 0x3ff, ts >> 10); 128 } else { 129 /* probably vat */ 130 u_int32_t i0 = (u_int32_t)ntohl(((u_int *)hdr)[0]); 131 u_int32_t i1 = (u_int32_t)ntohl(((u_int *)hdr)[1]); | 120 (u_int32_t)(ntohs(up->uh_ulen) - sizeof(*up)), 121 ts & 0x3ff, ts >> 10); 122 } else { 123 /* probably vat */ 124 u_int32_t i0 = (u_int32_t)ntohl(((u_int *)hdr)[0]); 125 u_int32_t i1 = (u_int32_t)ntohl(((u_int *)hdr)[1]); |
132 printf(" udp/vat %u c%d %u%s", | 126 printf("udp/vat %u c%d %u%s", |
133 (u_int32_t)(ntohs(up->uh_ulen) - sizeof(*up) - 8), 134 i0 & 0xffff, 135 i1, i0 & 0x800000? "*" : ""); 136 /* audio format */ 137 if (i0 & 0x1f0000) 138 printf(" f%d", (i0 >> 16) & 0x1f); 139 if (i0 & 0x3f000000) 140 printf(" s%d", (i0 >> 24) & 0x3f); --- 27 unchanged lines hidden (view full) --- 168 hasext = i0 & 0x10000000; 169 contype = (i0 >> 16) & 0x7f; 170 hasmarker = i0 & 0x800000; 171 dlen -= 4; 172 ptype = "rtp"; 173 ip += 1; 174 len -= 1; 175 } | 127 (u_int32_t)(ntohs(up->uh_ulen) - sizeof(*up) - 8), 128 i0 & 0xffff, 129 i1, i0 & 0x800000? "*" : ""); 130 /* audio format */ 131 if (i0 & 0x1f0000) 132 printf(" f%d", (i0 >> 16) & 0x1f); 133 if (i0 & 0x3f000000) 134 printf(" s%d", (i0 >> 24) & 0x3f); --- 27 unchanged lines hidden (view full) --- 162 hasext = i0 & 0x10000000; 163 contype = (i0 >> 16) & 0x7f; 164 hasmarker = i0 & 0x800000; 165 dlen -= 4; 166 ptype = "rtp"; 167 ip += 1; 168 len -= 1; 169 } |
176 printf(" udp/%s %d c%d %s%s %d %u", | 170 printf("udp/%s %d c%d %s%s %d %u", |
177 ptype, 178 dlen, 179 contype, 180 (hasopt || hasext)? "+" : "", 181 hasmarker? "*" : "", 182 i0 & 0xffff, 183 i1); 184 if (vflag) { --- 106 unchanged lines hidden (view full) --- 291 } 292 return (hdr + len); 293} 294 295static int udp_cksum(register const struct ip *ip, 296 register const struct udphdr *up, 297 register int len) 298{ | 171 ptype, 172 dlen, 173 contype, 174 (hasopt || hasext)? "+" : "", 175 hasmarker? "*" : "", 176 i0 & 0xffff, 177 i1); 178 if (vflag) { --- 106 unchanged lines hidden (view full) --- 285 } 286 return (hdr + len); 287} 288 289static int udp_cksum(register const struct ip *ip, 290 register const struct udphdr *up, 291 register int len) 292{ |
299 int i, tlen; | |
300 union phu { 301 struct phdr { 302 u_int32_t src; 303 u_int32_t dst; 304 u_char mbz; 305 u_char proto; 306 u_int16_t len; 307 } ph; 308 u_int16_t pa[6]; 309 } phu; 310 register const u_int16_t *sp; | 293 union phu { 294 struct phdr { 295 u_int32_t src; 296 u_int32_t dst; 297 u_char mbz; 298 u_char proto; 299 u_int16_t len; 300 } ph; 301 u_int16_t pa[6]; 302 } phu; 303 register const u_int16_t *sp; |
311 u_int32_t sum; 312 tlen = ntohs(ip->ip_len) - ((const char *)up-(const char*)ip); | |
313 314 /* pseudo-header.. */ | 304 305 /* pseudo-header.. */ |
315 phu.ph.len = htons(tlen); | 306 phu.ph.len = htons(len); |
316 phu.ph.mbz = 0; 317 phu.ph.proto = IPPROTO_UDP; 318 memcpy(&phu.ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t)); 319 memcpy(&phu.ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t)); 320 321 sp = &phu.pa[0]; | 307 phu.ph.mbz = 0; 308 phu.ph.proto = IPPROTO_UDP; 309 memcpy(&phu.ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t)); 310 memcpy(&phu.ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t)); 311 312 sp = &phu.pa[0]; |
322 sum = sp[0]+sp[1]+sp[2]+sp[3]+sp[4]+sp[5]; 323 324 sp = (const u_int16_t *)up; 325 326 for (i=0; i<(tlen&~1); i+= 2) 327 sum += *sp++; 328 329 if (tlen & 1) { 330 sum += htons( (*(const u_int8_t *)sp) << 8); 331 } 332 333 while (sum > 0xffff) 334 sum = (sum & 0xffff) + (sum >> 16); 335 sum = ~sum & 0xffff; 336 337 return (sum); | 313 return in_cksum((u_short *)up, len, 314 sp[0]+sp[1]+sp[2]+sp[3]+sp[4]+sp[5]); |
338} 339 340#ifdef INET6 341static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up, 342 int len) 343{ 344 int i, tlen; 345 register const u_int16_t *sp; --- 47 unchanged lines hidden (view full) --- 393#define SNMP_PORT 161 /*XXX*/ 394#define NTP_PORT 123 /*XXX*/ 395#define SNMPTRAP_PORT 162 /*XXX*/ 396#define ISAKMP_PORT 500 /*XXX*/ 397#define TIMED_PORT 525 /*XXX*/ 398#define RIP_PORT 520 /*XXX*/ 399#define KERBEROS_SEC_PORT 750 /*XXX*/ 400#define L2TP_PORT 1701 /*XXX*/ | 315} 316 317#ifdef INET6 318static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up, 319 int len) 320{ 321 int i, tlen; 322 register const u_int16_t *sp; --- 47 unchanged lines hidden (view full) --- 370#define SNMP_PORT 161 /*XXX*/ 371#define NTP_PORT 123 /*XXX*/ 372#define SNMPTRAP_PORT 162 /*XXX*/ 373#define ISAKMP_PORT 500 /*XXX*/ 374#define TIMED_PORT 525 /*XXX*/ 375#define RIP_PORT 520 /*XXX*/ 376#define KERBEROS_SEC_PORT 750 /*XXX*/ 377#define L2TP_PORT 1701 /*XXX*/ |
401#define ISAKMP_PORT_USER1 7500 /*??? - nonstandard*/ 402#define ISAKMP_PORT_USER2 8500 /*??? - nonstandard*/ | 378#define ISAKMP_PORT_USER1 7500 /*XXX - nonstandard*/ 379#define ISAKMP_PORT_USER2 8500 /*XXX - nonstandard*/ |
403#define RX_PORT_LOW 7000 /*XXX*/ 404#define RX_PORT_HIGH 7009 /*XXX*/ 405#define NETBIOS_NS_PORT 137 406#define NETBIOS_DGRAM_PORT 138 407#define CISCO_AUTORP_PORT 496 /*XXX*/ 408#define RADIUS_PORT 1645 409#define RADIUS_NEW_PORT 1812 410#define RADIUS_ACCOUNTING_PORT 1646 411#define RADIUS_NEW_ACCOUNTING_PORT 1813 | 380#define RX_PORT_LOW 7000 /*XXX*/ 381#define RX_PORT_HIGH 7009 /*XXX*/ 382#define NETBIOS_NS_PORT 137 383#define NETBIOS_DGRAM_PORT 138 384#define CISCO_AUTORP_PORT 496 /*XXX*/ 385#define RADIUS_PORT 1645 386#define RADIUS_NEW_PORT 1812 387#define RADIUS_ACCOUNTING_PORT 1646 388#define RADIUS_NEW_ACCOUNTING_PORT 1813 |
389#define HSRP_PORT 1985 /*XXX*/ 390#define LWRES_PORT 921 391#define ZEPHYR_SRV_PORT 2103 392#define ZEPHYR_CLT_PORT 2104 |
|
412 413#ifdef INET6 414#define RIPNG_PORT 521 /*XXX*/ 415#define DHCP6_SERV_PORT 546 /*XXX*/ 416#define DHCP6_CLI_PORT 547 /*XXX*/ 417#endif 418 419void --- 45 unchanged lines hidden (view full) --- 465 } 466 if (packettype) { 467 register struct rpc_msg *rp; 468 enum msg_type direction; 469 470 switch (packettype) { 471 472 case PT_VAT: | 393 394#ifdef INET6 395#define RIPNG_PORT 521 /*XXX*/ 396#define DHCP6_SERV_PORT 546 /*XXX*/ 397#define DHCP6_CLI_PORT 547 /*XXX*/ 398#endif 399 400void --- 45 unchanged lines hidden (view full) --- 446 } 447 if (packettype) { 448 register struct rpc_msg *rp; 449 enum msg_type direction; 450 451 switch (packettype) { 452 453 case PT_VAT: |
473 (void)printf("%s.%s > %s.%s:", | 454 (void)printf("%s.%s > %s.%s: ", |
474 ipaddr_string(&ip->ip_src), 475 udpport_string(sport), 476 ipaddr_string(&ip->ip_dst), 477 udpport_string(dport)); 478 vat_print((void *)(up + 1), length, up); 479 break; 480 481 case PT_WB: | 455 ipaddr_string(&ip->ip_src), 456 udpport_string(sport), 457 ipaddr_string(&ip->ip_dst), 458 udpport_string(dport)); 459 vat_print((void *)(up + 1), length, up); 460 break; 461 462 case PT_WB: |
482 (void)printf("%s.%s > %s.%s:", | 463 (void)printf("%s.%s > %s.%s: ", |
483 ipaddr_string(&ip->ip_src), 484 udpport_string(sport), 485 ipaddr_string(&ip->ip_dst), 486 udpport_string(dport)); 487 wb_print((void *)(up + 1), length); 488 break; 489 490 case PT_RPC: 491 rp = (struct rpc_msg *)(up + 1); 492 direction = (enum msg_type)ntohl(rp->rm_direction); 493 if (direction == CALL) 494 sunrpcrequest_print((u_char *)rp, length, 495 (u_char *)ip); 496 else 497 nfsreply_print((u_char *)rp, length, 498 (u_char *)ip); /*XXX*/ 499 break; 500 501 case PT_RTP: | 464 ipaddr_string(&ip->ip_src), 465 udpport_string(sport), 466 ipaddr_string(&ip->ip_dst), 467 udpport_string(dport)); 468 wb_print((void *)(up + 1), length); 469 break; 470 471 case PT_RPC: 472 rp = (struct rpc_msg *)(up + 1); 473 direction = (enum msg_type)ntohl(rp->rm_direction); 474 if (direction == CALL) 475 sunrpcrequest_print((u_char *)rp, length, 476 (u_char *)ip); 477 else 478 nfsreply_print((u_char *)rp, length, 479 (u_char *)ip); /*XXX*/ 480 break; 481 482 case PT_RTP: |
502 (void)printf("%s.%s > %s.%s:", | 483 (void)printf("%s.%s > %s.%s: ", |
503 ipaddr_string(&ip->ip_src), 504 udpport_string(sport), 505 ipaddr_string(&ip->ip_dst), 506 udpport_string(dport)); 507 rtp_print((void *)(up + 1), length, up); 508 break; 509 510 case PT_RTCP: --- 55 unchanged lines hidden (view full) --- 566 ((struct LAP *)cp)->type == lapDDP && 567 (atalk_port(sport) || atalk_port(dport))) { 568 if (vflag) 569 fputs("kip ", stdout); 570 llap_print(cp, length); 571 return; 572 } 573 } | 484 ipaddr_string(&ip->ip_src), 485 udpport_string(sport), 486 ipaddr_string(&ip->ip_dst), 487 udpport_string(dport)); 488 rtp_print((void *)(up + 1), length, up); 489 break; 490 491 case PT_RTCP: --- 55 unchanged lines hidden (view full) --- 547 ((struct LAP *)cp)->type == lapDDP && 548 (atalk_port(sport) || atalk_port(dport))) { 549 if (vflag) 550 fputs("kip ", stdout); 551 llap_print(cp, length); 552 return; 553 } 554 } |
574#if 0 575 (void)printf("%s.%s > %s.%s:", 576 ipaddr_string(&ip->ip_src), udpport_string(sport), 577 ipaddr_string(&ip->ip_dst), udpport_string(dport)); 578#else | |
579#ifdef INET6 580 if (ip6) { 581 if (ip6->ip6_nxt == IPPROTO_UDP) { 582 (void)printf("%s.%s > %s.%s: ", 583 ip6addr_string(&ip6->ip6_src), 584 udpport_string(sport), 585 ip6addr_string(&ip6->ip6_dst), 586 udpport_string(dport)); --- 10 unchanged lines hidden (view full) --- 597 udpport_string(sport), 598 ipaddr_string(&ip->ip_dst), 599 udpport_string(dport)); 600 } else { 601 (void)printf("%s > %s: ", 602 udpport_string(sport), udpport_string(dport)); 603 } 604 } | 555#ifdef INET6 556 if (ip6) { 557 if (ip6->ip6_nxt == IPPROTO_UDP) { 558 (void)printf("%s.%s > %s.%s: ", 559 ip6addr_string(&ip6->ip6_src), 560 udpport_string(sport), 561 ip6addr_string(&ip6->ip6_dst), 562 udpport_string(dport)); --- 10 unchanged lines hidden (view full) --- 573 udpport_string(sport), 574 ipaddr_string(&ip->ip_dst), 575 udpport_string(dport)); 576 } else { 577 (void)printf("%s > %s: ", 578 udpport_string(sport), udpport_string(dport)); 579 } 580 } |
605#endif | |
606 607 if (IP_V(ip) == 4 && vflag && !fragmented) { 608 int sum = up->uh_sum; 609 if (sum == 0) { | 581 582 if (IP_V(ip) == 4 && vflag && !fragmented) { 583 int sum = up->uh_sum; 584 if (sum == 0) { |
610 (void)printf(" [no cksum]"); | 585 (void)printf("[no cksum] "); |
611 } else if (TTEST2(cp[0], length)) { | 586 } else if (TTEST2(cp[0], length)) { |
612 sum = udp_cksum(ip, up, length); | 587 sum = udp_cksum(ip, up, length + sizeof(struct udphdr)); |
613 if (sum != 0) | 588 if (sum != 0) |
614 (void)printf(" [bad udp cksum %x!]", sum); | 589 (void)printf("[bad udp cksum %x!] ", sum); |
615 else | 590 else |
616 (void)printf(" [udp sum ok]"); | 591 (void)printf("[udp sum ok] "); |
617 } 618 } 619#ifdef INET6 620 if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) { 621 int sum = up->uh_sum; 622 /* for IPv6, UDP checksum is mandatory */ 623 if (TTEST2(cp[0], length)) { 624 sum = udp6_cksum(ip6, up, length); 625 if (sum != 0) | 592 } 593 } 594#ifdef INET6 595 if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) { 596 int sum = up->uh_sum; 597 /* for IPv6, UDP checksum is mandatory */ 598 if (TTEST2(cp[0], length)) { 599 sum = udp6_cksum(ip6, up, length); 600 if (sum != 0) |
626 (void)printf(" [bad udp cksum %x!]", sum); | 601 (void)printf("[bad udp cksum %x!] ", sum); |
627 else | 602 else |
628 (void)printf(" [udp sum ok]"); | 603 (void)printf("[udp sum ok] "); |
629 } 630 } 631#endif 632 633 if (!qflag) { 634#define ISPORT(p) (dport == (p) || sport == (p)) 635 if (ISPORT(NAMESERVER_PORT)) 636 ns_print((const u_char *)(up + 1), length); --- 15 unchanged lines hidden (view full) --- 652 else if (ISPORT(SNMP_PORT) || ISPORT(SNMPTRAP_PORT)) 653 snmp_print((const u_char *)(up + 1), length); 654 else if (ISPORT(NTP_PORT)) 655 ntp_print((const u_char *)(up + 1), length); 656 else if (ISPORT(KERBEROS_PORT) || ISPORT(KERBEROS_SEC_PORT)) 657 krb_print((const void *)(up + 1), length); 658 else if (ISPORT(L2TP_PORT)) 659 l2tp_print((const u_char *)(up + 1), length); | 604 } 605 } 606#endif 607 608 if (!qflag) { 609#define ISPORT(p) (dport == (p) || sport == (p)) 610 if (ISPORT(NAMESERVER_PORT)) 611 ns_print((const u_char *)(up + 1), length); --- 15 unchanged lines hidden (view full) --- 627 else if (ISPORT(SNMP_PORT) || ISPORT(SNMPTRAP_PORT)) 628 snmp_print((const u_char *)(up + 1), length); 629 else if (ISPORT(NTP_PORT)) 630 ntp_print((const u_char *)(up + 1), length); 631 else if (ISPORT(KERBEROS_PORT) || ISPORT(KERBEROS_SEC_PORT)) 632 krb_print((const void *)(up + 1), length); 633 else if (ISPORT(L2TP_PORT)) 634 l2tp_print((const u_char *)(up + 1), length); |
660 else if (ISPORT(NETBIOS_NS_PORT)) { | 635#ifdef TCPDUMP_DO_SMB 636 else if (ISPORT(NETBIOS_NS_PORT)) |
661 nbt_udp137_print((const u_char *)(up + 1), length); | 637 nbt_udp137_print((const u_char *)(up + 1), length); |
662 } 663 else if (ISPORT(NETBIOS_DGRAM_PORT)) { | 638 else if (ISPORT(NETBIOS_DGRAM_PORT)) |
664 nbt_udp138_print((const u_char *)(up + 1), length); | 639 nbt_udp138_print((const u_char *)(up + 1), length); |
665 } | 640#endif |
666 else if (dport == 3456) 667 vat_print((const void *)(up + 1), length, up); | 641 else if (dport == 3456) 642 vat_print((const void *)(up + 1), length, up); |
643 else if (ISPORT(ZEPHYR_SRV_PORT) || ISPORT(ZEPHYR_CLT_PORT)) 644 zephyr_print((const void *)(up + 1), length); |
|
668 /* 669 * Since there are 10 possible ports to check, I think 670 * a <> test would be more efficient 671 */ 672 else if ((sport >= RX_PORT_LOW && sport <= RX_PORT_HIGH) || 673 (dport >= RX_PORT_LOW && dport <= RX_PORT_HIGH)) 674 rx_print((const void *)(up + 1), length, sport, dport, 675 (u_char *) ip); --- 8 unchanged lines hidden (view full) --- 684 /* 685 * Kludge in test for whiteboard packets. 686 */ 687 else if (dport == 4567) 688 wb_print((const void *)(up + 1), length); 689 else if (ISPORT(CISCO_AUTORP_PORT)) 690 cisco_autorp_print((const void *)(up + 1), length); 691 else if (ISPORT(RADIUS_PORT) || | 645 /* 646 * Since there are 10 possible ports to check, I think 647 * a <> test would be more efficient 648 */ 649 else if ((sport >= RX_PORT_LOW && sport <= RX_PORT_HIGH) || 650 (dport >= RX_PORT_LOW && dport <= RX_PORT_HIGH)) 651 rx_print((const void *)(up + 1), length, sport, dport, 652 (u_char *) ip); --- 8 unchanged lines hidden (view full) --- 661 /* 662 * Kludge in test for whiteboard packets. 663 */ 664 else if (dport == 4567) 665 wb_print((const void *)(up + 1), length); 666 else if (ISPORT(CISCO_AUTORP_PORT)) 667 cisco_autorp_print((const void *)(up + 1), length); 668 else if (ISPORT(RADIUS_PORT) || |
692 ISPORT(RADIUS_NEW_PORT) || 693 ISPORT(RADIUS_ACCOUNTING_PORT) || 694 ISPORT(RADIUS_NEW_ACCOUNTING_PORT) ) 695 radius_print((const u_char *)(up+1), length); | 669 ISPORT(RADIUS_NEW_PORT) || 670 ISPORT(RADIUS_ACCOUNTING_PORT) || 671 ISPORT(RADIUS_NEW_ACCOUNTING_PORT) ) 672 radius_print((const u_char *)(up+1), length); 673 else if (dport == HSRP_PORT) 674 hsrp_print((const u_char *)(up + 1), length); 675 else if (ISPORT(LWRES_PORT)) 676 lwres_print((const u_char *)(up + 1), length); |
696 else | 677 else |
697 (void)printf(" udp %u", | 678 (void)printf("udp %u", |
698 (u_int32_t)(ulen - sizeof(*up))); 699#undef ISPORT 700 } else | 679 (u_int32_t)(ulen - sizeof(*up))); 680#undef ISPORT 681 } else |
701 (void)printf(" udp %u", (u_int32_t)(ulen - sizeof(*up))); | 682 (void)printf("udp %u", (u_int32_t)(ulen - sizeof(*up))); |
702} | 683} |