/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Copyright 2010 Emmanuel Roullit. * Subject to the GPL, version 2. */ #include #include #include /* for ntohs() */ #include "proto.h" #include "proto_vlan.h" #include "dissector_eth.h" #include "pkt_buff.h" struct vlanhdr { uint16_t h_vlan_TCI; uint16_t h_vlan_encapsulated_proto; } __packed; static void vlan(struct pkt_buff *pkt) { uint16_t tci; struct vlanhdr *vlan = (struct vlanhdr *) pkt_pull(pkt, sizeof(*vlan)); if (vlan == NULL) return; tci = ntohs(vlan->h_vlan_TCI); tprintf(" [ VLAN "); tprintf("Prio (%d), ", vlan_tci2prio(tci)); tprintf("CFI (%d), ", vlan_tci2cfi(tci)); tprintf("ID (%d), ", vlan_tci2vid(tci)); tprintf("Proto (0x%.4x)", ntohs(vlan->h_vlan_encapsulated_proto)); tprintf(" ]\n"); pkt_set_dissector(pkt, ð_lay2, ntohs(vlan->h_vlan_encapsulated_proto)); } static void vlan_less(struct pkt_buff *pkt) { uint16_t tci; struct vlanhdr *vlan = (struct vlanhdr *) pkt_pull(pkt, sizeof(*vlan)); if (vlan == NULL) return; tci = ntohs(vlan->h_vlan_TCI); tprintf(" VLAN%d", (tci & 0x0FFF)); pkt_set_dissector(pkt, ð_lay2, ntohs(vlan->h_vlan_encapsulated_proto)); } struct protocol vlan_ops = { .key = 0x8100, .print_full = vlan, .print_less = vlan_less, }; t type='submit' value='switch'/> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2016-03-09 00:06:53 -0600
committerIngo Molnar <mingo@kernel.org>2016-03-09 10:48:08 +0100
commitd435fb5ef74c31909ca58f93aa87ad09b17bbe9a (patch)
tree47729c99bbd55cd4239a8a9a93e712a07f6b87e6 /tools/objtool
parentb1e03249510b32645826bbf61a1452dd766c2e5c (diff)
objtool: Compile with debugging symbols
Compile objtool with debugging symbols ('-g') to help tools like perf and gdb understand what it's doing. Combined with '-O2', it's not always helpful, but it's better than nothing. Reported-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at> Cc: Borislav Petkov <bp@alien8.de> Cc: Chris J Arges <chris.j.arges@canonical.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michal Marek <mmarek@suse.cz> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Pedro Alves <palves@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/c295e9ee9ed360dc8b2e1d180c859f11cfc151ef.1457502970.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/objtool')