本文整理汇总了C++中eloop_terminate函数的典型用法代码示例。如果您正苦于以下问题:C++ eloop_terminate函数的具体用法?C++ eloop_terminate怎么用?C++ eloop_terminate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eloop_terminate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hostapd_cli_cmd_quit
static int hostapd_cli_cmd_quit(struct wpa_ctrl *ctrl, int argc, char *argv[])
{
hostapd_cli_quit = 1;
if (interactive)
eloop_terminate();
return 0;
}
示例2: wpa_supplicant_event_interface_status
static void
wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
union wpa_event_data *data)
{
if (os_strcmp(wpa_s->ifname, data->interface_status.ifname) != 0)
return;
switch (data->interface_status.ievent) {
case EVENT_INTERFACE_ADDED:
if (!wpa_s->interface_removed)
break;
wpa_s->interface_removed = 0;
wpa_printf(MSG_DEBUG, "Configured interface was added.");
if (wpa_supplicant_driver_init(wpa_s) < 0) {
wpa_printf(MSG_INFO, "Failed to initialize the driver "
"after interface was added.");
}
break;
case EVENT_INTERFACE_REMOVED:
wpa_printf(MSG_DEBUG, "Configured interface was removed.");
wpa_s->interface_removed = 1;
wpa_supplicant_mark_disassoc(wpa_s);
l2_packet_deinit(wpa_s->l2);
wpa_s->l2 = NULL;
#ifdef CONFIG_TERMINATE_ONLASTIF
/* check if last interface */
if (!any_interfaces(wpa_s->global->ifaces))
eloop_terminate();
#endif /* CONFIG_TERMINATE_ONLASTIF */
break;
}
}
示例3: eapol_test_terminate
static void eapol_test_terminate(int sig, void *eloop_ctx,
void *signal_ctx)
{
struct wpa_supplicant *wpa_s = eloop_ctx;
wpa_msg(wpa_s, MSG_INFO, "Signal %d received - terminating", sig);
eloop_terminate();
}
示例4: http_req
static void http_req(void *ctx, struct http_request *req)
{
struct browser_data *data = ctx;
struct wpabuf *resp;
const char *url;
int done = 0;
url = http_request_get_uri(req);
wpa_printf(MSG_INFO, "Browser response received: %s", url);
if (os_strcmp(url, "/") == 0) {
data->success = 1;
done = 1;
} else if (os_strncmp(url, "/osu/", 5) == 0) {
data->success = atoi(url + 5);
done = 1;
}
resp = wpabuf_alloc(1);
if (resp == NULL) {
http_request_deinit(req);
if (done)
eloop_terminate();
return;
}
if (done) {
eloop_cancel_timeout(browser_timeout, NULL, NULL);
eloop_register_timeout(0, 500000, browser_timeout, &data, NULL);
}
http_request_send_and_deinit(req, resp);
}
示例5: eapol_test_timeout
static void eapol_test_timeout(void *eloop_ctx, void *timeout_ctx)
{
struct wpa_supplicant *wpa_s = eloop_ctx;
printf("EAPOL test timed out\n");
wpa_s->auth_timed_out = 1;
eloop_terminate();
}
示例6: Handle_term
void Handle_term(int sig, void *eloop_ctx, void *signal_ctx)
{
//FILE *f;
//char buf[256], *pos;
//int line = 0, i;
//int filesize,cur = 0;
//char *ini_buffer; /* storage area for .INI file */
DBGPRINT(RT_DEBUG_ERROR,"Signal %d received - terminating\n", sig);
eloop_terminate();
}
示例7: eapol_sm_cb
static void eapol_sm_cb(struct eapol_sm *eapol, int success, void *ctx)
{
struct eapol_test_data *e = ctx;
printf("eapol_sm_cb: success=%d\n", success);
e->eapol_test_num_reauths--;
if (e->eapol_test_num_reauths < 0)
eloop_terminate();
else {
eapol_test_compare_pmk(e);
eloop_register_timeout(0, 100000, eapol_sm_reauth, e, NULL);
}
}
示例8: eapol_sm_cb
static void eapol_sm_cb(struct eapol_sm *eapol, enum eapol_supp_result result,
void *ctx)
{
struct eapol_test_data *e = ctx;
printf("eapol_sm_cb: result=%d\n", result);
e->eapol_test_num_reauths--;
if (e->eapol_test_num_reauths < 0)
eloop_terminate();
else {
eapol_test_compare_pmk(e);
eloop_register_timeout(0, 100000, eapol_sm_reauth, e, NULL);
}
}
示例9: handle_reload_iface
int handle_reload_iface(struct hostapd_iface *iface, void *ctx)
{
/* if (hostapd_reload_config(iface) < 0) {
wpa_printf(MSG_WARNING, "Failed to read new configuration "
"file - continuing with old.");
}
*/
reloading = 1;
eloop_terminate();
return 0;
}
示例10: wpa_supplicant_global_ctrl_iface_process
char * wpa_supplicant_global_ctrl_iface_process(struct wpa_global *global,
char *buf, size_t *resp_len)
{
char *reply;
const int reply_size = 4096;
int reply_len;
if (os_strcmp(buf, "PING") != 0) {
wpa_hexdump_ascii(MSG_DEBUG, "RX global ctrl_iface",
(const u8 *) buf, os_strlen(buf));
}
reply = os_malloc(reply_size);
if (reply == NULL) {
*resp_len = 1;
return NULL;
}
os_memcpy(reply, "OK\n", 3);
reply_len = 3;
if (os_strcmp(buf, "PING") == 0) {
os_memcpy(reply, "PONG\n", 5);
reply_len = 5;
} else if (os_strncmp(buf, "INTERFACE_ADD ", 14) == 0) {
if (wpa_supplicant_global_iface_add(global, buf + 14))
reply_len = -1;
} else if (os_strncmp(buf, "INTERFACE_REMOVE ", 17) == 0) {
if (wpa_supplicant_global_iface_remove(global, buf + 17))
reply_len = -1;
} else if (os_strcmp(buf, "INTERFACE_LIST") == 0) {
reply_len = wpa_supplicant_global_iface_list(
global, reply, reply_size);
} else if (os_strcmp(buf, "INTERFACES") == 0) {
reply_len = wpa_supplicant_global_iface_interfaces(
global, reply, reply_size);
} else if (os_strcmp(buf, "TERMINATE") == 0) {
eloop_terminate();
} else {
os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
reply_len = 16;
}
if (reply_len < 0) {
os_memcpy(reply, "FAIL\n", 5);
reply_len = 5;
}
*resp_len = reply_len;
return reply;
}
示例11: DOT1X_Stop
int DOT1X_Stop(void)
{
int i;
DBGPRINT(RT_DEBUG_ERROR,"DOT1X_Stop\n");
if(interfaces.rtapd != NULL)
{
eloop_terminate();
cyg_thread_delay(300);
cyg_thread_delete(dot1x_thread);
}
else
DBGPRINT(RT_DEBUG_ERROR,"1x daemon not running interfaces.rtapd == NULL\n");
}
示例12: receive_auth
/* Process the RADIUS frames from Authentication Server */
static RadiusRxResult receive_auth(struct radius_msg *msg,
struct radius_msg *req,
const u8 *shared_secret,
size_t shared_secret_len,
void *data)
{
/* struct radius_ctx *ctx = data; */
printf("Received RADIUS Authentication message; code=%d\n",
radius_msg_get_hdr(msg)->code);
/* We're done for this example, so request eloop to terminate. */
eloop_terminate();
return RADIUS_RX_PROCESSED;
}
示例13: check_sconf_integrity
static void check_sconf_integrity(struct smartconfig *sc)
{
int i, count = 0;
int len = (sc->ssid_len > sc->psk_len ? sc->ssid_len : sc->psk_len);
if (len > 0) {
for (i = 0; i < len; i++)
if (sc->slm[i + 4].flag)
count++;
if (count == len) {
eloop_terminate();
}
}
}
示例14: service_ctrl_handler
static void WINAPI service_ctrl_handler(DWORD control_code)
{
switch (control_code) {
case SERVICE_CONTROL_INTERROGATE:
break;
case SERVICE_CONTROL_SHUTDOWN:
case SERVICE_CONTROL_STOP:
svc_status.dwCurrentState = SERVICE_STOP_PENDING;
svc_status.dwWaitHint = 2000;
eloop_terminate();
SetEvent(kill_svc);
break;
}
if (!SetServiceStatus(svc_status_handle, &svc_status)) {
printf("SetServiceStatus() failed: %d\n",
(int) GetLastError());
}
}
示例15: handle_term
/**
* handle_term - SIGINT and SIGTERM handler to terminate hostapd process
*/
static void handle_term(int sig, void *signal_ctx)
{
wpa_printf(MSG_DEBUG, "Signal %d received - terminating", sig);
eloop_terminate();
}