/* * netsniff-ng - the packet sniffing beast * Subject to the GPL, version 2. */ #include #include "protos.h" #include "pcap_io.h" #include "pkt_buff.h" #include "dissector.h" #include "dissector_sll.h" #include "dissector_eth.h" #include "dissector_netlink.h" #include "lookup.h" static char *pkt_type2str(uint8_t pkttype) { switch (pkttype) { case PACKET_HOST: return "host"; case PACKET_BROADCAST: return "broadcast"; case PACKET_MULTICAST: return "multicast"; case PACKET_OTHERHOST: return "other host"; case PACKET_OUTGOING: return "outgoing"; case PACKET_USER: return "user"; case PACKET_KERNEL: return "kernel"; } return "Unknown"; } static void sll_print_full(struct pkt_buff *pkt) { struct sockaddr_ll *sll = pkt->sll; char addr_str[40] = {}; tprintf(" [ Linux \"cooked\""); tprintf(" Pkt Type %d (%s)", sll->sll_pkttype, pkt_type2str(sll->sll_pkttype)); tprintf(", If Type %d (%s)", sll->sll_hatype, device_type2str(sll->sll_hatype)); tprintf(", Addr Len %d", sll->sll_halen); tprintf(", Src (%s)", device_addr2str(sll->sll_addr, sll->sll_halen, sll->sll_hatype, addr_str, sizeof(addr_str))); tprintf(", Proto 0x%x", ntohs(sll->sll_protocol)); tprintf(" ]\n"); switch (pcap_devtype_to_linktype(sll->sll_hatype)) { case LINKTYPE_EN10MB: case ___constant_swab32(LINKTYPE_EN10MB): pkt_set_dissector(pkt, ð_lay2, ntohs(sll->sll_protocol)); break; case LINKTYPE_NETLINK: case ___constant_swab32(LINKTYPE_NETLINK): pkt->dissector = dissector_get_netlink_entry_point(); break; default: tprintf(" [ Unknown protocol ]\n"); } } static void sll_print_less(struct pkt_buff *pkt) { struct sockaddr_ll *sll = pkt->sll; char addr_str[40] = {}; tprintf(" Pkt Type %d (%s)", sll->sll_pkttype, pkt_type2str(sll->sll_pkttype)); tprintf(", If Type %d (%s)", sll->sll_hatype, device_type2str(sll->sll_hatype)); tprintf(", Addr Len %d", sll->sll_halen); tprintf(", Src (%s)", device_addr2str(sll->sll_addr, sll->sll_halen, sll->sll_hatype, addr_str, sizeof(addr_str))); tprintf(", Proto 0x%x", ntohs(sll->sll_protocol)); } struct protocol sll_ops = { .key = 0, .print_full = sll_print_full, .print_less = sll_print_less, }; struct protocol *dissector_get_sll_entry_point(void) { return &sll_ops; } struct protocol *dissector_get_sll_exit_point(void) { return &none_ops; } void dissector_init_sll(int fnttype) { dissector_set_print_type(&sll_ops, fnttype); dissector_set_print_type(&none_ops, fnttype); lookup_init(LT_OUI); } void dissector_cleanup_sll(void) { lookup_cleanup(LT_OUI); } lue='grep'>log msg
path: root/Documentation/.gitignore
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-05-16 14:30:43 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-05-16 14:30:43 +0200
commitc47b3bd0d3a18a93d62b91d2d02e3fe599805e6d (patch)
treee38ebf3593da76e6a63c47c979e3ebfec7b041c9 /Documentation/.gitignore
parent29cff1844a340f27fa8b9a47adcee880dcc3ae6f (diff)
parent1aa7a6e2b8105f22a5f7d6def281f776459c95ba (diff)
Merge branch 'pm-cpufreq'
* pm-cpufreq: (63 commits) intel_pstate: Clean up get_target_pstate_use_performance() intel_pstate: Use sample.core_avg_perf in get_avg_pstate() intel_pstate: Clarify average performance computation intel_pstate: Avoid unnecessary synchronize_sched() during initialization cpufreq: schedutil: Make default depend on CONFIG_SMP cpufreq: powernv: del_timer_sync when global and local pstate are equal cpufreq: powernv: Move smp_call_function_any() out of irq safe block intel_pstate: Clean up intel_pstate_get() cpufreq: schedutil: Make it depend on CONFIG_SMP cpufreq: governor: Fix handling of special cases in dbs_update() cpufreq: intel_pstate: Ignore _PPC processing under HWP cpufreq: arm_big_little: use generic OPP functions for {init, free}_opp_table cpufreq: tango: Use generic platdev driver cpufreq: Fix GOV_LIMITS handling for the userspace governor cpufreq: mvebu: Move cpufreq code into drivers/cpufreq/ cpufreq: dt: Kill platform-data mvebu: Use dev_pm_opp_set_sharing_cpus() to mark OPP tables as shared cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2 cpufreq: governor: Change confusing struct field and variable names cpufreq: intel_pstate: Enable PPC enforcement for servers ...
Diffstat (limited to 'Documentation/.gitignore')