source: lib/rt_protocol.h @ dd06159

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

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

  • Property mode set to 100644
File size: 4.1 KB
RevLine 
[49babe0]1#ifndef _RT_PROTOCOL_H
2#define _RT_PROTOCOL_H
3
4#include "libtrace.h"
[da34e20]5#include <time.h>
[49babe0]6
7#define CAPTURE_PORT 3434
8#define COLLECTOR_PORT 3435
9
[6dbc47a]10#define RT_MAX_HDR_SIZE 256
11#define MAX_SEQUENCE 2147483647
12
[b51edf5]13/* Procedure for adding new RT control types
14 * -------------------------------------------
15 *
16 * Add type to the enum list
[da34e20]17 * Add a struct below (even if it is empty - wrap it in an #if 0)
[b51edf5]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
[6dbc47a]37typedef struct fifo_info {
[20b7e75]38        uint64_t in;
39        uint64_t out;
40        uint64_t ack;
41        uint64_t length;
42        uint64_t used;
[6dbc47a]43} fifo_info_t;
[49babe0]44
[da34e20]45/** RT packet header */
[49babe0]46typedef struct rt_header {
[cab58c5]47        libtrace_rt_types_t type;
[49babe0]48        uint16_t length;
[6dbc47a]49        uint32_t sequence;
[afd0b73]50} rt_header_t;
[49babe0]51
[6dbc47a]52/* TODO: Reorganise this struct once more hello info is added */
[da34e20]53/** RT Hello packet sub-header */
[49babe0]54typedef struct rt_hello {
[6dbc47a]55        uint8_t reliable;
[49babe0]56} rt_hello_t;
57
[4617920]58#if 0
[49babe0]59typedef struct rt_start {
60
61} rt_start_t;
[4617920]62#endif
[49babe0]63
[da34e20]64/** RT Ack sub-header */
[49babe0]65typedef struct rt_ack {
[6dbc47a]66        uint32_t sequence;
[49babe0]67} rt_ack_t;
68
[da34e20]69/** RT Status sub-header */
[49babe0]70typedef struct rt_status {
[6dbc47a]71        fifo_info_t fifo_status;
[49babe0]72} rt_status_t;
73
[4617920]74#if 0
[49babe0]75typedef struct rt_duck {
[1fbd938]76        /*duckinf_t duck; */
[49babe0]77} rt_duck_t;
[4617920]78#endif
[49babe0]79
[4617920]80#if 0
[49babe0]81typedef struct rt_end_data {
82
83} rt_end_data_t;
[4617920]84#endif
[49babe0]85
[4617920]86#if 0
87typedef struct rt_close {
[49babe0]88
[5fb2251]89} rt_close_t;
[4617920]90#endif
[49babe0]91
[da34e20]92/** Connection denied reasons */
[1fbd938]93enum rt_conn_denied_t {
94 RT_DENY_WRAPPER        =1,
95 RT_DENY_FULL           =2,
96 RT_DENY_AUTH           =3
97};
[49babe0]98
[da34e20]99/** RT Denied Connection sub-header */
[49babe0]100typedef struct rt_deny_conn {
[1fbd938]101        enum rt_conn_denied_t reason;
[49babe0]102} rt_deny_conn_t;
103
[4617920]104#if 0
[49babe0]105typedef struct rt_pause {
106
107} rt_pause_t;
[4617920]108#endif
[49babe0]109
[4617920]110#if 0
[49babe0]111typedef struct rt_pause_ack {
112
113} rt_pause_ack_t;
[4617920]114#endif
[49babe0]115
[4617920]116#if 0
[49babe0]117typedef struct rt_option {
118
119} rt_option_t;
[4617920]120#endif
[49babe0]121
[4617920]122#if 0
[b51edf5]123typedef struct rt_keychange {
124       
125} rt_keychange_t;
[4617920]126#endif
[20b7e75]127
[b778083]128typedef struct rt_metadata {
129        uint32_t label_len;
130        uint32_t value_len;
131} rt_metadata_t ;
132
[da34e20]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;
[d8fea2b]162        uint32_t        Stat_Start;
163        uint32_t        Stat_End;   
[da34e20]164        uint32_t        Set_Duck_Field;
[d8fea2b]165} PACKED duck2_4_t;
[da34e20]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;
[d8fea2b]185        uint32_t        Stat_Start;
186        uint32_t        Stat_End;
[da34e20]187        uint64_t        Last_TSC;
[d8fea2b]188} PACKED duck2_5_t;
[da34e20]189
[cd7eec7]190/*
[da34e20]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;
[cd7eec7]198*/
[da34e20]199
[49babe0]200#endif
Note: See TracBrowser for help on using the repository browser.