本文整理汇总了C++中wpa_ctrl_command函数的典型用法代码示例。如果您正苦于以下问题:C++ wpa_ctrl_command函数的具体用法?C++ wpa_ctrl_command怎么用?C++ wpa_ctrl_command使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpa_ctrl_command函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hostapd_cli_cmd_ess_disassoc
static int hostapd_cli_cmd_ess_disassoc(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
char buf[300];
int res;
if (argc < 3) {
printf("Invalid 'ess_disassoc' command - three arguments (STA "
"addr, disassoc timer, and URL) are needed\n");
return -1;
}
res = os_snprintf(buf, sizeof(buf), "ESS_DISASSOC %s %s %s",
argv[0], argv[1], argv[2]);
if (os_snprintf_error(sizeof(buf), res))
return -1;
return wpa_ctrl_command(ctrl, buf);
}
示例2: hostapd_cli_cmd_hs20_wnm_notif
static int hostapd_cli_cmd_hs20_wnm_notif(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
char buf[300];
int res;
if (argc < 2) {
printf("Invalid 'hs20_wnm_notif' command - two arguments (STA "
"addr and URL) are needed\n");
return -1;
}
res = os_snprintf(buf, sizeof(buf), "HS20_WNM_NOTIF %s %s",
argv[0], argv[1]);
if (os_snprintf_error(sizeof(buf), res))
return -1;
return wpa_ctrl_command(ctrl, buf);
}
示例3: wpa_cli_cmd_ft_ds
static int wpa_cli_cmd_ft_ds(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
char cmd[256];
int res;
if (argc != 1) {
printf("Invalid FT_DS command: needs one argument "
"(Target AP MAC address)\n");
return -1;
}
res = os_snprintf(cmd, sizeof(cmd), "FT_DS %s", argv[0]);
if (res < 0 || (size_t) res >= sizeof(cmd) - 1) {
printf("Too long FT_DS command.\n");
return -1;
}
return wpa_ctrl_command(ctrl, cmd);
}
示例4: hostapd_cli_cmd_disassoc_imminent
static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
char buf[300];
int res;
if (argc < 2) {
printf("Invalid 'disassoc_imminent' command - two arguments "
"(STA addr and Disassociation Timer) are needed\n");
return -1;
}
res = os_snprintf(buf, sizeof(buf), "DISASSOC_IMMINENT %s %s",
argv[0], argv[1]);
if (os_snprintf_error(sizeof(buf), res))
return -1;
return wpa_ctrl_command(ctrl, buf);
}
示例5: wpa_cli_cmd_bss
static int wpa_cli_cmd_bss(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
char cmd[64];
int res;
if (argc != 1) {
printf("Invalid BSS command: need one argument (index or "
"BSSID)\n");
return -1;
}
res = os_snprintf(cmd, sizeof(cmd), "BSS %s", argv[0]);
if (res < 0 || (size_t) res >= sizeof(cmd))
return -1;
cmd[sizeof(cmd) - 1] = '\0';
return wpa_ctrl_command(ctrl, cmd);
}
示例6: wpa_cli_cmd_driver
static int wpa_cli_cmd_driver(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
char cmd[32];
if (argc < 1) {
printf("Invalid DRIVER command: needs one argument (cmd)\n");
return -1;
}
if (argc > 1)
os_snprintf(cmd, sizeof(cmd), "DRIVER %s %s", argv[0], argv[1]);
else
os_snprintf(cmd, sizeof(cmd), "DRIVER %s", argv[0]);
cmd[sizeof(cmd) - 1] = '\0';
return wpa_ctrl_command(ctrl, cmd);
}
示例7: hostapd_cli_cmd_get
static int hostapd_cli_cmd_get(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
char cmd[256];
int res;
if (argc != 1) {
printf("Invalid GET command: needs one argument (variable "
"name)\n");
return -1;
}
res = os_snprintf(cmd, sizeof(cmd), "GET %s", argv[0]);
if (res < 0 || (size_t) res >= sizeof(cmd) - 1) {
printf("Too long GET command.\n");
return -1;
}
return wpa_ctrl_command(ctrl, cmd);
}
示例8: hostapd_cli_cmd_ess_disassoc
static int hostapd_cli_cmd_ess_disassoc(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
char buf[300];
int res;
if (argc < 2) {
printf("Invalid 'ess_disassoc' command - two arguments (STA "
"addr and URL) are needed\n");
return -1;
}
res = os_snprintf(buf, sizeof(buf), "ESS_DISASSOC %s %s",
argv[0], argv[1]);
if (res < 0 || res >= (int) sizeof(buf))
return -1;
return wpa_ctrl_command(ctrl, buf);
}
示例9: hostapd_cli_cmd_set
static int hostapd_cli_cmd_set(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
char cmd[256];
int res;
if (argc != 2) {
printf("Invalid SET command: needs two arguments (variable "
"name and value)\n");
return -1;
}
res = os_snprintf(cmd, sizeof(cmd), "SET %s %s", argv[0], argv[1]);
if (os_snprintf_error(sizeof(cmd), res)) {
printf("Too long SET command.\n");
return -1;
}
return wpa_ctrl_command(ctrl, cmd);
}
示例10: hostapd_cli_cmd_req_lci
static int hostapd_cli_cmd_req_lci(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
char cmd[256];
int res;
if (argc != 1) {
printf("Invalid req_lci command - requires destination address\n");
return -1;
}
res = os_snprintf(cmd, sizeof(cmd), "REQ_LCI %s", argv[0]);
if (os_snprintf_error(sizeof(cmd), res)) {
printf("Too long REQ_LCI command.\n");
return -1;
}
return wpa_ctrl_command(ctrl, cmd);
}
示例11: hostapd_cli_cmd_set_qos_map_set
static int hostapd_cli_cmd_set_qos_map_set(struct wpa_ctrl *ctrl,
int argc, char *argv[])
{
char buf[200];
int res;
if (argc != 1) {
printf("Invalid 'set_qos_map_set' command - "
"one argument (comma delimited QoS map set) "
"is needed\n");
return -1;
}
res = os_snprintf(buf, sizeof(buf), "SET_QOS_MAP_SET %s", argv[0]);
if (os_snprintf_error(sizeof(buf), res))
return -1;
return wpa_ctrl_command(ctrl, buf);
}
示例12: hostapd_cli_cmd_wps_ap_pin
static int hostapd_cli_cmd_wps_ap_pin(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
char buf[64];
if (argc < 1) {
printf("Invalid 'wps_ap_pin' command - at least one argument "
"is required.\n");
return -1;
}
if (argc > 2)
snprintf(buf, sizeof(buf), "WPS_AP_PIN %s %s %s",
argv[0], argv[1], argv[2]);
else if (argc > 1)
snprintf(buf, sizeof(buf), "WPS_AP_PIN %s %s",
argv[0], argv[1]);
else
snprintf(buf, sizeof(buf), "WPS_AP_PIN %s", argv[0]);
return wpa_ctrl_command(ctrl, buf);
}
示例13: wpa_cli_cmd_remove_network
static int wpa_cli_cmd_remove_network(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
char cmd[32];
int res;
if (argc < 1) {
printf("Invalid REMOVE_NETWORK command: needs one argument "
"(network id)\n");
return -1;
}
res = os_snprintf(cmd, sizeof(cmd), "REMOVE_NETWORK %s", argv[0]);
if (res < 0 || (size_t) res >= sizeof(cmd))
return -1;
cmd[sizeof(cmd) - 1] = '\0';
return wpa_ctrl_command(ctrl, cmd);
}
示例14: wpa_cli_cmd_wps_reg
static int wpa_cli_cmd_wps_reg(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
char cmd[256];
int res;
if (argc != 2) {
printf("Invalid WPS_REG command: need two arguments:\n"
"- BSSID: use 'any' to select any\n"
"- AP PIN\n");
return -1;
}
res = os_snprintf(cmd, sizeof(cmd), "WPS_REG %s %s", argv[0], argv[1]);
if (res < 0 || (size_t) res >= sizeof(cmd) - 1) {
printf("Too long WPS_REG command.\n");
return -1;
}
return wpa_ctrl_command(ctrl, cmd);
}
示例15: wpa_cli_cmd_bssid
static int wpa_cli_cmd_bssid(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
char cmd[256], *pos, *end;
int i;
if (argc < 2) {
printf("Invalid BSSID command: needs two arguments (network "
"id and BSSID)\n");
return 0;
}
end = cmd + sizeof(cmd);
pos = cmd;
pos += snprintf(pos, end - pos, "BSSID");
for (i = 0; i < argc; i++)
pos += snprintf(pos, end - pos, " %s", argv[i]);
return wpa_ctrl_command(ctrl, cmd);
}