source: lib/rt_protocol.h @ 2d96bf2

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

Remove reliance on pcap.h for DLT_'s (and while we're here, make them a pretty
enum, so we get warnings if we forget one somewhere)

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