Changeset a842286 for lib/libtrace.h


Ignore:
Timestamp:
04/06/06 20:50:57 (15 years ago)
Author:
Perry Lorier <perry@…>
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:
9231fe5
Parents:
4029ce7
Message:

Finish migration to protocols.c, add more IPv6 support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h

    r4af54d1 ra842286  
    178178} libtrace_ip_t;
    179179
     180typedef PACKED struct libtrace_ip6_ext
     181{
     182        uint8_t nxt;
     183        uint8_t len;
     184} libtrace_ip6_ext_t;
     185
    180186/** IPv6 header structure */
    181187typedef PACKED struct libtrace_ip6
    182 {
    183 #if BYTE_ORDER == LITTLE_ENDIAN
    184     unsigned int flow:4;                /**< Flow label */
    185     unsigned int tclass:8;              /**< Traffic class */
    186     unsigned int version:4;             /**< IP Version (6) */
    187 #elif BYTE_ORDER == BIG_ENDIAN
    188     unsigned int version:4;             /**< IP Version (6) */
    189     unsigned int tclass:8;              /**< Traffic class */
    190     unsigned int flow:4;                /**< Flow label */
    191 #else
    192 #   error "Adjust your <bits/endian.h> defines"
    193 #endif
    194     uint16_t peln;                      /**< Payload length */
    195     uint8_t nxthdr;                     /**< Next header */
     188{
     189    uint32_t flow;
     190    uint16_t plen;                      /**< Payload length */
     191    uint8_t nxt;                        /**< Next header */
    196192    uint8_t hlim;                       /**< Hop limit */
    197193    struct in6_addr ip_src;             /**< source address */
     
    659655/** Gets a pointer to the transport layer header (if any)
    660656 * @param packet        a pointer to a libtrace_packet structure
     657 * @param[out] proto    transport layer protocol
    661658 *
    662659 * @return a pointer to the transport layer header, or NULL if there is no header
    663  */
    664 void *trace_get_transport(const libtrace_packet_t *packet);
     660 *
     661 * @note proto may be NULL if proto is unneeded.
     662 */
     663void *trace_get_transport(const libtrace_packet_t *packet, uint8_t *proto);
    665664
    666665/** Gets a pointer to the payload given a pointer to the IP header
    667666 * @param ip            The IP Header
     667 * @param[out] proto    An output variable of the IP protocol
    668668 * @param[out] skipped  An output variable of the number of bytes skipped
    669669 *
     
    673673 * @note This was called trace_get_transport_from_ip in libtrace2
    674674 */
    675 void *trace_get_payload_from_ip(libtrace_ip_t *ip, int *skipped);
     675void *trace_get_payload_from_ip(libtrace_ip_t *ip, uint8_t *proto,
     676                int *skipped);
    676677
    677678/** Gets a pointer to the payload given a pointer to a tcp header
Note: See TracChangeset for help on using the changeset viewer.