# Changeset 8106a45 for lib/protocols.h

Ignore:
Timestamp:
02/05/10 16:56:48 (12 years ago)
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
 re46cb80 /* These are protocol decoders that haven't yet seen enough use to consider * their API stable enough to move into libtrace.h where they probably belong /* * This file is part of libtrace * * These API's are not stable enough to be exported from libtrace and used * by user code * Copyright (c) 2007,2008,2009,2010 The University of Waikato, Hamilton, * New Zealand. * * These are generally used by the next higher level, so really we should * Authors: Daniel Lawson *          Perry Lorier *          Shane Alcock * * All rights reserved. * * This code has been developed by the University of Waikato WAND * research group. For further information please see http://www.wand.net.nz/ * * libtrace is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * libtrace is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with libtrace; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * * $Id$ * */ /** @file * * @brief Protocol access functions that have not yet been made available * through the external API. * * These are protocol decoders that haven't yet seen enough use to consider * their API stable enough to move into libtrace.h where they probably belong. */ /* These are generally used by the next higher level, so really we should * be defining API's that mean that these don't need to be known by the * higher level. /* l2 headers */ void *trace_get_mpls_payload_from_ethernet_payload(void *ethernet, uint16_t *type, uint32_t *remaining); /** Gets a pointer to the payload following an Ethernet header * * @param ethernet      A pointer to the Ethernet header * @param[out] type     Set to contain the Ethernet type of the next header * @param[in, out] remaining    Updated with the number of captured bytes *                              remaining * @return A pointer to the header following the provided Ethernet header, or * NULL if no subsequent header is present. * * Remaining must point to the number of bytes captured from the Ethernet header * and beyond.  It will be decremented by the number of bytes skipped to find * the payload. * * If the Ethernet header is complete but there are zero bytes of payload after * the end of the header, a pointer to where the payload would be is returned * and remaining will be set to 0.  If the Ethernet header is incomplete * (truncated), then NULL is returned and remaining will be set to 0. * Therefore, it is very important to check the value of remaining after * calling this function. * * @note \ref trace_get_payload_from_layer2 provides a suitable alternative that is * actually available via the external API */ void *trace_get_payload_from_ethernet(void *ethernet, uint16_t *type, uint32_t *remaining); void *trace_get_payload_from_pppoe(void *link, uint16_t *type, uint32_t *remaining); /* l3 definitions */ /** Ports structure used to get the source and destination ports for transport * protocols */ struct ports_t { uint16_t src; uint16_t dst; uint16_t src;           /**< Source port */ uint16_t dst;           /**< Destination port */ };