source: lib/rt_protocol.h @ e7bc155

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since e7bc155 was 64b6517, checked in by Perry Lorier <perry@…>, 15 years ago

Fix pcap dependancies

  • Property mode set to 100644
File size: 3.5 KB
Line 
1#ifndef _RT_PROTOCOL_H
2#define _RT_PROTOCOL_H
3
4#include "libtrace.h"
5#ifdef HAVE_PCAP
6#include <pcap.h>
7#endif
8
9#define CAPTURE_PORT 3434
10#define COLLECTOR_PORT 3435
11
12#define RT_MAX_HDR_SIZE 256
13#define MAX_SEQUENCE 2147483647
14
15#define RT_DATA_SIMPLE 1000
16#define RT_DATA_PCAP 2000
17
18/* Procedure for adding new RT control types
19 * -------------------------------------------
20 *
21 * Add type to the enum list
22 * Add a struct below (even if it is empty)
23 * Update rt_get_capture_length
24 * If type is intended to be sent TO clients, update rt_read_packet
25 *      Otherwise, update server implementations e.g. WDCAP
26 *
27 * Procedure for adding new RT data types
28 * ----------------------------------------
29 *
30 * If you are adding a new format:
31 *      RT_DATA_(new format) must be equal to RT_DATA_SIMPLE +
32 *              TRACE_FORMAT_(new_format)
33 *      Add a new dummy trace type to the rt_format_t structure
34 *      Set the dummy trace to NULL in rt_init_input
35 *      Update rt_set_format
36 *
37 * If you are adding a new PCAP DLT type:
38 *      RT_DATA_PCAP_(new DLT) must be equal to RT_DATA_PCAP + (DLT value)
39 *     
40 */
41
42/* Type field definitions */
43enum rt_field_t {
44 RT_HELLO       =1,     /* Connection accepted */
45 RT_START       =2,     /* Request for data transmission to begin */
46 RT_ACK         =3,     /* Data acknowledgement */
47 RT_STATUS      =4,     /* Fifo status packet */
48 RT_DUCK        =5,     /* Dag duck info packet */
49 RT_END_DATA    =6,     /* Server is exiting message */
50 RT_CLOSE       =7,     /* Client is exiting message */
51 RT_DENY_CONN   =8,     /* Connection has been denied */
52 RT_PAUSE       =9,     /* Request server to suspend sending data */
53 RT_PAUSE_ACK   =10,    /* Server is paused message */
54 RT_OPTION      =11,    /* Option request */
55 RT_KEYCHANGE   =12,    /* Anonymisation key has changed */ 
56 
57 RT_DATA_ERF            =RT_DATA_SIMPLE + TRACE_FORMAT_ERF, 
58 RT_DATA_WAG            =RT_DATA_SIMPLE + TRACE_FORMAT_WAG, 
59 RT_DATA_LEGACY_ATM     =RT_DATA_SIMPLE + TRACE_FORMAT_LEGACY_ATM, 
60 RT_DATA_LEGACY_POS     =RT_DATA_SIMPLE + TRACE_FORMAT_LEGACY_POS, 
61 RT_DATA_LEGACY_ETH     =RT_DATA_SIMPLE + TRACE_FORMAT_LEGACY_ETH, 
62
63#ifdef HAVE_PCAP
64 RT_DATA_PCAP_NULL              =RT_DATA_PCAP + DLT_NULL,
65 RT_DATA_PCAP_EN10MB            =RT_DATA_PCAP + DLT_EN10MB,
66 RT_DATA_PCAP_ATM_RFC1483       =RT_DATA_PCAP + DLT_ATM_RFC1483,
67 RT_DATA_PCAP_IEEE802_11        =RT_DATA_PCAP + DLT_IEEE802_11,
68#ifdef DLT_LINUX_SLL
69 RT_DATA_PCAP_LINUX_SLL         =RT_DATA_PCAP + DLT_LINUX_SLL,
70#endif
71#ifdef DLT_PFLOG
72 RT_DATA_PCAP_PFLOG             =RT_DATA_PCAP + DLT_PFLOG,
73#endif
74#endif
75 RT_LAST = 3000
76};
77
78typedef struct fifo_info {
79        uint64_t in;
80        uint64_t out;
81        uint64_t ack;
82        uint64_t length;
83        uint64_t used;
84} fifo_info_t;
85
86/* RT packet header */
87typedef struct rt_header {
88        enum rt_field_t type;
89        uint16_t length;
90        uint32_t sequence;
91} rt_header_t;
92
93/* TODO: Reorganise this struct once more hello info is added */
94typedef struct rt_hello {
95        uint8_t reliable;
96} rt_hello_t;
97
98typedef struct rt_start {
99
100} rt_start_t;
101
102typedef struct rt_ack {
103        uint32_t sequence;
104} rt_ack_t;
105
106typedef struct rt_status {
107        fifo_info_t fifo_status;
108} rt_status_t;
109
110typedef struct rt_duck {
111        /*duckinf_t duck; */
112} rt_duck_t;
113
114typedef struct rt_end_data {
115
116} rt_end_data_t;
117
118 typedef struct rt_close {
119
120} rt_close_t; 
121
122
123/* Connection denied reasons */
124enum rt_conn_denied_t {
125 RT_DENY_WRAPPER        =1,
126 RT_DENY_FULL           =2,
127 RT_DENY_AUTH           =3
128};
129
130typedef struct rt_deny_conn {
131        enum rt_conn_denied_t reason;
132} rt_deny_conn_t;
133
134
135typedef struct rt_pause {
136
137} rt_pause_t;
138
139typedef struct rt_pause_ack {
140
141} rt_pause_ack_t;
142
143typedef struct rt_option {
144
145} rt_option_t;
146
147typedef struct rt_keychange {
148       
149} rt_keychange_t;
150
151#endif
Note: See TracBrowser for help on using the repository browser.