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

◆ CMD_AUTH_REQUIRED

#define CMD_AUTH_REQUIRED   "auth_required"

Definition at line 144 of file rtspd.c.

◆ CMD_IDLE

#define CMD_IDLE   "idle"

Definition at line 148 of file rtspd.c.

◆ CMD_STREAM

#define CMD_STREAM   "stream"

Definition at line 151 of file rtspd.c.

◆ DEFAULT_LOGFILE

#define DEFAULT_LOGFILE   "log/rtspd.log"

Definition at line 127 of file rtspd.c.

◆ DEFAULT_PORT

#define DEFAULT_PORT   8999

Definition at line 124 of file rtspd.c.

◆ ENABLE_CURLX_PRINTF

#define ENABLE_CURLX_PRINTF

Definition at line 46 of file rtspd.c.

◆ END_OF_HEADERS

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

Definition at line 153 of file rtspd.c.

◆ MAXDOCNAMELEN

#define MAXDOCNAMELEN   140000

Definition at line 138 of file rtspd.c.

◆ MAXDOCNAMELEN_TXT

#define MAXDOCNAMELEN_TXT   "139999"

Definition at line 139 of file rtspd.c.

◆ RCMD_IDLE

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

Definition at line 80 of file rtspd.c.

◆ RCMD_NORMALREQ

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

Definition at line 79 of file rtspd.c.

◆ RCMD_STREAM

#define RCMD_STREAM   2 /* told to stream */

Definition at line 81 of file rtspd.c.

◆ REQBUFSIZ

#define REQBUFSIZ   150000

Definition at line 70 of file rtspd.c.

◆ REQBUFSIZ_TXT

#define REQBUFSIZ_TXT   "149999"

Definition at line 71 of file rtspd.c.

◆ REQUEST_DUMP

#define REQUEST_DUMP   "log/server.input"

Definition at line 134 of file rtspd.c.

◆ REQUEST_KEYWORD_SIZE

#define REQUEST_KEYWORD_SIZE   256

Definition at line 141 of file rtspd.c.

◆ REQUEST_KEYWORD_SIZE_TXT

#define REQUEST_KEYWORD_SIZE_TXT   "255"

Definition at line 142 of file rtspd.c.

◆ RESPONSE_DUMP

#define RESPONSE_DUMP   "log/server.response"

Definition at line 135 of file rtspd.c.

◆ RTP_DATA_SIZE

#define RTP_DATA_SIZE   12

Definition at line 198 of file rtspd.c.

◆ RTSPDVERSION

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

Definition at line 132 of file rtspd.c.

◆ SET_RTP_PKT_CHN

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

Definition at line 89 of file rtspd.c.

◆ SET_RTP_PKT_LEN

#define SET_RTP_PKT_LEN (   p,
 
)
Value:
(((p)[2] = (unsigned char)(((l) >> 8) & 0xFF)), \
((p)[3] = (unsigned char)((l) & 0xFF)))

Definition at line 91 of file rtspd.c.

◆ siginterrupt

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

Definition at line 204 of file rtspd.c.

◆ STREAMTHIS

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

Typedef Documentation

◆ SIGHANDLER_T

typedef RETSIGTYPE(* SIGHANDLER_T) (int)

Definition at line 209 of file rtspd.c.

Enumeration Type Documentation

◆ anonymous enum

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.

◆ reqprot_t

enum reqprot_t
Enumerator
RPROT_NONE 
RPROT_RTSP 
RPROT_HTTP 

Definition at line 83 of file rtspd.c.

Function Documentation

◆ exit_signal_handler()

static RETSIGTYPE exit_signal_handler ( int  signum)
static

Definition at line 248 of file rtspd.c.

◆ get_request()

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

Definition at line 783 of file rtspd.c.

◆ install_signal_handlers()

static void install_signal_handlers ( void  )
static

Definition at line 259 of file rtspd.c.

◆ main()

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

Definition at line 1185 of file rtspd.c.

◆ ProcessRequest()

static int ProcessRequest ( struct httprequest req)
static

Definition at line 333 of file rtspd.c.

◆ restore_signal_handlers()

static void restore_signal_handlers ( void  )
static

Definition at line 305 of file rtspd.c.

◆ send_doc()

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

Definition at line 894 of file rtspd.c.

◆ storerequest()

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

Definition at line 730 of file rtspd.c.

Variable Documentation

◆ doc404_HTTP

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"

Definition at line 179 of file rtspd.c.

◆ doc404_RTSP

const char* doc404_RTSP
static
Initial value:
= "RTSP/1.0 404 Not Found\r\n"
"Server: " RTSPDVERSION

Definition at line 193 of file rtspd.c.

◆ docbadconnect

const char* docbadconnect
static
Initial value:
=
"HTTP/1.1 501 Forbidden you fool" END_OF_HEADERS

Definition at line 175 of file rtspd.c.

◆ docconnect

const char* docconnect
static
Initial value:
=
"HTTP/1.1 200 Mighty fine indeed" END_OF_HEADERS

Definition at line 171 of file rtspd.c.

◆ docquit

const char* docquit
static
Initial value:
=
"HTTP/1.1 200 Goodbye" END_OF_HEADERS

Definition at line 167 of file rtspd.c.

◆ exit_signal

volatile int exit_signal = 0
static

Definition at line 241 of file rtspd.c.

◆ got_exit_signal

SIG_ATOMIC_T got_exit_signal = 0

Definition at line 237 of file rtspd.c.

◆ ipv_inuse

const char* ipv_inuse = "IPv4"
static

Definition at line 67 of file rtspd.c.

◆ prevbounce

bool prevbounce = FALSE
static

Definition at line 75 of file rtspd.c.

◆ prevpartno

long prevpartno = -1
static

Definition at line 74 of file rtspd.c.

◆ prevtestno

long prevtestno = -1
static

Definition at line 73 of file rtspd.c.

◆ RTP_DATA

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

Definition at line 199 of file rtspd.c.

◆ serverlogfile

const char* serverlogfile = DEFAULT_LOGFILE

Definition at line 130 of file rtspd.c.

◆ serverlogslocked

int serverlogslocked = 0
static

Definition at line 68 of file rtspd.c.

p
const char ** p
Definition: unit1394.c:76
END_OF_HEADERS
#define END_OF_HEADERS
Definition: rtspd.c:153
RTSPDVERSION
#define RTSPDVERSION
Definition: rtspd.c:132


rc_tagdetect_client
Author(s): Monika Florek-Jasinska , Raphael Schaller
autogenerated on Sun May 15 2022 02:25:02