/* * 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 "csum.h" #include "pkt_buff.h" #include "built_in.h" struct icmphdr { uint8_t type; uint8_t code; uint16_t checksum; union { struct { uint16_t id; uint16_t sequence; } echo; uint32_t gateway; struct { uint16_t ____unused; uint16_t mtu; } frag; } un; } __packed; static void icmp(struct pkt_buff *pkt) { struct icmphdr *icmp = (struct icmphdr *) pkt_pull(pkt, sizeof(*icmp)); uint16_t csum; if (icmp == NULL) return; csum = calc_csum(icmp, pkt_len(pkt) + sizeof(*icmp)); tprintf(" [ ICMP "); tprintf("Type (%u), ", icmp->type); tprintf("Code (%u), ", icmp->code); tprintf("CSum (0x%.4x) is %s", ntohs(icmp->checksum), csum ? colorize_start_full(black, red) "bogus (!)" colorize_end() : "ok"); tprintf(" ]\n"); } static void icmp_less(struct pkt_buff *pkt) { struct icmphdr *icmp = (struct icmphdr *) pkt_pull(pkt, sizeof(*icmp)); if (icmp == NULL) return; tprintf(" Type %u Code %u", icmp->type, icmp->code); } struct protocol icmpv4_ops = { .key = 0x01, .print_full = icmp, .print_less = icmp_less, }; packet-rx-pump-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/arch/sh
diff options
context:
space:
mode:
authorVenkat Reddy Talla <vreddytalla@nvidia.com>2016-11-17 23:24:36 +0530
committerMark Brown <broonie@kernel.org>2016-11-23 16:27:42 +0000
commit983779235a4d08f94e8cda073200423e0ff01d2e (patch)
tree254b624bd499c14b09d55abaf209ea95f3c860f7 /arch/sh
parent383d0fca7035a12f1201277d33e8fc87c9d60c9a (diff)
regulator: max77620: add documentation for MPOK property
Adding documentation for maxim,power-ok-control dts property Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'arch/sh')