Home | History | Annotate | Download | only in hostapd

Lines Matching refs:interfaces

287 hostapd_interface_init(struct hapd_interfaces *interfaces,
297 iface->interfaces = interfaces;
344 struct hapd_interfaces *interfaces = signal_ctx;
347 hostapd_for_each_interface(interfaces, handle_reload_iface, NULL);
354 struct hapd_interfaces *interfaces = signal_ctx;
355 hostapd_for_each_interface(interfaces, handle_dump_state_iface, NULL);
361 static int hostapd_global_init(struct hapd_interfaces *interfaces,
383 eloop_register_signal(SIGHUP, handle_reload, interfaces);
384 eloop_register_signal(SIGUSR1, handle_dump_state, interfaces);
386 eloop_register_signal_terminate(handle_term, interfaces);
496 " -G group for control interfaces\n"
518 static int hostapd_get_global_ctrl_iface(struct hapd_interfaces *interfaces,
522 os_free(interfaces->global_iface_path);
523 interfaces->global_iface_path = os_strdup(path);
524 if (interfaces->global_iface_path == NULL)
526 pos = os_strrchr(interfaces->global_iface_path, '/');
530 os_free(interfaces->global_iface_path);
531 interfaces->global_iface_path = NULL;
536 interfaces->global_iface_name = pos + 1;
542 static int hostapd_get_ctrl_iface_group(struct hapd_interfaces *interfaces,
552 interfaces->ctrl_iface_group = grp->gr_gid;
560 struct hapd_interfaces interfaces;
571 os_memset(&interfaces, 0, sizeof(interfaces));
572 interfaces.reload_config = hostapd_reload_config;
573 interfaces.config_read_cb = hostapd_config_read;
574 interfaces.for_each_interface = hostapd_for_each_interface;
575 interfaces.ctrl_iface_init = hostapd_ctrl_iface_init;
576 interfaces.ctrl_iface_deinit = hostapd_ctrl_iface_deinit;
577 interfaces.driver_init = hostapd_driver_init;
578 interfaces.global_iface_path = NULL;
579 interfaces.global_iface_name = NULL;
580 interfaces.global_ctrl_sock = -1;
619 if (hostapd_get_global_ctrl_iface(&interfaces, optarg))
623 if (hostapd_get_ctrl_iface_group(&interfaces, optarg))
632 if (optind == argc && interfaces.global_iface_path == NULL)
640 interfaces.count = argc - optind;
641 if (interfaces.count) {
642 interfaces.iface = os_calloc(interfaces.count,
644 if (interfaces.iface == NULL) {
650 if (hostapd_global_init(&interfaces, entropy_file))
653 /* Initialize interfaces */
654 for (i = 0; i < interfaces.count; i++) {
655 interfaces.iface[i] = hostapd_interface_init(&interfaces,
658 if (!interfaces.iface[i])
662 hostapd_global_ctrl_iface_init(&interfaces);
664 if (hostapd_global_run(&interfaces, daemonize, pid_file))
670 hostapd_global_ctrl_iface_deinit(&interfaces);
671 /* Deinitialize all interfaces */
672 for (i = 0; i < interfaces.count; i++)
673 hostapd_interface_deinit_free(interfaces.iface[i]);
674 os_free(interfaces.iface);