/* * netsniff-ng - the packet sniffing beast * Copyright 2009 - 2013 Daniel Borkmann. * Subject to the GPL, version 2. */ #ifndef DISSECTOR_H #define DISSECTOR_H #include #include #include "ring.h" #include "tprintf.h" #include "pcap_io.h" #define PRINT_NORM 0 #define PRINT_LESS 1 #define PRINT_HEX 2 #define PRINT_ASCII 3 #define PRINT_HEX_ASCII 4 #define PRINT_NONE 5 static const char * const packet_types[256]={ "<", /* Incoming */ "B", /* Broadcast */ "M", /* Multicast */ "P", /* Promisc */ ">", /* Outgoing */ "?", /* Unknown */ }; extern char *if_indextoname(unsigned ifindex, char *ifname); static inline void show_frame_hdr(struct frame_map *hdr, int mode) { char tmp[IFNAMSIZ]; if (mode == PRINT_NONE) return; switch (mode) { case PRINT_LESS: tprintf("%s %s %u", packet_types[hdr->s_ll.sll_pkttype] ? : "?", if_indextoname(hdr->s_ll.sll_ifindex, tmp) ? : "?", hdr->tp_h.tp_len); break; default: tprintf("%s %s %u %us.%uns\n", packet_types[hdr->s_ll.sll_pkttype] ? : "?", if_indextoname(hdr->s_ll.sll_ifindex, tmp) ? : "?", hdr->tp_h.tp_len, hdr->tp_h.tp_sec, hdr->tp_h.tp_nsec); break; } } extern void dissector_init_all(int fnttype); extern void dissector_entry_point(uint8_t *packet, size_t len, int linktype, int mode); extern void dissector_cleanup_all(void); extern int dissector_set_print_type(void *ptr, int type); #endif /* DISSECTOR_H */ -next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-05-20 17:55:51 -0700
committerDavid S. Miller <davem@davemloft.net>2016-05-20 17:55:51 -0700
commit20c698d7791420fb242a0d49b80790fb2d951ace (patch)
treebcab1c55fa1ba86f09896f891663ad6cec062815 /Documentation
parent33656a1f2ee5346c742d63ddd0e0970c95a56b70 (diff)
parent6b1cabe8992441afb542503781f11b9cce91e285 (diff)
Merge branch 'sparc32-cosmetic-changes'
Sam Ravnborg says: ==================== sparc32: kgdb_32 and STRICT_MM_TYPECHECKS updates A few cosmetic pathes for sparc32 follows. I noticed some inconsistency in kgdb_32 that triggered a few patches. The inconsistency in kgdb_32 turned out to have no functional impact. But I anyway fixed it so kgdb_32 and kgdb_64 became just a tiny bit more alike. The STRICT_MM_TYPECHECKS patch was triggered by a discussion on linux-arch where Arnd considered removing this cruft. The resulting benary of srmmu.c (I checked an assembler file) was _smaller_ when I defined STRICT_MM_TYPECHECKS. But due to lack of testing I left it undefined. With the build errors fixed it should be trivial to try out if defining STRICT_MM_TYPECHECKS breaks anything. Any takers? As I miss any working sparc32 gear for the moment this has only been build tested - so please consider if it is worth taking the risk to apply the patches. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation')