/* * netsniff-ng - the packet sniffing beast * Copyright 2012 Markus Amend , Deutsche Flugsicherung GmbH * Subject to the GPL, version 2. * * IPv6 Hop-By-Hop 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 hop_by_hophdr { uint8_t h_next_header; uint8_t hdr_len; } __packed; static void dissect_opt_hop (struct pkt_buff *pkt, ssize_t *opt_len) { /* Have to been upgraded. * http://tools.ietf.org/html/rfc2460#section-4.2 * Look also for proto_ipv6_dest_opts.h, it needs * dissect_opt(), too. */ if (*opt_len) tprintf(", Option(s) recognized "); /* If adding dissector reduce opt_len for each using of pkt_pull * to the same size. */ } static void hop_by_hop(struct pkt_buff *pkt) { uint16_t hdr_ext_len; ssize_t opt_len; struct hop_by_hophdr *hop_ops; hop_ops = (struct hop_by_hophdr *) pkt_pull(pkt, sizeof(*hop_ops)); if (hop_ops == NULL) return; /* Total Header Length in Bytes */ hdr_ext_len = (hop_ops->hdr_len + 1) * 8; /* Options length in Bytes */ opt_len = hdr_ext_len - sizeof(*hop_ops); tprintf("\t [ Hop-by-Hop Options "); tprintf("NextHdr (%u), ", hop_ops->h_next_header); if (opt_len > pkt_len(pkt) || opt_len < 0){ tprintf("HdrExtLen (%u, %u Bytes, %s)", hop_ops->hdr_len, hdr_ext_len, colorize_start_full(black, red) "invalid" colorize_end()); return; } tprintf("HdrExtLen (%u, %u Bytes)", hop_ops->hdr_len, hdr_ext_len); dissect_opt_hop(pkt, &opt_len); tprintf(" ]\n"); pkt_pull(pkt, opt_len); pkt_set_proto(pkt, ð_lay3, hop_ops->h_next_header); } static void hop_by_hop_less(struct pkt_buff *pkt) { uint16_t hdr_ext_len; ssize_t opt_len; struct hop_by_hophdr *hop_ops; hop_ops = (struct hop_by_hophdr *) pkt_pull(pkt, sizeof(*hop_ops)); if (hop_ops == NULL) return; /* Total Header Length in Bytes */ hdr_ext_len = (hop_ops->hdr_len + 1) * 8; /* Options length in Bytes */ opt_len = hdr_ext_len - sizeof(*hop_ops); if (opt_len > pkt_len(pkt) || opt_len < 0) return; tprintf(" Hop Ops"); pkt_pull(pkt, opt_len); pkt_set_proto(pkt, ð_lay3, hop_ops->h_next_header); } struct protocol ipv6_hop_by_hop_ops = { .key = 0x0, .print_full = hop_by_hop, .print_less = hop_by_hop_less, }; ue='nds-private-remove'/>
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-07-18 15:38:17 +1000
committerDave Airlie <airlied@redhat.com>2016-07-18 15:38:17 +1000
commitd315495d21bf44fd5e422807e8324ff82bfaabab (patch)
treea03cee37dbb6d1bb16006fc18a59b4777fee7ffe /Documentation
parent2d635fded22b71381b01e194a59544f2e8d71ef0 (diff)
parent0a677125d0ff726ed3d75ab311cf54674bf512bc (diff)
Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next
This time, a bunch of cleanups and refactoring work so that we can get dt bindings upstream. In general, we keep compatibility with existing downstream bindings as much as possible, to make backports to device kernels easier, but now we have cleaner upstream bindings so that we can start landing gpu/display support in upstream dts files. Plus shrinker and madvise support, which has been on my todo list for a long time. And support for arbitrary # of cmd bufs in submit ioctl (I've got libdrm+mesa userspace for this on branches) to enable some of the mesa batch/reorder stuff I'm working on. Userspace decides whether this is supported based on advertised driver version. For the interesting userspace bits, see: https://github.com/freedreno/libdrm/commit/1baf03ac6e77049d9c8be1e3d5164283ce82c9db Plus support for ASoC hdmi audio codec, and few other random other cleanups. * 'msm-next' of git://people.freedesktop.org/~robclark/linux: (52 commits) drm/msm: Delete an unnecessary check before drm_gem_object_unreference() drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked() drm/msm/hdmi: Delete an unnecessary check before the function call "kfree" drm/msm: return -EFAULT instead of bytes remaining drm/msm/hdmi: use PTR_ERR_OR_ZERO() to simplify the code drm/msm: add missing of_node_put after calling of_parse_phandle drm/msm: Replace drm_fb_get_bpp_depth() with drm_format_plane_cpp() drm/msm/dsi: Fix return value check in msm_dsi_host_set_display_mode() drm: msm: Add ASoC generic hdmi audio codec support. drm/msm/rd: add module param to dump all bo's drm/msm/rd: split out snapshot_buf helper drm/msm: bump kernel api version drm/msm: deal with arbitrary # of cmd buffers drm/msm: wire up vmap shrinker drm/msm: change gem->vmap() to get/put drm/msm: shrinker support drm/msm: add put_iova() helper drm/msm: add madvise ioctl drm/msm: use mutex_lock_interruptible for submit ioctl dt-bindings: msm/mdp: Provide details on MDP interface ports ...
Diffstat (limited to 'Documentation')