Go to the documentation of this file.
1 /**********
2 This library is free software; you can redistribute it and/or modify it under
3 the terms of the GNU Lesser General Public License as published by the
4 Free Software Foundation; either version 3 of the License, or (at your
5 option) any later version. (See <>.)
7 This library is distributed in the hope that it will be useful, but WITHOUT
8 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10 more details.
12 You should have received a copy of the GNU Lesser General Public License
13 along with this library; if not, write to the Free Software Foundation, Inc.,
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 **********/
16 // "liveMedia"
17 // Copyright (c) 1996-2022 Live Networks, Inc. All rights reserved.
18 // Common routines used by both RTSP clients and servers
19 // C++ header
21 #ifndef _RTSP_COMMON_HH
22 #define _RTSP_COMMON_HH
24 #ifndef _BOOLEAN_HH
25 #include "Boolean.hh"
26 #endif
28 #ifndef _MEDIA_HH
29 #include <Media.hh> // includes some definitions perhaps needed for Borland compilers?
30 #endif
32 #if defined(__WIN32__) || defined(_WIN32) || defined(_QNX4)
33 #define _strncasecmp _strnicmp
34 #define snprintf _snprintf
35 #else
36 #define _strncasecmp strncasecmp
37 #endif
39 #define RTSP_PARAM_STRING_MAX 200
41 Boolean parseRTSPRequestString(char const *reqStr, unsigned reqStrSize, // in
42  char *resultCmdName, // out
43  unsigned resultCmdNameMaxSize, // in
44  char* resultURLPreSuffix, // out
45  unsigned resultURLPreSuffixMaxSize, // in
46  char* resultURLSuffix, // out
47  unsigned resultURLSuffixMaxSize, // in
48  char* resultCSeq, // out
49  unsigned resultCSeqMaxSize, // in
50  char* resultSessionId, // out
51  unsigned resultSessionIdMaxSize, // in
52  unsigned& contentLength, Boolean& urlIsRTSPS); // out
54 Boolean parseRangeParam(char const* paramStr, double& rangeStart, double& rangeEnd, char*& absStartTime, char*& absEndTime, Boolean& startTimeIsNow);
55 Boolean parseRangeHeader(char const* buf, double& rangeStart, double& rangeEnd, char*& absStartTime, char*& absEndTime, Boolean& startTimeIsNow);
57 Boolean parseScaleHeader(char const* buf, float& scale);
59 Boolean RTSPOptionIsSupported(char const* commandName, char const* optionsResponseString);
60  // Returns True iff the RTSP command "commandName" is mentioned as one of the commands supported in "optionsResponseString"
61  // (which should be the 'resultString' from a previous RTSP "OPTIONS" request).
63 char const* dateHeader(); // A "Date:" header that can be used in a RTSP (or HTTP) response
65 #endif
unsigned char Boolean
Definition: Boolean.hh:25
Boolean parseRangeHeader(char const *buf, double &rangeStart, double &rangeEnd, char *&absStartTime, char *&absEndTime, Boolean &startTimeIsNow)
Boolean parseRangeParam(char const *paramStr, double &rangeStart, double &rangeEnd, char *&absStartTime, char *&absEndTime, Boolean &startTimeIsNow)
Boolean parseScaleHeader(char const *buf, float &scale)
char const * dateHeader()
Boolean parseRTSPRequestString(char const *reqStr, unsigned reqStrSize, char *resultCmdName, unsigned resultCmdNameMaxSize, char *resultURLPreSuffix, unsigned resultURLPreSuffixMaxSize, char *resultURLSuffix, unsigned resultURLSuffixMaxSize, char *resultCSeq, unsigned resultCSeqMaxSize, char *resultSessionId, unsigned resultSessionIdMaxSize, unsigned &contentLength, Boolean &urlIsRTSPS)
Boolean RTSPOptionIsSupported(char const *commandName, char const *optionsResponseString)