diff --git a/daemon/call.c b/daemon/call.c index 23cdf76c1..484debad1 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -134,7 +134,7 @@ static void call_timer_iterator(call_t *c, struct iterator_helper *hlp) { unsigned int check; bool good = false; struct packet_stream *ps; - struct stream_fd *sfd; + stream_fd *sfd; int tmp_t_reason = UNKNOWN; struct call_monologue *ml; enum call_stream_state css; @@ -684,7 +684,7 @@ static struct endpoint_map *__hunt_endpoint_map(struct call_media *media, unsign for (__auto_type k = em->intf_sfds.head; k; k = k->next) { struct sfd_intf_list *il = k->data; for (__auto_type j = il->list.head; j; j = j->next) { - struct stream_fd *sfd = j->data; + stream_fd *sfd = j->data; if (sfd->socket.fd == -1) return NULL; } @@ -735,7 +735,7 @@ static struct endpoint_map *__latch_endpoint_map(struct call_media *media) struct packet_stream *first_ps = media->streams.head->data; if (!first_ps->sfds.length) return NULL; - struct stream_fd *matcher = first_ps->sfds.head->data; + stream_fd *matcher = first_ps->sfds.head->data; for (GList *l = media->endpoint_maps.tail; l; l = l->prev) { struct endpoint_map *em = l->data; @@ -744,7 +744,7 @@ static struct endpoint_map *__latch_endpoint_map(struct call_media *media) struct sfd_intf_list *em_il = em->intf_sfds.head->data; if (!em_il->list.length) continue; - struct stream_fd *first = em_il->list.head->data; + stream_fd *first = em_il->list.head->data; if (first == matcher) return em; } @@ -753,7 +753,7 @@ static struct endpoint_map *__latch_endpoint_map(struct call_media *media) static struct endpoint_map *__get_endpoint_map(struct call_media *media, unsigned int num_ports, const struct endpoint *ep, const sdp_ng_flags *flags, bool always_reuse) { - struct stream_fd *sfd; + stream_fd *sfd; socket_intf_list_q intf_sockets = TYPED_GQUEUE_INIT; unsigned int want_interfaces = __media_want_interfaces(media); @@ -835,12 +835,12 @@ static void __assign_stream_fds(struct call_media *media, sfd_intf_list_q *intf_ t_queue_clear(&ps->sfds); bool sfd_found = false; - struct stream_fd *intf_sfd = NULL; + stream_fd *intf_sfd = NULL; for (__auto_type l = intf_sfds->head; l; l = l->next) { struct sfd_intf_list *il = l->data; - struct stream_fd *sfd = t_queue_peek_nth(&il->list, ps->component - 1); + stream_fd *sfd = t_queue_peek_nth(&il->list, ps->component - 1); if (!sfd) sfd = ps->selected_sfd; if (!sfd) { @@ -1059,7 +1059,7 @@ enum call_stream_state call_stream_state_machine(struct packet_stream *ps) { for (__auto_type l = ps->sfds.head; l; l = l->next) { static const str fake_rtp = STR_CONST_INIT("\x80\x7f\xff\xff\x00\x00\x00\x00" "\x00\x00\x00\x00"); - struct stream_fd *sfd = l->data; + stream_fd *sfd = l->data; if (sfd->socket.fd == -1 || ps->endpoint.address.family == NULL) continue; socket_sendto(&sfd->socket, fake_rtp.s, fake_rtp.len, &ps->endpoint); @@ -1094,7 +1094,7 @@ int __init_stream(struct packet_stream *ps) { if (MEDIA_ISSET(media, SDES) && dtls_active == -1) { for (__auto_type l = ps->sfds.head; l; l = l->next) { - struct stream_fd *sfd = l->data; + stream_fd *sfd = l->data; struct crypto_params_sdes *cps = media->sdes_in.head ? media->sdes_in.head->data : NULL; crypto_init(&sfd->crypto, cps ? &cps->params : NULL); @@ -1119,7 +1119,7 @@ int __init_stream(struct packet_stream *ps) { dtls_active = (PS_ISSET(ps, FILLED) && MEDIA_ISSET(media, SETUP_ACTIVE)); dtls_connection_init(&ps->ice_dtls, ps, dtls_active, call->dtls_cert); for (__auto_type l = ps->sfds.head; l; l = l->next) { - struct stream_fd *sfd = l->data; + stream_fd *sfd = l->data; dtls_connection_init(&sfd->dtls, ps, dtls_active, call->dtls_cert); } @@ -2018,7 +2018,7 @@ static void __fingerprint_changed(struct call_media *m) { static void __set_all_tos(call_t *c) { for (__auto_type l = c->stream_fds.head; l; l = l->next) { - struct stream_fd *sfd = l->data; + stream_fd *sfd = l->data; if (sfd->socket.fd == -1) continue; set_tos(&sfd->socket, c->tos); @@ -3587,7 +3587,7 @@ static void __call_cleanup(call_t *c) { } while (c->stream_fds.head) { - struct stream_fd *sfd = t_queue_pop_head(&c->stream_fds); + stream_fd *sfd = t_queue_pop_head(&c->stream_fds); stream_fd_release(sfd); obj_put(sfd); } @@ -4247,7 +4247,7 @@ void monologue_destroy(struct call_monologue *monologue) { ps->last_local_endpoint = ps->selected_sfd->socket.local; ps->selected_sfd = NULL; - struct stream_fd *sfd; + stream_fd *sfd; while ((sfd = t_queue_pop_head(&ps->sfds))) stream_fd_release(sfd); } diff --git a/daemon/crypto.c b/daemon/crypto.c index 779662ce8..36af68153 100644 --- a/daemon/crypto.c +++ b/daemon/crypto.c @@ -16,6 +16,7 @@ #include "rtcplib.h" #include "main.h" #include "ssllib.h" +#include "types.h" diff --git a/daemon/dtls.c b/daemon/dtls.c index 4be428d57..96f590e63 100644 --- a/daemon/dtls.c +++ b/daemon/dtls.c @@ -40,7 +40,7 @@ #define CERT_EXPIRY_TIME (60*60*24*30) /* 30 days */ -struct dtls_connection *dtls_ptr(struct stream_fd *sfd) { +struct dtls_connection *dtls_ptr(stream_fd *sfd) { if (!sfd) return NULL; struct packet_stream *ps = sfd->stream; @@ -763,7 +763,7 @@ found: } // it's possible that ps->selected_sfd is not from ps->sfds list (?) for (__auto_type l = ps->sfds.head; l; l = l->next) { - struct stream_fd *sfd = l->data; + stream_fd *sfd = l->data; if (d->active) /* we're the client */ crypto_init(&sfd->crypto, &server); else /* we're the server */ @@ -785,7 +785,7 @@ error: } /* called with call locked in W or R with ps->in_lock held */ -int dtls(struct stream_fd *sfd, const str *s, const endpoint_t *fsin) { +int dtls(stream_fd *sfd, const str *s, const endpoint_t *fsin) { struct packet_stream *ps = sfd->stream; int ret; unsigned char buf[0x10000]; @@ -906,7 +906,7 @@ void dtls_shutdown(struct packet_stream *ps) { dtls_connection_cleanup(&ps->ice_dtls); } for (__auto_type l = ps->sfds.head; l; l = l->next) { - struct stream_fd *sfd = l->data; + stream_fd *sfd = l->data; struct dtls_connection *d = &sfd->dtls; if (!d->init) diff --git a/daemon/ice.c b/daemon/ice.c index 2d1fbde3c..18872ff8f 100644 --- a/daemon/ice.c +++ b/daemon/ice.c @@ -321,7 +321,7 @@ static void __tree_coll_callback(void *oo, void *nn) { } /* agent must be locked */ -static struct ice_candidate_pair *__pair_candidate(struct stream_fd *sfd, struct ice_agent *ag, +static struct ice_candidate_pair *__pair_candidate(stream_fd *sfd, struct ice_agent *ag, struct ice_candidate *cand) { struct ice_candidate_pair *pair; @@ -510,7 +510,7 @@ void ice_update(struct ice_agent *ag, struct stream_params *sp, bool allow_reset unsigned int comps; struct packet_stream *components[MAX_COMPONENTS], *ps; candidate_q *candidates; - struct stream_fd *sfd; + stream_fd *sfd; if (!ag) return; @@ -782,7 +782,7 @@ static void __fail_pair(struct ice_candidate_pair *pair) { /* agent must NOT be locked, but call must be locked in R */ static void __do_ice_check(struct ice_candidate_pair *pair) { - struct stream_fd *sfd = pair->sfd; + stream_fd *sfd = pair->sfd; struct ice_agent *ag = pair->agent; uint32_t prio, transact[3]; @@ -884,7 +884,7 @@ static void __nominate_pairs(struct ice_agent *ag) { /* call must be locked R or W, agent must not be locked */ static void __do_ice_checks(struct ice_agent *ag) { struct ice_candidate_pair *pair, *highest = NULL, *frozen = NULL, *valid; - struct stream_fd *sfd; + stream_fd *sfd; GQueue retransmits = G_QUEUE_INIT; struct timeval next_run = {0,0}; int have_more = 0; @@ -1044,7 +1044,7 @@ static void __cand_ice_foundation(call_t *call, struct ice_candidate *cand) { } /* agent must be locked */ -static struct ice_candidate_pair *__learned_candidate(struct ice_agent *ag, struct stream_fd *sfd, +static struct ice_candidate_pair *__learned_candidate(struct ice_agent *ag, stream_fd *sfd, const endpoint_t *src, unsigned long priority) { struct ice_candidate *cand, *old_cand; @@ -1219,7 +1219,7 @@ static int __check_valid(struct ice_agent *ag) { candidate_pair_q all_compos; struct ice_candidate_pair *pair; // const struct local_intf *ifa; - struct stream_fd *sfd; + stream_fd *sfd; int is_complete = 1; if (!ag) { @@ -1292,7 +1292,7 @@ static int __check_valid(struct ice_agent *ag) { * -1 = generic error, process packet as normal * -2 = role conflict */ -int ice_request(struct stream_fd *sfd, const endpoint_t *src, +int ice_request(stream_fd *sfd, const endpoint_t *src, struct stun_attrs *attrs) { struct packet_stream *ps = sfd->stream; @@ -1401,7 +1401,7 @@ static int __check_succeeded_complete(struct ice_agent *ag) { } /* call is locked in R */ -int ice_response(struct stream_fd *sfd, const endpoint_t *src, +int ice_response(stream_fd *sfd, const endpoint_t *src, struct stun_attrs *attrs, void *transaction) { struct ice_candidate_pair *pair, *opair; diff --git a/daemon/log.h b/daemon/log.h index 0ab830f48..6f0fefed3 100644 --- a/daemon/log.h +++ b/daemon/log.h @@ -8,14 +8,13 @@ -struct stream_fd; struct ice_agent; enum log_format; struct log_info { union { call_t *call; - struct stream_fd *stream_fd; + stream_fd *stream_fd; const str *str; const char *cstr; struct ice_agent *ice_agent; diff --git a/daemon/log_funcs.h b/daemon/log_funcs.h index 20874fccd..310cc075f 100644 --- a/daemon/log_funcs.h +++ b/daemon/log_funcs.h @@ -78,7 +78,7 @@ INLINE void log_info_call(call_t *c) { log_info.e = LOG_INFO_CALL; log_info.call = obj_get(c); } -INLINE void log_info_stream_fd(struct stream_fd *sfd) { +INLINE void log_info_stream_fd(stream_fd *sfd) { if (!sfd) return; __log_info_push(); diff --git a/daemon/media_player.c b/daemon/media_player.c index e2cd781a4..ccc849a9f 100644 --- a/daemon/media_player.c +++ b/daemon/media_player.c @@ -232,7 +232,7 @@ static void send_timer_rtcp(struct send_timer *st, struct ssrc_ctx *ssrc_out) { static bool __send_timer_send_1(struct rtp_header *rh, struct packet_stream *sink, struct codec_packet *cp) { - struct stream_fd *sink_fd = sink->selected_sfd; + stream_fd *sink_fd = sink->selected_sfd; if (!sink_fd || sink_fd->socket.fd == -1 || sink->endpoint.address.family == NULL) return false; diff --git a/daemon/media_socket.c b/daemon/media_socket.c index dd7945c7d..58c2cb101 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -1281,7 +1281,7 @@ void free_release_sfd_intf_list(struct sfd_intf_list *il) { /* called lock-free */ static void stream_fd_closed(int fd, void *p, uintptr_t u) { - struct stream_fd *sfd = p; + stream_fd *sfd = p; call_t *c; int i; socklen_t j; @@ -3105,7 +3105,7 @@ out: static void stream_fd_readable(int fd, void *p, uintptr_t u) { - struct stream_fd *sfd = p; + stream_fd *sfd = p; char buf[RTP_BUFFER_SIZE]; int ret, iters; bool update = false; @@ -3222,7 +3222,7 @@ done: static void stream_fd_free(void *p) { - struct stream_fd *f = p; + stream_fd *f = p; release_port(&f->socket, f->local_intf->spec); crypto_cleanup(&f->crypto); dtls_connection_cleanup(&f->dtls); @@ -3230,8 +3230,8 @@ static void stream_fd_free(void *p) { obj_put(f->call); } -struct stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *lif) { - struct stream_fd *sfd; +stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *lif) { + stream_fd *sfd; struct poller_item pi; struct poller *p = rtpe_poller; @@ -3268,16 +3268,16 @@ struct stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *l return sfd; } -struct stream_fd *stream_fd_lookup(const endpoint_t *ep) { +stream_fd *stream_fd_lookup(const endpoint_t *ep) { RWLOCK_R(&local_media_socket_endpoints_lock); - struct stream_fd *ret = g_hash_table_lookup(local_media_socket_endpoints, ep); + stream_fd *ret = g_hash_table_lookup(local_media_socket_endpoints, ep); if (!ret) return NULL; obj_hold(ret); return ret; } -void stream_fd_release(struct stream_fd *sfd) { +void stream_fd_release(stream_fd *sfd) { if (!sfd) return; if (sfd->socket.fd == -1) @@ -3285,7 +3285,7 @@ void stream_fd_release(struct stream_fd *sfd) { { RWLOCK_W(&local_media_socket_endpoints_lock); - struct stream_fd *ent = g_hash_table_lookup(local_media_socket_endpoints, &sfd->socket.local); + stream_fd *ent = g_hash_table_lookup(local_media_socket_endpoints, &sfd->socket.local); if (ent == sfd) g_hash_table_remove(local_media_socket_endpoints, &sfd->socket.local); // releases reference @@ -3433,7 +3433,7 @@ enum thread_looper_action kernel_stats_updater(void) { while (kl) { ke = kl->data; kernel2endpoint(&ep, &ke->target.local); - AUTO_CLEANUP(struct stream_fd *sfd, stream_fd_auto_cleanup) = stream_fd_lookup(&ep); + AUTO_CLEANUP(stream_fd *sfd, stream_fd_auto_cleanup) = stream_fd_lookup(&ep); if (!sfd) goto next; diff --git a/daemon/mqtt.c b/daemon/mqtt.c index 3f2a43178..fa05fbd37 100644 --- a/daemon/mqtt.c +++ b/daemon/mqtt.c @@ -338,7 +338,7 @@ static void mqtt_stream_stats_dir(const struct stream_stats *s, JsonBuilder *jso static void mqtt_stream_stats(struct packet_stream *ps, JsonBuilder *json) { mutex_lock(&ps->in_lock); - struct stream_fd *sfd = ps->selected_sfd; + stream_fd *sfd = ps->selected_sfd; if (sfd) { json_builder_set_member_name(json, "address"); json_builder_add_string_value(json, sockaddr_print_buf(&sfd->socket.local.address)); diff --git a/daemon/redis.c b/daemon/redis.c index 48fbe3784..bd2ea977e 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -1382,7 +1382,7 @@ static int redis_sfds(call_t *c, struct redis_list *sfds) { struct local_intf *loc; socket_q q = TYPED_GQUEUE_INIT; unsigned int loc_uid; - struct stream_fd *sfd; + stream_fd *sfd; socket_t *sock; int port, fd; const char *err; @@ -1649,7 +1649,7 @@ static int redis_maps(call_t *c, struct redis_list *maps) { static int redis_link_sfds(struct redis_list *sfds, struct redis_list *streams) { unsigned int i; - struct stream_fd *sfd; + stream_fd *sfd; for (i = 0; i < sfds->len; i++) { sfd = sfds->ptrs[i]; @@ -2371,7 +2371,7 @@ char* redis_encode_json(call_t *c) { json_builder_end_object(builder); for (__auto_type l = c->stream_fds.head; l; l = l->next) { - struct stream_fd *sfd = l->data; + stream_fd *sfd = l->data; snprintf(tmp, sizeof(tmp), "sfd-%u", sfd->unique_id); json_builder_set_member_name(builder, tmp); @@ -2438,7 +2438,7 @@ char* redis_encode_json(call_t *c) { json_builder_set_member_name(builder, tmp); json_builder_begin_array(builder); for (__auto_type k = ps->sfds.head; k; k = k->next) { - struct stream_fd *sfd = k->data; + stream_fd *sfd = k->data; JSON_ADD_STRING("%u", sfd->unique_id); } json_builder_end_array(builder); @@ -2666,7 +2666,7 @@ char* redis_encode_json(call_t *c) { struct sfd_intf_list *il = m->data; JSON_ADD_STRING("loc-%u", il->local_intf->unique_id); for (__auto_type n = il->list.head; n; n = n->next) { - struct stream_fd *sfd = n->data; + stream_fd *sfd = n->data; JSON_ADD_STRING("%u", sfd->unique_id); } } diff --git a/daemon/sdp.c b/daemon/sdp.c index d03e27c26..14b6d4c86 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2241,7 +2241,7 @@ warn: return 0; } -static int insert_ice_address(GString *s, struct stream_fd *sfd, sdp_ng_flags *flags) { +static int insert_ice_address(GString *s, stream_fd *sfd, sdp_ng_flags *flags) { char buf[64]; int len; @@ -2256,7 +2256,7 @@ static int insert_ice_address(GString *s, struct stream_fd *sfd, sdp_ng_flags *f return 0; } -static int insert_raddr_rport(GString *s, struct stream_fd *sfd, sdp_ng_flags *flags) { +static int insert_raddr_rport(GString *s, stream_fd *sfd, sdp_ng_flags *flags) { char buf[64]; int len; @@ -2618,7 +2618,7 @@ out: *lprefp = lpref; } -static void insert_candidate(GString *s, struct stream_fd *sfd, +static void insert_candidate(GString *s, stream_fd *sfd, unsigned int type_pref, unsigned int local_pref, enum ice_candidate_type type, sdp_ng_flags *flags, struct sdp_media *sdp_media) { @@ -2652,7 +2652,7 @@ static void insert_sfd_candidates(GString *s, struct packet_stream *ps, sdp_ng_flags *flags, struct sdp_media *sdp_media) { for (__auto_type l = ps->sfds.head; l; l = l->next) { - struct stream_fd *sfd = l->data; + stream_fd *sfd = l->data; insert_candidate(s, sfd, type_pref, local_pref, type, flags, sdp_media); if (local_pref != -1) diff --git a/daemon/ssrc.c b/daemon/ssrc.c index 95f50aa91..337146121 100644 --- a/daemon/ssrc.c +++ b/daemon/ssrc.c @@ -361,7 +361,7 @@ void ssrc_sender_report(struct call_media *m, const struct ssrc_sender_report *s mutex_unlock(&e->lock); obj_put(e); } -void ssrc_receiver_report(struct call_media *m, struct stream_fd *sfd, const struct ssrc_receiver_report *rr, +void ssrc_receiver_report(struct call_media *m, stream_fd *sfd, const struct ssrc_receiver_report *rr, const struct timeval *tv) { ilog(LOG_DEBUG, "RR from %s%x%s about %s%x%s: FL %u TL %u HSR %u J %u LSR %u DLSR %u", diff --git a/daemon/stun.c b/daemon/stun.c index a1caa9a35..e0e9c8411 100644 --- a/daemon/stun.c +++ b/daemon/stun.c @@ -395,7 +395,7 @@ static void integrity(struct msghdr *mh, struct msg_integrity *mi, str *pwd) { hdr->msg_len = ntohs(hdr->msg_len); } -static void stun_error_len(struct stream_fd *sfd, const endpoint_t *sin, +static void stun_error_len(stream_fd *sfd, const endpoint_t *sin, struct header *req, int code, char *reason, int len, uint16_t add_attr, void *attr_cont, int attr_len) @@ -488,7 +488,7 @@ static int check_auth(const str *msg, struct stun_attrs *attrs, struct call_medi return memcmp(digest, attrs->msg_integrity.s, 20) ? -1 : 0; } -static int stun_binding_success(struct stream_fd *sfd, struct header *req, struct stun_attrs *attrs, +static int stun_binding_success(stream_fd *sfd, struct header *req, struct stun_attrs *attrs, const endpoint_t *sin) { struct header hdr; @@ -537,7 +537,7 @@ INLINE int uint16_t_arr_len(uint16_t *arr) { #define SLF " from %s%s%s" #define SLP FMT_M(endpoint_print_buf(sin)) -static int __stun_request(struct stream_fd *sfd, const endpoint_t *sin, +static int __stun_request(stream_fd *sfd, const endpoint_t *sin, struct header *req, struct stun_attrs *attrs) { int ret; @@ -557,12 +557,12 @@ static int __stun_request(struct stream_fd *sfd, const endpoint_t *sin, return ret; } -static int __stun_success(struct stream_fd *sfd, const endpoint_t *sin, +static int __stun_success(stream_fd *sfd, const endpoint_t *sin, struct header *req, struct stun_attrs *attrs) { return ice_response(sfd, sin, attrs, req->transaction); } -static int __stun_error(struct stream_fd *sfd, const endpoint_t *sin, +static int __stun_error(stream_fd *sfd, const endpoint_t *sin, struct header *req, struct stun_attrs *attrs) { return ice_response(sfd, sin, attrs, req->transaction); @@ -576,7 +576,7 @@ static int __stun_error(struct stream_fd *sfd, const endpoint_t *sin, * * call is locked in R */ -int stun(const str *b, struct stream_fd *sfd, const endpoint_t *sin) { +int stun(const str *b, stream_fd *sfd, const endpoint_t *sin) { struct header *req = (void *) b->s; int msglen, method, class; str attr_str; diff --git a/daemon/t38.c b/daemon/t38.c index 747c06e00..4a46c6f96 100644 --- a/daemon/t38.c +++ b/daemon/t38.c @@ -220,7 +220,7 @@ static int t38_gateway_handler(t38_core_state_t *stat, void *user_data, const ui ps = tg->t38_media->streams.head->data; if (ps) mutex_lock(&ps->out_lock); - struct stream_fd *sfd = NULL; + stream_fd *sfd = NULL; if (ps) sfd = ps->selected_sfd; if (sfd && sfd->socket.fd != -1 && ps->endpoint.address.family != NULL) { diff --git a/include/call.h b/include/call.h index 7a2d9d90f..c20b87c9e 100644 --- a/include/call.h +++ b/include/call.h @@ -386,7 +386,7 @@ struct packet_stream { struct recording_stream recording; /* LOCK: call->master_lock */ stream_fd_q sfds; /* LOCK: call->master_lock */ - struct stream_fd * selected_sfd; + stream_fd * selected_sfd; endpoint_t last_local_endpoint; struct dtls_connection ice_dtls; /* LOCK: in_lock */ sink_handler_q rtp_sinks; /* LOCK: call->master_lock, in_lock for streamhandler */ diff --git a/include/dtls.h b/include/dtls.h index 1dbaa0695..f5dedf137 100644 --- a/include/dtls.h +++ b/include/dtls.h @@ -12,6 +12,7 @@ #include "str.h" #include "obj.h" #include "socket.h" +#include "types.h" @@ -23,7 +24,6 @@ struct packet_stream; struct sockaddr_in6; -struct stream_fd; @@ -70,7 +70,7 @@ struct dtls_cert *dtls_cert(void); void dtls_cert_free(void); int dtls_connection_init(struct dtls_connection *, struct packet_stream *, int active, struct dtls_cert *cert); -int dtls(struct stream_fd *, const str *s, const endpoint_t *sin); +int dtls(stream_fd *, const str *s, const endpoint_t *sin); void dtls_connection_cleanup(struct dtls_connection *); void dtls_shutdown(struct packet_stream *ps); @@ -116,7 +116,7 @@ INLINE int dtls_is_active(const struct dtls_connection *d) { } -struct dtls_connection *dtls_ptr(struct stream_fd *sfd); +struct dtls_connection *dtls_ptr(stream_fd *sfd); diff --git a/include/ice.h b/include/ice.h index d3200866c..5336091e7 100644 --- a/include/ice.h +++ b/include/ice.h @@ -94,7 +94,7 @@ struct ice_candidate { struct ice_candidate_pair { struct ice_candidate *remote_candidate; const struct local_intf *local_intf; - struct stream_fd *sfd; + stream_fd *sfd; volatile unsigned int pair_flags; uint32_t stun_transaction[3]; /* belongs to transaction_hash, thus agent->lock */ unsigned int retransmit_ms; @@ -170,8 +170,8 @@ void ice_remote_candidates(candidate_q *, struct ice_agent *); void ice_thread_run(void *); -int ice_request(struct stream_fd *, const endpoint_t *, struct stun_attrs *); -int ice_response(struct stream_fd *, const endpoint_t *src, +int ice_request(stream_fd *, const endpoint_t *, struct stun_attrs *); +int ice_response(stream_fd *, const endpoint_t *src, struct stun_attrs *attrs, void *transaction); void dequeue_sdp_fragments(struct call_monologue *); diff --git a/include/media_socket.h b/include/media_socket.h index 9431f0b12..f1b11a4ec 100644 --- a/include/media_socket.h +++ b/include/media_socket.h @@ -23,11 +23,10 @@ struct transport_protocol; struct ssrc_ctx; struct rtpengine_srtp; struct jb_packet; -struct stream_fd; struct poller; struct media_player_cache_entry; -TYPED_GQUEUE(stream_fd, struct stream_fd) +TYPED_GQUEUE(stream_fd, stream_fd) typedef int rtcp_filter_func(struct media_packet *, GQueue *); @@ -269,7 +268,7 @@ struct media_packet { endpoint_t fsin; // source address of received packet struct timeval tv; // timestamp when packet was received - struct stream_fd *sfd; // fd which received the packet + stream_fd *sfd; // fd which received the packet call_t *call; // sfd->call struct packet_stream *stream; // sfd->stream struct call_media *media; // stream->media @@ -307,9 +306,9 @@ int is_local_endpoint(const struct intf_address *addr, unsigned int port); int __get_consecutive_ports(socket_q *out, unsigned int num_ports, unsigned int wanted_start_port, struct intf_spec *spec, const str *); int get_consecutive_ports(socket_intf_list_q *out, unsigned int num_ports, unsigned int num_intfs, struct call_media *media); -struct stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *lif); -struct stream_fd *stream_fd_lookup(const endpoint_t *); -void stream_fd_release(struct stream_fd *); +stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *lif); +stream_fd *stream_fd_lookup(const endpoint_t *); +void stream_fd_release(stream_fd *); enum thread_looper_action release_closed_sockets(void); void append_thread_lpr_to_glob_lpr(void); @@ -362,7 +361,7 @@ INLINE int proto_is(const struct transport_protocol *protocol, enum transport_pr return 0; return (protocol->index == idx) ? 1 : 0; } -INLINE void stream_fd_auto_cleanup(struct stream_fd **sp) { +INLINE void stream_fd_auto_cleanup(stream_fd **sp) { if (!*sp) return; obj_put(*sp); diff --git a/include/ssrc.h b/include/ssrc.h index c8385cdc8..38dbc7caf 100644 --- a/include/ssrc.h +++ b/include/ssrc.h @@ -8,6 +8,7 @@ #include "helpers.h" #include "obj.h" #include "codeclib.h" +#include "types.h" @@ -18,7 +19,6 @@ struct rtp_payload_type; struct ssrc_entry; struct ssrc_entry_call; enum ssrc_dir; -struct stream_fd; @@ -230,7 +230,7 @@ struct ssrc_ctx *get_ssrc_ctx(uint32_t, struct ssrc_hash *, enum ssrc_dir, void void ssrc_sender_report(struct call_media *, const struct ssrc_sender_report *, const struct timeval *); -void ssrc_receiver_report(struct call_media *, struct stream_fd *, const struct ssrc_receiver_report *, +void ssrc_receiver_report(struct call_media *, stream_fd *, const struct ssrc_receiver_report *, const struct timeval *); void ssrc_receiver_rr_time(struct call_media *m, const struct ssrc_xr_rr_time *rr, const struct timeval *); diff --git a/include/stun.h b/include/stun.h index eed7e133e..30561c75c 100644 --- a/include/stun.h +++ b/include/stun.h @@ -49,7 +49,7 @@ INLINE int is_stun(const str *s) { } -int stun(const str *, struct stream_fd *, const endpoint_t *); +int stun(const str *, stream_fd *, const endpoint_t *); int stun_binding_request(const endpoint_t *dst, uint32_t transaction[3], str *pwd, str ufrags[2], int controlling, uint64_t tiebreaker, uint32_t priority, diff --git a/include/types.h b/include/types.h index 21f4fa942..d277d0a43 100644 --- a/include/types.h +++ b/include/types.h @@ -7,6 +7,7 @@ typedef struct sdp_ng_flags sdp_ng_flags; typedef struct stats_metric stats_metric; typedef struct ng_buffer ng_buffer; typedef struct call call_t; +typedef struct stream_fd stream_fd; #include "containers.h" diff --git a/t/log_funcs.h b/t/log_funcs.h index 1525384e4..0c6d6cad0 100644 --- a/t/log_funcs.h +++ b/t/log_funcs.h @@ -5,7 +5,6 @@ #include "str.h" #include "types.h" -struct stream_fd; struct ice_agent; struct call_media; @@ -17,7 +16,7 @@ INLINE void log_info_pop_until(void *p) { } INLINE void log_info_call(call_t *c) { } -INLINE void log_info_stream_fd(struct stream_fd *sfd) { +INLINE void log_info_stream_fd(stream_fd *sfd) { } INLINE void log_info_str(const str *s) { } diff --git a/t/test-transcode.c b/t/test-transcode.c index 4ec2c37aa..65bb40d9d 100644 --- a/t/test-transcode.c +++ b/t/test-transcode.c @@ -246,7 +246,7 @@ static void __packet_seq_ts(const char *file, int line, struct call_media *media // from media_packet_rtp() struct local_intf lif = { }; - struct stream_fd sfd = { + stream_fd sfd = { .local_intf = &lif, }; struct media_packet mp = {