suricata
detect-engine-proto.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DetectProto_
 

Macros

#define DETECT_PROTO_ANY   (1 << 0)
 
#define DETECT_PROTO_ONLY_PKT   (1 << 1)
 
#define DETECT_PROTO_ONLY_STREAM   (1 << 2)
 
#define DETECT_PROTO_IPV4   (1 << 3)
 
#define DETECT_PROTO_IPV6   (1 << 4)
 

Typedefs

typedef struct DetectProto_ DetectProto
 

Functions

int DetectProtoParse (DetectProto *dp, const char *str)
 Parses a protocol sent as a string. More...
 
int DetectProtoContainsProto (const DetectProto *, int)
 see if a DetectProto contains a certain proto More...
 
void DetectProtoTests (void)
 this function registers unit tests for DetectProto More...
 

Detailed Description

Macro Definition Documentation

#define DETECT_PROTO_ANY   (1 << 0)
#define DETECT_PROTO_IPV4   (1 << 3)
#define DETECT_PROTO_IPV6   (1 << 4)
#define DETECT_PROTO_ONLY_PKT   (1 << 1)

Indicate that we only care about packet payloads.

Definition at line 30 of file detect-engine-proto.h.

Referenced by DetectProtoContainsProto(), DetectProtoParse(), and SigMatchListSMBelongsTo().

#define DETECT_PROTO_ONLY_STREAM   (1 << 2)

Indicate that we only care about stream payloads.

Definition at line 33 of file detect-engine-proto.h.

Referenced by DetectProtoContainsProto(), DetectProtoParse(), and SigMatchListSMBelongsTo().

Typedef Documentation

typedef struct DetectProto_ DetectProto

Function Documentation

int DetectProtoContainsProto ( const DetectProto dp,
int  proto 
)
int DetectProtoParse ( DetectProto dp,
const char *  str 
)

Parses a protocol sent as a string.

Parameters
dpPointer to the DetectProto instance which will be updated with the incoming protocol information.
strPointer to the string containing the protocol name.
Return values
>=0If proto is detected, -1 otherwise.
Todo:
are numeric protocols even valid?

Definition at line 56 of file detect-engine-proto.c.

References ByteExtractStringUint8(), DETECT_PROTO_ANY, DETECT_PROTO_IPV4, DETECT_PROTO_IPV6, DETECT_PROTO_ONLY_PKT, DETECT_PROTO_ONLY_STREAM, DetectProto_::flags, DetectProto_::proto, proto, and SCLogDebug.

Referenced by DetectProtoContainsProto(), and SigMatchListSMBelongsTo().

Here is the call graph for this function:

Here is the caller graph for this function:

void DetectProtoTests ( void  )

this function registers unit tests for DetectProto

Definition at line 579 of file detect-engine-proto.c.

References UtRegisterTest().

Here is the call graph for this function: