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...
#include <netinet/in.h>#include <arpa/inet.h>#include <netinet/in_systm.h>#include <netinet/ip.h>#include <netinet/tcp.h>#include <netdb.h>#include <sys/socket.h>#include <net/if.h>#include <sys/ioctl.h>

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 ast_find_ourip(), find_user_realtime(), sendmail(), make_email_file(), sendpage(), netconsole(), cli_prompt(), ast_readconfig(), main(), create_addr(), get_realm(), __sip_subscribe_mwi_do(), transmit_register(), build_peer(), reload_config(), and set_config().
| const char* ast_inet_ntoa | ( | struct in_addr | ia | ) |
thread-safe replacement for inet_ntoa().
Definition at line 467 of file utils.c.
References ast_threadstorage_get(), and inet_ntoa_buf.
Referenced by score_address(), ast_apply_ha(), rpt_exec(), gtalk_update_externip(), gtalk_update_stun(), oh323_call(), realtime_peer(), oh323_addrcmp_str(), find_peer(), external_rtp_create(), setup_incoming_call(), oh323_set_rtp_peer(), calltoken_required(), set_peercnt_limit(), peercnt_modify(), peercnt_add(), peercnt_remove(), handle_cli_iax2_show_callno_limits(), sched_delay_remove(), __find_callno(), handle_error(), send_packet(), __attempt_transmit(), handle_cli_iax2_show_peer(), realtime_user(), handle_call_token(), find_tpeer(), iax2_trunk_queue(), __iax2_show_peers(), manager_iax2_show_peer_list(), handle_cli_iax2_show_registry(), manager_iax2_show_registry(), handle_cli_iax2_show_channels(), handle_cli_iax2_set_debug(), check_access(), raw_hangup(), register_verify(), authenticate(), iax2_ack_registry(), update_registry(), registry_rerequest(), send_trunk(), timing_read(), socket_process_meta(), socket_process(), iax2_prov_app(), function_iaxpeer(), acf_channel_read(), peers_data_provider_get(), jingle_create_candidates(), resend_response(), send_response(), send_request(), handle_mgcp_show_endpoints(), find_subchannel_and_lock(), process_sdp(), add_sdp(), find_command(), handle_request(), mgcpsock_read(), reload_config(), skinny_set_rtp_peer(), _skinny_show_devices(), _skinny_show_device(), handle_skinny_show_settings(), handle_open_receive_channel_ack_message(), skinny_session(), config_load(), send_raw_client(), create_client(), start_rtp(), show_main_page(), process_request(), parsing(), unistimsock_read(), unistim_info(), ast_parse_arg(), data_get_xml_add_child(), data_result_print_cli_node(), data_result_manager_output(), dundi_showframe(), handle_show_http(), dump_addr(), dump_ipaddr(), iax_showframe(), iax_server(), handle_showmanconn(), action_login(), get_input(), do_message(), session_do(), purge_sessions(), generic_http_callback(), auth_http_callback(), ast_netsock_bindaddr(), handle_command_response(), dundi_show_peer(), dundi_show_peers(), dundi_show_trans(), dundi_xmit(), dundi_rexmit(), set_config(), load_module(), phoneprov_callback(), stun_monitor_request(), and add_ipv4_ie().
{
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 oh323_addrcmp(), find_tpeer(), iax2_ack_registry(), registry_rerequest(), socket_read(), socket_process(), ast_netsock_find(), find_transaction(), and handle_command_response().
{
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 | ||
| ) |