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
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
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
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
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
00187
00188
00189
00190
00191
00192
00193
00194
00195 #endif