本文整理汇总了C++中eloop_unregister_read_sock函数的典型用法代码示例。如果您正苦于以下问题:C++ eloop_unregister_read_sock函数的具体用法?C++ eloop_unregister_read_sock怎么用?C++ eloop_unregister_read_sock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eloop_unregister_read_sock函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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;
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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 */
}