wps_upnp_i.h File Reference

UPnP for WPS / internal definitions. More...

#include "http.h"
Include dependency graph for wps_upnp_i.h:
This graph shows which files directly or indirectly include this file:

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 subscriptionsubscription_start (struct upnp_wps_device_sm *sm, const char *callback_urls)
 Remember a UPnP control point to send events to.
struct subscriptionsubscription_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 subscriptionsubscription_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)

Detailed Description

UPnP for WPS / internal definitions.

Copyright
Copyright (c) 2000-2003 Intel Corporation Copyright (c) 2006-2007 Sony Corporation Copyright (c) 2008-2009 Atheros Communications Copyright (c) 2009, Jouni Malinen <j@w1.fi>

See wps_upnp.c for more details on licensing and code history.

Definition in file wps_upnp_i.h.


Function Documentation

int add_ssdp_network ( const char *  net_if  ) 

Add routing entry for SSDP.

Parameters:
net_if Selected network interface name
Returns:
0 on success, -1 on failure

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.

Here is the call graph for this function:

int advertisement_state_machine_start ( struct upnp_wps_device_sm sm  ) 

Start SSDP advertisements.

Parameters:
sm WPS UPnP state machine from upnp_wps_device_init()
Returns:
0 on success, -1 on failure

Definition at line 350 of file wps_upnp_ssdp.c.

Here is the call graph for this function:

void advertisement_state_machine_stop ( struct upnp_wps_device_sm sm,
int  send_byebye 
)

Stop SSDP advertisements.

Parameters:
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.

Here is the call graph for this function:

int event_add ( struct subscription s,
const struct wpabuf data 
)

Add a new event to a queue.

Parameters:
s Subscription
data Event data (is copied; caller retains ownership)
Returns:
0 on success, 1 on error

Definition at line 387 of file wps_upnp_event.c.

Here is the call graph for this function:

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.

Parameters:
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
Returns:
0 on success, -1 on failure

Definition at line 932 of file wps_upnp.c.

Here is the call graph for this function:

void msearchreply_state_machine_stop ( struct advertisement_state_machine a  ) 

Stop M-SEARCH reply state machine.

Parameters:
a Selected advertisement/reply state

Definition at line 391 of file wps_upnp_ssdp.c.

Here is the call graph for this function:

int ssdp_listener_start ( struct upnp_wps_device_sm sm  ) 

Set up for receiving discovery (UDP) packets.

Parameters:
sm WPS UPnP state machine from upnp_wps_device_init()
Returns:
0 on success, -1 on failure

The SSDP listener is stopped by calling ssdp_listener_stop().

Definition at line 809 of file wps_upnp_ssdp.c.

Here is the call graph for this function:

void ssdp_listener_stop ( struct upnp_wps_device_sm sm  ) 

Stop SSDP listered.

Parameters:
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.

Here is the call graph for this function:

int ssdp_open_multicast ( struct upnp_wps_device_sm sm  ) 

Open socket for sending multicast SSDP messages.

Parameters:
sm WPS UPnP state machine from upnp_wps_device_init()
Returns:
0 on success, -1 on failure

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.

Parameters:
sm WPS UPnP state machine from upnp_wps_device_init()
callback_urls Callback URLs
Returns:
NULL on error, or pointer to new subscription structure.

Definition at line 745 of file wps_upnp.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:24:52 2009 for hostapd by  doxygen 1.6.1