/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Subject to the GPL, version 2. */ #include #include #include /* for ntohs() */ #include "proto.h" #include "protos.h" #include "dissector_eth.h" #include "pkt_buff.h" struct udphdr { uint16_t source; uint16_t dest; uint16_t len; uint16_t check; } __packed; static void udp(struct pkt_buff *pkt) { struct udphdr *udp = (struct udphdr *) pkt_pull(pkt, sizeof(*udp)); ssize_t len; uint16_t src, dest; char *src_name, *dest_name; if (udp == NULL) return; len = ntohs(udp->len) - sizeof(*udp); src = ntohs(udp->source); dest = ntohs(udp->dest); src_name = lookup_port_udp(src); dest_name = lookup_port_udp(dest); tprintf(" [ UDP "); tprintf("Port (%u", src); if (src_name) tprintf(" (%s%s%s)", colorize_start(bold), src_name, colorize_end()); tprintf(" => %u", dest); if (dest_name) tprintf(" (%s%s%s)", colorize_start(bold), dest_name, colorize_end()); tprintf("), "); if(len > pkt_len(pkt) || len < 0){ tprintf("Len (%u) %s, ", ntohs(udp->len), colorize_start_full(black, red) "invalid" colorize_end()); } tprintf("Len (%u Bytes, %zd Bytes Data), ", ntohs(udp->len), len); tprintf("CSum (0x%.4x)", ntohs(udp->check)); tprintf(" ]\n"); } static void udp_less(struct pkt_buff *pkt) { struct udphdr *udp = (struct udphdr *) pkt_pull(pkt, sizeof(*udp)); uint16_t src, dest; char *src_name, *dest_name; if (udp == NULL) return; src = ntohs(udp->source); dest = ntohs(udp->dest); src_name = lookup_port_udp(src); dest_name = lookup_port_udp(dest); tprintf(" UDP %u", src); if(src_name) tprintf("(%s%s%s)", colorize_start(bold), src_name, colorize_end()); tprintf("/%u", dest); if (dest_name) tprintf("(%s%s%s)", colorize_start(bold), dest_name, colorize_end()); } struct protocol udp_ops = { .key = 0x11, .print_full = udp, .print_less = udp_less, }; Documentation/i2c/fault-codes?h=nds-private-remove&id=5766e9d25f41d79a0bb99e44a4408d00236dc3c7'>treecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-23 15:56:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-23 15:56:23 -0700
commit5766e9d25f41d79a0bb99e44a4408d00236dc3c7 (patch)
tree25f3beda46187f311597ffa83217771aeb212396 /Documentation/i2c/fault-codes
parent0c2b6dc4fd4fa13796b319aae969a009f03222c6 (diff)
parentbd85f4b37ddf2da22ccf5b29d264b2459b6722df (diff)
Merge tag 'for-linus-4.9-2' of git://git.code.sf.net/p/openipmi/linux-ipmi
Pull IPMI updates from Corey Minyard: "A small bug fix and a new driver for acting as an IPMI device. I was on vacation during the merge window (a long vacation) but this is a bug fix that should go in and a new driver that shouldn't hurt anything. This has been in linux-next for a month or so" * tag 'for-linus-4.9-2' of git://git.code.sf.net/p/openipmi/linux-ipmi: ipmi: fix crash on reading version from proc after unregisted bmc ipmi/bt-bmc: remove redundant return value check of platform_get_resource() ipmi/bt-bmc: add a dependency on ARCH_ASPEED ipmi: Fix ioremap error handling in bt-bmc ipmi: add an Aspeed BT IPMI BMC driver
Diffstat (limited to 'Documentation/i2c/fault-codes')