diff options
author | delphij <delphij@FreeBSD.org> | 2015-01-07 19:55:18 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-01-07 19:55:18 +0000 |
commit | f49c5d523af9076a4a59e8dd664f9a897108432e (patch) | |
tree | e268839e08c106e178b33bd461d8d0a9c6fb5ad9 /contrib/tcpdump/print-sip.c | |
parent | c371846049d370ab78d943e60e789cdffe0aad3d (diff) | |
parent | 08263d19579d35a7a65e0c8bcb768504ce76d04e (diff) | |
download | FreeBSD-src-f49c5d523af9076a4a59e8dd664f9a897108432e.zip FreeBSD-src-f49c5d523af9076a4a59e8dd664f9a897108432e.tar.gz |
MFV r276761: tcpdump 4.6.2.
MFC after: 1 month
Diffstat (limited to 'contrib/tcpdump/print-sip.c')
-rw-r--r-- | contrib/tcpdump/print-sip.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/contrib/tcpdump/print-sip.c b/contrib/tcpdump/print-sip.c index c5bc853..540cbf4 100644 --- a/contrib/tcpdump/print-sip.c +++ b/contrib/tcpdump/print-sip.c @@ -13,52 +13,44 @@ * 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 - +#define NETDISSECT_REWORKED #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) +sip_print(netdissect_options *ndo, + register const u_char *pptr, register u_int len) { u_int idx; - printf("SIP, length: %u%s", len, vflag ? "\n\t" : ""); + ND_PRINT((ndo, "SIP, length: %u%s", len, ndo->ndo_vflag ? "\n\t" : "")); /* in non-verbose mode just lets print the protocol and length */ - if (vflag < 1) + if (ndo->ndo_vflag < 1) return; for (idx = 0; idx < len; idx++) { - TCHECK2(*(pptr+idx), 2); + ND_TCHECK2(*(pptr+idx), 2); if (EXTRACT_16BITS(pptr+idx) != 0x0d0a) { /* linefeed ? */ - safeputchar(*(pptr+idx)); + safeputchar(ndo, *(pptr + idx)); } else { - printf("\n\t"); + ND_PRINT((ndo, "\n\t")); idx+=1; } } /* do we want to see an additionally hexdump ? */ - if (vflag> 1) - print_unknown_data(pptr,"\n\t",len); + if (ndo->ndo_vflag > 1) + print_unknown_data(ndo, pptr, "\n\t", len); return; trunc: - printf("[|sip]"); + ND_PRINT((ndo, "[|sip]")); } |