UPnP for WPS / internal definitions. More...
#include "http.h"
Go to the source code of this file.
Data Structures | |
struct | advertisement_state_machine |
struct | subscr_addr |
struct | subscription |
struct | upnp_wps_device_sm |
Defines | |
#define | UPNP_MULTICAST_ADDRESS "239.255.255.250" |
#define | UPNP_MULTICAST_PORT 1900 |
#define | UPNP_SUBSCRIBE_SEC_MIN 1800 |
#define | UPNP_SUBSCRIBE_SEC (UPNP_SUBSCRIBE_SEC_MIN + 1) |
#define | UPNP_WPS_DEVICE_XML_FILE "wps_device.xml" |
#define | UPNP_WPS_SCPD_XML_FILE "wps_scpd.xml" |
#define | UPNP_WPS_DEVICE_CONTROL_FILE "wps_control" |
#define | UPNP_WPS_DEVICE_EVENT_FILE "wps_event" |
#define | MULTICAST_MAX_READ 1600 |
Enumerations | |
enum | advertisement_type_enum { ADVERTISE_UP = 0, ADVERTISE_DOWN = 1, MSEARCH_REPLY = 2 } |
Functions | |
void | format_date (struct wpabuf *buf) |
struct subscription * | subscription_start (struct upnp_wps_device_sm *sm, const char *callback_urls) |
Remember a UPnP control point to send events to. | |
struct subscription * | subscription_renew (struct upnp_wps_device_sm *sm, const u8 uuid[UUID_LEN]) |
void | subscription_unlink (struct subscription *s) |
void | subscription_destroy (struct subscription *s) |
struct subscription * | subscription_find (struct upnp_wps_device_sm *sm, const u8 uuid[UUID_LEN]) |
int | send_wpabuf (int fd, struct wpabuf *buf) |
int | get_netif_info (const char *net_if, unsigned *ip_addr, char **ip_addr_text, u8 mac[ETH_ALEN], char **mac_addr_text) |
Get hw and IP addresses for network device. | |
void | msearchreply_state_machine_stop (struct advertisement_state_machine *a) |
Stop M-SEARCH reply state machine. | |
int | advertisement_state_machine_start (struct upnp_wps_device_sm *sm) |
Start SSDP advertisements. | |
void | advertisement_state_machine_stop (struct upnp_wps_device_sm *sm, int send_byebye) |
Stop SSDP advertisements. | |
void | ssdp_listener_stop (struct upnp_wps_device_sm *sm) |
Stop SSDP listered. | |
int | ssdp_listener_start (struct upnp_wps_device_sm *sm) |
Set up for receiving discovery (UDP) packets. | |
int | ssdp_listener_open (void) |
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. | |
int | web_listener_start (struct upnp_wps_device_sm *sm) |
void | web_listener_stop (struct upnp_wps_device_sm *sm) |
int | event_add (struct subscription *s, const struct wpabuf *data) |
Add a new event to a queue. | |
void | event_delete_all (struct subscription *s) |
void | event_send_all_later (struct upnp_wps_device_sm *sm) |
void | event_send_stop_all (struct upnp_wps_device_sm *sm) |
UPnP for WPS / internal definitions.
See wps_upnp.c for more details on licensing and code history.
Definition in file wps_upnp_i.h.
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.
int event_add | ( | struct subscription * | s, | |
const struct wpabuf * | data | |||
) |
Add a new event to a queue.
s | Subscription | |
data | Event data (is copied; caller retains ownership) |
Definition at line 387 of file wps_upnp_event.c.
int get_netif_info | ( | const char * | net_if, | |
unsigned * | ip_addr, | |||
char ** | ip_addr_text, | |||
u8 | mac[ETH_ALEN], | |||
char ** | mac_addr_text | |||
) |
Get hw and IP addresses for network device.
net_if | Selected network interface name | |
ip_addr | Buffer for returning IP address in network byte order | |
ip_addr_text | Buffer for returning a pointer to allocated IP address text | |
mac | Buffer for returning MAC address | |
mac_addr_text | Buffer for returning allocated MAC address text |
Definition at line 932 of file wps_upnp.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.
struct subscription* subscription_start | ( | struct upnp_wps_device_sm * | sm, | |
const char * | callback_urls | |||
) | [read] |
Remember a UPnP control point to send events to.
sm | WPS UPnP state machine from upnp_wps_device_init() | |
callback_urls | Callback URLs |
Definition at line 745 of file wps_upnp.c.