wps_upnp.c File Reference

UPnP WPS Device. More...

#include "includes.h"
#include <assert.h>
#include <net/if.h>
#include <netdb.h>
#include <sys/ioctl.h>
#include "common.h"
#include "uuid.h"
#include "base64.h"
#include "wps.h"
#include "wps_i.h"
#include "wps_upnp.h"
#include "wps_upnp_i.h"
Include dependency graph for wps_upnp.c:

Go to the source code of this file.

Defines

#define NO_DOMAIN_NAME_RESOLUTION   1
#define MAX_SUBSCRIPTIONS   4
#define MAX_ADDR_PER_SUBSCRIPTION   8

Functions

void format_date (struct wpabuf *buf)
int send_wpabuf (int fd, struct wpabuf *buf)
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])
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])
int upnp_wps_device_send_wlan_event (struct upnp_wps_device_sm *sm, const u8 from_mac_addr[ETH_ALEN], enum upnp_wps_wlanevent_type ev_type, const struct wpabuf *msg)
 Event notification.
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 upnp_wps_device_stop (struct upnp_wps_device_sm *sm)
 Stop WPS UPnP operations on an interface.
int upnp_wps_device_start (struct upnp_wps_device_sm *sm, char *net_if)
 Start WPS UPnP operations on an interface.
void upnp_wps_device_deinit (struct upnp_wps_device_sm *sm)
 Deinitialize WPS UPnP.
struct upnp_wps_device_smupnp_wps_device_init (struct upnp_wps_device_ctx *ctx, struct wps_context *wps, void *priv)
 Initialize WPS UPnP.
int upnp_wps_subscribers (struct upnp_wps_device_sm *sm)
 Check whether there are any event subscribers.

Detailed Description

UPnP WPS Device.

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 below for more details on licensing and code history.

Definition in file wps_upnp.c.


Function Documentation

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:

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:

void upnp_wps_device_deinit ( struct upnp_wps_device_sm sm  ) 

Deinitialize WPS UPnP.

Parameters:
sm WPS UPnP state machine from upnp_wps_device_init()

Definition at line 1101 of file wps_upnp.c.

Here is the call graph for this function:

struct upnp_wps_device_sm* upnp_wps_device_init ( struct upnp_wps_device_ctx ctx,
struct wps_context wps,
void *  priv 
) [read]

Initialize WPS UPnP.

Parameters:
ctx callback table; we must eventually free it
wps Pointer to longterm WPS context
priv External context data that will be used in callbacks
Returns:
WPS UPnP state or NULL on failure

Definition at line 1126 of file wps_upnp.c.

Here is the call graph for this function:

int upnp_wps_device_send_wlan_event ( struct upnp_wps_device_sm sm,
const u8  from_mac_addr[ETH_ALEN],
enum upnp_wps_wlanevent_type  ev_type,
const struct wpabuf msg 
)

Event notification.

Parameters:
sm WPS UPnP state machine from upnp_wps_device_init()
from_mac_addr Source (Enrollee) MAC address for the event
ev_type Event type
msg Event data
Returns:
0 on success, -1 on failure

Tell external Registrars (UPnP control points) that something happened. In particular, events include WPS messages from clients that are proxied to external Registrars.

Definition at line 823 of file wps_upnp.c.

Here is the call graph for this function:

int upnp_wps_device_start ( struct upnp_wps_device_sm sm,
char *  net_if 
)

Start WPS UPnP operations on an interface.

Parameters:
sm WPS UPnP state machine from upnp_wps_device_init()
net_if Selected network interface name
Returns:
0 on success, -1 on failure

Definition at line 1039 of file wps_upnp.c.

Here is the call graph for this function:

void upnp_wps_device_stop ( struct upnp_wps_device_sm sm  ) 

Stop WPS UPnP operations on an interface.

Parameters:
sm WPS UPnP state machine from upnp_wps_device_init()

Definition at line 997 of file wps_upnp.c.

Here is the call graph for this function:

int upnp_wps_subscribers ( struct upnp_wps_device_sm sm  ) 

Check whether there are any event subscribers.

Parameters:
sm WPS UPnP state machine from upnp_wps_device_init()
Returns:
0 if no subscribers, 1 if subscribers

Definition at line 1151 of file wps_upnp.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

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