]>
The Tcpdump Group git mirrors - tcpdump/blob - print-sip.c
2 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that: (1) source code
4 * distributions retain the above copyright notice and this paragraph
5 * in its entirety, and (2) distributions including binary code include
6 * the above copyright notice and this paragraph in its entirety in
7 * the documentation or other materials provided with the distribution.
8 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
9 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
10 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
11 * FOR A PARTICULAR PURPOSE.
13 * Original code by Hannes Gredler (hannes@juniper.net)
16 #define NETDISSECT_REWORKED
21 #include <tcpdump-stdinc.h>
23 #include "interface.h"
27 sip_print(netdissect_options
*ndo
,
28 register const u_char
*pptr
, register u_int len
)
32 ND_PRINT((ndo
, "SIP, length: %u%s", len
, ndo
->ndo_vflag
? "\n\t" : ""));
34 /* in non-verbose mode just lets print the protocol and length */
35 if (ndo
->ndo_vflag
< 1)
38 for (idx
= 0; idx
< len
; idx
++) {
39 ND_TCHECK2(*(pptr
+idx
), 2);
40 if (EXTRACT_16BITS(pptr
+idx
) != 0x0d0a) { /* linefeed ? */
41 safeputchar(ndo
, *(pptr
+ idx
));
43 ND_PRINT((ndo
, "\n\t"));
48 /* do we want to see an additionally hexdump ? */
49 if (ndo
->ndo_vflag
> 1)
50 print_unknown_data(ndo
, pptr
, "\n\t", len
);
55 ND_PRINT((ndo
, "[|sip]"));