diff options
-rw-r--r-- | Makefile.in | 4 | ||||
-rw-r--r-- | interface.h | 3 | ||||
-rw-r--r-- | print-sip.c | 60 | ||||
-rw-r--r-- | print-udp.c | 4 | ||||
-rw-r--r-- | udp.h | 4 |
5 files changed, 70 insertions, 5 deletions
diff --git a/Makefile.in b/Makefile.in index 615ac764..3acae8c4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -17,7 +17,7 @@ # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # -# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.288 2004-06-15 09:45:41 hannes Exp $ (LBL) +# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.289 2004-07-27 17:04:20 hannes Exp $ (LBL) # # Various configurable paths (remember to edit Makefile.in, not Makefile) @@ -82,7 +82,7 @@ CSRC = addrtoname.c gmpls.c oui.c gmt2local.c ipproto.c l2vpn.c machdep.c parsen print-nfs.c print-ntp.c print-null.c print-ospf.c \ print-pflog.c print-pim.c print-ppp.c print-pppoe.c \ print-pptp.c print-radius.c print-raw.c print-rip.c \ - print-rsvp.c print-rx.c print-sctp.c print-sl.c print-sll.c \ + print-rsvp.c print-rx.c print-sctp.c print-sip.c print-sl.c print-sll.c \ print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \ print-symantec.c print-tcp.c print-telnet.c print-tftp.c \ print-timed.c print-token.c print-udp.c print-vjc.c print-vrrp.c \ diff --git a/interface.h b/interface.h index 9eae7a23..b8a5c9ae 100644 --- a/interface.h +++ b/interface.h @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.232 2004-07-21 22:00:10 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.233 2004-07-27 17:05:41 hannes Exp $ (LBL) */ #ifndef tcpdump_interface_h @@ -278,6 +278,7 @@ extern void mpls_lsp_ping_print(const u_char *, u_int); extern void zephyr_print(const u_char *, int); extern void hsrp_print(const u_char *, u_int); extern void bfd_print(const u_char *, u_int, u_int); +extern void sip_print(const u_char *, u_int); #ifdef INET6 extern void ip6_print(const u_char *, u_int); diff --git a/print-sip.c b/print-sip.c new file mode 100644 index 00000000..48562f8c --- /dev/null +++ b/print-sip.c @@ -0,0 +1,60 @@ +/* + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that: (1) source code + * distributions retain the above copyright notice and this paragraph + * in its entirety, and (2) distributions including binary code include + * the above copyright notice and this paragraph in its entirety in + * the documentation or other materials provided with the distribution. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND + * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT + * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE. + * + * Original code by Hannes Gredler (hannes@juniper.net) + */ + +#ifndef lint +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-sip.c,v 1.1 2004-07-27 17:04:20 hannes Exp $"; +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <tcpdump-stdinc.h> + +#include <stdio.h> +#include <stdlib.h> + +#include "interface.h" +#include "extract.h" + +#include "udp.h" + +void +sip_print(register const u_char *pptr, register u_int len) +{ + u_int idx; + + printf("SIP, length: %u%s", len, vflag ? "\n\t" : ""); + + /* in non-verbose mode just lets print the protocol and length */ + if (vflag < 1) + return; + + for (idx = 0; idx < len; idx++) { + if (EXTRACT_16BITS(pptr+idx) != 0x0d0a) { /* linefeed ? */ + safeputchar(*(pptr+idx)); + } else { + printf("\n\t"); + idx+=1; + } + } + + /* do we want to see an additionally hexdump ? */ + if (vflag> 1) + print_unknown_data(pptr,"\n\t",len); + + return; +} diff --git a/print-udp.c b/print-udp.c index 8c3759ea..eace4c5d 100644 --- a/print-udp.c +++ b/print-udp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.132 2004-06-06 19:20:03 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.133 2004-07-27 17:04:21 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -679,6 +679,8 @@ udp_print(register const u_char *bp, u_int length, bfd_print((const u_char *)(up+1), length, dport); else if (ISPORT(LMP_PORT)) lmp_print((const u_char *)(up + 1), length); + else if (ISPORT(SIP_PORT)) + sip_print((const u_char *)(up + 1), length); else (void)printf("UDP, length %u", (u_int32_t)(ulen - sizeof(*up))); @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/udp.h,v 1.6 2004-04-19 21:17:14 hannes Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/udp.h,v 1.7 2004-07-27 17:04:21 hannes Exp $ (LBL) */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. @@ -52,12 +52,14 @@ struct udphdr { #define NTP_PORT 123 /*XXX*/ #define SNMPTRAP_PORT 162 /*XXX*/ #define ISAKMP_PORT 500 /*XXX*/ +#define SYSLOG_PORT 514 /* rfc3164 */ #define TIMED_PORT 525 /*XXX*/ #define RIP_PORT 520 /*XXX*/ #define LDP_PORT 646 #define AODV_PORT 654 /*XXX*/ #define KERBEROS_SEC_PORT 750 /*XXX*/ #define L2TP_PORT 1701 /*XXX*/ +#define SIP_PORT 5060 #define ISAKMP_PORT_USER1 7500 /*XXX - nonstandard*/ #define ISAKMP_PORT_USER2 8500 /*XXX - nonstandard*/ #define RX_PORT_LOW 7000 /*XXX*/ |