Lines Matching defs:sm

120 next_advertisement(struct upnp_wps_device_sm *sm,
129 iface = dl_list_first(&sm->interfaces,
167 sm->ip_addr_text, sm->web_port,
219 * @sm: WPS UPnP state machine from upnp_wps_device_init()
222 void advertisement_state_machine_stop(struct upnp_wps_device_sm *sm,
225 struct advertisement_state_machine *a = &sm->advertisement;
230 eloop_cancel_timeout(advertisement_state_machine_handler, NULL, sm);
231 if (!send_byebye || sm->multicast_sd < 0)
243 msg = next_advertisement(sm, a, &islast);
246 if (sendto(sm->multicast_sd, wpabuf_head(msg), wpabuf_len(msg),
260 struct upnp_wps_device_sm *sm = user_ctx;
261 struct advertisement_state_machine *a = &sm->advertisement;
282 msg = next_advertisement(sm, a, &islast);
291 if (sendto(sm->multicast_sd, wpabuf_head(msg), wpabuf_len(msg), 0,
314 sm->advertise_count++;
317 sm->advertise_count, next_timeout_sec);
326 advertisement_state_machine_handler, NULL, sm);
332 * @sm: WPS UPnP state machine from upnp_wps_device_init()
335 int advertisement_state_machine_start(struct upnp_wps_device_sm *sm)
337 struct advertisement_state_machine *a = &sm->advertisement;
340 advertisement_state_machine_stop(sm, 0);
354 NULL, sm);
382 struct upnp_wps_device_sm *sm = eloop_data;
400 msg = next_advertisement(sm, a, &islast);
408 if (sendto(sm->multicast_sd, wpabuf_head(msg), wpabuf_len(msg), 0,
428 msearchreply_state_machine_handler, sm, a);
434 * @sm: WPS UPnP state machine from upnp_wps_device_init()
447 static void msearchreply_state_machine_start(struct upnp_wps_device_sm *sm,
456 replies = dl_list_len(&sm->msearch_replies);
476 msearchreply_state_machine_handler, sm,
482 dl_list_add(&sm->msearch_replies, &a->list);
487 eloop_cancel_timeout(msearchreply_state_machine_handler, sm, a);
494 * @sm: WPS UPnP state machine from upnp_wps_device_init()
513 static void ssdp_parse_msearch(struct upnp_wps_device_sm *sm,
580 &sm->interfaces,
650 msearchreply_state_machine_start(sm, client, mx);
663 * @sm: WPS UPnP state machine from upnp_wps_device_init()
668 void ssdp_listener_stop(struct upnp_wps_device_sm *sm)
670 if (sm->ssdp_sd_registered) {
671 eloop_unregister_sock(sm->ssdp_sd, EVENT_TYPE_READ);
672 sm->ssdp_sd_registered = 0;
675 if (sm->ssdp_sd != -1) {
676 close(sm->ssdp_sd);
677 sm->ssdp_sd = -1;
680 eloop_cancel_timeout(msearchreply_state_machine_handler, sm,
687 struct upnp_wps_device_sm *sm = sock_ctx;
694 nread = recvfrom(sm->ssdp_sd, buf, sizeof(buf) - 1, 0,
719 ssdp_parse_msearch(sm, &addr, buf);
767 * @sm: WPS UPnP state machine from upnp_wps_device_init()
772 int ssdp_listener_start(struct upnp_wps_device_sm *sm)
774 sm->ssdp_sd = ssdp_listener_open();
776 if (eloop_register_sock(sm->ssdp_sd, EVENT_TYPE_READ,
777 ssdp_listener_handler, NULL, sm))
779 sm->ssdp_sd_registered = 1;
785 ssdp_listener_stop(sm);
933 * @sm: WPS UPnP state machine from upnp_wps_device_init()
936 int ssdp_open_multicast(struct upnp_wps_device_sm *sm)
938 sm->multicast_sd = ssdp_open_multicast_sock(sm->ip_addr, NULL);
939 if (sm->multicast_sd < 0)