source: lib/rt_protocol.h @ 78f750e

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

Added definition of rt protocol to libtrace.
Rtclients will now skip over packets that contain no useful message body
rt_protocol.h will be installed with other header files.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*
2 * This file is part of wdcap
3 *
4 * Copyright (c) 2004 The University of Waikato, Hamilton, New Zealand.
5 * Authors: Daniel Lawson
6 *          Shane Alcock
7 *
8 * All rights reserved.
9 *
10 * This code has been developed by the University of Waikato WAND
11 * research group. For further information please see http://www.wand.net.nz/
12 *
13 * wdcap is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * wdcap is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with wdcap; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 *
27 * $Id$
28 */
29
30#ifndef _RT_PROTOCOL_H_
31#define _RT_PROTOCOL_H_
32#include "config.h"
33
34#ifdef HAVE_DAG
35#       include <dagapi.h>
36#       include <dagnew.h>
37#else
38#       include <dagformat.h>
39#endif
40
41#include <libfifo.h>
42
43#define CAPTURE_PORT 3434
44#define COLLECTOR_PORT 3435
45
46#define MAXDATASIZE 65536
47
48// Server status codes
49#define S_KEYCHANGE 1 // Encryption key has changed, flush collection to disk
50#define S_DISKWARN 2 // Disk is > 75% used
51#define S_DISKCRIT 4 // Disk is > 90% used
52#define S_DISKFULL 8 // Disk is > 95% used
53#define S_STATUS 16 // Packet is a wdcap_status packet
54#define S_LOSTDATA 32 // capture restarted, flush collection to disk
55#define S_LOSTCONN 64 // connection to collector restarted, flush collection to disk
56/* ----------------------*/ 
57/* Codes for messages that cannot be parsed by libtrace */ 
58#define S_ALLCONN 128 // Already someone connected. Go away
59#define S_DUCKINFO 256 // Duck information packet
60#define S_FINISH 512 // No more data - close connection
61#define S_ACCEPT 1024 // Connection accepted
62
63#define S_MESSAGE_ONLY S_ALLCONN
64
65// fifo_state_t is a tricky data type to transmit and receive so
66// it's easier to create a specialised version for wdcap
67typedef struct fifo_info {
68        fifo_offset_t length;
69        fifo_offset_t used;
70        fifo_offset_t in;
71        fifo_offset_t out;
72        fifo_offset_t ack;
73} fifo_info_t;
74
75typedef struct fifo_status {
76        fifo_info_t fifo;
77} fifo_status_t;
78
79typedef struct duck_info {
80        duck_inf duck;
81} duck_info_t;
82
83typedef struct packet_header {
84        uint32_t message;
85        dag_record_t erf;
86} packet_header_t;
87
88typedef struct ack_packet {
89        uint32_t header;
90        long long int ts;
91} ack_packet_t;
92
93// Client message codes
94#define M_HALT_CAPTURE 1        // Request to halt capture
95#define M_START_CAPTURE 2       // Request to restart capture
96#define M_CONFIGURE 4           // Configuration info follows
97#define M_ACK 8                 // Ack
98
99#endif // _RT_PROTOCOL_H_
Note: See TracBrowser for help on using the repository browser.