-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvnscommand.h
More file actions
executable file
·140 lines (105 loc) · 3.67 KB
/
Copy pathvnscommand.h
File metadata and controls
executable file
·140 lines (105 loc) · 3.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*-----------------------------------------------------------------------------
File: vnscommand.h
Date: Sat Apr 06 21:58:07 PST 2002
Contact: casado@stanford.edu
Description:
A c-style declaration of commands for the virtual router.
---------------------------------------------------------------------------*/
#ifndef __VNSCOMMAND_H
#define __VNSCOMMAND_H
#define VNSOPEN 1
#define VNSCLOSE 2
#define VNSPACKET 4
#define VNSBANNER 8
#define VNSHWINFO 16
#define IDSIZE 32
/*-----------------------------------------------------------------------------
BASE
---------------------------------------------------------------------------*/
typedef struct
{
uint32_t mLen;
uint32_t mType;
}__attribute__ ((__packed__)) c_base;
/*-----------------------------------------------------------------------------
OPEN
---------------------------------------------------------------------------*/
typedef struct
{
uint32_t mLen;
uint32_t mType; /* = VNSOPEN */
uint16_t topoID; /* Id of the topology we want to run on */
uint16_t pad; /* unused */
char mVirtualHostID[IDSIZE]; /* Id of the simulated router (e.g.
'VNS-A'); */
char mUID[IDSIZE]; /* User id (e.g. "appenz"), for information only */
char mPass[IDSIZE];
}__attribute__ ((__packed__)) c_open;
/*-----------------------------------------------------------------------------
CLOSE
---------------------------------------------------------------------------*/
typedef struct
{
uint32_t mLen;
uint32_t mType;
char mErrorMessage[256];
}__attribute__ ((__packed__)) c_close;
/*-----------------------------------------------------------------------------
HWREQUEST
---------------------------------------------------------------------------*/
typedef struct
{
uint32_t mLen;
uint32_t mType;
}__attribute__ ((__packed__)) c_hwrequest;
/*-----------------------------------------------------------------------------
BANNER
---------------------------------------------------------------------------*/
typedef struct
{
uint32_t mLen;
uint32_t mType;
char mBannerMessage[256];
}__attribute__ ((__packed__)) c_banner;
/*-----------------------------------------------------------------------------
PACKET (header)
---------------------------------------------------------------------------*/
typedef struct
{
uint32_t mLen;
uint32_t mType;
char mInterfaceName[16];
uint8_t ether_dhost[6];
uint8_t ether_shost[6];
uint16_t ether_type;
}__attribute__ ((__packed__)) c_packet_ethernet_header;
typedef struct
{
uint32_t mLen;
uint32_t mType;
char mInterfaceName[16];
}__attribute__ ((__packed__)) c_packet_header;
/*-----------------------------------------------------------------------------
HWInfo
----------------------------------------------------------------------------*/
#define HWINTERFACE 1
#define HWSPEED 2
#define HWSUBNET 4
#define HWINUSE 8
#define HWFIXEDIP 16
#define HWETHER 32
#define HWETHIP 64
#define HWMASK 128
typedef struct
{
uint32_t mKey;
char value[32];
}__attribute__ ((__packed__)) c_hw_entry;
typedef struct
{
#define MAXHWENTRIES 256
uint32_t mLen;
uint32_t mType;
c_hw_entry mHWInfo[MAXHWENTRIES];
}__attribute__ ((__packed__)) c_hwinfo;
#endif /* __VNSCOMMAND_H */