• Main Page
  • Related Pages
  • Data Structures
  • Files
  • File List
  • Globals

rt_protocol.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of libtrace
00003  *
00004  * Copyright (c) 2007,2008,2009,2010 The University of Waikato, Hamilton, 
00005  * New Zealand.
00006  *
00007  * Authors: Daniel Lawson 
00008  *          Perry Lorier
00009  *          Shane Alcock 
00010  *          
00011  * All rights reserved.
00012  *
00013  * This code has been developed by the University of Waikato WAND 
00014  * research group. For further information please see http://www.wand.net.nz/
00015  *
00016  * libtrace is free software; you can redistribute it and/or modify
00017  * it under the terms of the GNU General Public License as published by
00018  * the Free Software Foundation; either version 2 of the License, or
00019  * (at your option) any later version.
00020  *
00021  * libtrace is distributed in the hope that it will be useful,
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024  * GNU General Public License for more details.
00025  *
00026  * You should have received a copy of the GNU General Public License
00027  * along with libtrace; if not, write to the Free Software
00028  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00029  *
00030  * $Id: rt_protocol.h 1516 2010-02-08 00:20:06Z salcock $
00031  *
00032  */
00033 
00034 #ifndef _RT_PROTOCOL_H
00035 #define _RT_PROTOCOL_H
00036 
00037 #include "libtrace.h"
00038 #include <time.h>
00039 
00048 #define COLLECTOR_PORT 3435
00049 
00051 #define RT_MAX_HDR_SIZE 256
00052 
00053 #define MAX_SEQUENCE 2147483647 
00054 
00055 /* Procedure for adding new RT control types
00056  * -------------------------------------------
00057  *
00058  * Add type to the enum list
00059  * Add a struct below (even if it is empty - wrap it in an #if 0)
00060  * Update rt_get_capture_length
00061  * If type is intended to be sent TO clients, update rt_read_packet
00062  *      Otherwise, update server implementations e.g. WDCAP
00063  *
00064  * Procedure for adding new RT data types
00065  * ----------------------------------------
00066  * 
00067  * If you are adding a new format:
00068  *      RT_DATA_(new format) must be equal to RT_DATA_SIMPLE + 
00069  *              TRACE_FORMAT_(new_format)
00070  *      Add a new dummy trace type to the rt_format_t structure
00071  *      Set the dummy trace to NULL in rt_init_input
00072  *      Update rt_set_format
00073  *
00074  * If you are adding a new PCAP DLT type:
00075  *      RT_DATA_PCAP_(new DLT) must be equal to RT_DATA_PCAP + (DLT value)
00076  *      
00077  */
00078 
00080 typedef struct fifo_info {
00081         uint64_t in;            
00082         uint64_t out;           
00083         uint64_t ack;           
00084         uint64_t length;        
00085         uint64_t used;          
00086 } fifo_info_t;
00087 
00089 typedef struct rt_header {
00091         libtrace_rt_types_t type;       
00093         uint16_t length;                
00095         uint32_t sequence;
00096 } rt_header_t;
00097 
00098 /* TODO: Reorganise this struct once more hello info is added */
00099 
00101 typedef struct rt_hello {
00104         uint8_t reliable;       
00105 } rt_hello_t;
00106 
00107 #if 0
00108 typedef struct rt_start {
00109 
00110 } rt_start_t;
00111 #endif
00112 
00114 typedef struct rt_ack {
00116         uint32_t sequence;
00117 } rt_ack_t;
00118 
00120 typedef struct rt_status {
00122         fifo_info_t fifo_status;
00123 } rt_status_t;
00124 
00125 #if 0
00126 typedef struct rt_duck {
00127         /*duckinf_t duck; */
00128 } rt_duck_t;
00129 #endif
00130 
00131 #if 0
00132 typedef struct rt_end_data {
00133 
00134 } rt_end_data_t;
00135 #endif
00136 
00137 #if 0
00138 typedef struct rt_close {
00139 
00140 } rt_close_t; 
00141 #endif
00142 
00144 enum rt_conn_denied_t {
00146         RT_DENY_WRAPPER         =1,
00148         RT_DENY_FULL            =2,
00150         RT_DENY_AUTH            =3
00151 };
00152 
00154 typedef struct rt_deny_conn {
00156         enum rt_conn_denied_t reason;
00157 } rt_deny_conn_t;
00158 
00159 #if 0
00160 typedef struct rt_pause {
00161 
00162 } rt_pause_t;
00163 #endif
00164 
00165 #if 0
00166 typedef struct rt_pause_ack {
00167 
00168 } rt_pause_ack_t;
00169 #endif
00170 
00171 #if 0
00172 typedef struct rt_option {
00173 
00174 } rt_option_t;
00175 #endif
00176 
00177 #if 0
00178 typedef struct rt_keychange {
00179         
00180 } rt_keychange_t;
00181 #endif
00182 
00184 typedef struct rt_metadata {
00186         uint32_t label_len;
00188         uint32_t value_len;
00189 } rt_metadata_t ;
00190 
00198 typedef struct duck2_4 {
00199         uint32_t        Command;
00200         uint32_t        Config;
00201         uint32_t        Clock_Inc;
00202         uint32_t        Clock_Wrap;
00203         uint32_t        DDS_Rate;
00204         uint32_t        Crystal_Freq;
00205         uint32_t        Synth_Freq; 
00206         uint32_t        Sync_Rate;
00207         uint64_t        Last_Ticks;
00208         uint32_t        Resyncs;
00209         uint32_t        Bad_Diffs;
00210         uint32_t        Bad_Offs;
00211         uint32_t        Bad_Pulses;
00212         uint32_t        Worst_Error;
00213         uint32_t        Worst_Off;
00214         uint32_t        Off_Limit;
00215         uint32_t        Off_Damp;
00216         uint32_t        Pulses;
00217         uint32_t        Single_Pulses_Missing;
00218         uint32_t        Longest_Pulse_Missing;
00219         uint32_t        Health;
00220         uint32_t        Sickness;
00221         int32_t         Error;
00222         int32_t         Offset;
00223         uint32_t        Stat_Start;
00224         uint32_t        Stat_End;   
00225         uint32_t        Set_Duck_Field;
00226 } PACKED duck2_4_t;
00227 
00229 typedef struct duck2_5 {
00230         uint32_t        Crystal_Freq;
00231         uint32_t        Synth_Freq;
00232         uint64_t        Last_Ticks;
00233         uint32_t        Resyncs;
00234         uint32_t        Bad_Pulses;
00235         uint32_t        Worst_Freq_Err;
00236         uint32_t        Worst_Phase_Err;
00237         uint32_t        Health_Thresh;
00238         uint32_t        Pulses;
00239         uint32_t        Single_Pulses_Missing;
00240         uint32_t        Longest_Pulse_Missing;
00241         uint32_t        Health;
00242         uint32_t        Sickness;
00243         int32_t         Freq_Err;
00244         int32_t         Phase_Err;
00245         uint32_t        Set_Duck_Field;
00246         uint32_t        Stat_Start;
00247         uint32_t        Stat_End;
00248         uint64_t        Last_TSC;
00249 } PACKED duck2_5_t;
00250 
00251 /*
00252 typedef struct rt_duck_2_4 {
00253         duck2_4_t duck;
00254 } rt_duck_2_4_t;
00255 
00256 typedef struct rt_duck_2_5 {
00257         duck2_5_t duck;
00258 } rt_duck_2_5_t;
00259 */
00260 
00261 #endif

Generated on Mon Oct 8 2012 11:29:10 for WAND Trace processing by  doxygen 1.7.1