# source:lib/protocols.h@0f5d4de

develop
Last change on this file since 0f5d4de was be1b03a, checked in by Shane Alcock <salcock@…>, 2 years ago

• Property mode set to 100644
File size: 2.9 KB
RevLine
[8106a45]1/*
[a81d2fc]2 *
[ee6e802]3 * Copyright (c) 2007-2016 The University of Waikato, Hamilton, New Zealand.
5 *
[ee6e802]6 * This file is part of libtrace.
7 *
8 * This code has been developed by the University of Waikato WAND
[8106a45]9 * research group. For further information please see http://www.wand.net.nz/
10 *
11 * libtrace is free software; you can redistribute it and/or modify
13 * the Free Software Foundation; either version 3 of the License, or
[8106a45]14 * (at your option) any later version.
15 *
16 * libtrace is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
[ee6e802]19 * GNU Lesser General Public License for more details.
[8106a45]20 *
[ee6e802]21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
[8106a45]23 *
24 *
25 */
26
[be1b03a]27#ifndef LIBTRACE_PROTOCOLS_H_
28#define LIBTRACE_PROTOCOLS_H_
29
[8106a45]30/** @file
31 *
32 * @brief Protocol access functions that have not yet been made available
33 * through the external API.
34 *
35 * These are protocol decoders that haven't yet seen enough use to consider
36 * their API stable enough to move into libtrace.h where they probably belong.
37 */
38
39
40/* These are generally used by the next higher level, so really we should
[a81d2fc]41 * be defining API's that mean that these don't need to be known by the
42 * higher level.
43 */
44
[e46cb80]45#include "libtrace.h"
47
[8106a45]49
51 *
52 * @param ethernet      A pointer to the Ethernet header
53 * @param[out] type     Set to contain the Ethernet type of the next header
54 * @param[in, out] remaining    Updated with the number of captured bytes
55 *                              remaining
56 * @return A pointer to the header following the provided Ethernet header, or
57 * NULL if no subsequent header is present.
58 *
59 * Remaining must point to the number of bytes captured from the Ethernet header
60 * and beyond.  It will be decremented by the number of bytes skipped to find
62 *
63 * If the Ethernet header is complete but there are zero bytes of payload after
64 * the end of the header, a pointer to where the payload would be is returned
65 * and remaining will be set to 0.  If the Ethernet header is incomplete
66 * (truncated), then NULL is returned and remaining will be set to 0.
67 * Therefore, it is very important to check the value of remaining after
68 * calling this function.
69 *
70 * @note \ref trace_get_payload_from_layer2 provides a suitable alternative that is
71 * actually available via the external API
72 */
74                uint16_t *type,
75                uint32_t *remaining);
[8106a45]76
[a81d2fc]77/* l3 definitions */
[8106a45]78
79/** Ports structure used to get the source and destination ports for transport
80 * protocols */
[a81d2fc]81struct ports_t {
[8106a45]82        uint16_t src;           /**< Source port */
83        uint16_t dst;           /**< Destination port */
[a81d2fc]84};
85
[be1b03a]86#endif
Note: See TracBrowser for help on using the repository browser.