suricata
detect-nfs-procedure.c
Go to the documentation of this file.
1 /* Copyright (C) 2017 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Victor Julien <victor@inliniac.net>
22  */
23 
24 #include "suricata-common.h"
25 #include "threads.h"
26 #include "debug.h"
27 #include "decode.h"
28 #include "detect.h"
29 
30 #include "detect-parse.h"
31 #include "detect-engine.h"
32 #include "detect-engine-mpm.h"
33 #include "detect-content.h"
34 #include "detect-pcre.h"
35 #include "detect-nfs-procedure.h"
36 
37 #include "app-layer-parser.h"
38 
39 #include "flow.h"
40 #include "flow-util.h"
41 #include "flow-var.h"
42 
43 #include "util-unittest.h"
44 #include "util-unittest-helper.h"
45 
46 #include "app-layer-nfs-tcp.h"
47 #include "rust.h"
48 #include "rust-nfs-nfs-gen.h"
49 
50 /**
51  * [nfs_procedure]:[<|>]<proc>[<><proc>];
52  */
53 #define PARSE_REGEX "^\\s*(<=|>=|<|>)?\\s*([0-9]+)\\s*(?:(<>)\\s*([0-9]+))?\\s*$"
54 static pcre *parse_regex;
55 static pcre_extra *parse_regex_study;
56 
58  PROCEDURE_EQ = 1, /* equal */
59  PROCEDURE_LT, /* less than */
60  PROCEDURE_LE, /* less than */
61  PROCEDURE_GT, /* greater than */
62  PROCEDURE_GE, /* greater than */
63  PROCEDURE_RA, /* range */
64 };
65 
66 typedef struct DetectNfsProcedureData_ {
67  uint32_t lo;
68  uint32_t hi;
71 
72 static DetectNfsProcedureData *DetectNfsProcedureParse (const char *);
73 static int DetectNfsProcedureSetup (DetectEngineCtx *, Signature *s, const char *str);
74 static void DetectNfsProcedureFree(void *);
75 static void DetectNfsProcedureRegisterTests(void);
76 static int g_nfs_request_buffer_id = 0;
77 
78 static int DetectEngineInspectNfsRequestGeneric(ThreadVars *tv,
79  DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
80  const Signature *s, const SigMatchData *smd,
81  Flow *f, uint8_t flags, void *alstate,
82  void *txv, uint64_t tx_id);
83 
84 static int DetectNfsProcedureMatch (DetectEngineThreadCtx *, Flow *,
85  uint8_t, void *, void *, const Signature *,
86  const SigMatchCtx *);
87 
88 /**
89  * \brief Registration function for nfs_procedure keyword.
90  */
92 {
93  sigmatch_table[DETECT_AL_NFS_PROCEDURE].name = "nfs_procedure";
94  sigmatch_table[DETECT_AL_NFS_PROCEDURE].desc = "match NFS procedure";
95  sigmatch_table[DETECT_AL_NFS_PROCEDURE].url = DOC_URL DOC_VERSION "/rules/nfs-keywords.html#procedure";
97  sigmatch_table[DETECT_AL_NFS_PROCEDURE].AppLayerTxMatch = DetectNfsProcedureMatch;
98  sigmatch_table[DETECT_AL_NFS_PROCEDURE].Setup = DetectNfsProcedureSetup;
99  sigmatch_table[DETECT_AL_NFS_PROCEDURE].Free = DetectNfsProcedureFree;
100  sigmatch_table[DETECT_AL_NFS_PROCEDURE].RegisterTests = DetectNfsProcedureRegisterTests;
101 
102 
103  DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study);
104 
107  DetectEngineInspectNfsRequestGeneric);
108 
109  g_nfs_request_buffer_id = DetectBufferTypeGetByName("nfs_request");
110 
111  SCLogDebug("g_nfs_request_buffer_id %d", g_nfs_request_buffer_id);
112 }
113 
114 static int DetectEngineInspectNfsRequestGeneric(ThreadVars *tv,
115  DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
116  const Signature *s, const SigMatchData *smd,
117  Flow *f, uint8_t flags, void *alstate,
118  void *txv, uint64_t tx_id)
119 {
120  return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, smd,
121  f, flags, alstate, txv, tx_id);
122 }
123 
124 static inline int
125 ProcedureMatch(const uint32_t procedure,
126  enum DetectNfsProcedureMode mode, uint32_t lo, uint32_t hi)
127 {
128  switch (mode) {
129  case PROCEDURE_EQ:
130  if (procedure == lo)
131  SCReturnInt(1);
132  break;
133  case PROCEDURE_LT:
134  if (procedure < lo)
135  SCReturnInt(1);
136  break;
137  case PROCEDURE_LE:
138  if (procedure <= lo)
139  SCReturnInt(1);
140  break;
141  case PROCEDURE_GT:
142  if (procedure > lo)
143  SCReturnInt(1);
144  break;
145  case PROCEDURE_GE:
146  if (procedure >= lo)
147  SCReturnInt(1);
148  break;
149  case PROCEDURE_RA:
150  if (procedure >= lo && procedure <= hi)
151  SCReturnInt(1);
152  break;
153  }
154  SCReturnInt(0);
155 }
156 
157 /**
158  * \internal
159  * \brief Function to match procedure of a TX
160  *
161  * For 'file txs'
162  *
163  * \param t Pointer to thread vars.
164  * \param det_ctx Pointer to the pattern matcher thread.
165  * \param f Pointer to the current flow.
166  * \param flags Flags.
167  * \param state App layer state.
168  * \param s Pointer to the Signature.
169  * \param m Pointer to the sigmatch that we will cast into
170  * DetectNfsProcedureData.
171  *
172  * \retval 0 no match.
173  * \retval 1 match.
174  */
175 static int DetectNfsProcedureMatch (DetectEngineThreadCtx *det_ctx,
176  Flow *f, uint8_t flags, void *state,
177  void *txv, const Signature *s,
178  const SigMatchCtx *ctx)
179 {
180  SCEnter();
181 
182  const DetectNfsProcedureData *dd = (const DetectNfsProcedureData *)ctx;
183  uint16_t i;
184  for (i = 0; i < 256; i++) {
185  uint32_t procedure;
186  if (rs_nfs_tx_get_procedures(txv, i, &procedure) == 1) {
187  SCLogDebug("proc %u mode %u lo %u hi %u",
188  procedure, dd->mode, dd->lo, dd->hi);
189  if (ProcedureMatch(procedure, dd->mode, dd->lo, dd->hi))
190  SCReturnInt(1);
191  continue;
192  }
193  break;
194  }
195  SCReturnInt(0);
196 }
197 
198 /**
199  * \internal
200  * \brief Function to parse options passed via tls validity keywords.
201  *
202  * \param rawstr Pointer to the user provided options.
203  *
204  * \retval dd pointer to DetectNfsProcedureData on success.
205  * \retval NULL on failure.
206  */
207 static DetectNfsProcedureData *DetectNfsProcedureParse (const char *rawstr)
208 {
209  DetectNfsProcedureData *dd = NULL;
210 #define MAX_SUBSTRINGS 30
211  int ret = 0, res = 0;
212  int ov[MAX_SUBSTRINGS];
213  char mode[2] = "";
214  char value1[20] = "";
215  char value2[20] = "";
216  char range[3] = "";
217 
218  ret = pcre_exec(parse_regex, parse_regex_study, rawstr, strlen(rawstr), 0,
219  0, ov, MAX_SUBSTRINGS);
220  if (ret < 3 || ret > 5) {
221  SCLogError(SC_ERR_PCRE_MATCH, "Parse error %s", rawstr);
222  goto error;
223  }
224 
225  res = pcre_copy_substring((char *)rawstr, ov, MAX_SUBSTRINGS, 1, mode,
226  sizeof(mode));
227  if (res < 0) {
228  SCLogError(SC_ERR_PCRE_GET_SUBSTRING, "pcre_copy_substring failed");
229  goto error;
230  }
231  SCLogDebug("mode \"%s\"", mode);
232 
233  res = pcre_copy_substring((char *)rawstr, ov, MAX_SUBSTRINGS, 2, value1,
234  sizeof(value1));
235  if (res < 0) {
236  SCLogError(SC_ERR_PCRE_GET_SUBSTRING, "pcre_copy_substring failed");
237  goto error;
238  }
239  SCLogDebug("value1 \"%s\"", value1);
240 
241  if (ret > 3) {
242  res = pcre_copy_substring((char *)rawstr, ov, MAX_SUBSTRINGS, 3,
243  range, sizeof(range));
244  if (res < 0) {
245  SCLogError(SC_ERR_PCRE_GET_SUBSTRING, "pcre_copy_substring failed");
246  goto error;
247  }
248  SCLogDebug("range \"%s\"", range);
249 
250  if (ret > 4) {
251  res = pcre_copy_substring((char *)rawstr, ov, MAX_SUBSTRINGS, 4,
252  value2, sizeof(value2));
253  if (res < 0) {
255  "pcre_copy_substring failed");
256  goto error;
257  }
258  SCLogDebug("value2 \"%s\"", value2);
259  }
260  }
261 
262  dd = SCCalloc(1, sizeof(DetectNfsProcedureData));
263  if (unlikely(dd == NULL))
264  goto error;
265 
266  if (strlen(mode) == 1) {
267  if (mode[0] == '<')
268  dd->mode = PROCEDURE_LT;
269  else if (mode[0] == '>')
270  dd->mode = PROCEDURE_GT;
271  } else if (strlen(mode) == 2) {
272  if (strcmp(mode, "<=") == 0)
273  dd->mode = PROCEDURE_LE;
274  if (strcmp(mode, ">=") == 0)
275  dd->mode = PROCEDURE_GE;
276  }
277 
278  if (strlen(range) > 0) {
279  if (strcmp("<>", range) == 0)
280  dd->mode = PROCEDURE_RA;
281  }
282 
283  if (strlen(range) != 0 && strlen(mode) != 0) {
285  "Range specified but mode also set");
286  goto error;
287  }
288 
289  if (dd->mode == 0) {
290  dd->mode = PROCEDURE_EQ;
291  }
292 
293  /* set the first value */
294  dd->lo = atoi(value1); //TODO
295 
296  /* set the second value if specified */
297  if (strlen(value2) > 0) {
298  if (!(dd->mode == PROCEDURE_RA)) {
300  "Multiple tls validity values specified but mode is not range");
301  goto error;
302  }
303 
304  //
305  dd->hi = atoi(value2); // TODO
306 
307  if (dd->hi <= dd->lo) {
309  "Second value in range must not be smaller than the first");
310  goto error;
311  }
312  }
313  return dd;
314 
315 error:
316  if (dd)
317  SCFree(dd);
318  return NULL;
319 }
320 
321 
322 
323 /**
324  * \brief Function to add the parsed tls validity field into the current signature.
325  *
326  * \param de_ctx Pointer to the Detection Engine Context.
327  * \param s Pointer to the Current Signature.
328  * \param rawstr Pointer to the user provided flags options.
329  * \param type Defines if this is notBefore or notAfter.
330  *
331  * \retval 0 on Success.
332  * \retval -1 on Failure.
333  */
334 static int DetectNfsProcedureSetup (DetectEngineCtx *de_ctx, Signature *s,
335  const char *rawstr)
336 {
337  DetectNfsProcedureData *dd = NULL;
338  SigMatch *sm = NULL;
339 
340  SCLogDebug("\'%s\'", rawstr);
341 
343  return -1;
344 
345  dd = DetectNfsProcedureParse(rawstr);
346  if (dd == NULL) {
347  SCLogError(SC_ERR_INVALID_ARGUMENT,"Parsing \'%s\' failed", rawstr);
348  goto error;
349  }
350 
351  /* okay so far so good, lets get this into a SigMatch
352  * and put it in the Signature. */
353  sm = SigMatchAlloc();
354  if (sm == NULL)
355  goto error;
356 
358  sm->ctx = (void *)dd;
359 
360  SCLogDebug("low %u hi %u", dd->lo, dd->hi);
361  SigMatchAppendSMToList(s, sm, g_nfs_request_buffer_id);
362  return 0;
363 
364 error:
365  DetectNfsProcedureFree(dd);
366  return -1;
367 }
368 
369 /**
370  * \internal
371  * \brief Function to free memory associated with DetectNfsProcedureData.
372  *
373  * \param de_ptr Pointer to DetectNfsProcedureData.
374  */
375 void DetectNfsProcedureFree(void *ptr)
376 {
377  SCFree(ptr);
378 }
379 
380 #ifdef UNITTESTS
381 
382 /**
383  * \test This is a test for a valid value 1430000000.
384  *
385  * \retval 1 on success.
386  * \retval 0 on failure.
387  */
388 static int ValidityTestParse01 (void)
389 {
390  DetectNfsProcedureData *dd = NULL;
391  dd = DetectNfsProcedureParse("1430000000");
392  FAIL_IF_NULL(dd);
393  FAIL_IF_NOT(dd->lo == 1430000000 && dd->mode == PROCEDURE_EQ);
394  DetectNfsProcedureFree(dd);
395  PASS;
396 }
397 
398 /**
399  * \test This is a test for a valid value >1430000000.
400  *
401  * \retval 1 on success.
402  * \retval 0 on failure.
403  */
404 static int ValidityTestParse02 (void)
405 {
406  DetectNfsProcedureData *dd = NULL;
407  dd = DetectNfsProcedureParse(">1430000000");
408  FAIL_IF_NULL(dd);
409  FAIL_IF_NOT(dd->lo == 1430000000 && dd->mode == PROCEDURE_GT);
410  DetectNfsProcedureFree(dd);
411  PASS;
412 }
413 
414 /**
415  * \test This is a test for a valid value <1430000000.
416  *
417  * \retval 1 on success.
418  * \retval 0 on failure.
419  */
420 static int ValidityTestParse03 (void)
421 {
422  DetectNfsProcedureData *dd = NULL;
423  dd = DetectNfsProcedureParse("<1430000000");
424  FAIL_IF_NULL(dd);
425  FAIL_IF_NOT(dd->lo == 1430000000 && dd->mode == PROCEDURE_LT);
426  DetectNfsProcedureFree(dd);
427  PASS;
428 }
429 
430 /**
431  * \test This is a test for a valid value 1430000000<>1470000000.
432  *
433  * \retval 1 on success.
434  * \retval 0 on failure.
435  */
436 static int ValidityTestParse04 (void)
437 {
438  DetectNfsProcedureData *dd = NULL;
439  dd = DetectNfsProcedureParse("1430000000<>1470000000");
440  FAIL_IF_NULL(dd);
441  FAIL_IF_NOT(dd->lo == 1430000000 && dd->hi == 1470000000 &&
442  dd->mode == PROCEDURE_RA);
443  DetectNfsProcedureFree(dd);
444  PASS;
445 }
446 
447 /**
448  * \test This is a test for a invalid value A.
449  *
450  * \retval 1 on success.
451  * \retval 0 on failure.
452  */
453 static int ValidityTestParse05 (void)
454 {
455  DetectNfsProcedureData *dd = NULL;
456  dd = DetectNfsProcedureParse("A");
457  FAIL_IF_NOT_NULL(dd);
458  PASS;
459 }
460 
461 /**
462  * \test This is a test for a invalid value >1430000000<>1470000000.
463  *
464  * \retval 1 on success.
465  * \retval 0 on failure.
466  */
467 static int ValidityTestParse06 (void)
468 {
469  DetectNfsProcedureData *dd = NULL;
470  dd = DetectNfsProcedureParse(">1430000000<>1470000000");
471  FAIL_IF_NOT_NULL(dd);
472  PASS;
473 }
474 
475 /**
476  * \test This is a test for a invalid value 1430000000<>.
477  *
478  * \retval 1 on success.
479  * \retval 0 on failure.
480  */
481 static int ValidityTestParse07 (void)
482 {
483  DetectNfsProcedureData *dd = NULL;
484  dd = DetectNfsProcedureParse("1430000000<>");
485  FAIL_IF_NOT_NULL(dd);
486  PASS;
487 }
488 
489 /**
490  * \test This is a test for a invalid value <>1430000000.
491  *
492  * \retval 1 on success.
493  * \retval 0 on failure.
494  */
495 static int ValidityTestParse08 (void)
496 {
497  DetectNfsProcedureData *dd = NULL;
498  dd = DetectNfsProcedureParse("<>1430000000");
499  FAIL_IF_NOT_NULL(dd);
500  PASS;
501 }
502 
503 /**
504  * \test This is a test for a invalid value "".
505  *
506  * \retval 1 on success.
507  * \retval 0 on failure.
508  */
509 static int ValidityTestParse09 (void)
510 {
511  DetectNfsProcedureData *dd = NULL;
512  dd = DetectNfsProcedureParse("");
513  FAIL_IF_NOT_NULL(dd);
514  PASS;
515 }
516 
517 /**
518  * \test This is a test for a invalid value " ".
519  *
520  * \retval 1 on success.
521  * \retval 0 on failure.
522  */
523 static int ValidityTestParse10 (void)
524 {
525  DetectNfsProcedureData *dd = NULL;
526  dd = DetectNfsProcedureParse(" ");
527  FAIL_IF_NOT_NULL(dd);
528  PASS;
529 }
530 
531 /**
532  * \test This is a test for a invalid value 1490000000<>1430000000.
533  *
534  * \retval 1 on success.
535  * \retval 0 on failure.
536  */
537 static int ValidityTestParse11 (void)
538 {
539  DetectNfsProcedureData *dd = NULL;
540  dd = DetectNfsProcedureParse("1490000000<>1430000000");
541  FAIL_IF_NOT_NULL(dd);
542  PASS;
543 }
544 
545 /**
546  * \test This is a test for a valid value 1430000000 <> 1490000000.
547  *
548  * \retval 1 on success.
549  * \retval 0 on failure.
550  */
551 static int ValidityTestParse12 (void)
552 {
553  DetectNfsProcedureData *dd = NULL;
554  dd = DetectNfsProcedureParse("1430000000 <> 1490000000");
555  FAIL_IF_NULL(dd);
556  FAIL_IF_NOT(dd->lo == 1430000000 && dd->hi == 1490000000 &&
557  dd->mode == PROCEDURE_RA);
558  DetectNfsProcedureFree(dd);
559  PASS;
560 }
561 
562 /**
563  * \test This is a test for a valid value > 1430000000.
564  *
565  * \retval 1 on success.
566  * \retval 0 on failure.
567  */
568 static int ValidityTestParse13 (void)
569 {
570  DetectNfsProcedureData *dd = NULL;
571  dd = DetectNfsProcedureParse("> 1430000000 ");
572  FAIL_IF_NULL(dd);
573  FAIL_IF_NOT(dd->lo == 1430000000 && dd->mode == PROCEDURE_GT);
574  DetectNfsProcedureFree(dd);
575  PASS;
576 }
577 
578 /**
579  * \test This is a test for a valid value < 1490000000.
580  *
581  * \retval 1 on success.
582  * \retval 0 on failure.
583  */
584 static int ValidityTestParse14 (void)
585 {
586  DetectNfsProcedureData *dd = NULL;
587  dd = DetectNfsProcedureParse("< 1490000000 ");
588  FAIL_IF_NULL(dd);
589  FAIL_IF_NOT(dd->lo == 1490000000 && dd->mode == PROCEDURE_LT);
590  DetectNfsProcedureFree(dd);
591  PASS;
592 }
593 
594 /**
595  * \test This is a test for a valid value 1490000000.
596  *
597  * \retval 1 on success.
598  * \retval 0 on failure.
599  */
600 static int ValidityTestParse15 (void)
601 {
602  DetectNfsProcedureData *dd = NULL;
603  dd = DetectNfsProcedureParse(" 1490000000 ");
604  FAIL_IF_NULL(dd);
605  FAIL_IF_NOT(dd->lo == 1490000000 && dd->mode == PROCEDURE_EQ);
606  DetectNfsProcedureFree(dd);
607  PASS;
608 }
609 
610 #endif /* UNITTESTS */
611 
612 /**
613  * \brief Register unit tests for nfs_procedure.
614  */
615 void DetectNfsProcedureRegisterTests(void)
616 {
617 #ifdef UNITTESTS /* UNITTESTS */
618  UtRegisterTest("ValidityTestParse01", ValidityTestParse01);
619  UtRegisterTest("ValidityTestParse02", ValidityTestParse02);
620  UtRegisterTest("ValidityTestParse03", ValidityTestParse03);
621  UtRegisterTest("ValidityTestParse04", ValidityTestParse04);
622  UtRegisterTest("ValidityTestParse05", ValidityTestParse05);
623  UtRegisterTest("ValidityTestParse06", ValidityTestParse06);
624  UtRegisterTest("ValidityTestParse07", ValidityTestParse07);
625  UtRegisterTest("ValidityTestParse08", ValidityTestParse08);
626  UtRegisterTest("ValidityTestParse09", ValidityTestParse09);
627  UtRegisterTest("ValidityTestParse10", ValidityTestParse10);
628  UtRegisterTest("ValidityTestParse11", ValidityTestParse11);
629  UtRegisterTest("ValidityTestParse12", ValidityTestParse12);
630  UtRegisterTest("ValidityTestParse13", ValidityTestParse13);
631  UtRegisterTest("ValidityTestParse14", ValidityTestParse14);
632  UtRegisterTest("ValidityTestParse15", ValidityTestParse15);
633 #endif /* UNITTESTS */
634 }
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
Definition: detect.h:1448
uint16_t flags
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1186
#define SCLogDebug(...)
Definition: util-debug.h:335
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
#define MAX_SUBSTRINGS
#define PASS
Pass the test.
#define unlikely(expr)
Definition: util-optimize.h:35
Data needed for Match()
Definition: detect.h:327
const char * name
Definition: detect.h:1200
int DetectEngineInspectGenericList(ThreadVars *tv, const DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Flow *f, const uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Do the content inspection & validation for a signature.
Signature container.
Definition: detect.h:522
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
Definition: detect.h:313
main detection engine ctx
Definition: detect.h:761
int DetectBufferTypeGetByName(const char *name)
#define str(s)
#define SCCalloc(nm, a)
Definition: util-mem.h:253
struct DetectNfsProcedureData_ DetectNfsProcedureData
DetectNfsProcedureMode
void(* Free)(void *)
Definition: detect.h:1191
#define SCLogError(err_code,...)
Macro used to log ERROR messages.
Definition: util-debug.h:294
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
void DetectSetupParseRegexes(const char *parse_str, pcre **parse_regex, pcre_extra **parse_regex_study)
#define SIG_FLAG_TOSERVER
Definition: detect.h:236
#define SCEnter(...)
Definition: util-debug.h:337
#define FAIL_IF_NOT_NULL(expr)
Fail a test if expression evaluates to non-NULL.
Definition: util-unittest.h:96
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Definition: detect.h:1170
#define PARSE_REGEX
uint8_t type
Definition: detect.h:319
#define SCReturnInt(x)
Definition: util-debug.h:341
const char * desc
Definition: detect.h:1202
void SigMatchAppendSMToList(Signature *s, SigMatch *new, int list)
Append a SigMatch to the list type.
Definition: detect-parse.c:346
SigMatchCtx * ctx
Definition: detect.h:321
#define SCFree(a)
Definition: util-mem.h:322
PoolThreadReserved res
uint16_t tx_id
const char * url
Definition: detect.h:1203
int(* AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *)
Definition: detect.h:1173
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
Definition: util-unittest.h:89
#define DOC_URL
Definition: suricata.h:86
void DetectNfsProcedureRegister(void)
Registration function for nfs_procedure keyword.
SigMatch * SigMatchAlloc(void)
Definition: detect-parse.c:232
Per thread variable structure.
Definition: threadvars.h:57
#define DOC_VERSION
Definition: suricata.h:91
Flow data structure.
Definition: flow.h:325
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback)
register inspect engine at start up time
void(* RegisterTests)(void)
Definition: detect.h:1192
a single match condition for a signature
Definition: detect.h:318
#define FAIL_IF_NOT(expr)
Fail a test if expression to true.
Definition: util-unittest.h:82
enum DetectNfsProcedureMode mode