Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/nss/test_nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/test_nat.c')
-rw-r--r--nss/test_nat.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/nss/test_nat.c b/nss/test_nat.c
new file mode 100644
index 0000000..b7a01cb
--- /dev/null
+++ b/nss/test_nat.c
@@ -0,0 +1,24 @@
+#define _GNU_SOURCE
+#include <errno.h>
+#include <stdio.h>
+#include <syslog.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "cgen.h"
+#include "nat.h"
+
+#include "config/debug.h"
+
+int main()
+{
+ openlog("nat", LOG_PERROR, LOG_LOCAL0);
+ unsigned long data;
+ char buf[] = "12345";
+ CHK(parse_nat(&data, buf, strlen(buf)) == 1, "Death", out_death);
+ printf("%ld\n", data);
+ return 0;
+out_death:
+ printf("Death.");
+ return -1;
+}