53static void DetectNfsProcedureRegisterTests(
void);
55static int g_nfs_request_buffer_id = 0;
58 uint8_t,
void *,
void *,
const Signature *,
82 SCLogDebug(
"g_nfs_request_buffer_id %d", g_nfs_request_buffer_id);
112 for (i = 0; i < 256; i++) {
114 if (SCNfsTxGetProcedures(txv, i, &procedure) == 1) {
115 SCLogDebug(
"proc %u mode %u lo %u hi %u", procedure, dd->mode, dd->arg1, dd->arg2);
134static DetectU32Data *DetectNfsProcedureParse(
const char *rawstr)
136 return SCDetectU32ParseInclusive(rawstr);
162 dd = DetectNfsProcedureParse(rawstr);
171 SCLogDebug(
"low %u hi %u", dd->arg1, dd->arg2);
173 g_nfs_request_buffer_id) == NULL) {
174 DetectNfsProcedureFree(
de_ctx, dd);
188 SCDetectU32Free(ptr);
199static int ValidityTestParse01 (
void)
202 dd = DetectNfsProcedureParse(
"1430000000");
205 DetectNfsProcedureFree(NULL, dd);
215static int ValidityTestParse02 (
void)
218 dd = DetectNfsProcedureParse(
">1430000000");
221 DetectNfsProcedureFree(NULL, dd);
231static int ValidityTestParse03 (
void)
234 dd = DetectNfsProcedureParse(
"<1430000000");
237 DetectNfsProcedureFree(NULL, dd);
247static int ValidityTestParse04 (
void)
250 dd = DetectNfsProcedureParse(
"1430000001<>1470000000");
253 DetectNfsProcedureFree(NULL, dd);
263static int ValidityTestParse05 (
void)
266 dd = DetectNfsProcedureParse(
"A");
277static int ValidityTestParse06 (
void)
280 dd = DetectNfsProcedureParse(
">1430000000<>1470000000");
291static int ValidityTestParse07 (
void)
294 dd = DetectNfsProcedureParse(
"1430000000<>");
305static int ValidityTestParse08 (
void)
308 dd = DetectNfsProcedureParse(
"<>1430000000");
319static int ValidityTestParse09 (
void)
322 dd = DetectNfsProcedureParse(
"");
333static int ValidityTestParse10 (
void)
336 dd = DetectNfsProcedureParse(
" ");
347static int ValidityTestParse11 (
void)
350 dd = DetectNfsProcedureParse(
"1490000000<>1430000000");
361static int ValidityTestParse12 (
void)
364 dd = DetectNfsProcedureParse(
"1430000001 <> 1490000000");
367 DetectNfsProcedureFree(NULL, dd);
377static int ValidityTestParse13 (
void)
380 dd = DetectNfsProcedureParse(
"> 1430000000 ");
383 DetectNfsProcedureFree(NULL, dd);
393static int ValidityTestParse14 (
void)
396 dd = DetectNfsProcedureParse(
"< 1490000000 ");
399 DetectNfsProcedureFree(NULL, dd);
409static int ValidityTestParse15 (
void)
412 dd = DetectNfsProcedureParse(
" 1490000000 ");
415 DetectNfsProcedureFree(NULL, dd);
422void DetectNfsProcedureRegisterTests(
void)
int DetectU32Match(const uint32_t parg, const DetectUintData_u32 *du32)
DetectUintData_u32 DetectU32Data
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
int DetectBufferTypeGetByName(const char *name)
uint8_t DetectEngineInspectGenericList(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Do the content inspection & validation for a signature.
void DetectNfsProcedureRegister(void)
Registration function for nfs_procedure keyword.
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
SigMatch * SCSigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
SigTableElmt * sigmatch_table
#define SIG_FLAG_TOSERVER
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
#define PASS
Pass the test.
#define FAIL_IF_NOT_NULL(expr)
Fail a test if expression evaluates to non-NULL.
main detection engine ctx
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
void(* Free)(DetectEngineCtx *, void *)
int(* AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *)
void(* RegisterTests)(void)
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
#define SCLogError(...)
Macro used to log ERROR messages.