blob: eabf2e057357aedc11410af0d57d20115f50795a [file] [log] [blame]
James Kuszmaul4a42b182021-01-17 11:32:46 -08001#pragma once
2#include <rawrtc/dtls_parameters.h>
3#include <rawrtc/ice_parameters.h>
4#include <rawrtc/peer_connection.h>
5#include <rawrtc/peer_connection_description.h>
6#include <rawrtc/peer_connection_ice_candidate.h>
7#include <rawrtcc/code.h>
8#include <rawrtcdc/sctp_capabilities.h>
9#include <re.h>
10
11#define RAWRTC_PEER_CONNECTION_DESCRIPTION_MID "rawrtc-sctp-dc"
12
13struct rawrtc_peer_connection_description {
14 struct rawrtc_peer_connection* connection;
15 enum rawrtc_sdp_type type;
16 bool trickle_ice;
17 char* bundled_mids;
18 char* remote_media_line;
19 uint8_t media_line_index;
20 char* mid;
21 bool sctp_sdp_05;
22 bool end_of_candidates;
23 struct list ice_candidates;
24 struct rawrtc_ice_parameters* ice_parameters;
25 struct rawrtc_dtls_parameters* dtls_parameters;
26 struct rawrtc_sctp_capabilities* sctp_capabilities;
27 uint16_t sctp_port;
28 struct mbuf* sdp;
29};
30
31enum {
32 RAWRTC_PEER_CONNECTION_DESCRIPTION_DEFAULT_SIZE = 1024,
33 RAWRTC_PEER_CONNECTION_DESCRIPTION_DEFAULT_MAX_MESSAGE_SIZE = 65536,
34 RAWRTC_PEER_CONNECTION_DESCRIPTION_DEFAULT_SCTP_PORT = 5000,
35};
36
37enum rawrtc_code rawrtc_peer_connection_description_create_internal(
38 struct rawrtc_peer_connection_description** const descriptionp,
39 struct rawrtc_peer_connection* const connection,
40 bool const offering);
41
42enum rawrtc_code rawrtc_peer_connection_description_add_candidate(
43 struct rawrtc_peer_connection_description* const description,
44 struct rawrtc_peer_connection_ice_candidate* const candidate);
45
46int rawrtc_peer_connection_description_debug(
47 struct re_printf* const pf, struct rawrtc_peer_connection_description* const description);