source: lib/rt_protocol.h @ a81d2fc

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since a81d2fc was b778083, checked in by Shane Alcock <salcock@…>, 14 years ago

Added a new RT packet type for transmitting trace meta-data

  • Property mode set to 100644
File size: 4.1 KB
Line 
1#ifndef _RT_PROTOCOL_H
2#define _RT_PROTOCOL_H
3
4#include "libtrace.h"
5#include <time.h>
6
7#define CAPTURE_PORT 3434
8#define COLLECTOR_PORT 3435
9
10#define RT_MAX_HDR_SIZE 256
11#define MAX_SEQUENCE 2147483647
12
13/* Procedure for adding new RT control types
14 * -------------------------------------------
15 *
16 * Add type to the enum list
17 * Add a struct below (even if it is empty - wrap it in an #if 0)
18 * Update rt_get_capture_length
19 * If type is intended to be sent TO clients, update rt_read_packet
20 *      Otherwise, update server implementations e.g. WDCAP
21 *
22 * Procedure for adding new RT data types
23 * ----------------------------------------
24 *
25 * If you are adding a new format:
26 *      RT_DATA_(new format) must be equal to RT_DATA_SIMPLE +
27 *              TRACE_FORMAT_(new_format)
28 *      Add a new dummy trace type to the rt_format_t structure
29 *      Set the dummy trace to NULL in rt_init_input
30 *      Update rt_set_format
31 *
32 * If you are adding a new PCAP DLT type:
33 *      RT_DATA_PCAP_(new DLT) must be equal to RT_DATA_PCAP + (DLT value)
34 *     
35 */
36
37typedef struct fifo_info {
38        uint64_t in;
39        uint64_t out;
40        uint64_t ack;
41        uint64_t length;
42        uint64_t used;
43} fifo_info_t;
44
45/** RT packet header */
46typedef struct rt_header {
47        libtrace_rt_types_t type;
48        uint16_t length;
49        uint32_t sequence;
50} rt_header_t;
51
52/* TODO: Reorganise this struct once more hello info is added */
53/** RT Hello packet sub-header */
54typedef struct rt_hello {
55        uint8_t reliable;
56} rt_hello_t;
57
58#if 0
59typedef struct rt_start {
60
61} rt_start_t;
62#endif
63
64/** RT Ack sub-header */
65typedef struct rt_ack {
66        uint32_t sequence;
67} rt_ack_t;
68
69/** RT Status sub-header */
70typedef struct rt_status {
71        fifo_info_t fifo_status;
72} rt_status_t;
73
74#if 0
75typedef struct rt_duck {
76        /*duckinf_t duck; */
77} rt_duck_t;
78#endif
79
80#if 0
81typedef struct rt_end_data {
82
83} rt_end_data_t;
84#endif
85
86#if 0
87typedef struct rt_close {
88
89} rt_close_t;
90#endif
91
92/** Connection denied reasons */
93enum rt_conn_denied_t {
94 RT_DENY_WRAPPER        =1,
95 RT_DENY_FULL           =2,
96 RT_DENY_AUTH           =3
97};
98
99/** RT Denied Connection sub-header */
100typedef struct rt_deny_conn {
101        enum rt_conn_denied_t reason;
102} rt_deny_conn_t;
103
104#if 0
105typedef struct rt_pause {
106
107} rt_pause_t;
108#endif
109
110#if 0
111typedef struct rt_pause_ack {
112
113} rt_pause_ack_t;
114#endif
115
116#if 0
117typedef struct rt_option {
118
119} rt_option_t;
120#endif
121
122#if 0
123typedef struct rt_keychange {
124       
125} rt_keychange_t;
126#endif
127
128typedef struct rt_metadata {
129        uint32_t label_len;
130        uint32_t value_len;
131} rt_metadata_t ;
132
133/** Specifications of duck structures - duck2_4 and duck2_5 match Endace's
134 * duck_inf and duckinf_t respectively */
135
136/** DAG 2.4 DUCK */
137typedef struct duck2_4 {
138        uint32_t        Command;
139        uint32_t        Config;
140        uint32_t        Clock_Inc;
141        uint32_t        Clock_Wrap;
142        uint32_t        DDS_Rate;
143        uint32_t        Crystal_Freq;
144        uint32_t        Synth_Freq; 
145        uint32_t        Sync_Rate;
146        uint64_t        Last_Ticks;
147        uint32_t        Resyncs;
148        uint32_t        Bad_Diffs;
149        uint32_t        Bad_Offs;
150        uint32_t        Bad_Pulses;
151        uint32_t        Worst_Error;
152        uint32_t        Worst_Off;
153        uint32_t        Off_Limit;
154        uint32_t        Off_Damp;
155        uint32_t        Pulses;
156        uint32_t        Single_Pulses_Missing;
157        uint32_t        Longest_Pulse_Missing;
158        uint32_t        Health;
159        uint32_t        Sickness;
160        int32_t         Error;
161        int32_t         Offset;
162        uint32_t        Stat_Start;
163        uint32_t        Stat_End;   
164        uint32_t        Set_Duck_Field;
165} PACKED duck2_4_t;
166
167/** DAG 2.5 DUCK */
168typedef struct duck2_5 {
169        uint32_t        Crystal_Freq;
170        uint32_t        Synth_Freq;
171        uint64_t        Last_Ticks;
172        uint32_t        Resyncs;
173        uint32_t        Bad_Pulses;
174        uint32_t        Worst_Freq_Err;
175        uint32_t        Worst_Phase_Err;
176        uint32_t        Health_Thresh;
177        uint32_t        Pulses;
178        uint32_t        Single_Pulses_Missing;
179        uint32_t        Longest_Pulse_Missing;
180        uint32_t        Health;
181        uint32_t        Sickness;
182        int32_t         Freq_Err;
183        int32_t         Phase_Err;
184        uint32_t        Set_Duck_Field;
185        uint32_t        Stat_Start;
186        uint32_t        Stat_End;
187        uint64_t        Last_TSC;
188} PACKED duck2_5_t;
189
190/*
191typedef struct rt_duck_2_4 {
192        duck2_4_t duck;
193} rt_duck_2_4_t;
194
195typedef struct rt_duck_2_5 {
196        duck2_5_t duck;
197} rt_duck_2_5_t;
198*/
199
200#endif
Note: See TracBrowser for help on using the repository browser.