diff options
Diffstat (limited to 'src/libwpactrl/wpactrl_setnetworkoption.c')
-rw-r--r-- | src/libwpactrl/wpactrl_setnetworkoption.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libwpactrl/wpactrl_setnetworkoption.c b/src/libwpactrl/wpactrl_setnetworkoption.c new file mode 100644 index 0000000..5b2fdca --- /dev/null +++ b/src/libwpactrl/wpactrl_setnetworkoption.c @@ -0,0 +1,21 @@ +/* ISC license. */ + +#include <string.h> +#include <skalibs/uint32.h> +#include <bcnm/wpactrl.h> + +wparesponse_t wpactrl_setnetworkoption (wpactrl_t *a, uint32_t id, char const *var, char const *val, tain_t *stamp) +{ + size_t varlen = strlen(var) ; + size_t vallen = strlen(val) ; + size_t idlen ; + char buf[15 + UINT32_FMT + varlen + vallen] ; + memcpy(buf, "SET_NETWORK ", 12) ; + idlen = uint32_fmt(buf + 12, id) ; + buf[12 + idlen] = ' ' ; + memcpy(buf + 13 + idlen, var, varlen) ; + buf[13 + idlen + varlen] = ' ' ; + memcpy(buf + 14 + idlen + varlen, val, vallen) ; + buf[14 + idlen + varlen + vallen] = 0 ; + return wpactrl_command(a, buf, stamp) ; +} |