suricata
|
#include "suricata-common.h"
#include "util-hash-string.h"
#include "util-proto-name.h"
#include "util-debug.h"
#include "util-unittest.h"
Go to the source code of this file.
Data Structures | |
struct | ProtoNameHashEntry_ |
Typedefs | |
typedef struct ProtoNameHashEntry_ | ProtoNameHashEntry |
Functions | |
void | SCProtoNameInit (void) |
void | SCProtoNameRelease (void) |
bool | SCProtoNameValid (uint16_t proto) |
Function to check if the received protocol number is valid and do we have corresponding name entry for this number or not. More... | |
bool | SCGetProtoByName (const char *protoname, uint8_t *proto_number) |
Function to return the protocol number for a named protocol. Note that protocol name aliases are honored. More... | |
void | SCProtoNameRegisterTests (void) |
Variables | |
const char * | known_proto [256] |
const char * | proto_aliases [256] |
File to provide the protocol names based on protocol numbers defined by the IANA
Definition in file util-proto-name.c.
typedef struct ProtoNameHashEntry_ ProtoNameHashEntry |
bool SCGetProtoByName | ( | const char * | protoname, |
uint8_t * | proto_number | ||
) |
Function to return the protocol number for a named protocol. Note that protocol name aliases are honored.
protoname | Protocol name (or alias for a protocol name). |
proto_number | Where to return protocol number |
ret | On success returns the protocol number; else -1 |
Definition at line 466 of file util-proto-name.c.
References HashTableLookup(), and proto.
void SCProtoNameInit | ( | void | ) |
Definition at line 417 of file util-proto-name.c.
Referenced by GlobalsInitPreConfig().
void SCProtoNameRegisterTests | ( | void | ) |
Definition at line 502 of file util-proto-name.c.
References UtRegisterTest().
void SCProtoNameRelease | ( | void | ) |
Definition at line 438 of file util-proto-name.c.
Referenced by GlobalsDestroy().
bool SCProtoNameValid | ( | uint16_t | proto | ) |
Function to check if the received protocol number is valid and do we have corresponding name entry for this number or not.
proto | Protocol number to be validated |
ret | On success returns true otherwise false |
Definition at line 453 of file util-proto-name.c.
References known_proto, and proto.
const char* known_proto[256] |
Lookup array to hold the information related to known protocol values
Definition at line 40 of file util-proto-name.c.
Referenced by SCProtoNameValid().
const char* proto_aliases[256] |
Definition at line 197 of file util-proto-name.c.