#include <pcap.h>
-extern void ascii_print(const u_char *, u_int);
extern void default_print(const u_char *, u_int);
extern char *q922_string(const u_char *);
extern char *smb_errstr(int, int);
u_int, u_int);
extern int print_unknown_data(netdissect_options *,const u_char *, const char *,int);
+extern void ascii_print(netdissect_options *, const u_char *, u_int);
extern void hex_print_with_offset(netdissect_options *, const char *ident, const u_char *cp,
u_int, u_int);
extern void hex_print(netdissect_options *,const char *ident, const u_char *cp,u_int);
/* OpenFlow: protocol between controller and datapath. */
+/* for netdissect_options */
+#include "netdissect.h"
+
#define OF_HEADER_LEN 8
/*
* POSSIBILITY OF SUCH DAMAGE.
*/
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <stdio.h>
-#include "netdissect.h"
#include "interface.h"
#define ASCII_LINELENGTH 300
(HEXDUMP_HEXSTUFF_PER_SHORT * HEXDUMP_SHORTS_PER_LINE)
void
-ascii_print(register const u_char *cp, register u_int length)
+ascii_print(netdissect_options *ndo,
+ register const u_char *cp, register u_int length)
{
- register int s;
+ register u_char s;
- putchar('\n');
+ ND_PRINT((ndo, "\n"));
while (length > 0) {
s = *cp++;
length--;
* In the middle of a line, just print a '.'.
*/
if (length > 1 && *cp != '\n')
- putchar('.');
+ ND_PRINT((ndo, "."));
} else {
if (!ND_ISGRAPH(s) &&
(s != '\t' && s != ' ' && s != '\n'))
- putchar('.');
+ ND_PRINT((ndo, "."));
else
- putchar(s);
+ ND_PRINT((ndo, "%c", s));
}
}
}
#include <tcpdump-stdinc.h>
-#include "netdissect.h"
#include "interface.h"
#include "extract.h"
u_int i = 0;
ND_PRINT((ndo, "\n\t Simple Text Authentication data: "));
for (; i < RIP_AUTHLEN; p++, i++)
- putchar (ND_ISPRINT(*p) ? *p : '.');
+ ND_PRINT((ndo, "%c", ND_ISPRINT(*p) ? *p : '.'));
} else if (auth_type == 3) {
ND_PRINT((ndo, "\n\t Auth header:"));
ND_PRINT((ndo, " Packet Len %u,", EXTRACT_16BITS((u_int8_t *)ni + 4)));
* or later
*/
+/* for netdissect_options */
+#include "netdissect.h"
+
/* the complete */
#define SMBmkdir 0x00 /* create directory */
#define SMBrmdir 0x01 /* delete directory */
/*
* Include the link-layer header.
*/
- ascii_print(sp, h->caplen);
+ ascii_print(ndo, sp, h->caplen);
} else {
/*
* Don't include the link-layer header - and if
* print nothing.
*/
if (h->caplen > hdrlen)
- ascii_print(sp + hdrlen, h->caplen - hdrlen);
+ ascii_print(ndo, sp + hdrlen, h->caplen - hdrlen);
}
}