static int transport_protocol_to_str(const void *obj, const intptr_t *args, char **buf) { const struct ast_sip_transport *transport = obj; if (ARRAY_IN_BOUNDS(transport->type, transport_types)) { *buf = ast_strdup(transport_types[transport->type]); } return 0; }
static int tls_method_to_str(const void *obj, const intptr_t *args, char **buf) { const struct ast_sip_transport *transport = obj; RAII_VAR(struct ast_sip_transport_state *, state, find_state_by_transport(transport), ao2_cleanup); if (!state) { return -1; } if (ARRAY_IN_BOUNDS(state->tls.method, tls_method_map)) { *buf = ast_strdup(tls_method_map[state->tls.method]); } return 0; }
const char *ast_sip_auth_type_to_str(enum ast_sip_auth_type type) { return ARRAY_IN_BOUNDS(type, auth_types_map) ? auth_types_map[type] : ""; }