Classes | Macros | Typedefs | Enumerations | Functions | Variables
rtspd.c File Reference
#include "server_setup.h"
#include "curlx.h"
#include "getpart.h"
#include "util.h"
#include "server_sockaddr.h"
#include "memdebug.h"
Include dependency graph for rtspd.c:

Go to the source code of this file.

Classes

struct  httprequest
 

Macros

#define CMD_AUTH_REQUIRED   "auth_required"
 
#define CMD_IDLE   "idle"
 
#define CMD_STREAM   "stream"
 
#define DEFAULT_LOGFILE   "log/rtspd.log"
 
#define DEFAULT_PORT   8999
 
#define ENABLE_CURLX_PRINTF
 
#define END_OF_HEADERS   "\r\n\r\n"
 
#define MAXDOCNAMELEN   140000
 
#define MAXDOCNAMELEN_TXT   "139999"
 
#define RCMD_IDLE   1 /* told to sit idle */
 
#define RCMD_NORMALREQ   0 /* default request, use the tests file normally */
 
#define RCMD_STREAM   2 /* told to stream */
 
#define REQBUFSIZ   150000
 
#define REQBUFSIZ_TXT   "149999"
 
#define REQUEST_DUMP   "log/server.input"
 
#define REQUEST_KEYWORD_SIZE   256
 
#define REQUEST_KEYWORD_SIZE_TXT   "255"
 
#define RESPONSE_DUMP   "log/server.response"
 
#define RTP_DATA_SIZE   12
 
#define RTSPDVERSION   "curl test suite RTSP server/0.1"
 
#define SET_RTP_PKT_CHN(p, c)   ((p)[1] = (unsigned char)((c) & 0xFF))
 
#define SET_RTP_PKT_LEN(p, l)
 
#define siginterrupt(x, y)   do {} while(0)
 
#define STREAMTHIS   "a string to stream 01234567890\n"
 

Typedefs

typedef RETSIGTYPE(* SIGHANDLER_T) (int)
 

Enumerations

enum  {
  DOCNUMBER_NOTHING = -7, DOCNUMBER_QUIT = -6, DOCNUMBER_BADCONNECT = -5, DOCNUMBER_INTERNAL = -4,
  DOCNUMBER_CONNECT = -3, DOCNUMBER_WERULEZ = -2, DOCNUMBER_404 = -1
}
 
enum  reqprot_t { RPROT_NONE = 0, RPROT_RTSP = 1, RPROT_HTTP = 2 }
 

Functions

static RETSIGTYPE exit_signal_handler (int signum)
 
static int get_request (curl_socket_t sock, struct httprequest *req)
 
static void install_signal_handlers (void)
 
int main (int argc, char *argv[])
 
static int ProcessRequest (struct httprequest *req)
 
static void restore_signal_handlers (void)
 
static int send_doc (curl_socket_t sock, struct httprequest *req)
 
static void storerequest (char *reqbuf, size_t totalsize)
 

Variables

static const char * doc404_HTTP
 
static const char * doc404_RTSP
 
static const char * docbadconnect
 
static const char * docconnect
 
static const char * docquit
 
static volatile int exit_signal = 0
 
SIG_ATOMIC_T got_exit_signal = 0
 
static const char * ipv_inuse = "IPv4"
 
static bool prevbounce = FALSE
 
static long prevpartno = -1
 
static long prevtestno = -1
 
static const char * RTP_DATA = "$_1234\n\0asdf"
 
const char * serverlogfile = DEFAULT_LOGFILE
 
static int serverlogslocked = 0
 

Macro Definition Documentation

#define CMD_AUTH_REQUIRED   "auth_required"

Definition at line 144 of file rtspd.c.

#define CMD_IDLE   "idle"

Definition at line 148 of file rtspd.c.

#define CMD_STREAM   "stream"

Definition at line 151 of file rtspd.c.

#define DEFAULT_LOGFILE   "log/rtspd.log"

Definition at line 127 of file rtspd.c.

#define DEFAULT_PORT   8999

Definition at line 124 of file rtspd.c.

#define ENABLE_CURLX_PRINTF

Definition at line 46 of file rtspd.c.

#define END_OF_HEADERS   "\r\n\r\n"

Definition at line 153 of file rtspd.c.

#define MAXDOCNAMELEN   140000

Definition at line 138 of file rtspd.c.

#define MAXDOCNAMELEN_TXT   "139999"

Definition at line 139 of file rtspd.c.

#define RCMD_IDLE   1 /* told to sit idle */

Definition at line 80 of file rtspd.c.

#define RCMD_NORMALREQ   0 /* default request, use the tests file normally */

Definition at line 79 of file rtspd.c.

#define RCMD_STREAM   2 /* told to stream */

Definition at line 81 of file rtspd.c.

#define REQBUFSIZ   150000

Definition at line 70 of file rtspd.c.

#define REQBUFSIZ_TXT   "149999"

Definition at line 71 of file rtspd.c.

#define REQUEST_DUMP   "log/server.input"

Definition at line 134 of file rtspd.c.

#define REQUEST_KEYWORD_SIZE   256

Definition at line 141 of file rtspd.c.

#define REQUEST_KEYWORD_SIZE_TXT   "255"

Definition at line 142 of file rtspd.c.

#define RESPONSE_DUMP   "log/server.response"

Definition at line 135 of file rtspd.c.

#define RTP_DATA_SIZE   12

Definition at line 198 of file rtspd.c.

#define RTSPDVERSION   "curl test suite RTSP server/0.1"

Definition at line 132 of file rtspd.c.

#define SET_RTP_PKT_CHN (   p,
 
)    ((p)[1] = (unsigned char)((c) & 0xFF))

Definition at line 89 of file rtspd.c.

#define SET_RTP_PKT_LEN (   p,
 
)
Value:
(((p)[2] = (unsigned char)(((l) >> 8) & 0xFF)), \
((p)[3] = (unsigned char)((l) & 0xFF)))
const char ** p
Definition: unit1394.c:76

Definition at line 91 of file rtspd.c.

#define siginterrupt (   x,
  y 
)    do {} while(0)

Definition at line 204 of file rtspd.c.

#define STREAMTHIS   "a string to stream 01234567890\n"

Typedef Documentation

typedef RETSIGTYPE(* SIGHANDLER_T) (int)

Definition at line 209 of file rtspd.c.

Enumeration Type Documentation

anonymous enum
Enumerator
DOCNUMBER_NOTHING 
DOCNUMBER_QUIT 
DOCNUMBER_BADCONNECT 
DOCNUMBER_INTERNAL 
DOCNUMBER_CONNECT 
DOCNUMBER_WERULEZ 
DOCNUMBER_404 

Definition at line 155 of file rtspd.c.

enum reqprot_t
Enumerator
RPROT_NONE 
RPROT_RTSP 
RPROT_HTTP 

Definition at line 83 of file rtspd.c.

Function Documentation

static RETSIGTYPE exit_signal_handler ( int  signum)
static

Definition at line 248 of file rtspd.c.

static int get_request ( curl_socket_t  sock,
struct httprequest req 
)
static

Definition at line 783 of file rtspd.c.

static void install_signal_handlers ( void  )
static

Definition at line 259 of file rtspd.c.

int main ( int  argc,
char *  argv[] 
)

Definition at line 1185 of file rtspd.c.

static int ProcessRequest ( struct httprequest req)
static

Definition at line 333 of file rtspd.c.

static void restore_signal_handlers ( void  )
static

Definition at line 305 of file rtspd.c.

static int send_doc ( curl_socket_t  sock,
struct httprequest req 
)
static

Definition at line 894 of file rtspd.c.

static void storerequest ( char *  reqbuf,
size_t  totalsize 
)
static

Definition at line 730 of file rtspd.c.

Variable Documentation

const char* doc404_HTTP
static
Initial value:
= "HTTP/1.1 404 Not Found\r\n"
"Server: " RTSPDVERSION "\r\n"
"Connection: close\r\n"
"Content-Type: text/html"
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
"<HTML><HEAD>\n"
"<TITLE>404 Not Found</TITLE>\n"
"</HEAD><BODY>\n"
"<H1>Not Found</H1>\n"
"The requested URL was not found on this server.\n"
"<P><HR><ADDRESS>" RTSPDVERSION "</ADDRESS>\n" "</BODY></HTML>\n"
#define RTSPDVERSION
Definition: rtspd.c:132
#define END_OF_HEADERS
Definition: rtspd.c:153

Definition at line 179 of file rtspd.c.

const char* doc404_RTSP
static
Initial value:
= "RTSP/1.0 404 Not Found\r\n"
"Server: " RTSPDVERSION
#define RTSPDVERSION
Definition: rtspd.c:132
#define END_OF_HEADERS
Definition: rtspd.c:153

Definition at line 193 of file rtspd.c.

const char* docbadconnect
static
Initial value:
=
"HTTP/1.1 501 Forbidden you fool" END_OF_HEADERS
#define END_OF_HEADERS
Definition: rtspd.c:153

Definition at line 175 of file rtspd.c.

const char* docconnect
static
Initial value:
=
"HTTP/1.1 200 Mighty fine indeed" END_OF_HEADERS
#define END_OF_HEADERS
Definition: rtspd.c:153

Definition at line 171 of file rtspd.c.

const char* docquit
static
Initial value:
=
"HTTP/1.1 200 Goodbye" END_OF_HEADERS
#define END_OF_HEADERS
Definition: rtspd.c:153

Definition at line 167 of file rtspd.c.

volatile int exit_signal = 0
static

Definition at line 241 of file rtspd.c.

SIG_ATOMIC_T got_exit_signal = 0

Definition at line 237 of file rtspd.c.

const char* ipv_inuse = "IPv4"
static

Definition at line 67 of file rtspd.c.

bool prevbounce = FALSE
static

Definition at line 75 of file rtspd.c.

long prevpartno = -1
static

Definition at line 74 of file rtspd.c.

long prevtestno = -1
static

Definition at line 73 of file rtspd.c.

const char* RTP_DATA = "$_1234\n\0asdf"
static

Definition at line 199 of file rtspd.c.

const char* serverlogfile = DEFAULT_LOGFILE

Definition at line 130 of file rtspd.c.

int serverlogslocked = 0
static

Definition at line 68 of file rtspd.c.



rc_tagdetect_client
Author(s): Monika Florek-Jasinska , Raphael Schaller
autogenerated on Sat Feb 13 2021 03:42:17