static int Apd_setup_interface(rtapd *rtapd) { #if MULTIPLE_RADIUS int i; #endif if (Apd_init_sockets(rtapd)) return -1; if (Radius_client_init(rtapd)) { DBGPRINT(RT_DEBUG_ERROR,"RADIUS client initialization failed.\n"); return -1; } if (ieee802_1x_init(rtapd)) { DBGPRINT(RT_DEBUG_ERROR,"IEEE 802.1X initialization failed.\n"); return -1; } #if MULTIPLE_RADIUS for (i = 0; i < rtapd->conf->SsidNum; i++) DBGPRINT(RT_DEBUG_TRACE,"auth_serv_sock[%d] = %d\n", i, rtapd->radius->mbss_auth_serv_sock[i]); #else DBGPRINT(RT_DEBUG_TRACE,"rtapd->radius->auth_serv_sock = %d\n",rtapd->radius->auth_serv_sock); #endif return 0; }
static void Handle_reload_config( rtapd *rtapd) { struct rtapd_config *newconf; #if MULTIPLE_RADIUS int i; #endif // MULTIPLE_RADIUS // DBGPRINT(RT_DEBUG_TRACE, "Reloading configuration\n"); /* create new config */ newconf = Config_read(rtapd->ioctl_sock, rtapd->prefix_wlan_name); if (newconf == NULL) { DBGPRINT(RT_DEBUG_ERROR, "Failed to read new configuration file - continuing with old.\n"); return; } /* TODO: update dynamic data based on changed configuration * items (e.g., open/close sockets, remove stations added to * deny list, etc.) */ Radius_client_flush(rtapd); Config_free(rtapd->conf); rtapd->conf = newconf; Apd_free_stas(rtapd); /* when reStartAP, no need to reallocate sock for (i = 0; i < rtapd->conf->SsidNum; i++) { if (rtapd->sock[i] >= 0) close(rtapd->sock[i]); rtapd->sock[i] = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); if (rtapd->sock[i] < 0) { perror("socket[PF_PACKET,SOCK_RAW]"); return; } }*/ #if MULTIPLE_RADIUS for (i = 0; i < MAX_MBSSID_NUM; i++) rtapd->radius->mbss_auth_serv_sock[i] = -1; #else rtapd->radius->auth_serv_sock = -1; #endif if (Radius_client_init(rtapd)) { DBGPRINT(RT_DEBUG_ERROR,"RADIUS client initialization failed.\n"); return; } #if MULTIPLE_RADIUS for (i = 0; i < rtapd->conf->SsidNum; i++) DBGPRINT(RT_DEBUG_TRACE, "auth_serv_sock[%d] = %d\n", i, rtapd->radius->mbss_auth_serv_sock[i]); #else DBGPRINT(RT_DEBUG_TRACE,"rtapd->radius->auth_serv_sock = %d\n",rtapd->radius->auth_serv_sock); #endif }
static int Apd_setup_interface(rtapd *rtapd) { if (rtapd->ioctl_sock < 0) { rtapd->ioctl_sock = socket(PF_INET, SOCK_DGRAM, 0); if (rtapd->ioctl_sock < 0) { perror("socket[PF_INET,SOCK_DGRAM]"); return -1; } } if (Apd_init_sockets(rtapd)) return -1; if (Radius_client_init(rtapd)) { DBGPRINT(RT_DEBUG_ERROR,"RADIUS client initialization failed.\n"); return -1; } if (ieee802_1x_init(rtapd)) { DBGPRINT(RT_DEBUG_ERROR,"IEEE 802.1X initialization failed.\n"); return -1; } DBGPRINT(RT_DEBUG_TRACE,"rtapd->radius->auth_serv_sock = %d\n",rtapd->radius->auth_serv_sock); return 0; }
static void Handle_usr1(int sig, void *eloop_ctx, void *signal_ctx) { struct hapd_interfaces *rtapds = (struct hapd_interfaces *) eloop_ctx; struct rtapd_config *newconf; int i; DBGPRINT(RT_DEBUG_TRACE,"Reloading configuration\n"); for (i = 0; i < rtapds->count; i++) { rtapd *rtapd = rtapds->rtapd[i]; newconf = Config_read(rtapd->config_fname,0); if (newconf == NULL) { DBGPRINT(RT_DEBUG_ERROR,"Failed to read new configuration file - continuing with old.\n"); continue; } /* TODO: update dynamic data based on changed configuration * items (e.g., open/close sockets, remove stations added to * deny list, etc.) */ Radius_client_flush(rtapd); Config_free(rtapd->conf); rtapd->conf = newconf; Apd_free_stas(rtapd); /* when reStartAP, no need to reallocate sock for (i = 0; i < rtapd->conf->SsidNum; i++) { if (rtapd->sock[i] >= 0) close(rtapd->sock[i]); rtapd->sock[i] = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); if (rtapd->sock[i] < 0) { perror("socket[PF_PACKET,SOCK_RAW]"); return; } }*/ if (Radius_client_init(rtapd)) { DBGPRINT(RT_DEBUG_ERROR,"RADIUS client initialization failed.\n"); return; } #if MULTIPLE_RADIUS for (i = 0; i < rtapd->conf->SsidNum; i++) DBGPRINT(RT_DEBUG_TRACE, "auth_serv_sock[%d] = %d\n", i, rtapd->radius->mbss_auth_serv_sock[i]); #else DBGPRINT(RT_DEBUG_TRACE,"rtapd->radius->auth_serv_sock = %d\n",rtapd->radius->auth_serv_sock); #endif } }
static void Handle_usr1(int sig, void *eloop_ctx, void *signal_ctx) { struct hapd_interfaces *rtapds = (struct hapd_interfaces *) eloop_ctx; struct rtapd_config *newconf; int i; DBGPRINT(RT_DEBUG_TRACE,"Reloading configuration\n"); for (i = 0; i < rtapds->count; i++) { rtapd *rtapd = rtapds->rtapd[i]; newconf = Config_read(rtapd->ioctl_sock, rtapd->prefix_wlan_name); if (newconf == NULL) { DBGPRINT(RT_DEBUG_ERROR,"Failed to read new configuration file - continuing with old.\n"); continue; } /* TODO: update dynamic data based on changed configuration * items (e.g., open/close sockets, remove stations added to * deny list, etc.) */ Radius_client_flush(rtapd); Config_free(rtapd->conf); rtapd->conf = newconf; Apd_free_stas(rtapd); #if MULTIPLE_RADIUS for (i = 0; i < MAX_MBSSID_NUM; i++) rtapd->radius->mbss_auth_serv_sock[i] = -1; #else rtapd->radius->auth_serv_sock = -1; #endif if (Radius_client_init(rtapd)) { DBGPRINT(RT_DEBUG_ERROR,"RADIUS client initialization failed.\n"); return; } #if MULTIPLE_RADIUS for (i = 0; i < rtapd->conf->SsidNum; i++) DBGPRINT(RT_DEBUG_TRACE, "auth_serv_sock[%d] = %d\n", i, rtapd->radius->mbss_auth_serv_sock[i]); #else DBGPRINT(RT_DEBUG_TRACE,"rtapd->radius->auth_serv_sock = %d\n",rtapd->radius->auth_serv_sock); #endif } }