From 7756d31990cd47673a21cacf6fd6d33227d6270e Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 26 Feb 2014 00:13:30 +0100 Subject: src: add assertion infrastructure to validate attribute types This will be used to validate that the size is correct according to the expected attribute size. Signed-off-by: Pablo Neira Ayuso --- src/utils.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index 9691c4c..18917f5 100644 --- a/src/utils.c +++ b/src/utils.c @@ -211,3 +211,10 @@ int nft_fprintf(FILE *fp, void *obj, uint32_t type, uint32_t flags, return ret; } + +void __nft_assert_fail(uint16_t attr, const char *filename, int line) +{ + fprintf(stderr, "libnftnl: attribute %d assertion failed in %s:%d\n", + attr, filename, line); + exit(EXIT_FAILURE); +} -- cgit v1.2.3