diff options
author | Pierre Lebleu <pme.lebleu@gmail.com> | 2017-05-04 10:52:52 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2017-05-09 23:54:15 +0200 |
commit | e264c8e585ea37ccb1739e7a8e12f8454da1d8a4 (patch) | |
tree | 3a5e80cd9dde172ae53ae0dd58916daebfcd790d /utils.h | |
parent | 6039c7f4b0052c4da21520cdd604f04a5a67f50d (diff) | |
download | firewall3-e264c8e585ea37ccb1739e7a8e12f8454da1d8a4.tar.gz |
firewall3: replace warn_rule() by warn_section()
Replace the wan_rule() by warn_section() in order to
make it reusable by the other section type.
Signed-off-by: Pierre Lebleu <pme.lebleu@gmail.com>
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -46,6 +46,16 @@ void warn(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))) |