source: lib/rt_protocol.h @ 6dbc47a

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

Updated all formats to use TRACE_FORMAT_* instead of nasty strings
format_rt is in a state where it provides basic client services
Added trace_get_format() function
libtrace_packet_t has a type field for storing format now

  • Property mode set to 100644
File size: 1.9 KB
Line 
1#ifndef _RT_PROTOCOL_H
2#define _RT_PROTOCOL_H
3
4#include "libtrace.h"
5
6#define CAPTURE_PORT 3434
7#define COLLECTOR_PORT 3435
8
9#define RT_MAX_HDR_SIZE 256
10#define MAX_SEQUENCE 2147483647
11
12/* Type field definitions */
13/* NOTE: RT_DATA should always be zero */
14enum rt_field_t {
15 RT_DATA        =0,     /* Libtrace data packet */
16 RT_HELLO       =1,     /* Connection accepted */
17 RT_START       =2,     /* Request for data transmission to begin */
18 RT_ACK         =3,     /* Data acknowledgement */
19 RT_STATUS      =4,     /* Fifo status packet */
20 RT_DUCK        =5,     /* Dag duck info packet */
21 RT_END_DATA    =6,     /* Server is exiting message */
22 RT_CLOSE       =7,     /* Client is exiting message */
23 RT_DENY_CONN   =8,     /* Connection has been denied */
24 RT_PAUSE       =9,     /* Request server to suspend sending data */
25 RT_PAUSE_ACK   =10,    /* Server is paused message */
26 RT_OPTION      =11     /* Option request */
27};
28
29typedef struct fifo_info {
30        uint64_t in;
31        uint64_t out;
32        uint64_t ack;
33        uint64_t length;
34        uint64_t used;
35} fifo_info_t;
36
37/* RT packet header */
38typedef struct rt_header {
39        enum rt_field_t type;
40        uint16_t length;
41} rt_header_t;
42
43typedef struct rt_data {
44        uint16_t format;
45        uint32_t sequence;
46} rt_data_t;
47
48/* TODO: Reorganise this struct once more hello info is added */
49typedef struct rt_hello {
50        uint8_t reliable;
51} rt_hello_t;
52
53typedef struct rt_start {
54
55} rt_start_t;
56
57typedef struct rt_ack {
58        uint32_t sequence;
59} rt_ack_t;
60
61typedef struct rt_status {
62        fifo_info_t fifo_status;
63} rt_status_t;
64
65typedef struct rt_duck {
66        /*duckinf_t duck; */
67} rt_duck_t;
68
69typedef struct rt_end_data {
70
71} rt_end_data_t;
72
73typedef struct rt_close {
74
75} rt_close_t;
76
77
78/* Connection denied reasons */
79enum rt_conn_denied_t {
80 RT_DENY_WRAPPER        =1,
81 RT_DENY_FULL           =2,
82 RT_DENY_AUTH           =3
83};
84
85typedef struct rt_deny_conn {
86        enum rt_conn_denied_t reason;
87} rt_deny_conn_t;
88
89
90typedef struct rt_pause {
91
92} rt_pause_t;
93
94typedef struct rt_pause_ack {
95
96} rt_pause_ack_t;
97
98typedef struct rt_option {
99
100} rt_option_t;
101
102
103
104
105#endif
Note: See TracBrowser for help on using the repository browser.