/* * netsniff-ng - the packet sniffing beast * Copyright 2012 Markus Amend , Deutsche Flugsicherung GmbH * Subject to the GPL, version 2. * * IPv6 Fragmentation Header described in RFC2460 */ #include #include #include /* for ntohs() */ #include "proto.h" #include "protos.h" #include "dissector_eth.h" #include "built_in.h" #include "pkt_buff.h" struct fragmhdr { uint8_t h_fragm_next_header; uint8_t h_fragm_reserved; uint16_t h_fragm_off_res_M; uint32_t h_fragm_identification; } __packed; static void fragm(struct pkt_buff *pkt) { uint16_t off_res_M; struct fragmhdr *fragm_ops; fragm_ops = (struct fragmhdr *) pkt_pull(pkt, sizeof(*fragm_ops)); if (fragm_ops == NULL) return; off_res_M = ntohs(fragm_ops->h_fragm_off_res_M); tprintf("\t [ Fragment "); tprintf("NextHdr (%u), ", fragm_ops->h_fragm_next_header); tprintf("Reserved (%u), ", fragm_ops->h_fragm_reserved); tprintf("Offset (%u), ", off_res_M >> 3); tprintf("Res (%u), ", (off_res_M >> 1) & 0x3); tprintf("M flag (%u), ", off_res_M & 0x1); tprintf("Identification (%u)", ntohl(fragm_ops->h_fragm_identification)); tprintf(" ]\n"); pkt_set_proto(pkt, ð_lay3, fragm_ops->h_fragm_next_header); } static void fragm_less(struct pkt_buff *pkt) { uint16_t off_res_M; struct fragmhdr *fragm_ops; fragm_ops = (struct fragmhdr *) pkt_pull(pkt, sizeof(*fragm_ops)); if (fragm_ops == NULL) return; off_res_M = ntohs(fragm_ops->h_fragm_off_res_M); tprintf(" FragmOffs %u", off_res_M >> 3); pkt_set_proto(pkt, ð_lay3, fragm_ops->h_fragm_next_header); } struct protocol ipv6_fragm_ops = { .key = 0x2C, .print_full = fragm, .print_less = fragm_less, }; amp;id=852801417a89375c0df4285e60d90c7821a1d730'>refslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2016-11-22 11:29:14 +0100
committerMark Brown <broonie@kernel.org>2016-11-22 16:45:46 +0000
commit852801417a89375c0df4285e60d90c7821a1d730 (patch)
treee4f266309fd9b5b06634bfde9cee2da44346d8a8 /Documentation/i2c/fault-codes
parent1001354ca34179f3db924eb66672442a173147dc (diff)
ASoC: Make return type of dpcm_state_string() const char *
dpcm_state_string() returns a pointer to a string literal. Modifying a string literal causes undefined behaviour. So make the return type of the function const char * to make it explicit that the returned value should not be modified. This patch is purely cosmetic, none of the users of dpcm_state_string() attempt to modify the returned content. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'Documentation/i2c/fault-codes')