suricata
|
#include "suricata-common.h"
#include "util-host-os-info.h"
#include "util-error.h"
#include "util-debug.h"
#include "util-ip.h"
#include "util-radix4-tree.h"
#include "util-radix6-tree.h"
#include "util-byte.h"
#include "stream-tcp-private.h"
#include "stream-tcp-reassemble.h"
#include "conf.h"
#include "conf-yaml-loader.h"
#include "util-enum.h"
#include "util-unittest.h"
Go to the source code of this file.
Functions | |
int | SCHInfoAddHostOSInfo (const char *host_os, const char *host_os_ip_range, int is_ipv4) |
Used to add the host-os-info data obtained from the conf. More... | |
int | SCHInfoGetIPv4HostOSFlavour (uint8_t *addr) |
Retrieves the host os flavour, given an ipv4 address in the raw address format. More... | |
int | SCHInfoGetIPv6HostOSFlavour (uint8_t *addr) |
Retrieves the host os flavour, given an ipv6 address in the raw address format. More... | |
void | SCHInfoCleanResources (void) |
void | SCHInfoLoadFromConfig (void) |
Load the host os policy information from the configuration. More... | |
void | SCHInfoRegisterTests (void) |
Variables | |
SCEnumCharMap | sc_hinfo_os_policy_map [] |
Host info utility functions
Definition in file util-host-os-info.c.
int SCHInfoAddHostOSInfo | ( | const char * | host_os, |
const char * | host_os_ip_range, | ||
int | is_ipv4 | ||
) |
Used to add the host-os-info data obtained from the conf.
host_os | The host_os name/flavour from the conf file |
host_os_ip_range | Pointer to a char string holding the ip/ip_netblock for the host_os specified in the first argument |
is_ipv4 | Indicates if the ip address to be considered for the default configuration is IPV4; if not it is IPV6. Specified using SC_HINFO_IS_IPV6 or SC_HINFO_IS_IPV4 |
0 | On successfully adding the host os info to the Radix tree |
-1 | On failure \initonly (only specified from config, at the startup) |
Definition at line 122 of file util-host-os-info.c.
References SCLogError.
void SCHInfoCleanResources | ( | void | ) |
Definition at line 270 of file util-host-os-info.c.
References SCRadix4TreeRelease().
int SCHInfoGetIPv4HostOSFlavour | ( | uint8_t * | addr | ) |
Retrieves the host os flavour, given an ipv4 address in the raw address format.
Pointer | to a raw ipv4 address. |
The | OS flavour on success; -1 on failure, or on not finding the key |
Definition at line 244 of file util-host-os-info.c.
References SCRadix4TreeFindBestMatch().
int SCHInfoGetIPv6HostOSFlavour | ( | uint8_t * | addr | ) |
Retrieves the host os flavour, given an ipv6 address in the raw address format.
Pointer | to a raw ipv6 address. |
The | OS flavour on success; -1 on failure, or on not finding the key |
Definition at line 261 of file util-host-os-info.c.
References SCRadix6TreeFindBestMatch().
void SCHInfoLoadFromConfig | ( | void | ) |
Load the host os policy information from the configuration.
\initonly (A mem alloc error should cause an exit failure)
Definition at line 281 of file util-host-os-info.c.
void SCHInfoRegisterTests | ( | void | ) |
Definition at line 1439 of file util-host-os-info.c.
References UtRegisterTest().
SCEnumCharMap sc_hinfo_os_policy_map[] |
Enum map for the various OS flavours
Definition at line 44 of file util-host-os-info.c.