Main Page | Data Structures | Directories | File List | Data Fields | Globals

rt_protocol.h

00001 #ifndef _RT_PROTOCOL_H
00002 #define _RT_PROTOCOL_H
00003 
00004 #include "libtrace.h"
00005 #include <time.h>
00006 
00007 #define CAPTURE_PORT 3434
00008 #define COLLECTOR_PORT 3435
00009 
00010 #define RT_MAX_HDR_SIZE 256
00011 #define MAX_SEQUENCE 2147483647 
00012 
00013 /* Procedure for adding new RT control types
00014  * -------------------------------------------
00015  *
00016  * Add type to the enum list
00017  * Add a struct below (even if it is empty - wrap it in an #if 0)
00018  * Update rt_get_capture_length
00019  * If type is intended to be sent TO clients, update rt_read_packet
00020  *      Otherwise, update server implementations e.g. WDCAP
00021  *
00022  * Procedure for adding new RT data types
00023  * ----------------------------------------
00024  * 
00025  * If you are adding a new format:
00026  *      RT_DATA_(new format) must be equal to RT_DATA_SIMPLE + 
00027  *              TRACE_FORMAT_(new_format)
00028  *      Add a new dummy trace type to the rt_format_t structure
00029  *      Set the dummy trace to NULL in rt_init_input
00030  *      Update rt_set_format
00031  *
00032  * If you are adding a new PCAP DLT type:
00033  *      RT_DATA_PCAP_(new DLT) must be equal to RT_DATA_PCAP + (DLT value)
00034  *      
00035  */
00036 
00037 typedef struct fifo_info {
00038         uint64_t in;
00039         uint64_t out;
00040         uint64_t ack;
00041         uint64_t length;
00042         uint64_t used;
00043 } fifo_info_t;
00044 
00046 typedef struct rt_header {
00047         libtrace_rt_types_t type;
00048         uint16_t length;
00049         uint32_t sequence;
00050 } rt_header_t;
00051 
00052 /* TODO: Reorganise this struct once more hello info is added */
00054 typedef struct rt_hello {
00055         uint8_t reliable;
00056 } rt_hello_t;
00057 
00058 #if 0
00059 typedef struct rt_start {
00060 
00061 } rt_start_t;
00062 #endif
00063 
00065 typedef struct rt_ack {
00066         uint32_t sequence;
00067 } rt_ack_t;
00068 
00070 typedef struct rt_status {
00071         fifo_info_t fifo_status;
00072 } rt_status_t;
00073 
00074 #if 0
00075 typedef struct rt_duck {
00076         /*duckinf_t duck; */
00077 } rt_duck_t;
00078 #endif
00079 
00080 #if 0
00081 typedef struct rt_end_data {
00082 
00083 } rt_end_data_t;
00084 #endif
00085 
00086 #if 0
00087 typedef struct rt_close {
00088 
00089 } rt_close_t; 
00090 #endif
00091 
00093 enum rt_conn_denied_t {
00094  RT_DENY_WRAPPER        =1,
00095  RT_DENY_FULL           =2,
00096  RT_DENY_AUTH           =3
00097 };
00098 
00100 typedef struct rt_deny_conn {
00101         enum rt_conn_denied_t reason;
00102 } rt_deny_conn_t;
00103 
00104 #if 0
00105 typedef struct rt_pause {
00106 
00107 } rt_pause_t;
00108 #endif
00109 
00110 #if 0
00111 typedef struct rt_pause_ack {
00112 
00113 } rt_pause_ack_t;
00114 #endif
00115 
00116 #if 0
00117 typedef struct rt_option {
00118 
00119 } rt_option_t;
00120 #endif
00121 
00122 #if 0
00123 typedef struct rt_keychange {
00124         
00125 } rt_keychange_t;
00126 #endif
00127 
00132 typedef struct duck2_4 {
00133         uint32_t        Command;
00134         uint32_t        Config;
00135         uint32_t        Clock_Inc;
00136         uint32_t        Clock_Wrap;
00137         uint32_t        DDS_Rate;
00138         uint32_t        Crystal_Freq;
00139         uint32_t        Synth_Freq; 
00140         uint32_t        Sync_Rate;
00141         uint64_t        Last_Ticks;
00142         uint32_t        Resyncs;
00143         uint32_t        Bad_Diffs;
00144         uint32_t        Bad_Offs;
00145         uint32_t        Bad_Pulses;
00146         uint32_t        Worst_Error;
00147         uint32_t        Worst_Off;
00148         uint32_t        Off_Limit;
00149         uint32_t        Off_Damp;
00150         uint32_t        Pulses;
00151         uint32_t        Single_Pulses_Missing;
00152         uint32_t        Longest_Pulse_Missing;
00153         uint32_t        Health;
00154         uint32_t        Sickness;
00155         int32_t         Error;
00156         int32_t         Offset;
00157         uint32_t        Stat_Start;
00158         uint32_t        Stat_End;   
00159         uint32_t        Set_Duck_Field;
00160 } PACKED duck2_4_t;
00161 
00163 typedef struct duck2_5 {
00164         uint32_t        Crystal_Freq;
00165         uint32_t        Synth_Freq;
00166         uint64_t        Last_Ticks;
00167         uint32_t        Resyncs;
00168         uint32_t        Bad_Pulses;
00169         uint32_t        Worst_Freq_Err;
00170         uint32_t        Worst_Phase_Err;
00171         uint32_t        Health_Thresh;
00172         uint32_t        Pulses;
00173         uint32_t        Single_Pulses_Missing;
00174         uint32_t        Longest_Pulse_Missing;
00175         uint32_t        Health;
00176         uint32_t        Sickness;
00177         int32_t         Freq_Err;
00178         int32_t         Phase_Err;
00179         uint32_t        Set_Duck_Field;
00180         uint32_t        Stat_Start;
00181         uint32_t        Stat_End;
00182         uint64_t        Last_TSC;
00183 } PACKED duck2_5_t;
00184 
00185 /*
00186 typedef struct rt_duck_2_4 {
00187         duck2_4_t duck;
00188 } rt_duck_2_4_t;
00189 
00190 typedef struct rt_duck_2_5 {
00191         duck2_5_t duck;
00192 } rt_duck_2_5_t;
00193 */
00194 
00195 #endif

Generated on Mon Feb 12 11:43:50 2007 for WAND Trace processing by  doxygen 1.4.2