Utilitary stuff.
More...
#include <compy/option.h>
#include <compy/types/error.h>
#include <compy/types/header_map.h>
#include <stdbool.h>
#include <stdint.h>
#include <slice99.h>
Go to the source code of this file.
|
|
#define | COMPY_CRLF (CharSlice99_from_str("\r\n")) |
| | Carriage-return + new-line represented as a data slice.
|
| |
|
#define | COMPY_DEFAULT_PORT 554 |
| | The default RTSP port.
|
| |
|
#define | COMPY_DEFAULT_RTSPS_PORT 322 |
| | The default RTSPS port.
|
| |
| #define | COMPY_REQUIRE_ONVIF_BACKCHANNEL (CharSlice99_from_str("www.onvif.org/ver20/backchannel")) |
| | The ONVIF backchannel feature tag.
|
| |
◆ COMPY_REQUIRE_ONVIF_BACKCHANNEL
| #define COMPY_REQUIRE_ONVIF_BACKCHANNEL (CharSlice99_from_str("www.onvif.org/ver20/backchannel")) |
◆ Compy_LowerTransport
An RTSP lower transport.
| Enumerator |
|---|
| Compy_LowerTransport_TCP | TCP.
|
| Compy_LowerTransport_UDP | UDP.
|
◆ COMPY_DEF_OPTION() [1/2]
Defines Compy_ChannelPairOption.
See Datatype99 for the macro usage.
◆ COMPY_DEF_OPTION() [2/2]
Defines Compy_PortPairOption.
See Datatype99 for the macro usage.
◆ compy_interleaved_header()
| uint32_t compy_interleaved_header |
( |
uint8_t |
channel_id, |
|
|
uint16_t |
payload_len |
|
) |
| |
◆ compy_parse_interleaved_header()
| void compy_parse_interleaved_header |
( |
const uint8_t |
data[restrict static 4], |
|
|
uint8_t *restrict |
channel_id, |
|
|
uint16_t *restrict |
payload_len |
|
) |
| |
Parses an four-octet interleaved binary data header data.
- Parameters
-
| [in] | data | The header to parse. |
| [out] | channel_id | The one-byte channel identifier. |
| [out] | payload_len | The length of the encapsulated binary data (host byte order). |
- Precondition
channel_id != NULL
-
payload_len != NULL
- See also
- https://datatracker.ietf.org/doc/html/rfc2326#section-10.12
◆ compy_parse_transport()
Parses the Transport header.
- Parameters
-
| [out] | config | The result of parsing. It remains unchanged on failure. |
| [in] | header_value | The value of the Transport header. |
- Returns
- 0 on success, -1 on failure.
- Precondition
config != NULL
◆ compy_require_has_tag()
| bool compy_require_has_tag |
( |
const Compy_HeaderMap *restrict |
headers, |
|
|
CharSlice99 |
tag |
|
) |
| |
Checks whether a Require header is present in headers and contains the feature tag tag.
The Require header value is compared as a whole against tag (not comma-separated). For multiple tags, check each separately.
- Parameters
-
| [in] | headers | The request header map. |
| [in] | tag | The feature tag to look for. |
- Returns
true if the Require header is present and matches tag.
- Precondition
headers != NULL
◆ compy_respond_option_not_supported()
| void compy_respond_option_not_supported |
( |
Compy_Context * |
ctx, |
|
|
CharSlice99 |
tag |
|
) |
| |
Responds with 551 Option not supported and an Unsupported header listing tag.
Use this when a request contains a Require header with a feature tag the server does not understand, per RFC 2326 Section 12.32.
- Parameters
-
| [in] | ctx | The request context. |
| [in] | tag | The unsupported feature tag value. |
- Precondition
ctx != NULL