about summary refs log tree commit diff
path: root/src/libwpactrl/wpactrl_query.c
blob: 0bdf38895b387924bd44762966c0229585f77e43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <string.h>
#include <skalibs/unix-timed.h>
#include <bcnm/wpactrl.h>
#include "wpactrl-internal.h"

ssize_t wpactrl_query (wpactrl_t *a, char const *q, char *ans, size_t ansmax, tain *stamp)
{
  tain deadline ;
  tain_add(&deadline, stamp, &a->tto) ;
  if (!ipc_timed_send(a->fds, q, strlen(q), &deadline, stamp)) return WPA_ERROR ;
  return wpactrl_fd_timed_recv(a->fds, ans, ansmax, &deadline, stamp) ;
}