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

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 
00128 typedef struct rt_metadata {
00129         uint32_t label_len;
00130         uint32_t value_len;
00131 } rt_metadata_t ;
00132 
00137 typedef struct duck2_4 {
00138         uint32_t        Command;
00139         uint32_t        Config;
00140         uint32_t        Clock_Inc;
00141         uint32_t        Clock_Wrap;
00142         uint32_t        DDS_Rate;
00143         uint32_t        Crystal_Freq;
00144         uint32_t        Synth_Freq; 
00145         uint32_t        Sync_Rate;
00146         uint64_t        Last_Ticks;
00147         uint32_t        Resyncs;
00148         uint32_t        Bad_Diffs;
00149         uint32_t        Bad_Offs;
00150         uint32_t        Bad_Pulses;
00151         uint32_t        Worst_Error;
00152         uint32_t        Worst_Off;
00153         uint32_t        Off_Limit;
00154         uint32_t        Off_Damp;
00155         uint32_t        Pulses;
00156         uint32_t        Single_Pulses_Missing;
00157         uint32_t        Longest_Pulse_Missing;
00158         uint32_t        Health;
00159         uint32_t        Sickness;
00160         int32_t         Error;
00161         int32_t         Offset;
00162         uint32_t        Stat_Start;
00163         uint32_t        Stat_End;   
00164         uint32_t        Set_Duck_Field;
00165 } PACKED duck2_4_t;
00166 
00168 typedef struct duck2_5 {
00169         uint32_t        Crystal_Freq;
00170         uint32_t        Synth_Freq;
00171         uint64_t        Last_Ticks;
00172         uint32_t        Resyncs;
00173         uint32_t        Bad_Pulses;
00174         uint32_t        Worst_Freq_Err;
00175         uint32_t        Worst_Phase_Err;
00176         uint32_t        Health_Thresh;
00177         uint32_t        Pulses;
00178         uint32_t        Single_Pulses_Missing;
00179         uint32_t        Longest_Pulse_Missing;
00180         uint32_t        Health;
00181         uint32_t        Sickness;
00182         int32_t         Freq_Err;
00183         int32_t         Phase_Err;
00184         uint32_t        Set_Duck_Field;
00185         uint32_t        Stat_Start;
00186         uint32_t        Stat_End;
00187         uint64_t        Last_TSC;
00188 } PACKED duck2_5_t;
00189 
00190 /*
00191 typedef struct rt_duck_2_4 {
00192         duck2_4_t duck;
00193 } rt_duck_2_4_t;
00194 
00195 typedef struct rt_duck_2_5 {
00196         duck2_5_t duck;
00197 } rt_duck_2_5_t;
00198 */
00199 
00200 #endif

Generated on Thu Jan 3 10:28:47 2008 for WAND Trace processing by  doxygen 1.4.2