/* * 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) {} static 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"); } static 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) { tprintf("\n"); } struct protocol none_ops = { .key = 0x01, .print_full = hex_ascii, .print_less = none_less, }; ='packet-rx-pump-back'>packet-rx-pump-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
akefile?h=nds-private-remove&id=72df5eba704252e54b5b19395cb938f8bb55cab8'>Makefile
diff options
AgeCommit message (Expand)AuthorFilesLines
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-06 14:37:55 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-06 14:37:55 -0800
commit72df5eba704252e54b5b19395cb938f8bb55cab8 (patch)
tree9b9dd6aa0cd3b6cda738de32dd05075e6e66bab1 /drivers/usb/gadget/Makefile
parent396bf4cd835e62d70fad4a03a8963e61f19021f2 (diff)
parentf9f96fc10c09ca16e336854c08bc1563eed97985 (diff)
Merge tag 'media/v4.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: "A few documentation fixes at CEC (with got promoted from staging for 4.10), and one fix on its core." * tag 'media/v4.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: [media] cec: fix wrong last_la determination [media] cec-intro.rst: mention the v4l-utils package and CEC utilities [media] cec rst: remove "This API is not yet finalized" notice
Diffstat (limited to 'drivers/usb/gadget/Makefile')