wps_upnp_ssdp.c File Reference

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"
Include dependency graph for wps_upnp_ssdp.c:

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.

Detailed Description

UPnP SSDP for WPS.

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_ssdp.c.


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:

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.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

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