/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Subject to the GPL, version 2. */ #include #include #include #include "proto.h" #include "protos.h" #include "pkt_buff.h" void empty(struct pkt_buff *pkt __maybe_unused) {} void _hex(uint8_t *ptr, size_t len) { if (!len) return; tprintf(" [ Hex "); for (; ptr && len-- > 0; ptr++) tprintf(" %.2x", *ptr); tprintf(" ]\n"); } void hex(struct pkt_buff *pkt) { size_t len = pkt_len(pkt); if (!len) return; _hex(pkt_pull(pkt, len), len); tprintf("\n"); } void _ascii(uint8_t *ptr, size_t len) { if (!len) return; tprintf(" [ Chr "); for (; ptr && len-- > 0; ptr++) tprintf("%c", isprint(*ptr) ? *ptr : '.'); tprintf(" ]\n"); } void ascii(struct pkt_buff *pkt) { size_t len = pkt_len(pkt); if (!len) return; _ascii(pkt_pull(pkt, len), len); tprintf("\n"); } void hex_ascii(struct pkt_buff *pkt) { size_t len = pkt_len(pkt); uint8_t *ptr = pkt_pull(pkt, len); if (len) { _ascii(ptr, len); _hex(ptr, len); } tprintf("\n"); } static void none_less(struct pkt_buff *pkt __maybe_unused) { tprintf("\n"); } struct protocol none_ops = { .key = 0x01, .print_full = hex_ascii, .print_less = none_less, }; -pump-back'>packet-rx-pump-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2017-02-09openvswitch: Pack struct sw_flow_key.Jarno Rajahalme4-34/+39
2017-02-09openvswitch: Add force commit.Jarno Rajahalme1-2/+24
2017-02-09openvswitch: Add original direction conntrack tuple to sw_flow_key.Jarno Rajahalme7-46/+227
2017-02-09openvswitch: Inherit master's labels.Jarno Rajahalme1-14/+31
2017-02-09openvswitch: Refactor labels initialization.Jarno Rajahalme1-42/+62
2017-02-09openvswitch: Simplify labels length logic.Jarno Rajahalme1-11/+9
2017-02-09openvswitch: Unionize ovs_key_ct_label with a u32 array.Jarno Rajahalme1-7/+8
2017-02-09openvswitch: Do not trigger events for unconfirmed connections.Jarno Rajahalme1-6/+22
2017-02-09openvswitch: Use inverted tuple in ovs_ct_find_existing() if NATted.Jarno Rajahalme1-2/+22
2017-02-09openvswitch: Fix comments for skb->_nfctJarno Rajahalme1-7/+7
2017-02-03Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-nextDavid S. Miller1-7/+5
2017-02-02netfilter: add and use nf_ct_set helperFlorian Westphal1-4/+2
2017-02-02skbuff: add and use skb_nfct helperFlorian Westphal1-3/+3