From dd22cf687600903c953fb3b80e19996b6dcb2641 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 25 Jun 2009 18:43:54 +0000 Subject: [PATCH] Wed Jun 3 12:25:19 CDT 2009 Pekka Pessi * tport_type_udp.c: added field names to tport_vtable_t initialization Wed Jun 3 12:25:52 CDT 2009 Pekka Pessi * tport_type_tcp.c: added field names to tport_vtable_t initialization Wed Jun 3 12:29:13 CDT 2009 Pekka Pessi * tport_threadpool.c: added field names to tport_vtable_t initialization Wed Jun 3 12:29:41 CDT 2009 Pekka Pessi * tport_type_connect.c: added field names to tport_vtable_t initialization Wed Jun 3 12:30:01 CDT 2009 Pekka Pessi * tport_type_stun.c: added field names to tport_vtable_t initialization Wed Jun 3 12:30:17 CDT 2009 Pekka Pessi * tport_type_sctp.c: added field names to tport_vtable_t initialization git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13956 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/.update | 2 +- .../libsofia-sip-ua/tport/tport_threadpool.c | 38 +++++---- .../tport/tport_type_connect.c | 36 ++++---- .../libsofia-sip-ua/tport/tport_type_sctp.c | 82 ++++++++++--------- .../libsofia-sip-ua/tport/tport_type_stun.c | 39 +++++---- .../libsofia-sip-ua/tport/tport_type_tcp.c | 82 ++++++++++--------- .../libsofia-sip-ua/tport/tport_type_udp.c | 70 +++++++++------- 7 files changed, 191 insertions(+), 158 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index f209d4f940..6dae18dded 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Tue Jun 23 14:48:51 CDT 2009 +Thu Jun 25 13:42:28 CDT 2009 diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_threadpool.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_threadpool.c index 43388434a7..31665e7503 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_threadpool.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_threadpool.c @@ -129,22 +129,27 @@ static int tport_thread_send(tport_t *tp, tport_vtable_t const tport_threadpool_vtable = { - "udp", tport_type_local, - sizeof (tport_threadpool_t), - tport_threadpool_init_primary, - tport_threadpool_deinit_primary, - NULL, - NULL, - 0, /* No secondary transports! */ - NULL, - NULL, - NULL, - NULL, - NULL, - tport_recv_dgram, - tport_send_dgram, - NULL, - tport_thread_send + /* vtp_name */ "udp", + /* vtp_public */ tport_type_local, + /* vtp_pri_size */ sizeof (tport_threadpool_t), + /* vtp_init_primary */ tport_threadpool_init_primary, + /* vtp_deinit_primary */ tport_threadpool_deinit_primary, + /* vtp_wakeup_pri */ NULL, + /* vtp_connect */ NULL, + /* vtp_secondary_size */ 0, /* No secondary transports! */ + /* vtp_init_secondary */ NULL, + /* vtp_deinit_secondary */ NULL, + /* vtp_shutdown */ NULL, + /* vtp_set_events */ NULL, + /* vtp_wakeup */ NULL, + /* vtp_recv */ tport_recv_dgram, + /* vtp_send */ tport_send_dgram, + /* vtp_deliver */ NULL, + /* vtp_prepare */ tport_thread_send, + /* vtp_keepalive */ NULL, + /* vtp_stun_response */ NULL, + /* vtp_next_secondary_timer*/ NULL, + /* vtp_secondary_timer */ NULL, }; static int thrp_udp_init(su_root_t *, threadpool_t *); @@ -809,4 +814,5 @@ void thrp_udp_send_report(su_root_magic_t *magic, tport_error_report(tp, tpd->tpd_errorcode, msg_addr(tpd->tpd_msg)); msg_ref_destroy(tpd->tpd_msg); + } diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_connect.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_connect.c index 7401ff37a5..72b212f728 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_connect.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_connect.c @@ -76,21 +76,27 @@ typedef struct tport_vtable_t const tport_http_connect_vtable = { - "TCP", tport_type_connect, - sizeof (tport_http_connect_t), - tport_http_connect_init_primary, - tport_http_connect_deinit_primary, - NULL, - tport_http_connect, - sizeof (tport_http_connect_instance_t), - NULL, - NULL, - NULL, - NULL, - NULL, - tport_recv_stream, - tport_send_stream, - tport_http_deliver, + /* vtp_name */ "TCP", + /* vtp_public */ tport_type_connect, + /* vtp_pri_size */ sizeof (tport_http_connect_t), + /* vtp_init_primary */ tport_http_connect_init_primary, + /* vtp_deinit_primary */ tport_http_connect_deinit_primary, + /* vtp_wakeup_pri */ NULL, + /* vtp_connect */ tport_http_connect, + /* vtp_secondary_size */ sizeof (tport_http_connect_instance_t), + /* vtp_init_secondary */ NULL, + /* vtp_deinit_secondary */ NULL, + /* vtp_shutdown */ NULL, + /* vtp_set_events */ NULL, + /* vtp_wakeup */ NULL, + /* vtp_recv */ tport_recv_stream, + /* vtp_send */ tport_send_stream, + /* vtp_deliver */ tport_http_deliver, + /* vtp_prepare */ NULL, + /* vtp_keepalive */ NULL, + /* vtp_stun_response */ NULL, + /* vtp_next_secondary_timer*/ NULL, + /* vtp_secondary_timer */ NULL, }; static int tport_http_connect_init_primary(tport_primary_t *pri, diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_sctp.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_sctp.c index 014aa479fb..08b160bb75 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_sctp.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_sctp.c @@ -102,50 +102,52 @@ static void tport_sctp_timer(tport_t *self, su_time_t); tport_vtable_t const tport_sctp_client_vtable = { - "sctp", tport_type_client, - sizeof (tport_primary_t), - tport_sctp_init_client, - NULL, - tport_accept, - NULL, - sizeof (tport_t), - tport_sctp_init_secondary, - NULL, - NULL, - NULL, - NULL, - tport_recv_sctp, - tport_send_sctp, - NULL, - NULL, - NULL, - NULL, - tport_sctp_next_timer, - tport_sctp_timer, + /* vtp_name */ "sctp", + /* vtp_public */ tport_type_client, + /* vtp_pri_size */ sizeof (tport_primary_t), + /* vtp_init_primary */ tport_sctp_init_client, + /* vtp_deinit_primary */ NULL, + /* vtp_wakeup_pri */ tport_accept, + /* vtp_connect */ NULL, + /* vtp_secondary_size */ sizeof (tport_t), + /* vtp_init_secondary */ tport_sctp_init_secondary, + /* vtp_deinit_secondary */ NULL, + /* vtp_shutdown */ NULL, + /* vtp_set_events */ NULL, + /* vtp_wakeup */ NULL, + /* vtp_recv */ tport_recv_sctp, + /* vtp_send */ tport_send_sctp, + /* vtp_deliver */ NULL, + /* vtp_prepare */ NULL, + /* vtp_keepalive */ NULL, + /* vtp_stun_response */ NULL, + /* vtp_next_secondary_timer*/ tport_sctp_next_timer, + /* vtp_secondary_timer */ tport_sctp_timer, }; tport_vtable_t const tport_sctp_vtable = { - "sctp", tport_type_local, - sizeof (tport_primary_t), - tport_sctp_init_primary, - NULL, - tport_accept, - NULL, - sizeof (tport_t), - tport_sctp_init_secondary, - NULL, - NULL, - NULL, - NULL, - tport_recv_sctp, - tport_send_sctp, - NULL, - NULL, - NULL, - NULL, - tport_sctp_next_timer, - tport_sctp_timer, + /* vtp_name */ "sctp", + /* vtp_public */ tport_type_local, + /* vtp_pri_size */ sizeof (tport_primary_t), + /* vtp_init_primary */ tport_sctp_init_primary, + /* vtp_deinit_primary */ NULL, + /* vtp_wakeup_pri */ tport_accept, + /* vtp_connect */ NULL, + /* vtp_secondary_size */ sizeof (tport_t), + /* vtp_init_secondary */ tport_sctp_init_secondary, + /* vtp_deinit_secondary */ NULL, + /* vtp_shutdown */ NULL, + /* vtp_set_events */ NULL, + /* vtp_wakeup */ NULL, + /* vtp_recv */ tport_recv_sctp, + /* vtp_send */ tport_send_sctp, + /* vtp_deliver */ NULL, + /* vtp_prepare */ NULL, + /* vtp_keepalive */ NULL, + /* vtp_stun_response */ NULL, + /* vtp_next_secondary_timer*/ tport_sctp_next_timer, + /* vtp_secondary_timer */ tport_sctp_timer, }; static int tport_sctp_init_primary(tport_primary_t *pri, diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_stun.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_stun.c index 018c2b6508..55f67a9e2c 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_stun.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_stun.c @@ -77,24 +77,27 @@ static int tport_stun_response(tport_t const *self, tport_vtable_t const tport_stun_vtable = { - "UDP", tport_type_stun, - sizeof (tport_primary_t), - tport_udp_init_stun, - tport_udp_deinit_stun, - NULL, - NULL, - sizeof (tport_t), - NULL, - NULL, - NULL, - NULL, - NULL, - tport_recv_dgram, - tport_send_dgram, - NULL, - NULL, - tport_stun_keepalive, - tport_stun_response + /* vtp_name */ "UDP", + /* vtp_public */ tport_type_stun, + /* vtp_pri_size */ sizeof (tport_primary_t), + /* vtp_init_primary */ tport_udp_init_stun, + /* vtp_deinit_primary */ tport_udp_deinit_stun, + /* vtp_wakeup_pri */ NULL, + /* vtp_connect */ NULL, + /* vtp_secondary_size */ sizeof (tport_t), + /* vtp_init_secondary */ NULL, + /* vtp_deinit_secondary */ NULL, + /* vtp_shutdown */ NULL, + /* vtp_set_events */ NULL, + /* vtp_wakeup */ NULL, + /* vtp_recv */ tport_recv_dgram, + /* vtp_send */ tport_send_dgram, + /* vtp_deliver */ NULL, + /* vtp_prepare */ NULL, + /* vtp_keepalive */ tport_stun_keepalive, + /* vtp_stun_response */ tport_stun_response, + /* vtp_next_secondary_timer*/ NULL, + /* vtp_secondary_timer */ NULL, }; static int tport_udp_init_stun(tport_primary_t *pri, diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c index ec87db586d..138caf6960 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c @@ -63,50 +63,52 @@ static char const __func__[] = "tport_type_tcp"; tport_vtable_t const tport_tcp_vtable = { - "tcp", tport_type_local, - sizeof (tport_primary_t), - tport_tcp_init_primary, - NULL, - tport_accept, - NULL, - sizeof (tport_t), - tport_tcp_init_secondary, - NULL, - NULL, - NULL, - NULL, - tport_recv_stream, - tport_send_stream, - NULL, - NULL, - NULL, - NULL, - tport_tcp_next_timer, - tport_tcp_timer, + /* vtp_name */ "tcp", + /* vtp_public */ tport_type_local, + /* vtp_pri_size */ sizeof (tport_primary_t), + /* vtp_init_primary */ tport_tcp_init_primary, + /* vtp_deinit_primary */ NULL, + /* vtp_wakeup_pri */ tport_accept, + /* vtp_connect */ NULL, + /* vtp_secondary_size */ sizeof (tport_t), + /* vtp_init_secondary */ tport_tcp_init_secondary, + /* vtp_deinit_secondary */ NULL, + /* vtp_shutdown */ NULL, + /* vtp_set_events */ NULL, + /* vtp_wakeup */ NULL, + /* vtp_recv */ tport_recv_stream, + /* vtp_send */ tport_send_stream, + /* vtp_deliver */ NULL, + /* vtp_prepare */ NULL, + /* vtp_keepalive */ NULL, + /* vtp_stun_response */ NULL, + /* vtp_next_secondary_timer*/ tport_tcp_next_timer, + /* vtp_secondary_timer */ tport_tcp_timer, }; tport_vtable_t const tport_tcp_client_vtable = { - "tcp", tport_type_client, - sizeof (tport_primary_t), - tport_tcp_init_client, - NULL, - NULL, - NULL, - sizeof (tport_t), - tport_tcp_init_secondary, - NULL, - NULL, - NULL, - NULL, - tport_recv_stream, - tport_send_stream, - NULL, - NULL, - NULL, - NULL, - tport_tcp_next_timer, - tport_tcp_timer, + /* vtp_name */ "tcp", + /* vtp_public */ tport_type_client, + /* vtp_pri_size */ sizeof (tport_primary_t), + /* vtp_init_primary */ tport_tcp_init_client, + /* vtp_deinit_primary */ NULL, + /* vtp_wakeup_pri */ NULL, + /* vtp_connect */ NULL, + /* vtp_secondary_size */ sizeof (tport_t), + /* vtp_init_secondary */ tport_tcp_init_secondary, + /* vtp_deinit_secondary */ NULL, + /* vtp_shutdown */ NULL, + /* vtp_set_events */ NULL, + /* vtp_wakeup */ NULL, + /* vtp_recv */ tport_recv_stream, + /* vtp_send */ tport_send_stream, + /* vtp_deliver */ NULL, + /* vtp_prepare */ NULL, + /* vtp_keepalive */ NULL, + /* vtp_stun_response */ NULL, + /* vtp_next_secondary_timer*/ tport_tcp_next_timer, + /* vtp_secondary_timer */ tport_tcp_timer, }; static int tport_tcp_setsndbuf(int socket, int atleast); diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c index 2f89d4baf4..8d0f2de712 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c @@ -69,38 +69,52 @@ static char const __func__[] = "tport_type_udp"; tport_vtable_t const tport_udp_client_vtable = { - "udp", tport_type_client, - sizeof (tport_primary_t), - tport_udp_init_client, - NULL, - NULL, - NULL, - sizeof (tport_t), - NULL, - NULL, - NULL, - NULL, - NULL, - tport_recv_dgram, - tport_send_dgram, + /* vtp_name */ "udp", + /* vtp_public */ tport_type_client, + /* vtp_pri_size */ sizeof (tport_primary_t), + /* vtp_init_primary */ tport_udp_init_client, + /* vtp_deinit_primary */ NULL, + /* vtp_wakeup_pri */ NULL, + /* vtp_connect */ NULL, + /* vtp_secondary_size */ sizeof (tport_t), + /* vtp_init_secondary */ NULL, + /* vtp_deinit_secondary */ NULL, + /* vtp_shutdown */ NULL, + /* vtp_set_events */ NULL, + /* vtp_wakeup */ NULL, + /* vtp_recv */ tport_recv_dgram, + /* vtp_send */ tport_send_dgram, + /* vtp_deliver */ NULL, + /* vtp_prepare */ NULL, + /* vtp_keepalive */ NULL, + /* vtp_stun_response */ NULL, + /* vtp_next_secondary_timer*/ NULL, + /* vtp_secondary_timer */ NULL, }; tport_vtable_t const tport_udp_vtable = { - "udp", tport_type_local, - sizeof (tport_primary_t), - tport_udp_init_primary, - NULL, - NULL, - NULL, - sizeof (tport_t), - NULL, - NULL, - NULL, - NULL, - NULL, - tport_recv_dgram, - tport_send_dgram, + /* vtp_name */ "udp", + /* vtp_public */ tport_type_local, + /* vtp_pri_size */ sizeof (tport_primary_t), + /* vtp_init_primary */ tport_udp_init_primary, + /* vtp_deinit_primary */ NULL, + /* vtp_wakeup_pri */ NULL, + /* vtp_connect */ NULL, + /* vtp_secondary_size */ sizeof (tport_t), + /* vtp_init_secondary */ NULL, + /* vtp_deinit_secondary */ NULL, + /* vtp_shutdown */ NULL, + /* vtp_set_events */ NULL, + /* vtp_wakeup */ NULL, + /* vtp_recv */ tport_recv_dgram, + /* vtp_send */ tport_send_dgram, + /* vtp_deliver */ NULL, + /* vtp_prepare */ NULL, + /* vtp_keepalive */ NULL, + /* vtp_stun_response */ NULL, + /* vtp_next_secondary_timer*/ NULL, + /* vtp_secondary_timer */ NULL, }; static void tport_check_trunc(tport_t *tp, su_addrinfo_t *ai);