summaryrefslogtreecommitdiff
path: root/src/libwpactrl/wpactrl_addnetwork.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-08-04 22:46:45 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-08-04 22:46:45 +0000
commitbabf43abf301d072192bda1f72a47440c354b072 (patch)
treed917d33ebb97d2b783e163f299b360be4f5b3a0a /src/libwpactrl/wpactrl_addnetwork.c
parent69099d84949a8044fdfc74e9d7ff6b9e57fc0bcd (diff)
downloadbcnm-babf43abf301d072192bda1f72a47440c354b072.tar.xz
Add the higher layer of libwpactrl
Diffstat (limited to 'src/libwpactrl/wpactrl_addnetwork.c')
-rw-r--r--src/libwpactrl/wpactrl_addnetwork.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libwpactrl/wpactrl_addnetwork.c b/src/libwpactrl/wpactrl_addnetwork.c
new file mode 100644
index 0000000..65e5963
--- /dev/null
+++ b/src/libwpactrl/wpactrl_addnetwork.c
@@ -0,0 +1,15 @@
+/* ISC license. */
+
+#include <string.h>
+#include <errno.h>
+#include <skalibs/uint32.h>
+#include <skalibs/error.h>
+#include <bcnm/wpactrl.h>
+
+int wpactrl_addnetwork (wpactrl_t *a, uint32_t *id, tain_t *stamp)
+{
+ char buf[UINT32_FMT] ;
+ if (wpactrl_query(a, "ADD_NETWORK", buf, UINT32_FMT, stamp) < 0) return 0 ;
+ if (uint32_scan(buf, id)) return 1 ;
+ return (errno = EPROTO, 0) ;
+}