Changeset dc6072d for lib


Ignore:
Timestamp:
02/18/13 13:31:17 (9 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
0801187
Parents:
c0a5a50
Message:
  • Added libtrace structure for the ICMPv6 header
  • Updated trace_get_payload_length to calculate correct payload length for ICMP6 packets
Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h.in

    r2627439 rdc6072d  
    625625} PACKED libtrace_icmp_t;
    626626
     627typedef struct libtrace_icmp6 {
     628  uint8_t type;         /**< Message Type */
     629  uint8_t code;         /**< Type Sub-code */
     630  uint16_t checksum;    /**< Checksum */
     631
     632  union {
     633    struct {
     634        uint8_t length;   /**< Length of original datagram content in 64 bit words */
     635        uint8_t unused;   /**< Unused */       
     636        uint8_t unused1;  /**< Unused */
     637    } extend;   /**< Extensions added in RFC 4884 for Time Exceeded and Destination Unreachable Messages */
     638
     639    uint32_t mtu;       /**< MTU from Packet Too Big Message */
     640    uint32_t pointer;   /**< Pointer from Parameter Problem Message */
     641    struct {
     642        uint16_t id;    /**< Echo Identifier */
     643        uint16_t sequence; /**< Echo Sequence Number */
     644    } echo; /**< Data required for Echo Request and Reply messages */
     645  } un;
     646} PACKED libtrace_icmp6_t;
     647
    627648/** Generic LLC/SNAP header structure */
    628649typedef struct libtrace_llcsnap
  • lib/protocols_transport.c

    r1d4db58 rdc6072d  
    129129                        len -= sizeof(libtrace_icmp_t);
    130130                        break;
    131                
     131                case TRACE_IPPROTO_ICMPV6:
     132                        if (rem < sizeof(libtrace_icmp6_t))
     133                                return 0;
     134                        if (len < sizeof(libtrace_icmp6_t))
     135                                return 0;
     136                        len -= sizeof(libtrace_icmp6_t);
     137                        break;
     138                       
    132139                default:
    133140                        return 0;
Note: See TracChangeset for help on using the changeset viewer.