Browse Source

MT#61352 use "introspection" for ng_flags

Change-Id: I1d757728e22d9d101fa62eebeed6e8d2ca040107
pull/1884/head
Richard Fuchs 1 year ago
parent
commit
e802c7547f
2 changed files with 43 additions and 28 deletions
  1. +11
    -14
      daemon/call_interfaces.c
  2. +32
    -14
      include/call_interfaces.h

+ 11
- 14
daemon/call_interfaces.c View File

@ -2097,24 +2097,21 @@ static void ng_sdp_attr_manipulations_free(struct sdp_manipulations * array[__MT
}
void call_ng_free_flags(sdp_ng_flags *flags) {
str_case_ht_destroy_ptr(&flags->codec_except);
str_case_value_ht_destroy_ptr(&flags->codec_set);
str_case_ht_destroy_ptr(&flags->sdes_no);
str_case_ht_destroy_ptr(&flags->sdes_only);
if (flags->frequencies)
g_array_free(flags->frequencies, true);
t_queue_clear_full(&flags->from_tags, str_free);
t_queue_clear_full(&flags->codec_offer, str_free);
t_queue_clear_full(&flags->codec_transcode, str_free);
t_queue_clear_full(&flags->codec_strip, str_free);
t_queue_clear_full(&flags->codec_accept, str_free);
t_queue_clear_full(&flags->codec_consume, str_free);
t_queue_clear_full(&flags->codec_mask, str_free);
t_queue_clear_full(&flags->sdes_order, str_free);
t_queue_clear_full(&flags->sdes_offerer_pref, str_free);
t_queue_clear_full(&flags->generic_attributes, sdp_attr_free);
t_queue_clear_full(&flags->all_attributes, sdp_attr_free);
#define X(x) t_queue_clear_full(&flags->x, str_free);
RTPE_NG_FLAGS_STR_Q_PARAMS
#undef X
#define X(x) t_queue_clear_full(&flags->x, sdp_attr_free);
RTPE_NG_FLAGS_SDP_ATTR_Q_PARAMS
#undef X
#define X(x) str_case_ht_destroy_ptr(&flags->x);
RTPE_NG_FLAGS_STR_CASE_HT_PARAMS
#undef X
ng_sdp_attr_manipulations_free(flags->sdp_manipulations);
}


+ 32
- 14
include/call_interfaces.h View File

@ -13,13 +13,32 @@ struct call_stats;
struct streambuf_stream;
struct sockaddr_in6;
#define RTPE_NG_FLAGS_STR_Q_PARAMS \
X(from_tags) \
X(codec_strip) \
X(codec_offer) \
X(codec_transcode) \
X(codec_mask) \
X(codec_accept) \
X(codec_consume) \
X(sdes_order) /* the order, in which crypto suites are being added to the SDP */ \
X(sdes_offerer_pref) /* preferred crypto suites to be selected for the offerer */
#define RTPE_NG_FLAGS_SDP_ATTR_Q_PARAMS \
X(generic_attributes) /* top-level (not part of an m= section) SDP session attributes */ \
X(all_attributes) /* top-level (not part of an m= section) SDP session attributes */
#define RTPE_NG_FLAGS_STR_CASE_HT_PARAMS \
X(codec_except) \
X(sdes_no) /* individual crypto suites which are excluded */ \
X(sdes_only) /* individual crypto suites which are only accepted */
struct sdp_ng_flags {
enum call_opmode opmode;
enum message_type message_type;
unsigned int code;
str call_id;
str from_tag;
str_q from_tags;
str to_tag;
str via_branch;
str sdp;
@ -44,25 +63,12 @@ struct sdp_ng_flags {
str address;
sockaddr_t xmlrpc_callback;
endpoint_t dtmf_log_dest;
str_q codec_strip;
str_case_ht codec_except;
str_q codec_offer;
str_q codec_transcode;
str_q codec_mask;
str_q codec_accept;
str_q codec_consume;
str_case_value_ht codec_set;
int ptime,
rev_ptime;
str_case_ht sdes_no; /* individual crypto suites which are excluded */
str_case_ht sdes_only; /* individual crypto suites which are only accepted */
str_q sdes_order; /* the order, in which crypto suites are being added to the SDP */
str_q sdes_offerer_pref; /* preferred crypto suites to be selected for the offerer */
str dtls_fingerprint;
/* keep session level attributes for internal proper parsing */
sdp_attr_q generic_attributes; // top-level (not part of an m= section) SDP session attributes
sdp_attr_q all_attributes; // top-level (not part of an m= section) SDP session attributes
sdp_origin session_sdp_orig;
str session_sdp_name;
@ -140,6 +146,18 @@ struct sdp_ng_flags {
str vsc_pause_resume_rec;
str vsc_start_pause_resume_rec;
#define X(x) str_q x;
RTPE_NG_FLAGS_STR_Q_PARAMS
#undef X
#define X(x) sdp_attr_q x;
RTPE_NG_FLAGS_SDP_ATTR_Q_PARAMS
#undef X
#define X(x) str_case_ht x;
RTPE_NG_FLAGS_STR_CASE_HT_PARAMS
#undef X
unsigned int asymmetric:1,
protocol_accept:1,
no_redis_update:1,


Loading…
Cancel
Save