Changeset 81c0b9e for lib/rt_protocol.h


Ignore:
Timestamp:
02/08/10 13:20:06 (12 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:
5511c14
Parents:
8106a45
Message:
  • Documented and licensed the last two header files in lib/
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
    134#ifndef _RT_PROTOCOL_H
    235#define _RT_PROTOCOL_H
     
    538#include <time.h>
    639
    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 */
    848#define COLLECTOR_PORT 3435
    949
     50/** Maximum size for the RT header */
    1051#define RT_MAX_HDR_SIZE 256
     52/** Maximum sequence number for the RT protocol */
    1153#define MAX_SEQUENCE 2147483647
    1254
     
    3577 */
    3678
     79/** Fifo statistics reported by the RT_STATUS message */
    3780typedef 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 */
    4386} fifo_info_t;
    4487
    4588/** RT packet header */
    4689typedef 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 */
    4995        uint32_t sequence;
    5096} rt_header_t;
    5197
    5298/* TODO: Reorganise this struct once more hello info is added */
     99
    53100/** RT Hello packet sub-header */
    54101typedef 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;       
    56105} rt_hello_t;
    57106
     
    64113/** RT Ack sub-header */
    65114typedef struct rt_ack {
     115        /** The sequence number of the last received RT packet */
    66116        uint32_t sequence;
    67117} rt_ack_t;
     
    69119/** RT Status sub-header */
    70120typedef struct rt_status {
     121        /** Statistics describing the current status of the sender fifo */
    71122        fifo_info_t fifo_status;
    72123} rt_status_t;
     
    90141#endif
    91142
    92 /** Connection denied reasons */
     143/** Reasons that an RT connection may be denied */
    93144enum 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
    97151};
    98152
    99153/** RT Denied Connection sub-header */
    100154typedef struct rt_deny_conn {
     155        /** The reason that the connection was denied */
    101156        enum rt_conn_denied_t reason;
    102157} rt_deny_conn_t;
     
    126181#endif
    127182
     183/** RT meta-data sub-header */
    128184typedef struct rt_metadata {
     185        /** Length of the label string that follows the header */
    129186        uint32_t label_len;
     187        /** Length of the value string that follows the header */
    130188        uint32_t value_len;
    131189} rt_metadata_t ;
    132190
    133191/** 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 */
    135196
    136197/** DAG 2.4 DUCK */
Note: See TracChangeset for help on using the changeset viewer.