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
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
00192
00193
00194
00195
00196
00197
00198
00199
00200 #endif