Lines Matching refs:interfaces
243 hostapd_interface_init(struct hapd_interfaces *interfaces, in hostapd_interface_init() argument
250 iface = hostapd_init(interfaces, config_fname); in hostapd_interface_init()
253 iface->interfaces = interfaces; in hostapd_interface_init()
299 struct hapd_interfaces *interfaces = signal_ctx; in handle_reload() local
302 hostapd_for_each_interface(interfaces, handle_reload_iface, NULL); in handle_reload()
313 static int hostapd_global_init(struct hapd_interfaces *interfaces, in hostapd_global_init() argument
335 eloop_register_signal(SIGHUP, handle_reload, interfaces); in hostapd_global_init()
336 eloop_register_signal(SIGUSR1, handle_dump_state, interfaces); in hostapd_global_init()
338 eloop_register_signal_terminate(handle_term, interfaces); in hostapd_global_init()
475 static int hostapd_get_global_ctrl_iface(struct hapd_interfaces *interfaces, in hostapd_get_global_ctrl_iface() argument
479 os_free(interfaces->global_iface_path); in hostapd_get_global_ctrl_iface()
480 interfaces->global_iface_path = os_strdup(path); in hostapd_get_global_ctrl_iface()
481 if (interfaces->global_iface_path == NULL) in hostapd_get_global_ctrl_iface()
483 pos = os_strrchr(interfaces->global_iface_path, '/'); in hostapd_get_global_ctrl_iface()
487 os_free(interfaces->global_iface_path); in hostapd_get_global_ctrl_iface()
488 interfaces->global_iface_path = NULL; in hostapd_get_global_ctrl_iface()
493 interfaces->global_iface_name = pos + 1; in hostapd_get_global_ctrl_iface()
499 static int hostapd_get_ctrl_iface_group(struct hapd_interfaces *interfaces, in hostapd_get_ctrl_iface_group() argument
509 interfaces->ctrl_iface_group = grp->gr_gid; in hostapd_get_ctrl_iface_group()
538 struct hapd_interfaces interfaces; in main() local
554 os_memset(&interfaces, 0, sizeof(interfaces)); in main()
555 interfaces.reload_config = hostapd_reload_config; in main()
556 interfaces.config_read_cb = hostapd_config_read; in main()
557 interfaces.for_each_interface = hostapd_for_each_interface; in main()
558 interfaces.ctrl_iface_init = hostapd_ctrl_iface_init; in main()
559 interfaces.ctrl_iface_deinit = hostapd_ctrl_iface_deinit; in main()
560 interfaces.driver_init = hostapd_driver_init; in main()
561 interfaces.global_iface_path = NULL; in main()
562 interfaces.global_iface_name = NULL; in main()
563 interfaces.global_ctrl_sock = -1; in main()
607 if (hostapd_get_global_ctrl_iface(&interfaces, optarg)) in main()
611 if (hostapd_get_ctrl_iface_group(&interfaces, optarg)) in main()
633 if (optind == argc && interfaces.global_iface_path == NULL && in main()
653 interfaces.count = argc - optind; in main()
654 if (interfaces.count || num_bss_configs) { in main()
655 interfaces.iface = os_calloc(interfaces.count + num_bss_configs, in main()
657 if (interfaces.iface == NULL) { in main()
663 if (hostapd_global_init(&interfaces, entropy_file)) { in main()
669 for (i = 0; i < interfaces.count; i++) { in main()
670 interfaces.iface[i] = hostapd_interface_init(&interfaces, in main()
673 if (!interfaces.iface[i]) { in main()
693 iface = hostapd_interface_init_bss(&interfaces, bss_config[i], in main()
697 for (j = 0; j < interfaces.count; j++) { in main()
698 if (interfaces.iface[j] == iface) in main()
701 if (j == interfaces.count) { in main()
703 tmp = os_realloc_array(interfaces.iface, in main()
704 interfaces.count + 1, in main()
710 interfaces.iface = tmp; in main()
711 interfaces.iface[interfaces.count++] = iface; in main()
723 interfaces.terminate_on_error = interfaces.count; in main()
724 for (i = 0; i < interfaces.count; i++) { in main()
725 if (hostapd_driver_init(interfaces.iface[i]) || in main()
726 hostapd_setup_interface(interfaces.iface[i])) in main()
730 hostapd_global_ctrl_iface_init(&interfaces); in main()
732 if (hostapd_global_run(&interfaces, daemonize, pid_file)) { in main()
740 hostapd_global_ctrl_iface_deinit(&interfaces); in main()
742 for (i = 0; i < interfaces.count; i++) { in main()
743 if (!interfaces.iface[i]) in main()
745 interfaces.iface[i]->driver_ap_teardown = in main()
746 !!(interfaces.iface[i]->drv_flags & in main()
748 hostapd_interface_deinit_free(interfaces.iface[i]); in main()
750 os_free(interfaces.iface); in main()