projects
/
project
/
firewall3.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
options: remove stray continue statement
[project/firewall3.git]
/
utils.h
diff --git
a/utils.h
b/utils.h
index c74a5dd76d22fcab5b7e496ed2582899302e9923..9a716aec1a9dd8dc03fff00aeaf4cb9d304a1c5c 100644
(file)
--- a/
utils.h
+++ b/
utils.h
@@
-32,6
+32,7
@@
#include <ifaddrs.h>
#include <libubox/list.h>
#include <ifaddrs.h>
#include <libubox/list.h>
+#include <libubox/blob.h>
#include <uci.h>
#include <uci.h>
@@
-46,6
+47,16
@@
void warn(const char *format, ...);
void error(const char *format, ...);
void info(const char *format, ...);
void error(const char *format, ...);
void info(const char *format, ...);
+
+#define warn_section(t, r, e, fmt, ...) \
+ do { \
+ if (e) \
+ warn_elem(e, fmt, ##__VA_ARGS__); \
+ else \
+ warn("Warning: ubus " t " (%s) " fmt, \
+ (r && r->name) ? r->name : "?", ##__VA_ARGS__); \
+ } while(0)
+
#define fw3_setbit(field, flag) field |= (1 << (flag))
#define fw3_delbit(field, flag) field &= ~(1 << (flag))
#define fw3_hasbit(field, flag) (field & (1 << (flag)))
#define fw3_setbit(field, flag) field |= (1 << (flag))
#define fw3_delbit(field, flag) field &= ~(1 << (flag))
#define fw3_hasbit(field, flag) (field & (1 << (flag)))
@@
-103,4
+114,6
@@
bool fw3_bitlen2netmask(int family, int bits, void *mask);
void fw3_flush_conntrack(void *zone);
void fw3_flush_conntrack(void *zone);
+bool fw3_attr_parse_name_type(struct blob_attr *entry, const char **name, const char **type);
+
#endif
#endif