mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
wip
This commit is contained in:
@@ -40,6 +40,12 @@
|
||||
#define SWITCH_CORE_H
|
||||
|
||||
#include <switch.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/x509v3.h>
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
#include <openssl/engine.h>
|
||||
#endif
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_MAX_CORE_THREAD_SESSION_OBJS 128
|
||||
@@ -77,6 +83,37 @@ typedef struct switch_thread_data_s {
|
||||
} switch_thread_data_t;
|
||||
|
||||
|
||||
#define DTLS_SRTP_FNAME "dtls-srtp"
|
||||
#define MAX_FPLEN 64
|
||||
#define MAX_FPSTRLEN 192
|
||||
|
||||
typedef struct dtls_fp_s {
|
||||
uint32_t len;
|
||||
uint8_t data[MAX_FPLEN+1];
|
||||
char *type;
|
||||
char str[MAX_FPSTRLEN];
|
||||
} dtls_fingerprint_t;
|
||||
|
||||
typedef enum {
|
||||
DTLS_TYPE_CLIENT = (1 << 0),
|
||||
DTLS_TYPE_SERVER = (1 << 1),
|
||||
DTLS_TYPE_RTP = (1 << 2),
|
||||
DTLS_TYPE_RTCP = (1 << 3)
|
||||
} dtls_type_t;
|
||||
|
||||
typedef enum {
|
||||
DS_HANDSHAKE,
|
||||
DS_SETUP,
|
||||
DS_READY,
|
||||
DS_FAIL,
|
||||
DS_INVALID,
|
||||
} dtls_state_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define MESSAGE_STAMP_FFL(_m) _m->_file = __FILE__; _m->_func = __SWITCH_FUNC__; _m->_line = __LINE__
|
||||
|
||||
#define MESSAGE_STRING_ARG_MAX 10
|
||||
@@ -2478,6 +2515,12 @@ SWITCH_DECLARE(void) switch_sql_queue_manger_execute_sql_event_callback(switch_s
|
||||
|
||||
SWITCH_DECLARE(pid_t) switch_fork(void);
|
||||
|
||||
SWITCH_DECLARE(int) switch_core_gen_certs(const char *prefix);
|
||||
SWITCH_DECLARE(int) switch_core_cert_gen_fingerprint(const char *prefix, dtls_fingerprint_t *fp);
|
||||
SWITCH_DECLARE(int) switch_core_cert_expand_fingerprint(dtls_fingerprint_t *fp, const char *str);
|
||||
SWITCH_DECLARE(int) switch_core_cert_extract_fingerprint(X509* x509, dtls_fingerprint_t *fp);
|
||||
SWITCH_DECLARE(int) switch_core_cert_verify(dtls_fingerprint_t *fp);
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
#endif
|
||||
/* For Emacs:
|
||||
|
||||
@@ -96,7 +96,7 @@ typedef struct icand_s {
|
||||
#define MAX_CAND 25
|
||||
typedef struct ice_s {
|
||||
|
||||
icand_t cands[2][MAX_CAND];
|
||||
icand_t cands[MAX_CAND][2];
|
||||
int cand_idx;
|
||||
int chosen;
|
||||
char *ufrag;
|
||||
@@ -506,6 +506,9 @@ SWITCH_DECLARE(switch_rtp_stats_t *) switch_rtp_get_stats(switch_rtp_t *rtp_sess
|
||||
SWITCH_DECLARE(switch_byte_t) switch_rtp_check_auto_adj(switch_rtp_t *rtp_session);
|
||||
SWITCH_DECLARE(void) switch_rtp_set_interdigit_delay(switch_rtp_t *rtp_session, uint32_t delay);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_add_dtls(switch_rtp_t *rtp_session, dtls_fingerprint_t *local_fp, dtls_fingerprint_t *remote_fp, dtls_type_t type);
|
||||
|
||||
|
||||
/*!
|
||||
\}
|
||||
*/
|
||||
|
||||
@@ -486,6 +486,7 @@ struct switch_directories {
|
||||
char *recordings_dir;
|
||||
char *sounds_dir;
|
||||
char *lib_dir;
|
||||
char *certs_dir;
|
||||
};
|
||||
|
||||
typedef struct switch_directories switch_directories;
|
||||
@@ -1297,6 +1298,7 @@ typedef enum {
|
||||
CF_RTP_NOTIMER_DURING_BRIDGE,
|
||||
CF_WEBRTC,
|
||||
CF_ICE,
|
||||
CF_DTLS,
|
||||
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
|
||||
/* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
|
||||
CF_FLAG_MAX
|
||||
|
||||
Reference in New Issue
Block a user