#ifndef _SESSIONS_SDP_H_
#define _SESSIONS_SDP_H_

#include <winsock.h>
/*
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <rpcsvc/ypclnt.h>   
*/

#define MAXADSIZE 2048
#define MAXKEYLEN 256
#define TMPSTRLEN 1024

/*ordering types used for sorting session lists*/
#define ALPHABETIC 1
#define STARTTIME 2

#define SDP_AUDIO 0
#define SDP_VIDEO 1
#define SDP_WHITEBOARD 2
#define SDP_TEXT 3

#define SD_GROUP        "224.2.127.254"
#define SD_PORT         9875

#ifdef __cplusplus
extern "C"
{
#endif

extern char *medianames[];

struct session {
  unsigned int aid;
  char *username;
  struct in_addr orighost;
  unsigned int sessid;
  unsigned int version;
  char *sname;
  char *desc;
  char *uri;
  int no_of_emails;
  struct lent *email;
struct lent *tail_email;
  int no_of_phones;
  struct lent *phone;
struct lent *tail_phone;
  unsigned int starttime; /* 1 First start to record */
  unsigned int endtime;   /* 2 Last end to record (2-1 it is no duration) */
  int no_of_times;
  struct tent *time;
struct tent *tail_time;
  int no_of_attrs;
  struct lent *attr;
struct lent *tail_attr;
  int no_of_media;
  struct media *media;
struct media *tail_media;
  struct cache *cache;
  char *key;
  struct connect *connect;
};

struct lent {
  char *data;
  struct lent *next;
  struct lent *prev;
};

struct tent {
  unsigned int starttime;
  unsigned int endtime;
  struct tent *next;
  struct tent *prev;
};

struct media {
  struct in_addr addr;
  unsigned char ttl;
  char *media;
  unsigned int port;
  char *proto;
  char *fmt;
  int no_of_attrs;
  struct lent *attr;
struct lent *tail_attr;
  struct media *next;
  struct media *prev;
};

struct cache {
   unsigned long origsrc;
   unsigned long src;
   time_t t;
   char *sd_addr;
   int sd_port;
   int ttl;
   char *origin;
};

struct connect {
   char *net;
   char *proto;
   char *maddr;
};

extern int read_sessions();
extern struct session *parse_SDP_file(FILE *sdpfile);

#ifdef __cplusplus
}
#endif

#endif
