source: lib/rt_protocol.h @ e4e1635

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

Changed rt types so that every pcap dlt has a matching rt type
Added functions for conversion between rt type and pcap dlt
format_rt now uses trace_set_err appropriately if rt_connect fails
format_pcap will check if a trace is dead before trying to look at

format data

Dead traces now have their format_data set to NULL
packet->type is now 32 bits, not 8

  • Property mode set to 100644
File size: 2.5 KB
Line 
1#ifndef _RT_PROTOCOL_H
2#define _RT_PROTOCOL_H
3
4#include "libtrace.h"
5#include <pcap.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#define RT_DATA_SIMPLE 1000
14#define RT_DATA_PCAP 2000
15
16/* Type field definitions */
17enum rt_field_t {
18 RT_HELLO       =1,     /* Connection accepted */
19 RT_START       =2,     /* Request for data transmission to begin */
20 RT_ACK         =3,     /* Data acknowledgement */
21 RT_STATUS      =4,     /* Fifo status packet */
22 RT_DUCK        =5,     /* Dag duck info packet */
23 RT_END_DATA    =6,     /* Server is exiting message */
24 RT_CLOSE       =7,     /* Client is exiting message */
25 RT_DENY_CONN   =8,     /* Connection has been denied */
26 RT_PAUSE       =9,     /* Request server to suspend sending data */
27 RT_PAUSE_ACK   =10,    /* Server is paused message */
28 RT_OPTION      =11,    /* Option request */
29 
30 RT_DATA_ERF            =RT_DATA_SIMPLE + TRACE_FORMAT_ERF, 
31 RT_DATA_WAG            =RT_DATA_SIMPLE + TRACE_FORMAT_WAG, 
32 RT_DATA_LEGACY_ATM     =RT_DATA_SIMPLE + TRACE_FORMAT_LEGACY_ATM, 
33 RT_DATA_LEGACY_POS     =RT_DATA_SIMPLE + TRACE_FORMAT_LEGACY_POS, 
34 RT_DATA_LEGACY_ETH     =RT_DATA_SIMPLE + TRACE_FORMAT_LEGACY_ETH, 
35
36 RT_DATA_PCAP_NULL              =RT_DATA_PCAP + DLT_NULL,
37 RT_DATA_PCAP_EN10MB            =RT_DATA_PCAP + DLT_EN10MB,
38 RT_DATA_PCAP_ATM_RFC1483       =RT_DATA_PCAP + DLT_ATM_RFC1483,
39 RT_DATA_PCAP_IEEE802_11        =RT_DATA_PCAP + DLT_IEEE802_11,
40#ifdef DLT_LINUX_SLL
41 RT_DATA_PCAP_LINUX_SLL         =RT_DATA_PCAP + DLT_LINUX_SLL,
42#endif
43#ifdef DLT_PFLOG
44 RT_DATA_PCAP_PFLOG             =RT_DATA_PCAP + DLT_PFLOG,
45#endif
46
47};
48
49typedef struct fifo_info {
50        uint64_t in;
51        uint64_t out;
52        uint64_t ack;
53        uint64_t length;
54        uint64_t used;
55} fifo_info_t;
56
57/* RT packet header */
58typedef struct rt_header {
59        enum rt_field_t type;
60        uint16_t length;
61        uint32_t sequence;
62} rt_header_t;
63
64/* TODO: Reorganise this struct once more hello info is added */
65typedef struct rt_hello {
66        uint8_t reliable;
67} rt_hello_t;
68
69typedef struct rt_start {
70
71} rt_start_t;
72
73typedef struct rt_ack {
74        uint32_t sequence;
75} rt_ack_t;
76
77typedef struct rt_status {
78        fifo_info_t fifo_status;
79} rt_status_t;
80
81typedef struct rt_duck {
82        /*duckinf_t duck; */
83} rt_duck_t;
84
85typedef struct rt_end_data {
86
87} rt_end_data_t;
88
89 typedef struct rt_close {
90
91} rt_close_t; 
92
93
94/* Connection denied reasons */
95enum rt_conn_denied_t {
96 RT_DENY_WRAPPER        =1,
97 RT_DENY_FULL           =2,
98 RT_DENY_AUTH           =3
99};
100
101typedef struct rt_deny_conn {
102        enum rt_conn_denied_t reason;
103} rt_deny_conn_t;
104
105
106typedef struct rt_pause {
107
108} rt_pause_t;
109
110typedef struct rt_pause_ack {
111
112} rt_pause_ack_t;
113
114typedef struct rt_option {
115
116} rt_option_t;
117
118
119
120
121#endif
Note: See TracBrowser for help on using the repository browser.