-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecode-geneve.c
499 lines (414 loc) · 17.8 KB
/
decode-geneve.c
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
/* Copyright (C) 2020-2021 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/**
* \file
*
* \author Ali Jad Khalil <jadkhal@amazon.com>
*
* Geneve tunneling scheme decoder.
*
* This implementation is based on the following specification doc:
* https://tools.ietf.org/html/draft-ietf-nvo3-geneve-16#section-3
*/
#include "suricata-common.h"
#include "decode.h"
#include "decode-geneve.h"
#include "decode-events.h"
#include "detect.h"
#include "detect-engine-port.h"
#include "flow.h"
#include "util-validate.h"
#include "util-unittest.h"
#include "util-debug.h"
#include "pkt-var.h"
#include "util-profiling.h"
#include "host.h"
#define VALID_GENEVE_VERSIONS \
{ \
0 \
}
#define GENEVE_VERSION(hdr_ptr) (hdr_ptr->ver_plus_len >> 6)
#define GENEVE_RESERVED_FLAGS(hdr_ptr) (hdr_ptr->flags & 0x3F)
#define GENEVE_MIN_HEADER_LEN sizeof(GeneveHeader)
#define GENEVE_TOTAL_OPT_LEN(hdr_ptr) ((uint8_t)((hdr_ptr->ver_plus_len & 0x3F) << 2))
#define GENEVE_TOTAL_HEADER_LEN(hdr_ptr) (GENEVE_MIN_HEADER_LEN + GENEVE_TOTAL_OPT_LEN(hdr_ptr))
#define GENEVE_MIN_SINGLE_OPT_LEN sizeof(GeneveOption)
#define GENEVE_SINGLE_OPT_LEN(option_ptr) ((uint8_t)((option_ptr->flags_plus_len & 0x1F) << 2))
#define GENEVE_SINGLE_OPT_TOTAL_LEN(option_ptr) \
(GENEVE_MIN_SINGLE_OPT_LEN + GENEVE_SINGLE_OPT_LEN(option_ptr))
#define GENEVE_MAX_PORTS 4
#define GENEVE_UNSET_PORT -1
#define GENEVE_DEFAULT_PORT 6081
#define GENEVE_DEFAULT_PORT_S "6081"
static bool g_geneve_enabled = true;
static int g_geneve_ports_idx = 0;
static int g_geneve_ports[GENEVE_MAX_PORTS] = { GENEVE_DEFAULT_PORT, GENEVE_UNSET_PORT,
GENEVE_UNSET_PORT, GENEVE_UNSET_PORT };
/* Geneve structs based on diagrams from the following specification doc:
* https://tools.ietf.org/html/draft-ietf-nvo3-geneve-16#section-3 */
typedef struct GeneveOption_ {
uint16_t option_class;
uint8_t type;
uint8_t flags_plus_len;
uint8_t option_data[0];
} GeneveOption;
typedef struct GeneveHeader_ {
uint8_t ver_plus_len;
uint8_t flags;
uint16_t eth_type;
uint8_t vni[3];
uint8_t res;
GeneveOption options[0];
} GeneveHeader;
bool DecodeGeneveEnabledForPort(const uint16_t sp, const uint16_t dp)
{
SCLogDebug("ports %u->%u ports %d %d %d %d", sp, dp, g_geneve_ports[0], g_geneve_ports[1],
g_geneve_ports[2], g_geneve_ports[3]);
if (g_geneve_enabled) {
for (int i = 0; i < g_geneve_ports_idx; i++) {
if (g_geneve_ports[i] == GENEVE_UNSET_PORT)
return false;
const int port = g_geneve_ports[i];
if (port == (const int)sp || port == (const int)dp)
return true;
}
}
return false;
}
static void DecodeGeneveConfigPorts(const char *pstr)
{
SCLogDebug("parsing \'%s\'", pstr);
DetectPort *head = NULL;
DetectPortParse(NULL, &head, pstr);
g_geneve_ports_idx = 0;
for (DetectPort *p = head; p != NULL; p = p->next) {
if (g_geneve_ports_idx >= GENEVE_MAX_PORTS) {
SCLogWarning("more than %d Geneve ports defined", GENEVE_MAX_PORTS);
break;
}
g_geneve_ports[g_geneve_ports_idx++] = (int)p->port;
}
DetectPortCleanupList(NULL, head);
}
void DecodeGeneveConfig(void)
{
int enabled = 0;
if (ConfGetBool("decoder.geneve.enabled", &enabled) == 1) {
if (enabled) {
g_geneve_enabled = true;
} else {
g_geneve_enabled = false;
}
}
if (g_geneve_enabled) {
ConfNode *node = ConfGetNode("decoder.geneve.ports");
if (node && node->val) {
DecodeGeneveConfigPorts(node->val);
} else {
DecodeGeneveConfigPorts(GENEVE_DEFAULT_PORT_S);
}
}
}
static inline bool IsValidGeneveVersion(const GeneveHeader *geneve_hdr)
{
const int valid_versions[] = VALID_GENEVE_VERSIONS;
const int num_versions = sizeof(valid_versions) / sizeof(int);
const uint8_t cur_version = GENEVE_VERSION(geneve_hdr);
for (int i = 0; i < num_versions; i++) {
if (valid_versions[i] == cur_version)
return true;
}
return false;
}
/* Performs a check to ensure that option lens add up to total length specified in the fixed header
*/
static inline bool IsHeaderLengthConsistentWithOptions(const GeneveHeader *geneve_hdr)
{
uint8_t *geneve_opt_ptr = (uint8_t *)geneve_hdr->options;
int remaining_hdr_len = GENEVE_TOTAL_OPT_LEN(geneve_hdr);
while (remaining_hdr_len > 0) {
const GeneveOption *cur_opt = (const GeneveOption *)geneve_opt_ptr;
const uint8_t cur_option_len = GENEVE_SINGLE_OPT_TOTAL_LEN(cur_opt);
geneve_opt_ptr += cur_option_len;
remaining_hdr_len -=
cur_option_len; /* cur_option_len will always be between 4-128, inclusive */
}
return (remaining_hdr_len == 0);
}
/** \param pkt payload data directly above UDP header
* \param len length in bytes of pkt
*/
int DecodeGeneve(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *pkt, uint32_t len)
{
DEBUG_VALIDATE_BUG_ON(pkt == NULL);
const GeneveHeader *geneve_hdr = (const GeneveHeader *)pkt;
uint16_t eth_type, geneve_hdr_len;
int decode_tunnel_proto = DECODE_TUNNEL_UNSET;
/* General Geneve packet validation */
if (unlikely(!g_geneve_enabled))
return TM_ECODE_FAILED;
if (unlikely(len < GENEVE_MIN_HEADER_LEN))
return TM_ECODE_FAILED;
if (!PacketIncreaseCheckLayers(p)) {
return TM_ECODE_FAILED;
}
/* Specific Geneve header field validation */
geneve_hdr_len = GENEVE_TOTAL_HEADER_LEN(geneve_hdr);
if (len < geneve_hdr_len)
return TM_ECODE_FAILED;
if (!IsValidGeneveVersion(geneve_hdr))
return TM_ECODE_FAILED;
if (GENEVE_RESERVED_FLAGS(geneve_hdr) != 0 || geneve_hdr->res != 0)
return TM_ECODE_FAILED;
if (!IsHeaderLengthConsistentWithOptions(geneve_hdr))
return TM_ECODE_FAILED;
#if DEBUG
/* Print the VNI for debugging purposes */
uint32_t vni = (geneve_hdr->vni[0] << 16) + (geneve_hdr->vni[1] << 8) + (geneve_hdr->vni[2]);
SCLogDebug("Geneve vni %u", vni);
#endif
/* Increment stats counter for Geneve packets */
StatsIncr(tv, dtv->counter_geneve);
/* Determine first protocol encapsulated after Geneve header */
eth_type = SCNtohs(geneve_hdr->eth_type);
SCLogDebug("Geneve ethertype 0x%04x", eth_type);
switch (eth_type) {
case ETHERNET_TYPE_IP:
SCLogDebug("Geneve found IPv4");
decode_tunnel_proto = DECODE_TUNNEL_IPV4;
break;
case ETHERNET_TYPE_IPV6:
SCLogDebug("Geneve found IPv6");
decode_tunnel_proto = DECODE_TUNNEL_IPV6;
break;
case ETHERNET_TYPE_BRIDGE:
SCLogDebug("Geneve found Ethernet");
decode_tunnel_proto = DECODE_TUNNEL_ETHERNET;
break;
case ETHERNET_TYPE_ARP:
SCLogDebug("Geneve found ARP");
break;
default:
SCLogDebug(
"Geneve found unsupported Ethertype - expected IPv4, IPv6, ARP, or Ethernet");
ENGINE_SET_INVALID_EVENT(p, GENEVE_UNKNOWN_PAYLOAD_TYPE);
}
/* Set-up and process inner packet if it is a supported ethertype */
if (decode_tunnel_proto != DECODE_TUNNEL_UNSET) {
Packet *tp = PacketTunnelPktSetup(
tv, dtv, p, pkt + geneve_hdr_len, len - geneve_hdr_len, decode_tunnel_proto);
if (tp != NULL) {
PKT_SET_SRC(tp, PKT_SRC_DECODER_GENEVE);
PacketEnqueueNoLock(&tv->decode_pq, tp);
}
}
return TM_ECODE_OK;
}
#ifdef UNITTESTS
/**
* \test DecodeGeneveTest01 tests a good Geneve header with 16-bytes of options.
* Contains a Ethernet+IPv6 DHCP request packet.
*/
static int DecodeGeneveTest01(void)
{
uint8_t raw_geneve[] = { 0x32, 0x10, 0x17, 0xc1, 0x00, 0xc1, 0x87, 0x51, /* UDP header */
0x04, 0x00, 0x65, 0x58, 0x00, 0x00, 0x25, 0x00, /* Geneve fixed header */
0x01, 0x08, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, /* Geneve variable options */
0x01, 0x08, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, /* Geneve variable options */
0x33, 0x33, 0x00, 0x01, 0x00, 0x02, /* inner destination MAC */
0x08, 0x00, 0x27, 0xfe, 0x8f, 0x95, /* inner source MAC */
0x86, 0xdd, /* type is IPv6 0x86dd */
0x60, 0x00, 0x00, 0x00, 0x00, 0x6b, 0x11, 0x01, /* IPv6 hdr */
0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x27, 0xff, 0xfe, 0xfe, 0x8f,
0x95, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x02, 0x02, 0x22, 0x02, 0x23, 0x00, 0x6b, 0x9c, 0xfb, /* UDP src port 546 */
0x03, 0x49, 0x17, 0x4e, 0x00, 0x01, 0x00, 0x0e, /* DHCP request payload */
0x00, 0x01, 0x00, 0x01, 0x1c, 0x39, 0xcf, 0x88, 0x08, 0x00, 0x27, 0xfe, 0x8f, 0x95, 0x00,
0x02, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x01, 0x1c, 0x38, 0x25, 0xe8, 0x08, 0x00, 0x27, 0xd4,
0x10, 0xbb, 0x00, 0x06, 0x00, 0x04, 0x00, 0x17, 0x00, 0x18, 0x00, 0x08, 0x00, 0x02, 0x00,
0x00, 0x00, 0x19, 0x00, 0x29, 0x27, 0xfe, 0x8f, 0x95, 0x00, 0x00, 0x0e, 0x10, 0x00, 0x00,
0x15, 0x18, 0x00, 0x1a, 0x00, 0x19, 0x00, 0x00, 0x1c, 0x20, 0x00, 0x00, 0x1d, 0x4c, 0x40,
0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00 };
Packet *p = PacketGetFromAlloc();
FAIL_IF_NULL(p);
ThreadVars tv;
DecodeThreadVars dtv;
DecodeGeneveConfigPorts(GENEVE_DEFAULT_PORT_S);
memset(&tv, 0, sizeof(ThreadVars));
memset(&dtv, 0, sizeof(DecodeThreadVars));
FlowInitConfig(FLOW_QUIET);
DecodeUDP(&tv, &dtv, p, raw_geneve, sizeof(raw_geneve));
FAIL_IF_NOT(PacketIsUDP(p));
FAIL_IF(tv.decode_pq.top == NULL);
Packet *tp = PacketDequeueNoLock(&tv.decode_pq);
FAIL_IF_NOT(PacketIsUDP(tp));
FAIL_IF_NOT(tp->sp == 546);
FlowShutdown();
PacketFree(p);
PacketFree(tp);
PASS;
}
/**
* \test DecodeGeneveTest02 tests a good Geneve header with 16-bytes of options.
* Contains a IPv4 DNS request packet.
*/
static int DecodeGeneveTest02(void)
{
uint8_t raw_geneve[] = {
0x32, 0x10, 0x17, 0xc1, 0x00, 0x3c, 0x87, 0x51, /* UDP header */
0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x25, 0x00, /* Geneve fixed header */
0x01, 0x08, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, /* Geneve variable options */
0x01, 0x08, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, /* Geneve variable options */
0x45, 0x00, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, /* IPv4 hdr */
0x44, 0x45, 0x0a, 0x60, 0x00, 0x0a, 0xb9, 0x1b, 0x73, 0x06, 0x00, 0x35, 0x30, 0x39, 0x00,
0x08, 0x98, 0xe4 /* UDP probe src port 53 */
};
Packet *p = PacketGetFromAlloc();
FAIL_IF_NULL(p);
ThreadVars tv;
DecodeThreadVars dtv;
DecodeGeneveConfigPorts(GENEVE_DEFAULT_PORT_S);
memset(&tv, 0, sizeof(ThreadVars));
memset(&dtv, 0, sizeof(DecodeThreadVars));
FlowInitConfig(FLOW_QUIET);
DecodeUDP(&tv, &dtv, p, raw_geneve, sizeof(raw_geneve));
FAIL_IF_NOT(PacketIsUDP(p));
FAIL_IF(tv.decode_pq.top == NULL);
Packet *tp = PacketDequeueNoLock(&tv.decode_pq);
FAIL_IF_NOT(PacketIsUDP(tp));
FAIL_IF_NOT(tp->sp == 53);
FlowShutdown();
PacketFree(p);
PacketFree(tp);
PASS;
}
/**
* \test DecodeGeneveTest03 tests a good Geneve header with 16-bytes of options.
* Contains a IPv4 DNS request packet with a VLAN tag after the Ethernet frame.
* In practice, this probably won't be used but it should be support either way.
*/
static int DecodeGeneveTest03(void)
{
uint8_t raw_geneve[] = {
0x32, 0x10, 0x17, 0xc1, 0x00, 0x4e, 0x87, 0x51, /* UDP header */
0x04, 0x00, 0x65, 0x58, 0x00, 0x00, 0x25, 0x00, /* Geneve fixed header */
0x01, 0x08, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, /* Geneve variable options */
0x01, 0x08, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, /* Geneve variable options */
0x33, 0x33, 0x00, 0x01, 0x00, 0x02, /* inner destination MAC */
0x08, 0x00, 0x27, 0xfe, 0x8f, 0x95, /* inner source MAC */
0x81, 0x00, 0x00, 0xad, /* 802.1Q VLAN tag */
0x08, 0x00, /* type is IPv4 0x0800 */
0x45, 0x00, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, /* IPv4 hdr */
0x44, 0x45, 0x0a, 0x60, 0x00, 0x0a, 0xb9, 0x1b, 0x73, 0x06, 0x00, 0x35, 0x30, 0x39, 0x00,
0x08, 0x98, 0xe4 /* UDP probe src port 53 */
};
Packet *p = PacketGetFromAlloc();
FAIL_IF_NULL(p);
ThreadVars tv;
DecodeThreadVars dtv;
DecodeGeneveConfigPorts(GENEVE_DEFAULT_PORT_S);
memset(&tv, 0, sizeof(ThreadVars));
memset(&dtv, 0, sizeof(DecodeThreadVars));
FlowInitConfig(FLOW_QUIET);
DecodeUDP(&tv, &dtv, p, raw_geneve, sizeof(raw_geneve));
FAIL_IF_NOT(PacketIsUDP(p));
FAIL_IF(tv.decode_pq.top == NULL);
Packet *tp = PacketDequeueNoLock(&tv.decode_pq);
FAIL_IF_NOT(PacketIsUDP(tp));
FAIL_IF_NOT(tp->sp == 53);
FlowShutdown();
PacketFree(p);
PacketFree(tp);
PASS;
}
/**
* \test DecodeGeneveTest04 tests default port disabled by the config.
*/
static int DecodeGeneveTest04(void)
{
uint8_t raw_geneve[] = {
0x32, 0x10, 0x17, 0xc1, 0x00, 0x4a, 0x87, 0x51, /* UDP header */
0x04, 0x00, 0x65, 0x58, 0x00, 0x00, 0x25, 0x00, /* Geneve fixed header */
0x01, 0x08, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, /* Geneve variable options */
0x01, 0x08, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, /* Geneve variable options */
0x10, 0x00, 0x00, 0x0c, 0x01, 0x00, /* inner destination MAC */
0x00, 0x51, 0x52, 0xb3, 0x54, 0xe5, /* inner source MAC */
0x08, 0x00, /* type is IPv4 0x0800 */
0x45, 0x00, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, /* IPv4 hdr */
0x44, 0x45, 0x0a, 0x60, 0x00, 0x0a, 0xb9, 0x1b, 0x73, 0x06, 0x00, 0x35, 0x30, 0x39, 0x00,
0x08, 0x98, 0xe4 /* UDP probe src port 53 */
};
Packet *p = PacketGetFromAlloc();
FAIL_IF_NULL(p);
ThreadVars tv;
DecodeThreadVars dtv;
DecodeGeneveConfigPorts("1"); /* Set Suricata to use a non-default port for Geneve*/
memset(&tv, 0, sizeof(ThreadVars));
memset(&dtv, 0, sizeof(DecodeThreadVars));
FlowInitConfig(FLOW_QUIET);
DecodeUDP(&tv, &dtv, p, raw_geneve, sizeof(raw_geneve));
FAIL_IF_NOT(PacketIsUDP(p));
FAIL_IF(tv.decode_pq.top != NULL); /* Geneve packet should not have been processed */
DecodeGeneveConfigPorts(GENEVE_DEFAULT_PORT_S); /* Reset Geneve port list for future calls */
FlowShutdown();
PacketFree(p);
PASS;
}
/**
* \test DecodeGeneveTest05 tests if Geneve header has inconsistent option len values.
*/
static int DecodeGeneveTest05(void)
{
uint8_t raw_geneve[] = {
0x32, 0x10, 0x17, 0xc1, 0x00, 0x4a, 0x87, 0x51, /* UDP header */
0x04, 0x00, 0x65, 0x58, 0x00, 0x00, 0x25, 0x00, /* Geneve fixed header */
0x01, 0x08, 0x00, 0x04, 0x11, 0x11, 0x11, 0x11, /* Geneve variable options */
0x01, 0x08, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, /* Geneve variable options */
0x10, 0x00, 0x00, 0x0c, 0x01, 0x00, /* inner destination MAC */
0x00, 0x51, 0x52, 0xb3, 0x54, 0xe5, /* inner source MAC */
0x08, 0x00, /* type is IPv4 0x0800 */
0x45, 0x00, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11, /* IPv4 hdr */
0x44, 0x45, 0x0a, 0x60, 0x00, 0x0a, 0xb9, 0x1b, 0x73, 0x06, 0x00, 0x35, 0x30, 0x39, 0x00,
0x08, 0x98, 0xe4 /* UDP probe src port 53 */
};
Packet *p = PacketGetFromAlloc();
FAIL_IF_NULL(p);
ThreadVars tv;
DecodeThreadVars dtv;
DecodeGeneveConfigPorts(GENEVE_DEFAULT_PORT_S);
memset(&tv, 0, sizeof(ThreadVars));
memset(&dtv, 0, sizeof(DecodeThreadVars));
FlowInitConfig(FLOW_QUIET);
DecodeUDP(&tv, &dtv, p, raw_geneve, sizeof(raw_geneve));
FAIL_IF_NOT(PacketIsUDP(p));
FAIL_IF(tv.decode_pq.top != NULL); /* Geneve packet should not have been processed */
FlowShutdown();
PacketFree(p);
PASS;
}
#endif /* UNITTESTS */
void DecodeGeneveRegisterTests(void)
{
#ifdef UNITTESTS
UtRegisterTest("DecodeGeneveTest01 -- Ethernet+IPv6 DHCP Request", DecodeGeneveTest01);
UtRegisterTest("DecodeGeneveTest02 -- IPv4 DNS Request", DecodeGeneveTest02);
UtRegisterTest("DecodeGeneveTest03 -- VLAN+IPv4 DNS Request", DecodeGeneveTest03);
UtRegisterTest("DecodeGeneveTest04 -- Non-standard port configuration", DecodeGeneveTest04);
UtRegisterTest("DecodeGeneveTest05 -- Inconsistent Geneve hdr option lens", DecodeGeneveTest05);
#endif /* UNITTESTS */
}