UPnP SSDP for WPS. More...
#include "includes.h"
#include <fcntl.h>
#include <sys/ioctl.h>
#include <net/route.h>
#include "common.h"
#include "uuid.h"
#include "eloop.h"
#include "wps.h"
#include "wps_upnp.h"
#include "wps_upnp_i.h"
Go to the source code of this file.
Defines | |
#define | UPNP_CACHE_SEC (UPNP_CACHE_SEC_MIN + 1) |
#define | UPNP_CACHE_SEC_MIN 1800 |
#define | UPNP_ADVERTISE_REPEAT 2 |
#define | MAX_MSEARCH 20 |
#define | SSDP_TARGET "239.0.0.0" |
#define | SSDP_NETMASK "255.0.0.0" |
Functions | |
void | advertisement_state_machine_stop (struct upnp_wps_device_sm *sm, int send_byebye) |
Stop SSDP advertisements. | |
int | advertisement_state_machine_start (struct upnp_wps_device_sm *sm) |
Start SSDP advertisements. | |
void | msearchreply_state_machine_stop (struct advertisement_state_machine *a) |
Stop M-SEARCH reply state machine. | |
void | ssdp_listener_stop (struct upnp_wps_device_sm *sm) |
Stop SSDP listered. | |
int | ssdp_listener_open (void) |
int | ssdp_listener_start (struct upnp_wps_device_sm *sm) |
Set up for receiving discovery (UDP) packets. | |
int | add_ssdp_network (const char *net_if) |
Add routing entry for SSDP. | |
int | ssdp_open_multicast_sock (u32 ip_addr) |
int | ssdp_open_multicast (struct upnp_wps_device_sm *sm) |
Open socket for sending multicast SSDP messages. |
UPnP SSDP for WPS.
See wps_upnp.c for more details on licensing and code history.
Definition in file wps_upnp_ssdp.c.
int add_ssdp_network | ( | const char * | net_if | ) |
Add routing entry for SSDP.
net_if | Selected network interface name |
This function assures that the multicast address will be properly handled by Linux networking code (by a modification to routing tables). This must be done per network interface. It really only needs to be done once after booting up, but it does not hurt to call this more frequently "to be safe".
Definition at line 839 of file wps_upnp_ssdp.c.
int advertisement_state_machine_start | ( | struct upnp_wps_device_sm * | sm | ) |
Start SSDP advertisements.
sm | WPS UPnP state machine from upnp_wps_device_init() |
Definition at line 350 of file wps_upnp_ssdp.c.
void advertisement_state_machine_stop | ( | struct upnp_wps_device_sm * | sm, | |
int | send_byebye | |||
) |
Stop SSDP advertisements.
sm | WPS UPnP state machine from upnp_wps_device_init() | |
send_byebye | Send byebye advertisement messages immediately |
Definition at line 236 of file wps_upnp_ssdp.c.
void msearchreply_state_machine_stop | ( | struct advertisement_state_machine * | a | ) |
Stop M-SEARCH reply state machine.
a | Selected advertisement/reply state |
Definition at line 391 of file wps_upnp_ssdp.c.
int ssdp_listener_start | ( | struct upnp_wps_device_sm * | sm | ) |
Set up for receiving discovery (UDP) packets.
sm | WPS UPnP state machine from upnp_wps_device_init() |
The SSDP listener is stopped by calling ssdp_listener_stop().
Definition at line 809 of file wps_upnp_ssdp.c.
void ssdp_listener_stop | ( | struct upnp_wps_device_sm * | sm | ) |
Stop SSDP listered.
sm | WPS UPnP state machine from upnp_wps_device_init() |
This function stops the SSDP listener that was started by calling ssdp_listener_start().
Definition at line 701 of file wps_upnp_ssdp.c.
int ssdp_open_multicast | ( | struct upnp_wps_device_sm * | sm | ) |
Open socket for sending multicast SSDP messages.
sm | WPS UPnP state machine from upnp_wps_device_init() |
Definition at line 948 of file wps_upnp_ssdp.c.