30 #include <sys/types.h> 31 #include <sys/socket.h> 32 #include <sys/select.h> 33 #include <netinet/in.h> 34 #include <arpa/inet.h> 51 int janus_sctp_init(
void);
54 void janus_sctp_deinit(
void);
57 #define BUFFER_SIZE (1<<16) 58 #define NUMBER_OF_CHANNELS (100) 59 #define NUMBER_OF_STREAMS (16) 61 #define DATA_CHANNEL_PPID_CONTROL 50 62 #define DATA_CHANNEL_PPID_DOMSTRING 51 63 #define DATA_CHANNEL_PPID_BINARY_PARTIAL 52 64 #define DATA_CHANNEL_PPID_BINARY 53 65 #define DATA_CHANNEL_PPID_DOMSTRING_PARTIAL 54 67 #define DATA_CHANNEL_CLOSED 0 68 #define DATA_CHANNEL_CONNECTING 1 69 #define DATA_CHANNEL_OPEN 2 70 #define DATA_CHANNEL_CLOSING 3 72 #define DATA_CHANNEL_FLAGS_SEND_REQ 0x00000001 73 #define DATA_CHANNEL_FLAGS_SEND_RSP 0x00000002 74 #define DATA_CHANNEL_FLAGS_SEND_ACK 0x00000004 76 typedef struct janus_sctp_channel {
93 typedef struct janus_sctp_association {
99 struct janus_sctp_channel channels[NUMBER_OF_CHANNELS];
101 struct janus_sctp_channel *stream_channel[NUMBER_OF_STREAMS];
103 uint16_t stream_buffer[NUMBER_OF_STREAMS];
105 uint32_t stream_buffer_counter;
111 uint16_t remote_port;
113 GAsyncQueue *messages;
121 } janus_sctp_association;
124 typedef struct janus_sctp_message {
131 } janus_sctp_message;
134 #define DATA_CHANNEL_OPEN_REQUEST 3 135 #define DATA_CHANNEL_OPEN_RESPONSE 1 136 #define DATA_CHANNEL_ACK 2 138 #define DATA_CHANNEL_RELIABLE 0x00 139 #define DATA_CHANNEL_RELIABLE_UNORDERED 0x80 140 #define DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT 0x01 141 #define DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED 0x81 142 #define DATA_CHANNEL_PARTIAL_RELIABLE_TIMED 0x02 143 #define DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED 0x82 146 typedef struct janus_datachannel_open_request {
150 uint8_t channel_type;
154 uint32_t reliability_params;
156 uint16_t label_length;
158 uint16_t protocol_length;
162 } janus_datachannel_open_request;
164 typedef struct janus_datachannel_open_response {
172 uint16_t reverse_stream;
173 } janus_datachannel_open_response;
175 typedef struct janus_datachannel_ack {
178 } janus_datachannel_ack;
187 janus_sctp_association *janus_sctp_association_create(
void *dtls, uint64_t handle_id, uint16_t udp_port);
191 int janus_sctp_association_setup(janus_sctp_association *sctp);
195 void janus_sctp_association_destroy(janus_sctp_association *sctp);
201 void janus_sctp_data_from_dtls(janus_sctp_association *sctp,
char *buf,
int len);
207 void janus_sctp_send_data(janus_sctp_association *sctp,
char *buf,
int len);
ogg_stream_state * stream
Definition: pp-opus.c:31
Semaphors, Mutexes and Conditions.
pthread_mutex_t janus_mutex
Janus mutex implementation.
Definition: mutex.h:19