LIBSSDP
 All Classes Files Functions Variables Typedefs Macros
Classes | Typedefs | Functions
ssdp_listener.h File Reference
#include <sys/socket.h>
#include "common_definitions.h"
#include "configuration.h"
Include dependency graph for ssdp_listener.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ssdp_listener_s
 

Typedefs

typedef struct ssdp_listener_s ssdp_listener_s
 

Functions

int ssdp_passive_listener_init (ssdp_listener_s *listener, configuration_s *conf)
 
int ssdp_active_listener_init (ssdp_listener_s *listener, configuration_s *conf, int port)
 
void ssdp_listener_close (ssdp_listener_s *listener)
 
void ssdp_listener_read (ssdp_listener_s *listener, ssdp_recv_node_s *recv_node)
 
SOCKET ssdp_listener_get_sock (ssdp_listener_s *listener)
 
int ssdp_listener_start (ssdp_listener_s *listener, configuration_s *conf)
 
void ssdp_listener_stop (ssdp_listener_s *listener)
 

Detailed Description

The SSDP listener header file.

Definition in file ssdp_listener.h.

Typedef Documentation

A container struct for the SSDP listener.

Function Documentation

int ssdp_active_listener_init ( ssdp_listener_s listener,
configuration_s conf,
int  port 
)

Create an active (unicast) SSDP listener. This type of listener is used to listen to SSDP query responses. Sets errno to the error number on failure.

Parameters
listenerThe listener to init.
confThe global configuration.
portThe port to listen at.
Returns
A SSDP listener.

Definition at line 111 of file ssdp_listener.c.

void ssdp_listener_close ( ssdp_listener_s listener)

Destroy the passed SSDP listener.

Parameters
listenerThe SSDP listener to destroy.

Definition at line 118 of file ssdp_listener.c.

SOCKET ssdp_listener_get_sock ( ssdp_listener_s listener)

Return the underlaying socket from a SSDP listener.

Parameters
proberThe listener to get the socket from.
Returns
The underlaying socket.
void ssdp_listener_read ( ssdp_listener_s listener,
ssdp_recv_node_s recv_node 
)

Read from the listener. Blocks untill timeout if no data to read.

Parameters
listenerThe listener to read from.
recv_nodeInformation about the node (client) that sent data.

Definition at line 127 of file ssdp_listener.c.

int ssdp_listener_start ( ssdp_listener_s listener,
configuration_s conf 
)

Tells the SSDP listener to start listening to SSDP messages. This function should not be called on an active SSDP listener (call ssdp_listener_read() after ssdp_active_listener_init() instead).

Parameters
listenerThe SSDP listener to start.
confThe global configuration to use.

Non-0 value on error. This function does not return if no error ocurrs.

Definition at line 144 of file ssdp_listener.c.

void ssdp_listener_stop ( ssdp_listener_s listener)

Tells the SSDP listener to stop listening.

Parameters
Thelistener to stop.

Definition at line 287 of file ssdp_listener.c.

int ssdp_passive_listener_init ( ssdp_listener_s listener,
configuration_s conf 
)

Create a passive (multicast) SSDP listener. This type of listener is used to passively listen to SSDP messages sent over a network. Sets errno to the error number on failure.

Parameters
listenerThe listener to init.
confthe global configuration.
Returns
A SSDP listener.

Definition at line 104 of file ssdp_listener.c.