• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ eloop_terminate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中eloop_terminate函数的典型用法代码示例。如果您正苦于以下问题:C++ eloop_terminate函数的具体用法?C++ eloop_terminate怎么用?C++ eloop_terminate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了eloop_terminate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:cococorp,项目名称:hostap-upstream,代码行数:7,代码来源:hostapd_cli.c


示例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;
	}
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:32,代码来源:events.c


示例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();
}
开发者ID:LucidOne,项目名称:Rovio,代码行数:7,代码来源:eapol_test.c


示例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);
}
开发者ID:9A9A,项目名称:wpa_supplicant-fork,代码行数:33,代码来源:browser-android.c


示例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();
}
开发者ID:OPSF,项目名称:uClinux,代码行数:7,代码来源:eapol_test.c


示例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();
}
开发者ID:houzhenggang,项目名称:mt7688_mips_ecos,代码行数:11,代码来源:rtdot1x.c


示例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);
	}
}
开发者ID:MultiNet-80211,项目名称:Hostapd,代码行数:12,代码来源:eapol_test.c


示例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);
	}
}
开发者ID:Hansenq,项目名称:wifi-goes-to-town,代码行数:13,代码来源:eapol_test.c


示例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;

}
开发者ID:springware,项目名称:92u10,代码行数:13,代码来源:main.c


示例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;
}
开发者ID:abo-hob,项目名称:android-wpa_supplicant,代码行数:51,代码来源:ctrl_iface.c


示例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");
}
开发者ID:houzhenggang,项目名称:mt7688_mips_ecos,代码行数:14,代码来源:rtdot1x.c


示例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;
}
开发者ID:avchinch,项目名称:hostap-1,代码行数:16,代码来源:radius_example.c


示例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();
		}
	}
}
开发者ID:jolin90,项目名称:smartconfig,代码行数:16,代码来源:pcap.c


示例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());
        }
}
开发者ID:tigerjibo,项目名称:wpa_suppliant_with_openssl,代码行数:19,代码来源:main_winsvc.c


示例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();
}
开发者ID:imw,项目名称:hapd,代码行数:8,代码来源:main.c


示例16: ieee802_1x_decapsulate_radius

static void ieee802_1x_decapsulate_radius(struct eapol_test_data *e)
{
	u8 *eap;
	size_t len;
	struct eap_hdr *hdr;
	int eap_type = -1;
	char buf[64];
	struct radius_msg *msg;

	if (e->last_recv_radius == NULL)
		return;

	msg = e->last_recv_radius;

	eap = radius_msg_get_eap(msg, &len);
	if (eap == NULL) {
		/* draft-aboba-radius-rfc2869bis-20.txt, Chap. 2.6.3:
		 * RADIUS server SHOULD NOT send Access-Reject/no EAP-Message
		 * attribute */
		wpa_printf(MSG_DEBUG, "could not extract "
			       "EAP-Message from RADIUS message");
		os_free(e->last_eap_radius);
		e->last_eap_radius = NULL;
		e->last_eap_radius_len = 0;
		return;
	}

	if (len < sizeof(*hdr)) {
		wpa_printf(MSG_DEBUG, "too short EAP packet "
			       "received from authentication server");
		os_free(eap);
		return;
	}

	if (len > sizeof(*hdr))
		eap_type = eap[sizeof(*hdr)];

	hdr = (struct eap_hdr *) eap;
	switch (hdr->code) {
	case EAP_CODE_REQUEST:
		os_snprintf(buf, sizeof(buf), "EAP-Request-%s (%d)",
			    eap_type >= 0 ? eap_type_text(eap_type) : "??",
			    eap_type);
		break;
	case EAP_CODE_RESPONSE:
		os_snprintf(buf, sizeof(buf), "EAP Response-%s (%d)",
			    eap_type >= 0 ? eap_type_text(eap_type) : "??",
			    eap_type);
		break;
	case EAP_CODE_SUCCESS:
		os_strlcpy(buf, "EAP Success", sizeof(buf));
		/* LEAP uses EAP Success within an authentication, so must not
		 * stop here with eloop_terminate(); */
		break;
	case EAP_CODE_FAILURE:
		os_strlcpy(buf, "EAP Failure", sizeof(buf));
		eloop_terminate();
		break;
	default:
		os_strlcpy(buf, "unknown EAP code", sizeof(buf));
		wpa_hexdump(MSG_DEBUG, "Decapsulated EAP packet", eap, len);
		break;
	}
	wpa_printf(MSG_DEBUG, "decapsulated EAP packet (code=%d "
		       "id=%d len=%d) from RADIUS server: %s",
		      hdr->code, hdr->identifier, ntohs(hdr->length), buf);

	/* sta->eapol_sm->be_auth.idFromServer = hdr->identifier; */

	os_free(e->last_eap_radius);
	e->last_eap_radius = eap;
	e->last_eap_radius_len = len;

	{
		struct ieee802_1x_hdr *dot1x;
		dot1x = os_malloc(sizeof(*dot1x) + len);
		assert(dot1x != NULL);
		dot1x->version = EAPOL_VERSION;
		dot1x->type = IEEE802_1X_TYPE_EAP_PACKET;
		dot1x->length = htons(len);
		os_memcpy((u8 *) (dot1x + 1), eap, len);
		eapol_sm_rx_eapol(e->wpa_s->eapol, e->wpa_s->bssid,
				  (u8 *) dot1x, sizeof(*dot1x) + len);
		os_free(dot1x);
	}
}
开发者ID:MultiNet-80211,项目名称:Hostapd,代码行数:86,代码来源:eapol_test.c


示例17: handle_term

static void handle_term(int sig, void *eloop_ctx, void *signal_ctx)
{
	printf("Signal %d received - terminating\n", sig);
	eloop_terminate();
}
开发者ID:OPSF,项目名称:uClinux,代码行数:5,代码来源:hostapd.c


示例18: wpa_priv_terminate

static void wpa_priv_terminate(int sig, void *eloop_ctx, void *signal_ctx)
{
	wpa_printf(MSG_DEBUG, "wpa_priv termination requested");
	eloop_terminate();
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:5,代码来源:wpa_priv.c


示例19: 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);

#if 0
    f = fopen(RT2860AP_SYSTEM_PATH, "r");
    if (f == NULL)
    {
        DBGPRINT(RT_DEBUG_ERROR,"Could not open configuration file '%s' for reading.\n", RT2860AP_SYSTEM_PATH);
        return;
    }

    if ((fseek(f, 0, SEEK_END))!=0)
        return;
    filesize=ftell(f);
    DBGPRINT(RT_DEBUG_ERROR,"filesize %d   - terminating\n", filesize);

    if ((ini_buffer=(char *)malloc(filesize + 1 ))==NULL)
        return;   //out of memory
    fseek(f,0,SEEK_SET);
    fread(ini_buffer, filesize, 1, f);
    fseek(f,0,SEEK_SET);
    ini_buffer[filesize]='\0';

    while ((fgets(buf, sizeof(buf), f)))
    {
        line++;
        if (buf[0] == '#')
            continue;
        pos = buf;
        while (*pos != '\0')
        {
            if (*pos == '\n')
            {
                *pos = '\0';
                break;
            }
            pos++;
        }
        if (buf[0] == '\0')
            continue;

        pos = strchr(buf, '=');
        if (pos == NULL)
        {
            pos = strchr(buf, '[');
            continue;
        }
        *pos = '\0';
        pos++;

        if ((strcmp(buf, "pid") == 0) )
        {
            cur = 0;
            while(cur < (int)filesize)
            {
                if ((ini_buffer[cur]=='p') && (ini_buffer[cur+1]=='i') && (ini_buffer[cur+2]=='d'))
                {
                    cur += 4;
                    for( i=4; i>=0; i--)
                    {
                        if (ini_buffer[cur] !='\n' )
                        {
                            ini_buffer[cur] =0x30;
                        }
                        else
                        {
                            break;
                        }
                        cur++;
                    }
                    break;
                }
                cur++;
            }
        }
    }
    fseek(f,0,SEEK_SET);
    fprintf(f, "%s", ini_buffer);
    fclose(f);
#endif

    eloop_terminate();
}
开发者ID:Brainiarc7,项目名称:openwrt-xiaomi-mini,代码行数:90,代码来源:rtdot1x.c


示例20: browser_timeout

static void browser_timeout(void *eloop_data, void *user_ctx)
{
	wpa_printf(MSG_INFO, "Timeout on waiting browser interaction to "
		   "complete");
	eloop_terminate();
}
开发者ID:9A9A,项目名称:wpa_supplicant-fork,代码行数:6,代码来源:browser-android.c



注:本文中的eloop_terminate函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ eloop_unregister_read_sock函数代码示例发布时间:2022-05-30
下一篇:
C++ eloop_register_timeout函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap