/* belle-sip - SIP (RFC3261) library. Copyright (C) 2010 Belledonne Communications SARL This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef belle_sip_stack_h #define belle_sip_stack_h struct belle_sip_hop{ char *host; char *transport; int port; }; typedef struct belle_sip_hop belle_sip_hop_t; struct belle_sip_timer_config{ int T1; int T2; int T3; int T4; }; typedef struct belle_sip_timer_config belle_sip_timer_config_t; BELLE_SIP_BEGIN_DECLS BELLESIP_EXPORT belle_sip_stack_t * belle_sip_stack_new(const char *properties); BELLESIP_EXPORT belle_sip_listening_point_t *belle_sip_stack_create_listening_point(belle_sip_stack_t *s, const char *ipaddress, int port, const char *transport); BELLESIP_EXPORT void belle_sip_stack_delete_listening_point(belle_sip_stack_t *s, belle_sip_listening_point_t *lp); BELLESIP_EXPORT belle_sip_provider_t *belle_sip_stack_create_provider(belle_sip_stack_t *s, belle_sip_listening_point_t *lp); BELLESIP_EXPORT belle_sip_main_loop_t* belle_sip_stack_get_main_loop(belle_sip_stack_t *stack); BELLESIP_EXPORT void belle_sip_stack_main(belle_sip_stack_t *stack); BELLESIP_EXPORT void belle_sip_stack_sleep(belle_sip_stack_t *stack, unsigned int milliseconds); BELLESIP_EXPORT int belle_sip_stack_get_transport_timeout(const belle_sip_stack_t *stack); BELLESIP_EXPORT int belle_sip_stack_get_dns_timeout(const belle_sip_stack_t *stack); BELLESIP_EXPORT void belle_sip_stack_set_dns_timeout(belle_sip_stack_t *stack, int timeout); void belle_sip_hop_free(belle_sip_hop_t *hop); /** * Can be used to simulate network transmission delays, for tests. **/ BELLESIP_EXPORT void belle_sip_stack_set_tx_delay(belle_sip_stack_t *stack, int delay_ms); /** * Can be used to simulate network sending error, for tests. * @param stack * @param send_error if <0, will cause channel error to be reported **/ BELLESIP_EXPORT void belle_sip_stack_set_send_error(belle_sip_stack_t *stack, int send_error); /** * Can be used to simulate network transmission delays, for tests. **/ BELLESIP_EXPORT void belle_sip_stack_set_resolver_tx_delay(belle_sip_stack_t *stack, int delay_ms); /** * Can be used to simulate network sending error, for tests. * @param stack * @param send_error if <0, will cause the resolver to fail with this error code. **/ BELLESIP_EXPORT void belle_sip_stack_set_resolver_send_error(belle_sip_stack_t *stack, int send_error); BELLE_SIP_END_DECLS #endif