ssdplib.h File Reference

#include <sys/types.h>
#include <signal.h>
#include <setjmp.h>
#include <fcntl.h>
#include <errno.h>
#include "httpparser.h"
#include "httpreadwrite.h"
#include "miniserver.h"
#include <syslog.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <sys/time.h>
#include <arpa/inet.h>

Go to the source code of this file.

Data Structures

struct  SsdpEventStruct
struct  resultData
struct  TData
struct  ssdpsearchreply
struct  ssdpsearcharg
struct  ssdp_thread_data

Defines

#define BUFSIZE   2500
#define SSDP_IP   "239.255.255.250"
#define SSDP_PORT   1900
#define NUM_TRY   3
#define NUM_COPY   1
#define THREAD_LIMIT   50
#define COMMAND_LEN   300
#define NO_ERROR_FOUND   0
#define E_REQUEST_INVALID   -3
#define E_RES_EXPIRED   -4
#define E_MEM_ALLOC   -5
#define E_HTTP_SYNTEX   -6
#define E_SOCKET   -7
#define RQST_TIMEOUT   20

Typedefs

typedef enum SsdpSearchType SType
typedef enum SsdpCmdType Cmd
typedef struct SsdpEventStruct Event
typedef void(* SsdpFunPtr )(Event *)
typedef Event SsdpEvent
typedef struct resultData ResultData
typedef struct TData ThreadData
typedef struct ssdpsearchreply SsdpSearchReply
typedef struct ssdpsearcharg SsdpSearchArg
typedef int(* ParserFun )(char *, Event *)

Enumerations

enum  SsdpSearchType {
  SSDP_SERROR = -1, SSDP_ALL, SSDP_ROOTDEVICE, SSDP_DEVICEUDN,
  SSDP_DEVICETYPE, SSDP_SERVICE
}
enum  SsdpCmdType {
  SSDP_ERROR = -1, SSDP_OK, SSDP_ALIVE, SSDP_BYEBYE,
  SSDP_SEARCH, SSDP_NOTIFY, SSDP_TIMEOUT
}

Functions

 CLIENTONLY (extern SOCKET gSsdpReqSocket;)
int Make_Socket_NoBlocking (int sock)
void ssdp_handle_device_request (IN http_message_t *hmsg, IN struct sockaddr_in *dest_addr)
void ssdp_handle_ctrlpt_msg (IN http_message_t *hmsg, IN struct sockaddr_in *dest_addr, IN xboolean timeout, IN void *cookie)
int unique_service_name (char *cmd, SsdpEvent *Evt)
int get_ssdp_sockets (MiniServerSockArray *out)
void readFromSSDPSocket (SOCKET socket)
enum SsdpSearchType ssdp_request_type1 (IN char *cmd)
int ssdp_request_type (IN char *cmd, OUT SsdpEvent *Evt)
int SearchByTarget (IN int Mx, IN char *St, IN void *Cookie)
int DeviceAdvertisement (IN char *DevType, int RootDev, char *Udn, IN char *Location, IN int Duration)
int DeviceShutdown (IN char *DevType, IN int RootDev, IN char *Udn, IN char *_Server, IN char *Location, IN int Duration)
int DeviceReply (IN struct sockaddr_in *DestAddr, IN char *DevType, IN int RootDev, IN char *Udn, IN char *Location, IN int Duration)
int SendReply (IN struct sockaddr_in *DestAddr, IN char *DevType, IN int RootDev, IN char *Udn, IN char *Location, IN int Duration, IN int ByType)
int ServiceAdvertisement (IN char *Udn, IN char *ServType, IN char *Location, IN int Duration)
int ServiceReply (IN struct sockaddr_in *DestAddr, IN char *ServType, IN char *Udn, IN char *Location, IN int Duration)
int ServiceShutdown (IN char *Udn, IN char *ServType, IN char *Location, IN int Duration)
void * advertiseAndReplyThread (IN void *data)
int AdvertiseAndReply (IN int AdFlag, IN UpnpDevice_Handle Hnd, IN enum SsdpSearchType SearchType, IN struct sockaddr_in *DestAddr, IN char *DeviceType, IN char *DeviceUDN, IN char *ServiceType, int Exp)

Define Documentation

#define BUFSIZE   2500

Definition at line 79 of file ssdplib.h.

#define COMMAND_LEN   300

Definition at line 85 of file ssdplib.h.

#define E_HTTP_SYNTEX   -6

Definition at line 92 of file ssdplib.h.

#define E_MEM_ALLOC   -5

Definition at line 91 of file ssdplib.h.

#define E_REQUEST_INVALID   -3

Definition at line 89 of file ssdplib.h.

#define E_RES_EXPIRED   -4

Definition at line 90 of file ssdplib.h.

#define E_SOCKET   -7

Definition at line 93 of file ssdplib.h.

#define NO_ERROR_FOUND   0

Definition at line 88 of file ssdplib.h.

#define NUM_COPY   1

Definition at line 83 of file ssdplib.h.

#define NUM_TRY   3

Definition at line 82 of file ssdplib.h.

#define RQST_TIMEOUT   20

Definition at line 94 of file ssdplib.h.

#define SSDP_IP   "239.255.255.250"

Definition at line 80 of file ssdplib.h.

#define SSDP_PORT   1900

Definition at line 81 of file ssdplib.h.

#define THREAD_LIMIT   50

Definition at line 84 of file ssdplib.h.


Typedef Documentation

typedef enum SsdpCmdType Cmd
typedef struct SsdpEventStruct Event
typedef int(* ParserFun)(char *, Event *)

Definition at line 169 of file ssdplib.h.

typedef struct resultData ResultData
typedef Event SsdpEvent

Definition at line 120 of file ssdplib.h.

typedef void(* SsdpFunPtr)(Event *)

Definition at line 118 of file ssdplib.h.

typedef struct ssdpsearcharg SsdpSearchArg
typedef enum SsdpSearchType SType
typedef struct TData ThreadData

Enumeration Type Documentation

Enumerator:
SSDP_ERROR 
SSDP_OK 
SSDP_ALIVE 
SSDP_BYEBYE 
SSDP_SEARCH 
SSDP_NOTIFY 
SSDP_TIMEOUT 

Definition at line 67 of file ssdplib.h.

Enumerator:
SSDP_SERROR 
SSDP_ALL 
SSDP_ROOTDEVICE 
SSDP_DEVICEUDN 
SSDP_DEVICETYPE 
SSDP_SERVICE 

Definition at line 57 of file ssdplib.h.


Function Documentation

int AdvertiseAndReply ( IN int  AdFlag,
IN UpnpDevice_Handle  Hnd,
IN enum SsdpSearchType  SearchType,
IN struct sockaddr_in *  DestAddr,
IN char *  DeviceType,
IN char *  DeviceUDN,
IN char *  ServiceType,
int  Exp 
)
void* advertiseAndReplyThread ( IN void *  data  ) 
CLIENTONLY ( extern SOCKET gSsdpReqSocket;   ) 
int DeviceAdvertisement ( IN char *  DevType,
int  RootDev,
char *  Udn,
IN char *  Location,
IN int  Duration 
)
int DeviceReply ( IN struct sockaddr_in *  DestAddr,
IN char *  DevType,
IN int  RootDev,
IN char *  Udn,
IN char *  Location,
IN int  Duration 
)
int DeviceShutdown ( IN char *  DevType,
IN int  RootDev,
IN char *  Udn,
IN char *  _Server,
IN char *  Location,
IN int  Duration 
)
int get_ssdp_sockets ( MiniServerSockArray out  ) 
int Make_Socket_NoBlocking ( int  sock  ) 
void readFromSSDPSocket ( SOCKET  socket  ) 
int SearchByTarget ( IN int  Mx,
IN char *  St,
IN void *  Cookie 
)
int SendReply ( IN struct sockaddr_in *  DestAddr,
IN char *  DevType,
IN int  RootDev,
IN char *  Udn,
IN char *  Location,
IN int  Duration,
IN int  ByType 
)
int ServiceAdvertisement ( IN char *  Udn,
IN char *  ServType,
IN char *  Location,
IN int  Duration 
)
int ServiceReply ( IN struct sockaddr_in *  DestAddr,
IN char *  ServType,
IN char *  Udn,
IN char *  Location,
IN int  Duration 
)
int ServiceShutdown ( IN char *  Udn,
IN char *  ServType,
IN char *  Location,
IN int  Duration 
)
void ssdp_handle_ctrlpt_msg ( IN http_message_t hmsg,
IN struct sockaddr_in *  dest_addr,
IN xboolean  timeout,
IN void *  cookie 
)
void ssdp_handle_device_request ( IN http_message_t hmsg,
IN struct sockaddr_in *  dest_addr 
)
int ssdp_request_type ( IN char *  cmd,
OUT SsdpEvent Evt 
)
enum SsdpSearchType ssdp_request_type1 ( IN char *  cmd  ) 
int unique_service_name ( char *  cmd,
SsdpEvent Evt 
)

Generated on Fri Mar 26 20:16:55 2010 for MediaTomb by  doxygen 1.6.1