suricata
util-misc.c File Reference
#include "suricata-common.h"
#include "config.h"
#include "suricata.h"
#include "util-byte.h"
#include "util-debug.h"
#include "util-unittest.h"
#include "util-misc.h"
Include dependency graph for util-misc.c:

Go to the source code of this file.

Macros

#define PARSE_REGEX   "^\\s*(\\d+(?:.\\d+)?)\\s*([a-zA-Z]{2})?\\s*$"
 
#define MAX_SUBSTRINGS   30
 

Functions

void ParseSizeInit (void)
 
void ParseSizeDeinit (void)
 
int ParseSizeStringU8 (const char *size, uint8_t *res)
 
int ParseSizeStringU16 (const char *size, uint16_t *res)
 
int ParseSizeStringU32 (const char *size, uint32_t *res)
 
int ParseSizeStringU64 (const char *size, uint64_t *res)
 
void ShortenString (const char *input, char *output, size_t output_size, char c)
 
void UtilMiscRegisterTests (void)
 

Detailed Description

Macro Definition Documentation

#define MAX_SUBSTRINGS   30

Referenced by ParseSizeDeinit().

#define PARSE_REGEX   "^\\s*(\\d+(?:.\\d+)?)\\s*([a-zA-Z]{2})?\\s*$"

Definition at line 32 of file util-misc.c.

Referenced by ParseSizeInit().

Function Documentation

void ParseSizeDeinit ( void  )
void ParseSizeInit ( void  )

Definition at line 36 of file util-misc.c.

References PARSE_REGEX, SC_ERR_PCRE_COMPILE, SC_ERR_PCRE_STUDY, and SCLogError.

Referenced by main().

Here is the caller graph for this function:

int ParseSizeStringU16 ( const char *  size,
uint16_t *  res 
)

Definition at line 169 of file util-misc.c.

Referenced by RunModeIdsNflogRegister(), and StreamTcpInitConfig().

Here is the caller graph for this function:

int ParseSizeStringU32 ( const char *  size,
uint32_t *  res 
)

Definition at line 186 of file util-misc.c.

Referenced by HTPFreeConfig(), PostRunDeinit(), RegisterModbusParsers(), RegisterSMBParsers(), and StreamTcpInitConfig().

Here is the caller graph for this function:

int ParseSizeStringU64 ( const char *  size,
uint64_t *  res 
)
int ParseSizeStringU8 ( const char *  size,
uint8_t *  res 
)

Definition at line 152 of file util-misc.c.

void ShortenString ( const char *  input,
char *  output,
size_t  output_size,
char  c 
)

Definition at line 220 of file util-misc.c.

References length, MemcmpTest18Tests::result, str, and strlcat().

Referenced by DetectAppLayerMpmRegisterByParentId(), and LiveGetDeviceName().

Here is the call graph for this function:

Here is the caller graph for this function:

void UtilMiscRegisterTests ( void  )

Definition at line 1174 of file util-misc.c.

References UtRegisterTest().

Here is the call graph for this function: