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

C++ eloop_unregister_read_sock函数代码示例

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

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



在下文中一共展示了eloop_unregister_read_sock函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: iapp_deinit

void iapp_deinit(struct iapp_data *iapp)
{
	struct ip_mreqn mreq;

	if (iapp == NULL)
		return;

	if (iapp->udp_sock >= 0) {
		os_memset(&mreq, 0, sizeof(mreq));
		mreq.imr_multiaddr = iapp->multicast;
		mreq.imr_address.s_addr = INADDR_ANY;
		mreq.imr_ifindex = 0;
		if (setsockopt(iapp->udp_sock, SOL_IP, IP_DROP_MEMBERSHIP,
			       &mreq, sizeof(mreq)) < 0) {
			perror("setsockopt[UDP,IP_DEL_MEMBERSHIP]");
		}

		eloop_unregister_read_sock(iapp->udp_sock);
		close(iapp->udp_sock);
	}
	if (iapp->packet_sock >= 0) {
		eloop_unregister_read_sock(iapp->packet_sock);
		close(iapp->packet_sock);
	}
	os_free(iapp);
}
开发者ID:MultiNet-80211,项目名称:Hostapd,代码行数:26,代码来源:iapp.c


示例2: wpa_driver_privsep_deinit

static void wpa_driver_privsep_deinit(void *priv)
{
	struct wpa_driver_privsep_data *drv = priv;

	if (drv->priv_socket >= 0) {
		wpa_priv_reg_cmd(drv, PRIVSEP_CMD_UNREGISTER);
		eloop_unregister_read_sock(drv->priv_socket);
		close(drv->priv_socket);
	}

	if (drv->own_socket_path) {
		unlink(drv->own_socket_path);
		os_free(drv->own_socket_path);
	}

	if (drv->cmd_socket >= 0) {
		eloop_unregister_read_sock(drv->cmd_socket);
		close(drv->cmd_socket);
	}

	if (drv->own_cmd_path) {
		unlink(drv->own_cmd_path);
		os_free(drv->own_cmd_path);
	}

	os_free(drv);
}
开发者ID:MindShow,项目名称:amlogic_s905_kernel_merges,代码行数:27,代码来源:driver_privsep.c


示例3: monitor_deinit

void monitor_deinit(struct wlantest *wt)
{
	if (wt->monitor_sock >= 0) {
		eloop_unregister_read_sock(wt->monitor_sock);
		close(wt->monitor_sock);
		wt->monitor_sock = -1;
	}

	if (wt->monitor_wired >= 0) {
		eloop_unregister_read_sock(wt->monitor_wired);
		close(wt->monitor_wired);
		wt->monitor_wired = -1;
	}
}
开发者ID:MultiNet-80211,项目名称:Hostapd,代码行数:14,代码来源:monitor.c


示例4: wpa_supplicant_ctrl_iface_deinit

void wpa_supplicant_ctrl_iface_deinit(struct ctrl_iface_priv *priv)
{
	struct wpa_ctrl_dst *dst, *prev;

	if (priv->sock > -1) {
		eloop_unregister_read_sock(priv->sock);
		if (priv->ctrl_dst) {
			/*
			 * Wait a second before closing the control socket if
			 * there are any attached monitors in order to allow
			 * them to receive any pending messages.
			 */
			wpa_printf(MSG_DEBUG, "CTRL_IFACE wait for attached "
				   "monitors to receive messages");
			os_sleep(1, 0);
		}
		close(priv->sock);
		priv->sock = -1;
	}

	dst = priv->ctrl_dst;
	while (dst) {
		prev = dst;
		dst = dst->next;
		os_free(prev);
	}
	os_free(priv);
}
开发者ID:MultiNet-80211,项目名称:Hostapd,代码行数:28,代码来源:ctrl_iface_udp.c


示例5: edit_deinit

void edit_deinit(const char *history_file,
		 int (*filter_cb)(void *ctx, const char *cmd))
{
	rl_callback_handler_remove();
	readline_free_completions();

	eloop_unregister_read_sock(STDIN_FILENO);

	if (history_file) {
		/* Save command history, excluding lines that may contain
		 * passwords. */
		HIST_ENTRY *h;
		history_set_pos(0);
		while ((h = current_history())) {
			char *p = h->line;
			while (*p == ' ' || *p == '\t')
				p++;
			if (filter_cb && filter_cb(edit_cb_ctx, p)) {
				h = remove_history(where_history());
				if (h) {
					os_free(h->line);
					free(h->data);
					os_free(h);
				} else
					next_history();
			} else
				next_history();
		}
		write_history(history_file);
	}
}
开发者ID:MultiNet-80211,项目名称:Hostapd,代码行数:31,代码来源:edit_readline.c


示例6: wired_driver_hapd_deinit

static void wired_driver_hapd_deinit(void *priv)
{
	struct wpa_driver_wired_data *drv = priv;

	if (drv->sock >= 0) {
		eloop_unregister_read_sock(drv->sock);
		close(drv->sock);
	}

	if (drv->dhcp_sock >= 0) {
		eloop_unregister_read_sock(drv->dhcp_sock);
		close(drv->dhcp_sock);
	}

	os_free(drv);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:16,代码来源:driver_wired.c


示例7: wpa_supplicant_ctrl_iface_deinit

void wpa_supplicant_ctrl_iface_deinit(struct ctrl_iface_priv *priv)
{
	struct wpa_ctrl_dst *dst, *prev;

	if (priv->sock > -1) {
		char *fname;
		char *buf, *dir = NULL, *gid_str = NULL;
		eloop_unregister_read_sock(priv->sock);
		if (priv->ctrl_dst) {
			/*
			 * Wait a second before closing the control socket if
			 * there are any attached monitors in order to allow
			 * them to receive any pending messages.
			 */
			wpa_printf(MSG_DEBUG, "CTRL_IFACE wait for attached "
				   "monitors to receive messages");
			os_sleep(1, 0);
		}
		close(priv->sock);
		priv->sock = -1;
		fname = wpa_supplicant_ctrl_iface_path(priv->wpa_s);
		if (fname) {
			unlink(fname);
			os_free(fname);
		}

		buf = os_strdup(priv->wpa_s->conf->ctrl_interface);
		if (buf == NULL)
			goto free_dst;
		if (os_strncmp(buf, "DIR=", 4) == 0) {
			dir = buf + 4;
			gid_str = os_strstr(dir, " GROUP=");
			if (gid_str) {
				*gid_str = '\0';
				gid_str += 7;
			}
		} else
			dir = buf;

		if (rmdir(dir) < 0) {
			if (errno == ENOTEMPTY) {
				wpa_printf(MSG_DEBUG, "Control interface "
					   "directory not empty - leaving it "
					   "behind");
			} else {
				perror("rmdir[ctrl_interface]");
			}
		}
		os_free(buf);
	}

free_dst:
	dst = priv->ctrl_dst;
	while (dst) {
		prev = dst;
		dst = dst->next;
		os_free(prev);
	}
	os_free(priv);
}
开发者ID:WiseMan787,项目名称:ralink_sdk,代码行数:60,代码来源:ctrl_iface_unix.c


示例8: wpas_ctrl_iface_reinit

static int wpas_ctrl_iface_reinit(struct wpa_supplicant *wpa_s,
				  struct ctrl_iface_priv *priv)
{
	int res;

	if (priv->sock <= 0)
		return -1;

	/*
	 * On Android, the control socket being used may be the socket
	 * that is created when wpa_supplicant is started as a /init.*.rc
	 * service. Such a socket is maintained as a key-value pair in
	 * Android's environment. Closing this control socket would leave us
	 * in a bad state with an invalid socket descriptor.
	 */
	if (priv->android_control_socket)
		return priv->sock;

	eloop_unregister_read_sock(priv->sock);
	close(priv->sock);
	priv->sock = -1;
	res = wpas_ctrl_iface_open_sock(wpa_s, priv);
	if (res < 0)
		return -1;
	return priv->sock;
}
开发者ID:zarelaky,项目名称:WN752N-v2-hostapd,代码行数:26,代码来源:ctrl_iface_unix.c


示例9: wpa_supplicant_run

int32
WPASupplicantApp::_SupplicantThread(void *data)
{
	WPASupplicantApp *app = (WPASupplicantApp *)data;

	// Register our notify socket with the polling event loop.
	if (eloop_register_read_sock(app->fNotifySockets[0],
			_EventLoopProcessEvents, app->fWPAGlobal, app) != 0) {
		return B_ERROR;
	}

	wpa_supplicant_run(app->fWPAGlobal);

	eloop_unregister_read_sock(app->fNotifySockets[0]);

	// There are two reasons why the supplicant thread quit:
	// 1.	The event loop was terminated because of a signal or error and the
	//		application is still there and running.
	// 2.	The app has quit and stopped the event loop.
	//
	// In case of 2. we're done, but in case of 1. we need to quit the still
	// running application. We use the app messenger to reach the app if it is
	// still running. If it already quit the SendMessage() will simply fail.

	be_app_messenger.SendMessage(B_QUIT_REQUESTED);
	return B_OK;
}
开发者ID:kallisti5,项目名称:wpa_supplicant-haiku,代码行数:27,代码来源:main_haiku.cpp


示例10: test_driver_deinit

static void test_driver_deinit(void *priv)
{
	struct test_driver_data *drv = priv;
	struct test_client_socket *cli, *prev;

	cli = drv->cli;
	while (cli) {
		prev = cli;
		cli = cli->next;
		free(prev);
	}

	if (drv->test_socket >= 0) {
		eloop_unregister_read_sock(drv->test_socket);
		close(drv->test_socket);
		if (drv->own_socket_path)
			unlink(drv->own_socket_path);
	}

	/* There should be only one BSS remaining at this point. */
	if (drv->bss == NULL)
		wpa_printf(MSG_ERROR, "%s: drv->bss == NULL", __func__);
	else if (drv->bss->next)
		wpa_printf(MSG_ERROR, "%s: drv->bss->next != NULL", __func__);

	test_driver_free_priv(drv);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:27,代码来源:driver_test.c


示例11: hostapd_ctrl_iface_deinit

void hostapd_ctrl_iface_deinit(struct hostapd_data *hapd)
{
	struct wpa_ctrl_dst *dst, *prev;

	if (hapd->ctrl_sock > -1) {
		char *fname;
		eloop_unregister_read_sock(hapd->ctrl_sock);
		close(hapd->ctrl_sock);
		hapd->ctrl_sock = -1;
		fname = hostapd_ctrl_iface_path(hapd);
		if (fname)
			unlink(fname);
		free(fname);

		if (hapd->conf->ctrl_interface &&
		    rmdir(hapd->conf->ctrl_interface) < 0) {
			if (errno == ENOTEMPTY) {
				wpa_printf(MSG_DEBUG, "Control interface "
					   "directory not empty - leaving it "
					   "behind");
			} else {
				perror("rmdir[ctrl_interface]");
			}
		}
	}

	dst = hapd->ctrl_dst;
	while (dst) {
		prev = dst;
		dst = dst->next;
		free(prev);
	}
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-ef_fw-20-19-8,代码行数:33,代码来源:ctrl_iface.c


示例12: full_dynamic_vlan_deinit

static void full_dynamic_vlan_deinit(struct full_dynamic_vlan *priv)
{
	if (priv == NULL)
		return;
	eloop_unregister_read_sock(priv->s);
	close(priv->s);
	os_free(priv);
}
开发者ID:hazmole,项目名称:sdnwf_hostapd,代码行数:8,代码来源:vlan_init.c


示例13: wpa_supplicant_global_ctrl_iface_deinit

void wpa_supplicant_global_ctrl_iface_deinit(struct ctrl_iface_global_priv *priv)
{
	if (priv->sock >= 0) {
		eloop_unregister_read_sock(priv->sock);
		close(priv->sock);
	}
	os_free(priv);
}
开发者ID:drashti304,项目名称:TizenRT,代码行数:8,代码来源:ctrl_iface_udp.c


示例14: radius_client_deinit

void radius_client_deinit(struct radius_client_data *radius)
{
	if (!radius)
		return;

	if (radius->auth_serv_sock >= 0)
		eloop_unregister_read_sock(radius->auth_serv_sock);
	if (radius->acct_serv_sock >= 0)
		eloop_unregister_read_sock(radius->acct_serv_sock);

	eloop_cancel_timeout(radius_retry_primary_timer, radius, NULL);

	radius_client_flush(radius, 0);
	os_free(radius->auth_handlers);
	os_free(radius->acct_handlers);
	os_free(radius);
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-e-f_fw-20-10-7-5,代码行数:17,代码来源:radius_client.c


示例15: radius_close_acct_sockets

static void radius_close_acct_sockets(struct radius_client_data *radius)
{
	radius->acct_sock = -1;

	if (radius->acct_serv_sock >= 0) {
		eloop_unregister_read_sock(radius->acct_serv_sock);
		close(radius->acct_serv_sock);
		radius->acct_serv_sock = -1;
	}
#ifdef CONFIG_IPV6
	if (radius->acct_serv_sock6 >= 0) {
		eloop_unregister_read_sock(radius->acct_serv_sock6);
		close(radius->acct_serv_sock6);
		radius->acct_serv_sock6 = -1;
	}
#endif /* CONFIG_IPV6 */
}
开发者ID:9A9A,项目名称:wpa_supplicant-fork,代码行数:17,代码来源:radius_client.c


示例16: wpa_driver_broadcom_deinit

static void wpa_driver_broadcom_deinit(void *priv)
{
	struct wpa_driver_broadcom_data *drv = priv;
	eloop_cancel_timeout(wpa_driver_broadcom_scan_timeout, drv, drv->ctx);
	eloop_unregister_read_sock(drv->event_sock);
	close(drv->event_sock);
	close(drv->ioctl_sock);
	os_free(drv);
}
开发者ID:ACSOP,项目名称:android_external_wpa_supplicant_6,代码行数:9,代码来源:driver_broadcom.c


示例17: wpas_binder_deinit

void wpas_binder_deinit(struct wpas_binder_priv *priv)
{
	if (!priv)
		return;

	wpa_supplicant_binder::BinderManager::destroyInstance();
	eloop_unregister_read_sock(priv->binder_fd);
	android::IPCThreadState::shutdown();
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:9,代码来源:binder.cpp


示例18: unregister_event_handler

static void unregister_event_handler(struct wpa_ctrl *ctrl)
{
	if (!ctrl_conn)
		return;
	if (interactive && event_handler_registered) {
		eloop_unregister_read_sock(wpa_ctrl_get_fd(ctrl));
		event_handler_registered = 0;
	}
}
开发者ID:cococorp,项目名称:hostap-upstream,代码行数:9,代码来源:hostapd_cli.c


示例19: ctrl_deinit

void ctrl_deinit(struct wlantest *wt)
{
	int i;

	if (wt->ctrl_sock < 0)
		return;

	for (i = 0; i < MAX_CTRL_CONNECTIONS; i++) {
		if (wt->ctrl_socks[i] >= 0) {
			close(wt->ctrl_socks[i]);
			eloop_unregister_read_sock(wt->ctrl_socks[i]);
			wt->ctrl_socks[i] = -1;
		}
	}

	eloop_unregister_read_sock(wt->ctrl_sock);
	close(wt->ctrl_sock);
	wt->ctrl_sock = -1;
}
开发者ID:cozybit,项目名称:hostap-sae,代码行数:19,代码来源:ctrl.c


示例20: apac_ctrl_detach

static void apac_ctrl_detach(apacHyfi20IF_t *pIF)
{
     if (apac_ctrl_cmd(pIF, "DETACH", 6) < 0)
    {
       dprintf(MSG_INFO, "Failed to detach CTRL connection[%s]\n", pIF->ifName);
    }
    
    eloop_unregister_read_sock(pIF->ctrlSock);
    apac_ctrl_close(pIF);
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:10,代码来源:apac_hyfi20_ctrl.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ els函数代码示例发布时间:2022-05-30
下一篇:
C++ eloop_terminate函数代码示例发布时间: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