suricata
util-misc.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2010 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Anoop Saldanha <anoopsaldanha@gmail.com>
22  */
23 
24 #ifndef __UTIL_MISC_H__
25 #define __UTIL_MISC_H__
26 
27 #include "util-error.h"
28 
29 /**
30  * \brief Generic API that can be used by all to log an
31  * invalid conf entry.
32  * \param param_name A string specifying the param name.
33  * \param format Format for the below value. For example "%s", "%"PRIu32,
34  etc.
35  * \param value Default value to be printed.
36  */
37 #define WarnInvalidConfEntry(param_name, format, value) do { \
38  SCLogWarning(SC_ERR_INVALID_YAML_CONF_ENTRY, \
39  "Invalid conf entry found for " \
40  "\"%s\". Using default value of \"" format "\".", \
41  param_name, value); \
42  } while (0)
43 
44 /* size string parsing API */
45 
46 int ParseSizeStringU8(const char *, uint8_t *);
47 int ParseSizeStringU16(const char *, uint16_t *);
48 int ParseSizeStringU32(const char *, uint32_t *);
49 int ParseSizeStringU64(const char *, uint64_t *);
50 void UtilMiscRegisterTests(void);
51 
52 void ParseSizeInit(void);
53 void ParseSizeDeinit(void);
54 
55 #endif /* __UTIL_MISC_H__ */
int ParseSizeStringU32(const char *, uint32_t *)
Definition: util-misc.c:186
int ParseSizeStringU16(const char *, uint16_t *)
Definition: util-misc.c:169
void UtilMiscRegisterTests(void)
Definition: util-misc.c:1147
void ParseSizeDeinit(void)
Definition: util-misc.c:55
int ParseSizeStringU8(const char *, uint8_t *)
Definition: util-misc.c:152
int ParseSizeStringU64(const char *, uint64_t *)
Definition: util-misc.c:203
void ParseSizeInit(void)
Definition: util-misc.c:36