Wrapper for network related headers, masking differences between various operating systems. On passing, we also provide here trivial functions or other simple wrappers to network-related functions. More...
Go to the source code of this file.
Defines | |
#define | IFNAMSIZ 16 |
#define | inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__ |
#define | MAXHOSTNAMELEN 256 |
Functions | |
const char * | ast_inet_ntoa (struct in_addr ia) |
thread-safe replacement for inet_ntoa(). | |
static force_inline int | inaddrcmp (const struct sockaddr_in *sin1, const struct sockaddr_in *sin2) |
Compares the source address and port of two sockaddr_in. | |
int | inet_aton (const char *cp, struct in_addr *pin) |
Wrapper for network related headers, masking differences between various operating systems. On passing, we also provide here trivial functions or other simple wrappers to network-related functions.
Definition in file network.h.
#define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__ |
#define MAXHOSTNAMELEN 256 |
Definition at line 69 of file network.h.
Referenced by __sip_subscribe_mwi_do(), ast_find_ourip(), ast_readconfig(), build_peer(), cli_prompt(), create_addr(), find_user_realtime(), main(), make_email_file(), netconsole(), reload_config(), sendmail(), sendpage(), set_config(), and transmit_register().
const char* ast_inet_ntoa | ( | struct in_addr | ia | ) |
thread-safe replacement for inet_ntoa().
Definition at line 433 of file utils.c.
References ast_threadstorage_get(), and buf.
Referenced by __attempt_transmit(), __find_callno(), __iax2_show_peers(), __sip_xmit(), _sip_show_peer(), _sip_show_peers(), _skinny_show_device(), _skinny_show_devices(), acf_channel_read(), action_login(), add_sdp(), ast_append_ha(), ast_apply_ha(), ast_netsock_bindaddr(), ast_parse_arg(), ast_rtcp_read(), ast_rtcp_write_rr(), ast_rtcp_write_sr(), ast_rtp_raw_write(), ast_rtp_read(), ast_rtp_sendcng(), ast_rtp_senddigit_begin(), ast_rtp_senddigit_continuation(), ast_rtp_senddigit_end_with_duration(), ast_sip_ouraddrfor(), ast_tcptls_client_create(), ast_tcptls_client_start(), ast_tcptls_server_start(), ast_udptl_bridge(), ast_udptl_read(), ast_udptl_write(), authenticate(), bridge_native_loop(), bridge_p2p_rtp_write(), build_callid_pvt(), build_callid_registry(), build_contact(), build_peer(), build_reply_digest(), build_rpid(), build_via(), calltoken_required(), check_access(), check_peer_ok(), check_via(), config_load(), copy_via_headers(), create_addr_from_peer(), create_client(), create_dtmf_frame(), dnsmgr_refresh(), do_message(), dump_addr(), dump_ipaddr(), dundi_rexmit(), dundi_show_peer(), dundi_show_peers(), dundi_show_trans(), dundi_showframe(), dundi_xmit(), external_rtp_create(), find_command(), find_peer(), find_subchannel_and_lock(), find_tpeer(), function_iaxpeer(), function_sipchaninfo_read(), function_sippeer(), generic_http_callback(), get_input(), gtalk_create_candidates(), gtalk_update_stun(), handle_call_token(), handle_cli_iax2_set_debug(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_channels(), handle_cli_iax2_show_peer(), handle_cli_iax2_show_registry(), handle_cli_udptl_set_debug(), handle_command_response(), handle_error(), handle_incoming(), handle_mgcp_show_endpoints(), handle_open_receive_channel_ack_message(), handle_request(), handle_request_bye(), handle_request_do(), handle_request_register(), handle_request_subscribe(), handle_response(), handle_response_notify(), handle_response_refer(), handle_show_http(), handle_showmanconn(), handle_skinny_show_settings(), httpstatus_callback(), iax2_ack_registry(), iax2_prov_app(), iax2_trunk_queue(), iax_server(), iax_showframe(), initreqprep(), jingle_create_candidates(), load_module(), manager_iax2_show_peer_list(), manager_iax2_show_registry(), mgcpsock_read(), oh323_addrcmp_str(), oh323_call(), oh323_set_rtp_peer(), parse_register_contact(), parsing(), peercnt_add(), peercnt_modify(), peercnt_remove(), phoneprov_callback(), process_request(), process_rfc3389(), process_sdp(), purge_sessions(), raw_hangup(), realtime_peer(), realtime_update_peer(), realtime_user(), reg_source_db(), register_verify(), registry_rerequest(), reload_config(), resend_response(), retrans_pkt(), rpt_exec(), rtcp_do_debug_ip(), rtp_do_debug_ip(), sched_delay_remove(), send_packet(), send_raw_client(), send_request(), send_response(), send_trunk(), session_do(), set_config(), set_destination(), set_peercnt_limit(), setup_incoming_call(), show_channels_cb(), show_chanstats_cb(), show_main_page(), sip_do_debug_ip(), sip_do_debug_peer(), sip_poke_peer(), sip_set_rtp_peer(), sip_set_udptl_peer(), sip_show_channel(), sip_show_settings(), sip_show_tcp(), skinny_session(), skinny_set_rtp_peer(), socket_process(), socket_process_meta(), start_rtp(), timing_read(), transmit_notify_with_mwi(), unistim_info(), unistimsock_read(), and update_registry().
{ char *buf; if (!(buf = ast_threadstorage_get(&inet_ntoa_buf, INET_ADDRSTRLEN))) return ""; return inet_ntop(AF_INET, &ia, buf, INET_ADDRSTRLEN); }
static force_inline int inaddrcmp | ( | const struct sockaddr_in * | sin1, |
const struct sockaddr_in * | sin2 | ||
) | [static] |
Compares the source address and port of two sockaddr_in.
Definition at line 90 of file network.h.
Referenced by ast_netsock_find(), ast_udptl_bridge(), bridge_native_loop(), dnsmgr_refresh(), find_tpeer(), find_transaction(), handle_command_response(), iax2_ack_registry(), oh323_addrcmp(), parse_register_contact(), registry_rerequest(), reload_config(), socket_process(), socket_read(), threadinfo_locate_cb(), and update_registry().
{
return ((sin1->sin_addr.s_addr != sin2->sin_addr.s_addr)
|| (sin1->sin_port != sin2->sin_port));
}
int inet_aton | ( | const char * | cp, |
struct in_addr * | pin | ||
) |