suricata
util-proto-name.c File Reference
#include "suricata-common.h"
#include "util-proto-name.h"
#include "util-byte.h"
Include dependency graph for util-proto-name.c:

Go to the source code of this file.

Functions

void SCProtoNameInit ()
 Function to load the protocol names from the specified protocol file. More...
 
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...
 
void SCProtoNameDeInit ()
 Function to clears the memory used in storing the protocol names. More...
 

Variables

char * known_proto [256]
 

Detailed Description

Author
Gurvinder Singh gurvi.nosp@m.nder.nosp@m.singh.nosp@m.dahi.nosp@m.ya@gm.nosp@m.ail..nosp@m.com

File to provide the protocol names based on protocol numbers defined in the specified protocol file.

Definition in file util-proto-name.c.

Function Documentation

◆ SCProtoNameDeInit()

void SCProtoNameDeInit ( )

Function to clears the memory used in storing the protocol names.

Definition at line 106 of file util-proto-name.c.

◆ SCProtoNameInit()

void SCProtoNameInit ( )

Function to load the protocol names from the specified protocol file.

Definition at line 40 of file util-proto-name.c.

References BUG_ON.

Referenced by RunUnittests().

Here is the caller graph for this function:

◆ SCProtoNameValid()

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.

Parameters
protoProtocol number to be validated
Return values
retOn success returns true otherwise false

Definition at line 98 of file util-proto-name.c.

References known_proto, and proto.

Referenced by AlertFastLogger(), and JsonAddrInfoInit().

Here is the caller graph for this function:

Variable Documentation

◆ known_proto

char* known_proto[256]

Lookup array to hold the information related to known protocol in /etc/protocols

Definition at line 33 of file util-proto-name.c.

Referenced by AlertFastLogger(), JsonAddrInfoInit(), and SCProtoNameValid().