Changeset 8106a45 for lib/protocols.h


Ignore:
Timestamp:
02/05/10 16:56:48 (11 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:
81c0b9e
Parents:
c0fcc14
Message:
  • Added doxygen documentation and licensing to a couple more header files
  • Removed prototype for trace_get_mpls_payload_from_ethernet as this function is not actually present in libtrace
  • Removed prototype for trace_get_payload_from_pppoe because it is already in libtrace.h
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols.h

    re46cb80 r8106a45  
    1 /* These are protocol decoders that haven't yet seen enough use to consider
    2  * their API stable enough to move into libtrace.h where they probably belong
     1/*
     2 * This file is part of libtrace
    33 *
    4  * These API's are not stable enough to be exported from libtrace and used
    5  * by user code
     4 * Copyright (c) 2007,2008,2009,2010 The University of Waikato, Hamilton,
     5 * New Zealand.
    66 *
    7  * These are generally used by the next higher level, so really we should
     7 * Authors: Daniel Lawson
     8 *          Perry Lorier
     9 *          Shane Alcock
     10 *         
     11 * All rights reserved.
     12 *
     13 * This code has been developed by the University of Waikato WAND
     14 * research group. For further information please see http://www.wand.net.nz/
     15 *
     16 * libtrace is free software; you can redistribute it and/or modify
     17 * it under the terms of the GNU General Public License as published by
     18 * the Free Software Foundation; either version 2 of the License, or
     19 * (at your option) any later version.
     20 *
     21 * libtrace is distributed in the hope that it will be useful,
     22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     24 * GNU General Public License for more details.
     25 *
     26 * You should have received a copy of the GNU General Public License
     27 * along with libtrace; if not, write to the Free Software
     28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     29 *
     30 * $Id$
     31 *
     32 */
     33
     34
     35/** @file
     36 *
     37 * @brief Protocol access functions that have not yet been made available
     38 * through the external API.
     39 *
     40 * These are protocol decoders that haven't yet seen enough use to consider
     41 * their API stable enough to move into libtrace.h where they probably belong.
     42 */
     43
     44
     45/* These are generally used by the next higher level, so really we should
    846 * be defining API's that mean that these don't need to be known by the
    947 * higher level.
     
    1452
    1553/* l2 headers */
    16 void *trace_get_mpls_payload_from_ethernet_payload(void *ethernet,
    17                 uint16_t *type, uint32_t *remaining);
     54
     55/** Gets a pointer to the payload following an Ethernet header
     56 *
     57 * @param ethernet      A pointer to the Ethernet header
     58 * @param[out] type     Set to contain the Ethernet type of the next header
     59 * @param[in, out] remaining    Updated with the number of captured bytes
     60 *                              remaining
     61 * @return A pointer to the header following the provided Ethernet header, or
     62 * NULL if no subsequent header is present.
     63 *
     64 * Remaining must point to the number of bytes captured from the Ethernet header
     65 * and beyond.  It will be decremented by the number of bytes skipped to find
     66 * the payload.
     67 *
     68 * If the Ethernet header is complete but there are zero bytes of payload after
     69 * the end of the header, a pointer to where the payload would be is returned
     70 * and remaining will be set to 0.  If the Ethernet header is incomplete
     71 * (truncated), then NULL is returned and remaining will be set to 0.
     72 * Therefore, it is very important to check the value of remaining after
     73 * calling this function.
     74 *
     75 * @note \ref trace_get_payload_from_layer2 provides a suitable alternative that is
     76 * actually available via the external API
     77 */
    1878void *trace_get_payload_from_ethernet(void *ethernet,
    1979                uint16_t *type,
    2080                uint32_t *remaining);
    21 void *trace_get_payload_from_pppoe(void *link, uint16_t *type,
    22                 uint32_t *remaining);
     81
    2382/* l3 definitions */
     83
     84/** Ports structure used to get the source and destination ports for transport
     85 * protocols */
    2486struct ports_t {
    25         uint16_t src;
    26         uint16_t dst;
     87        uint16_t src;           /**< Source port */
     88        uint16_t dst;           /**< Destination port */
    2789};
    2890
Note: See TracChangeset for help on using the changeset viewer.