/* * 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); } msg
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-17 16:45:00 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-17 16:45:00 -0800
commitaf79ce47efabba36d1db0902d46a80de7f251411 (patch)
tree571106db25ed2da54891995aed38407f85e6ac4b /Documentation
parentc07dee7348e2451bcf2f178bf0e7830268e2c31a (diff)
parentf26e8817b235d8764363bffcc9cbfc61867371f2 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem updates from Dmitry Torokhov: - updated support for Synaptics RMI4 devices, including support for SMBus controllers, firmware update support, sensor tuning, and PS/2 guest support - ALPS driver now supports tracksticks on SS5 controllers - i8042 now uses chassis info to skip selftest on Asus laptops as list of individual models became too unwieldy - miscellaneous fixes to other drivers * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (67 commits) Input: imx6ul_tsc - generalize the averaging property Input: drv260x - use generic device properties Input: drv260x - use temporary for &client->dev Input: drv260x - fix input device's parent assignment Input: synaptics-rmi4 - add support for F34 V7 bootloader Input: drv260x - fix initializing overdrive voltage Input: ALPS - fix protcol -> protocol Input: i8042 - comment #else/#endif of CONFIG_PNP Input: lpc32xx-keys - fix invalid error handling of a requested irq Input: synaptics-rmi4 - fix debug for sensor clip Input: synaptics-rmi4 - store the attn data in the driver Input: synaptics-rmi4 - allow to add attention data Input: synaptics-rmi4 - f03 - grab data passed by transport device Input: synaptics-rmi4 - add support for F03 Input: imx6ul_tsc - convert int to u32 Input: imx6ul_tsc - add mask when set REG_ADC_CFG Input: synaptics-rmi4 - have only one struct platform data Input: synaptics-rmi4 - remove EXPORT_SYMBOL_GPL for internal functions Input: synaptics-rmi4 - remove mutex calls while updating the firmware Input: drv2667 - fix misuse of regmap_update_bits ...
Diffstat (limited to 'Documentation')