Changeset 81c0b9e for lib/rt_protocol.h
- Timestamp:
- 02/08/10 13:20:06 (11 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:
- 5511c14
- Parents:
- 8106a45
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/rt_protocol.h
rb778083 r81c0b9e 1 /* 2 * This file is part of libtrace 3 * 4 * Copyright (c) 2007,2008,2009,2010 The University of Waikato, Hamilton, 5 * New Zealand. 6 * 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 1 34 #ifndef _RT_PROTOCOL_H 2 35 #define _RT_PROTOCOL_H … … 5 38 #include <time.h> 6 39 7 #define CAPTURE_PORT 3434 40 /** @file 41 * 42 * @brief Header file containing definitions specific to the RT protocol that 43 * can be used to transport captured packets over a network connection. 44 * 45 */ 46 47 /** Default port for RT clients */ 8 48 #define COLLECTOR_PORT 3435 9 49 50 /** Maximum size for the RT header */ 10 51 #define RT_MAX_HDR_SIZE 256 52 /** Maximum sequence number for the RT protocol */ 11 53 #define MAX_SEQUENCE 2147483647 12 54 … … 35 77 */ 36 78 79 /** Fifo statistics reported by the RT_STATUS message */ 37 80 typedef struct fifo_info { 38 uint64_t in; 39 uint64_t out; 40 uint64_t ack; 41 uint64_t length; 42 uint64_t used; 81 uint64_t in; /**< The offset for the fifo write pointer */ 82 uint64_t out; /**< The offset for the fifo read pointer */ 83 uint64_t ack; /**< The offset for the fifo ACK pointer */ 84 uint64_t length; /**< The total length of the fifo */ 85 uint64_t used; /**< The amount of fifo space in use */ 43 86 } fifo_info_t; 44 87 45 88 /** RT packet header */ 46 89 typedef struct rt_header { 47 libtrace_rt_types_t type; 48 uint16_t length; 90 /** The type of RT packet */ 91 libtrace_rt_types_t type; 92 /** The length of the packet (not including the RT header */ 93 uint16_t length; 94 /** The sequence number of the packet */ 49 95 uint32_t sequence; 50 96 } rt_header_t; 51 97 52 98 /* TODO: Reorganise this struct once more hello info is added */ 99 53 100 /** RT Hello packet sub-header */ 54 101 typedef struct rt_hello { 55 uint8_t reliable; 102 /** Indicates whether the sender is acting in a reliable fashion, 103 * i.e. expecting acknowledgements */ 104 uint8_t reliable; 56 105 } rt_hello_t; 57 106 … … 64 113 /** RT Ack sub-header */ 65 114 typedef struct rt_ack { 115 /** The sequence number of the last received RT packet */ 66 116 uint32_t sequence; 67 117 } rt_ack_t; … … 69 119 /** RT Status sub-header */ 70 120 typedef struct rt_status { 121 /** Statistics describing the current status of the sender fifo */ 71 122 fifo_info_t fifo_status; 72 123 } rt_status_t; … … 90 141 #endif 91 142 92 /** Connection denied reasons*/143 /** Reasons that an RT connection may be denied */ 93 144 enum rt_conn_denied_t { 94 RT_DENY_WRAPPER =1, 95 RT_DENY_FULL =2, 96 RT_DENY_AUTH =3 145 /** The client failed a TCP wrapper check */ 146 RT_DENY_WRAPPER =1, 147 /** The server has reached the maximum number of client connections */ 148 RT_DENY_FULL =2, 149 /** Client failed to correctly authenticate */ 150 RT_DENY_AUTH =3 97 151 }; 98 152 99 153 /** RT Denied Connection sub-header */ 100 154 typedef struct rt_deny_conn { 155 /** The reason that the connection was denied */ 101 156 enum rt_conn_denied_t reason; 102 157 } rt_deny_conn_t; … … 126 181 #endif 127 182 183 /** RT meta-data sub-header */ 128 184 typedef struct rt_metadata { 185 /** Length of the label string that follows the header */ 129 186 uint32_t label_len; 187 /** Length of the value string that follows the header */ 130 188 uint32_t value_len; 131 189 } rt_metadata_t ; 132 190 133 191 /** Specifications of duck structures - duck2_4 and duck2_5 match Endace's 134 * duck_inf and duckinf_t respectively */ 192 * duck_inf and duckinf_t respectively. Unfortunately, Endace don't exactly 193 * make it clear what each value within the duck structure actually means. 194 * Some are self-explanatory but I have no idea about the others so our own 195 * documentation is a bit weak as a result */ 135 196 136 197 /** DAG 2.4 DUCK */
Note: See TracChangeset
for help on using the changeset viewer.