Home | History | Annotate | Download | only in hostapd

Lines Matching refs:interfaces

242  * interfaces. No actiual driver operations are started.
245 hostapd_interface_init(struct hapd_interfaces *interfaces,
252 iface = hostapd_init(interfaces, config_fname);
255 iface->interfaces = interfaces;
301 struct hapd_interfaces *interfaces = signal_ctx;
304 hostapd_for_each_interface(interfaces, handle_reload_iface, NULL);
315 static int hostapd_global_init(struct hapd_interfaces *interfaces,
337 eloop_register_signal(SIGHUP, handle_reload, interfaces);
338 eloop_register_signal(SIGUSR1, handle_dump_state, interfaces);
340 eloop_register_signal_terminate(handle_term, interfaces);
450 " -G group for control interfaces\n"
477 static int hostapd_get_global_ctrl_iface(struct hapd_interfaces *interfaces,
481 os_free(interfaces->global_iface_path);
482 interfaces->global_iface_path = os_strdup(path);
483 if (interfaces->global_iface_path == NULL)
485 pos = os_strrchr(interfaces->global_iface_path, '/');
489 os_free(interfaces->global_iface_path);
490 interfaces->global_iface_path = NULL;
495 interfaces->global_iface_name = pos + 1;
501 static int hostapd_get_ctrl_iface_group(struct hapd_interfaces *interfaces,
511 interfaces->ctrl_iface_group = grp->gr_gid;
540 struct hapd_interfaces interfaces;
556 os_memset(&interfaces, 0, sizeof(interfaces));
557 interfaces.reload_config = hostapd_reload_config;
558 interfaces.config_read_cb = hostapd_config_read;
559 interfaces.for_each_interface = hostapd_for_each_interface;
560 interfaces.ctrl_iface_init = hostapd_ctrl_iface_init;
561 interfaces.ctrl_iface_deinit = hostapd_ctrl_iface_deinit;
562 interfaces.driver_init = hostapd_driver_init;
563 interfaces.global_iface_path = NULL;
564 interfaces.global_iface_name = NULL;
565 interfaces.global_ctrl_sock = -1;
609 if (hostapd_get_global_ctrl_iface(&interfaces, optarg))
613 if (hostapd_get_ctrl_iface_group(&interfaces, optarg))
635 if (optind == argc && interfaces.global_iface_path == NULL &&
653 interfaces.count = argc - optind;
654 if (interfaces.count || num_bss_configs) {
655 interfaces.iface = os_calloc(interfaces.count + num_bss_configs,
657 if (interfaces.iface == NULL) {
663 if (hostapd_global_init(&interfaces, entropy_file)) {
669 for (i = 0; i < interfaces.count; i++) {
670 interfaces.iface[i] = hostapd_interface_init(&interfaces,
673 if (!interfaces.iface[i]) {
693 iface = hostapd_interface_init_bss(&interfaces, bss_config[i],
697 for (j = 0; j < interfaces.count; j++) {
698 if (interfaces.iface[j] == iface)
701 if (j == interfaces.count) {
703 tmp = os_realloc_array(interfaces.iface,
704 interfaces.count + 1,
710 interfaces.iface = tmp;
711 interfaces.iface[interfaces.count++] = iface;
716 * Enable configured interfaces. Depending on channel configuration,
723 interfaces.terminate_on_error = interfaces.count;
724 for (i = 0; i < interfaces.count; i++) {
725 if (hostapd_driver_init(interfaces.iface[i]) ||
726 hostapd_setup_interface(interfaces.iface[i]))
730 hostapd_global_ctrl_iface_init(&interfaces);
732 if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
740 hostapd_global_ctrl_iface_deinit(&interfaces);
741 /* Deinitialize all interfaces */
742 for (i = 0; i < interfaces.count; i++) {
743 if (!interfaces.iface[i])
745 interfaces.iface[i]->driver_ap_teardown =
746 !!(interfaces.iface[i]->drv_flags &
748 hostapd_interface_deinit_free(interfaces.iface[i]);
750 os_free(interfaces.iface);