

Go to the source code of this file.
Data Structures | |
| struct | ao2_iterator |
| When we need to walk through a container, we use an ao2_iterator to keep track of the current position. More... | |
Defines | |
| #define | ao2_callback_data(arg1, arg2, arg3, arg4, arg5) __ao2_callback_data((arg1), (arg2), (arg3), (arg4), (arg5)) |
| #define | ao2_find(arg1, arg2, arg3) __ao2_find((arg1), (arg2), (arg3)) |
| #define | ao2_iterator_next(arg1) __ao2_iterator_next((arg1)) |
| #define | ao2_lock(a) __ao2_lock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
| #define | ao2_t_callback_data(arg1, arg2, arg3, arg4, arg5, arg6) __ao2_callback_data((arg1), (arg2), (arg3), (arg4), (arg5)) |
| ao2_callback_data() is a generic function that applies cb_fn() to all objects in a container. It is functionally identical to ao2_callback() except that instead of taking an ao2_callback_fn *, it takes an ao2_callback_data_fn *, and allows the caller to pass in arbitrary data. | |
| #define | ao2_t_find(arg1, arg2, arg3, arg4) __ao2_find((arg1), (arg2), (arg3)) |
| #define | ao2_t_iterator_next(arg1, arg2) __ao2_iterator_next((arg1)) |
| #define | ao2_trylock(a) __ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
| #define | ao2_unlock(a) __ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
Typedefs | |
| typedef int( | ao2_callback_data_fn )(void *obj, void *arg, void *data, int flags) |
| Type of a generic callback function. | |
| typedef int( | ao2_callback_fn )(void *obj, void *arg, int flags) |
| Type of a generic callback function. | |
| typedef void(* | ao2_destructor_fn )(void *) |
| Typedef for an object destructor. This is called just before freeing the memory for the object. It is passed a pointer to the user-defined data of the object. | |
| typedef int( | ao2_hash_fn )(const void *obj, const int flags) |
Enumerations | |
| enum | _cb_results { CMP_MATCH = 0x1, CMP_STOP = 0x2 } |
| A callback function will return a combination of CMP_MATCH and CMP_STOP. The latter will terminate the search in a container. More... | |
| enum | ao2_iterator_flags { AO2_ITERATOR_DONTLOCK = (1 << 0), AO2_ITERATOR_MALLOCD = (1 << 1), AO2_ITERATOR_UNLINK = (1 << 2) } |
| enum | search_flags { OBJ_UNLINK = (1 << 0), OBJ_NODATA = (1 << 1), OBJ_MULTIPLE = (1 << 2), OBJ_POINTER = (1 << 3), OBJ_CONTINUE = (1 << 4) } |
| Flags passed to ao2_callback() and ao2_hash_fn() to modify its behaviour. More... | |
Functions | |
| void * | __ao2_callback_data (struct ao2_container *c, enum search_flags flags, ao2_callback_data_fn *cb_fn, void *arg, void *data) |
| void * | __ao2_callback_data_debug (struct ao2_container *c, enum search_flags flags, ao2_callback_data_fn *cb_fn, void *arg, void *data, char *tag, char *file, int line, const char *funcname) |
| void * | __ao2_find (struct ao2_container *c, void *arg, enum search_flags flags) |
| void * | __ao2_find_debug (struct ao2_container *c, void *arg, enum search_flags flags, char *tag, char *file, int line, const char *funcname) |
| void * | __ao2_iterator_next (struct ao2_iterator *a) |
| void * | __ao2_iterator_next_debug (struct ao2_iterator *a, char *tag, char *file, int line, const char *funcname) |
| int | __ao2_lock (void *a, const char *file, const char *func, int line, const char *var) |
| Lock an object. | |
| int | __ao2_trylock (void *a, const char *file, const char *func, int line, const char *var) |
| Try locking-- (don't block if fail) | |
| int | __ao2_unlock (void *a, const char *file, const char *func, int line, const char *var) |
| Unlock an object. | |
| void | ao2_bt (void) |
| void | ao2_iterator_destroy (struct ao2_iterator *i) |
| Destroy a container iterator. | |
| struct ao2_iterator | ao2_iterator_init (struct ao2_container *c, int flags) |
| Create an iterator for a container. | |
| void * | ao2_object_get_lockaddr (void *obj) |
| Return the lock address of an object. | |
Variables | |
| ao2_callback_fn | ao2_match_by_addr |
| a very common callback is one that matches by address. | |
| #define | ao2_t_alloc(data_size, destructor_fn, debug_msg) __ao2_alloc((data_size), (destructor_fn)) |
| Allocate and initialize an object. | |
| #define | ao2_alloc(data_size, destructor_fn) __ao2_alloc((data_size), (destructor_fn)) |
| void * | __ao2_alloc_debug (const size_t data_size, ao2_destructor_fn destructor_fn, char *tag, const char *file, int line, const char *funcname, int ref_debug) |
| void * | __ao2_alloc (const size_t data_size, ao2_destructor_fn destructor_fn) |
| #define | ao2_t_ref(o, delta, tag) __ao2_ref((o), (delta)) |
| Reference/unreference an object and return the old refcount. | |
| #define | ao2_ref(o, delta) __ao2_ref((o), (delta)) |
| int | __ao2_ref_debug (void *o, int delta, char *tag, char *file, int line, const char *funcname) |
| int | __ao2_ref (void *o, int delta) |
Object Containers | |
| #define | ao2_t_container_alloc(arg1, arg2, arg3, arg4) __ao2_container_alloc((arg1), (arg2), (arg3)) |
| Allocate and initialize a container with the desired number of buckets. | |
| #define | ao2_container_alloc(arg1, arg2, arg3) __ao2_container_alloc((arg1), (arg2), (arg3)) |
| struct ao2_container * | __ao2_container_alloc (const unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_callback_fn *cmp_fn) |
| struct ao2_container * | __ao2_container_alloc_debug (const unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_callback_fn *cmp_fn, char *tag, char *file, int line, const char *funcname, int ref_debug) |
| int | ao2_container_count (struct ao2_container *c) |
| Returns the number of elements in a container. | |
Object Management | |
Here we have functions to manage objects. We can use the functions below on any kind of object defined by the user. | |
| #define | ao2_t_link(arg1, arg2, arg3) __ao2_link((arg1), (arg2)) |
| Add an object to a container. | |
| #define | ao2_link(arg1, arg2) __ao2_link((arg1), (arg2)) |
| #define | ao2_t_unlink(arg1, arg2, arg3) __ao2_unlink((arg1), (arg2)) |
| Remove an object from a container. | |
| #define | ao2_unlink(arg1, arg2) __ao2_unlink((arg1), (arg2)) |
| void * | __ao2_link_debug (struct ao2_container *c, void *new_obj, char *tag, char *file, int line, const char *funcname) |
| void * | __ao2_link (struct ao2_container *c, void *newobj) |
| void * | __ao2_unlink_debug (struct ao2_container *c, void *obj, char *tag, char *file, int line, const char *funcname) |
| void * | __ao2_unlink (struct ao2_container *c, void *obj) |
| #define | ao2_t_callback(c, flags, cb_fn, arg, tag) __ao2_callback((c), (flags), (cb_fn), (arg)) |
| ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below. | |
| #define | ao2_callback(c, flags, cb_fn, arg) __ao2_callback((c), (flags), (cb_fn), (arg)) |
| void * | __ao2_callback_debug (struct ao2_container *c, enum search_flags flags, ao2_callback_fn *cb_fn, void *arg, char *tag, char *file, int line, const char *funcname) |
| void * | __ao2_callback (struct ao2_container *c, enum search_flags flags, ao2_callback_fn *cb_fn, void *arg) |
Object Model implementing objects and containers.
Definition in file astobj2.h.
| #define ao2_alloc | ( | data_size, | |
| destructor_fn | |||
| ) | __ao2_alloc((data_size), (destructor_fn)) |
Definition at line 419 of file astobj2.h.
Referenced by join_conference_bridge(), conf_run(), create_queue_member(), try_calling(), inprocess_count(), multiplexed_bridge_create(), ast_bridge_new(), parse_apps(), build_device(), new_iax(), peercnt_add(), build_callno_limits(), add_calltoken_ignore(), create_callno_pools(), build_peer(), build_user(), local_alloc(), chan_list_init(), create_esc_entry(), sip_monitor_instance_init(), sip_threadinfo_create(), sip_tcptls_write(), sip_prepare_socket(), __ast_channel_alloc_ap(), ast_dummy_channel_alloc(), set_fn(), data_provider_new(), data_search_alloc(), data_result_create(), data_filter_alloc(), alloc_event_ref(), create_parkinglot(), get_filestream(), dialgroup_write(), ast_register_indication(), ast_tone_zone_alloc(), build_mansession(), xml_translate(), ast_extension_state_add(), ast_add_hint(), realtime_common(), build_calendar(), ast_calendar_event_alloc(), calendar_query_exec(), caldav_load_calendar(), ewscal_load_calendar(), exchangecal_load_calendar(), ical_load_calendar(), load_config(), session_details_new(), fax_session_reserve(), fax_session_new(), _moh_class_malloc(), load_odbc_config(), _ast_odbc_request_obj2(), build_route(), build_profile(), kqueue_timer_open(), pthread_timer_open(), timerfd_timer_open(), ast_rtp_instance_new(), ast_taskprocessor_get(), ast_tcptls_server_root(), and ast_tcptls_client_create().
| #define ao2_callback | ( | c, | |
| flags, | |||
| cb_fn, | |||
| arg | |||
| ) | __ao2_callback((c), (flags), (cb_fn), (arg)) |
Definition at line 899 of file astobj2.h.
Referenced by conf_run(), admin_exec(), channel_admin_exec(), meetme_data_provider_get(), reload_single_queue(), reload_queues(), multiplexed_bridge_create(), handle_cli_status(), do_reload(), load_config(), calltoken_required(), set_peercnt_limit(), delete_users(), set_config_destroy(), reload_config(), load_module(), cc_handle_publish_error(), handle_response_subscribe(), handle_cc_notify(), sip_tcp_locate(), ast_begin_shutdown(), ast_event_dump_cache(), event_update_cache(), event_dump_cache(), ast_unregister_indication_country(), load_indications(), ast_extension_state_del(), destroy_hint(), ast_merge_contexts_and_delete(), cleanup(), calendar_is_busy(), ast_calendar_unregister(), ast_calendar_clear_events(), ast_calendar_merge_events(), reload(), unload_module(), caldav_destructor(), ewscal_destructor(), exchangecal_destructor(), icalendar_destructor(), _ast_odbc_request_obj2(), and do_timing().
| #define ao2_callback_data | ( | arg1, | |
| arg2, | |||
| arg3, | |||
| arg4, | |||
| arg5 | |||
| ) | __ao2_callback_data((arg1), (arg2), (arg3), (arg4), (arg5)) |
Definition at line 932 of file astobj2.h.
Referenced by ast_channel_callback().
| #define ao2_container_alloc | ( | arg1, | |
| arg2, | |||
| arg3 | |||
| ) | __ao2_container_alloc((arg1), (arg2), (arg3)) |
Definition at line 723 of file astobj2.h.
Referenced by load_module(), build_conf(), init_queue(), ast_cel_engine_init(), create_callno_pools(), load_objects(), initialize_escs(), ast_channels_init(), ast_config_text_file_save(), data_provider_new(), data_search_alloc(), data_result_create(), data_filter_alloc(), ast_data_init(), ast_event_init(), ast_features_init(), dialgroup_write(), get_lock(), ast_indications_init(), build_mansession(), xml_translate(), __init_manager(), ast_add_hint(), ast_pbx_init(), build_calendar(), ast_calendar_event_container_alloc(), load_odbc_config(), sig_pri_load(), and ast_tps_init().
| #define ao2_find | ( | arg1, | |
| arg2, | |||
| arg3 | |||
| ) | __ao2_find((arg1), (arg2), (arg3)) |
Definition at line 953 of file astobj2.h.
Referenced by join_conference_bridge(), conf_run(), find_user(), admin_exec(), meetmemute(), compare_weight(), update_queue(), remove_from_queue(), reload_single_member(), inprocess_count(), ast_cel_report_event(), find_pvt(), find_peer(), iax2_destroy_helper(), peercnt_modify(), peercnt_add(), peercnt_remove_by_addr(), build_callno_limits(), add_calltoken_ignore(), get_unused_callno(), sched_delay_remove(), __find_callno(), handle_cli_iax2_unregister(), authenticate_request(), authenticate_verify(), build_peer(), build_user(), get_esc_entry(), sip_poke_peer_s(), channel_iterator_search(), ast_channel_get_full(), set_fn(), data_provider_find(), data_search_find(), data_result_find_child(), data_filter_find(), ast_event_get_cached(), find_parkinglot(), dialgroup_read(), dialgroup_write(), ast_get_indication_zone(), ast_unregister_indication_country(), complete_indications(), handle_cli_indication_show(), parse_tone_zone(), check_manager_session_inuse(), xml_translate(), ast_extension_state_add(), find_hint_by_cb_id(), ast_extension_state_del(), ast_remove_hint(), ast_add_hint(), ast_change_hint(), ast_merge_contexts_and_delete(), realtime_common(), find_calendar(), find_event(), cli_alias_passthrough(), cli_fax_show_session(), find_profile(), phoneprov_callback(), _lookup_timer(), find_timer(), timerfd_timer_close(), timerfd_timer_set_rate(), timerfd_timer_ack(), timerfd_timer_enable_continuous(), timerfd_timer_disable_continuous(), timerfd_timer_get_event(), and ast_taskprocessor_get().
| #define ao2_iterator_next | ( | arg1 | ) | __ao2_iterator_next((arg1)) |
Definition at line 1115 of file astobj2.h.
Referenced by ast_var_indications(), ast_var_indications_table(), complete_meetmecmd(), meetme_show_cmd(), conf_queue_dtmf(), conf_run(), action_meetmelist(), get_member_status(), handle_statechange(), extension_state_cb(), clear_queue(), rt_handle_member_record(), free_members(), find_queue_by_name_rt(), update_realtime_members(), num_available_members(), try_calling(), interface_exists(), dump_queue_members(), queue_function_qac(), queue_function_qac_dep(), queue_function_queuememberlist(), __queues_show(), manager_queues_summary(), manager_queues_status(), complete_queue_remove_member(), queues_data_provider_get_helper(), queues_data_provider_get(), cli_list_devices(), cli_console_active(), destroy_pvts(), stop_streams(), iax2_getpeername(), handle_cli_iax2_show_callno_limits(), complete_iax2_peers(), iax2_getpeertrunk(), handle_cli_iax2_show_users(), __iax2_show_peers(), complete_iax2_unregister(), manager_iax2_show_peer_list(), check_access(), authenticate_reply(), prune_users(), prune_peers(), poke_all_peers(), peers_data_provider_get(), users_data_provider_get(), local_devicestate(), locals_show(), manager_optimize_away(), unload_module(), find_call(), ast_channel_iterator_next(), data_provider_release_all(), __ast_data_search_cmp_structure(), ast_data_search_match(), data_filter_find(), data_result_generate_node(), data_get_xml_add_child(), ast_data_iterator_next(), __data_result_print_cli(), data_provider_print_cli(), data_result_manager_output(), do_parking_thread(), build_dialplan_useage_map(), handle_feature_show(), handle_parkedcalls(), manager_parking_status(), dialgroup_read(), complete_country(), handle_cli_indication_show(), handle_showmanconn(), authenticate(), purge_sessions(), __ast_manager_event_multichan(), find_session(), find_session_by_nonce(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), handle_show_hints(), complete_core_show_hint(), handle_show_hint(), ast_merge_contexts_and_delete(), hints_data_provider_get(), calendar_query_exec(), handle_show_calendars(), handle_show_calendar(), alias_show(), fax_session_tab_complete(), cli_fax_show_sessions(), moh_rescan_files(), handle_cli_odbc_show(), data_odbc_provider_handler(), reload(), delete_users(), delete_routes(), delete_profiles(), pp_each_user_helper(), handle_show_routes(), ast_srtp_unprotect(), tps_taskprocessor_tab_complete(), and cli_tps_report().
| #define ao2_link | ( | arg1, | |
| arg2 | |||
| ) | __ao2_link((arg1), (arg2)) |
Definition at line 774 of file astobj2.h.
Referenced by join_conference_bridge(), conf_run(), rt_handle_member_record(), add_to_queue(), reload_single_member(), inprocess_count(), multiplexed_bridge_create(), parse_apps(), build_device(), store_by_transfercallno(), store_by_peercallno(), peercnt_add(), build_callno_limits(), add_calltoken_ignore(), replace_callno(), create_callno_pools(), realtime_peer(), realtime_user(), set_config(), local_alloc(), create_new_sip_etag(), sip_monitor_instance_init(), __ast_channel_alloc_ap(), ast_change_name(), ast_do_masquerade(), set_fn(), data_provider_add_child(), data_search_add_child(), data_result_add_child(), data_filter_add_child(), event_update_cache(), create_dynamic_parkinglot(), build_parkinglot(), dialgroup_write(), get_lock(), ast_register_indication_country(), build_mansession(), xml_translate(), ast_extension_state_add(), ast_add_hint(), ast_change_hint(), ast_merge_contexts_and_delete(), realtime_common(), build_calendar(), add_new_event_cb(), caldav_add_event(), endelm(), parse_tag(), icalendar_add_event(), load_config(), fax_session_new(), odbc_register_class(), _ast_odbc_request_obj2(), build_route(), build_profile(), kqueue_timer_open(), pthread_timer_open(), timerfd_timer_open(), ast_taskprocessor_get(), and ast_taskprocessor_unreference().
| #define ao2_lock | ( | a | ) | __ao2_lock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
Definition at line 477 of file astobj2.h.
Referenced by play_prompt_to_channel(), post_join_marked(), post_join_unmarked(), join_conference_bridge(), leave_conference_bridge(), menu_callback(), conf_run(), set_queue_variables(), get_member_status(), handle_statechange(), extension_state_cb(), find_queue_by_name_rt(), load_realtime_queue(), update_realtime_members(), join_queue(), recalc_holdtime(), leave_queue(), compare_weight(), ring_entry(), record_abandoned(), is_our_turn(), update_queue(), try_calling(), remove_from_queue(), add_to_queue(), set_member_paused(), set_member_penalty(), get_member_penalty(), reload_queue_members(), queue_function_var(), queue_function_qac(), queue_function_qac_dep(), queue_function_queuewaitingcount(), queue_function_queuememberlist(), reload_single_queue(), reload_queues(), clear_stats(), __queues_show(), manager_queues_summary(), manager_queues_status(), complete_queue_remove_member(), queues_data_provider_get(), inprocess_count(), internal_ao2_link(), internal_ao2_callback(), internal_ao2_iterator_next(), attended_abort_transfer(), multiplexed_bridge_create(), multiplexed_bridge_destroy(), multiplexed_thread_function(), multiplexed_add_or_remove(), softmix_bridge_thread(), generic_thread_loop(), bridge_thread(), ast_bridge_destroy(), smart_bridge_operation(), bridge_channel_join_multithreaded(), bridge_channel_join_singlethreaded(), bridge_channel_join(), ast_bridge_depart(), ast_bridge_remove(), ast_bridge_merge(), ast_bridge_suspend(), ast_bridge_unsuspend(), ast_bridge_dtmf_stream(), peercnt_add(), peercnt_remove(), build_callno_limits(), add_calltoken_ignore(), get_unused_callno(), replace_callno(), awesome_locking(), local_setoption(), local_bridgedchannel(), local_queryoption(), local_queue_frame(), local_answer(), check_bridge(), local_write(), local_fixup(), local_indicate(), local_digit_begin(), local_digit_end(), local_sendtext(), local_sendhtml(), local_call(), locals_show(), manager_optimize_away(), handle_cli_misdn_send_facility(), sip_tcptls_write(), _sip_tcp_helper_thread(), create_addr_from_peer(), update_call_counter(), mwi_event_cb(), register_verify(), sip_show_inuse(), sip_show_users(), _sip_show_peers(), sip_prune_realtime(), _sip_show_peer(), complete_sip_user(), sip_show_user(), build_reply_digest(), handle_request_subscribe(), build_peer(), sip_poke_all_peers(), peers_data_provider_get(), ast_hangup(), ast_do_masquerade(), event_update_cache(), build_parkinglot(), ast_set_indication_country(), ast_get_indication_zone(), ast_get_indication_tone(), ast_register_indication_country(), ast_unregister_indication_country(), load_indications(), handle_showmanconn(), set_eventmask(), action_waitevent(), process_events(), get_input(), session_do(), purge_sessions(), __ast_manager_event_multichan(), find_session(), find_session_by_nonce(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), generic_http_callback(), auth_http_callback(), ast_extension_state_add(), ast_extension_state_del(), ast_remove_hint(), ast_add_hint(), ast_change_hint(), handle_show_hints(), complete_core_show_hint(), handle_show_hint(), ast_merge_contexts_and_delete(), calendar_destructor(), schedule_calendar_event(), generic_fax_exec(), cli_fax_show_sessions(), spandsp_fax_cli_show_session(), monmp3thread(), mohalloc(), moh_release(), pthread_timer_open(), pthread_timer_set_rate(), pthread_timer_ack(), pthread_timer_enable_continuous(), pthread_timer_disable_continuous(), pthread_timer_get_event(), run_timer(), timerfd_timer_set_rate(), timerfd_timer_ack(), timerfd_timer_enable_continuous(), timerfd_timer_disable_continuous(), timerfd_timer_get_event(), ast_taskprocessor_get(), and ast_taskprocessor_unreference().
| #define ao2_ref | ( | o, | |
| delta | |||
| ) | __ao2_ref((o), (delta)) |
Definition at line 461 of file astobj2.h.
Referenced by join_conference_bridge(), leave_conference_bridge(), unload_module(), load_module(), app_exec(), build_conf(), complete_meetmecmd(), meetme_show_cmd(), conf_free(), conf_queue_dtmf(), announce_thread(), conf_run(), admin_exec(), channel_admin_exec(), meetmemute(), action_meetmelist(), queue_ref(), queue_unref(), get_member_status(), handle_statechange(), extension_state_cb(), clear_queue(), rt_handle_member_record(), free_members(), destroy_queue(), find_queue_by_name_rt(), update_realtime_members(), callattempt_free(), num_available_members(), compare_weight(), update_queue(), end_bridge_callback_data_fixup(), end_bridge_callback(), try_calling(), interface_exists(), dump_queue_members(), remove_from_queue(), add_to_queue(), set_member_paused(), set_member_penalty(), get_member_penalty(), queue_function_qac(), queue_function_qac_dep(), queue_function_queuememberlist(), reload_single_member(), __queues_show(), manager_queues_summary(), manager_queues_status(), complete_queue_remove_member(), queues_data_provider_get_helper(), inprocess_count(), internal_ao2_callback(), ao2_iterator_init(), ao2_iterator_destroy(), multiplexed_bridge_create(), multiplexed_bridge_destroy(), multiplexed_thread_function(), multiplexed_add_or_remove(), bridge_thread(), ast_bridge_new(), ast_bridge_destroy(), bridge_channel_join(), ast_bridge_join(), bridge_channel_thread(), ast_bridge_impart(), ast_bridge_merge(), parse_apps(), ast_cel_report_event(), ast_cel_engine_term(), ast_cel_engine_init(), ref_pvt(), unref_pvt(), gtalk_get_rtp_peer(), oh323_get_rtp_peer(), peer_ref(), peer_unref(), user_ref(), user_unref(), new_iax(), calltoken_required(), set_peercnt_limit(), peercnt_modify(), peercnt_add(), peercnt_remove_cb(), peercnt_remove_by_addr(), build_callno_limits(), add_calltoken_ignore(), handle_cli_iax2_show_callno_limits(), replace_callno(), create_callno_pools(), sched_delay_remove(), __find_callno(), iax2_destroy(), handle_cli_iax2_set_debug(), __unload_module(), load_objects(), jingle_get_rtp_peer(), local_setoption(), local_devicestate(), local_answer(), local_write(), local_indicate(), local_digit_begin(), local_digit_end(), local_sendtext(), local_sendhtml(), local_call(), local_hangup(), local_request(), locals_show(), manager_optimize_away(), mgcp_get_rtp_peer(), chan_list_destructor(), misdn_attempt_transfer(), cb_events(), publish_expire(), create_esc_entry(), destroy_escs(), sip_monitor_instance_init(), sip_cc_monitor_suspend(), sip_handle_cc(), dialog_ref_debug(), dialog_unref_debug(), _sip_tcp_helper_thread(), ref_proxy(), sip_destroy_peer(), copy_socket_data(), __sip_destroy(), add_cc_call_info_to_response(), transmit_publish(), set_socket_transport(), expire_register(), get_destination(), parse_moved_contact(), cc_handle_publish_error(), handle_cc_notify(), cc_esc_publish_handler(), handle_sip_publish_initial(), handle_sip_publish_refresh(), handle_sip_publish_modify(), handle_sip_publish_remove(), handle_cc_subscribe(), sip_tcp_locate(), sip_prepare_socket(), sip_get_rtp_peer(), sip_get_vrtp_peer(), sip_get_trtp_peer(), peers_data_provider_get(), skinny_get_vrtp_peer(), skinny_get_rtp_peer(), unistim_get_rtp_peer(), set_fn(), ast_config_text_file_save(), data_provider_destructor(), data_provider_new(), data_provider_find(), data_provider_release(), data_provider_release_all(), data_provider_create(), __ast_data_register(), data_search_destructor(), data_search_alloc(), data_search_find(), data_search_create(), data_search_release(), data_search_get_node(), data_search_cmp_string(), data_search_cmp_ptr(), data_search_cmp_ipaddr(), data_search_cmp_bool(), data_search_cmp_dbl(), data_search_cmp_uint(), data_search_cmp_int(), data_search_cmp_char(), __ast_data_search_cmp_structure(), data_result_destructor(), data_result_create(), data_result_find_child(), ast_data_search_match(), data_result_get_node(), data_filter_destructor(), data_filter_alloc(), data_filter_release(), data_filter_find(), data_filter_add_nodes(), data_filter_generate(), data_result_generate_node(), data_result_generate(), data_get_xml_add_child(), __ast_data_add(), ast_data_free(), ast_data_iterator_end(), ast_data_iterator_next(), __data_result_print_cli(), data_provider_print_cli(), data_result_manager_output(), ast_event_get_cached(), event_update_cache(), handle_event(), ast_event_queue(), do_parking_thread(), copy_parkinglot(), parkinglot_unref(), parkinglot_addref(), build_dialplan_useage_map(), handle_feature_show(), handle_parkedcalls(), manager_parking_status(), ast_closestream(), group_destroy(), dialgroup_read(), dialgroup_write(), httpd_helper_thread(), ast_tone_zone_unref(), ast_tone_zone_ref(), ast_tone_zone_sound_unref(), ast_tone_zone_sound_ref(), unref_mansession(), build_mansession(), session_do(), xml_translate(), ast_extension_state_add(), find_hint_by_cb_id(), ast_extension_state_del(), destroy_hint(), ast_remove_hint(), ast_add_hint(), ast_change_hint(), handle_show_hints(), complete_core_show_hint(), handle_show_hint(), ast_merge_contexts_and_delete(), hints_data_provider_get(), realtime_common(), unref_calendar(), ast_calendar_unref_event(), calendar_destructor(), eventlist_destructor(), event_notification_duplicate(), do_notify(), calendar_event_notify(), calendar_devstate_change(), add_event_to_list(), eventlist_destroy(), eventlist_duplicate(), caldav_destructor(), unref_caldav(), ewscal_destructor(), unref_ewscal(), exchangecal_destructor(), unref_exchangecal(), icalendar_destructor(), unref_icalendar(), cli_alias_passthrough(), alias_show(), load_config(), destroy_callback(), find_details(), session_details_new(), find_or_create_details(), destroy_session(), fax_session_reserve(), fax_session_new(), generic_fax_exec(), receivefax_exec(), sendfax_exec(), fax_session_tab_complete(), cli_fax_show_session(), cli_fax_show_sessions(), acf_faxopt_read(), acf_faxopt_write(), moh_rescan_files(), odbc_class_destructor(), odbc_obj_destructor(), load_odbc_config(), handle_cli_odbc_show(), odbc_release_obj2(), _ast_odbc_request_obj2(), data_odbc_provider_handler(), reload(), unref_profile(), unref_route(), unref_user(), kqueue_timer_open(), kqueue_timer_close(), kqueue_timer_set_rate(), kqueue_timer_enable_continuous(), kqueue_timer_disable_continuous(), kqueue_timer_get_event(), pthread_timer_open(), pthread_timer_close(), pthread_timer_set_rate(), pthread_timer_ack(), pthread_timer_enable_continuous(), pthread_timer_disable_continuous(), pthread_timer_get_event(), timerfd_timer_open(), timerfd_timer_close(), timerfd_timer_set_rate(), timerfd_timer_ack(), timerfd_timer_enable_continuous(), timerfd_timer_disable_continuous(), timerfd_timer_get_event(), ast_rtp_instance_destroy(), ast_rtp_instance_new(), unref_instance_cond(), ast_rtp_instance_make_compatible(), sig_pri_cc_generic_check(), sig_pri_handle_cis_subcmds(), sig_pri_handle_subcmds(), sig_pri_call(), sig_pri_unload(), tps_taskprocessor_tab_complete(), cli_tps_ping(), cli_tps_report(), ast_taskprocessor_get(), ast_taskprocessor_unreference(), handle_tcptls_connection(), ast_tcptls_server_root(), ast_tcptls_client_start(), and ast_tcptls_client_create().
| #define ao2_t_alloc | ( | data_size, | |
| destructor_fn, | |||
| debug_msg | |||
| ) | __ao2_alloc((data_size), (destructor_fn)) |
Allocate and initialize an object.
| data_size | The sizeof() of the user-defined structure. |
| destructor_fn | The destructor function (can be NULL) |
| debug_msg |
Allocates a struct astobj2 with sufficient space for the user-defined structure.
Definition at line 418 of file astobj2.h.
Referenced by alloc_queue(), create_new_generic_list(), cc_extension_monitor_init(), cc_interfaces_datastore_init(), cc_device_monitor_init(), cc_agent_init(), cc_core_init_instance(), create_epa_entry(), sip_alloc(), add_realm_authentication(), temp_peer(), build_peer(), __init_manager(), and ast_srtp_policy_alloc().
| #define ao2_t_callback | ( | c, | |
| flags, | |||
| cb_fn, | |||
| arg, | |||
| tag | |||
| ) | __ao2_callback((c), (flags), (cb_fn), (arg)) |
ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below.
| c | A pointer to the container to operate on. |
| flags | A set of flags specifying the operation to perform, partially used by the container code, but also passed to the callback.
|
| cb_fn | A function pointer, that will be called on all objects, to see if they match. This function returns CMP_MATCH if the object is matches the criteria; CMP_STOP if the traversal should immediately stop, or both (via bitwise ORing), if you find a match and want to end the traversal, and 0 if the object is not a match, but the traversal should continue. This is the function that is applied to each object traversed. Its arguments are: (void *obj, void *arg, int flags), where: obj is an object arg is the same as arg passed into ao2_callback flags is the same as flags passed into ao2_callback (flags are also used by ao2_callback). |
| arg | passed to the callback. |
| tag | used for debuging. |
If the function returns any objects, their refcount is incremented, and the caller is in charge of decrementing them once done.
Typically, ao2_callback() is used for two purposes:
This function searches through a container and performs operations on objects according on flags passed. XXX describe better The comparison is done calling the compare function set implicitly. The p pointer can be a pointer to an object or to a key, we can say this looking at flags value. If p points to an object we will search for the object pointed by this value, otherwise we serch for a key value. If the key is not unique we only find the first matching valued.
The use of flags argument is the follow:
OBJ_UNLINK unlinks the object found OBJ_NODATA on match, do return an object Callbacks use OBJ_NODATA as a default functions such as find() do OBJ_MULTIPLE return multiple matches Default is no. OBJ_POINTER the pointer is an object pointer
Definition at line 898 of file astobj2.h.
Referenced by ast_cc_agent_callback(), ast_cc_monitor_count(), cc_cli_output_status(), handle_cc_kill(), unlink_peers_from_tables(), find_call(), sip_show_objects(), sip_show_channelstats(), sip_show_channels(), do_monitor(), reload_config(), load_config(), session_destructor(), __init_manager(), get_mohbydigit(), load_moh_classes(), ast_moh_destroy(), unload_module(), and ast_srtp_destroy().
| #define ao2_t_callback_data | ( | arg1, | |
| arg2, | |||
| arg3, | |||
| arg4, | |||
| arg5, | |||
| arg6 | |||
| ) | __ao2_callback_data((arg1), (arg2), (arg3), (arg4), (arg5)) |
ao2_callback_data() is a generic function that applies cb_fn() to all objects in a container. It is functionally identical to ao2_callback() except that instead of taking an ao2_callback_fn *, it takes an ao2_callback_data_fn *, and allows the caller to pass in arbitrary data.
This call would be used instead of ao2_callback() when the caller needs to pass OBJ_POINTER as part of the flags argument (which in turn requires passing in a prototype ao2 object for 'arg') and also needs access to other non-global data to complete it's comparison or task.
See the documentation for ao2_callback() for argument descriptions.
Definition at line 931 of file astobj2.h.
Referenced by count_agents(), kill_duplicate_offers(), ccreq_exec(), cccancel_exec(), find_peer(), and match_filter().
| #define ao2_t_container_alloc | ( | arg1, | |
| arg2, | |||
| arg3, | |||
| arg4 | |||
| ) | __ao2_container_alloc((arg1), (arg2), (arg3)) |
Allocate and initialize a container with the desired number of buckets.
We allocate space for a struct astobj_container, struct container and the buckets[] array.
| arg1 | Number of buckets for hash |
| arg2 | Pointer to a function computing a hash value. |
| arg3 | Pointer to a function comparating key-value with a string. (can be NULL) |
| arg4 |
Definition at line 722 of file astobj2.h.
Referenced by ast_cc_init(), load_module(), and res_srtp_new().
| #define ao2_t_find | ( | arg1, | |
| arg2, | |||
| arg3, | |||
| arg4 | |||
| ) | __ao2_find((arg1), (arg2), (arg3)) |
ao2_find() is a short hand for ao2_callback(c, flags, c->cmp_fn, arg) XXX possibly change order of arguments ?
Definition at line 952 of file astobj2.h.
Referenced by find_queue_by_name_rt(), load_realtime_queue(), remove_from_queue(), get_member_penalty(), reload_queue_members(), queue_function_var(), queue_function_queuewaitingcount(), queue_function_queuememberlist(), reload_single_queue(), find_cc_core_instance(), find_generic_monitor_instance_list(), sip_tcptls_write(), _sip_tcp_helper_thread(), find_peer(), find_call(), get_sip_pvt_byid_locked(), sip_prune_realtime(), build_peer(), and find_policy().
| #define ao2_t_iterator_next | ( | arg1, | |
| arg2 | |||
| ) | __ao2_iterator_next((arg1)) |
Definition at line 1114 of file astobj2.h.
Referenced by handle_statechange(), extension_state_cb(), compare_weight(), update_queue(), set_member_paused(), set_member_penalty(), clear_stats(), __queues_show(), complete_queue(), manager_queues_summary(), manager_queues_status(), complete_queue_remove_member(), unload_module(), complete_core_id(), sip_show_inuse(), sip_show_tcp(), sip_show_users(), _sip_show_peers(), sip_prune_realtime(), complete_sip_user(), complete_sipch(), complete_sip_peer(), complete_sip_registered_peer(), sip_show_channel(), sip_show_history(), sip_poke_all_peers(), handle_cli_moh_show_files(), and handle_cli_moh_show_classes().
| #define ao2_t_link | ( | arg1, | |
| arg2, | |||
| arg3 | |||
| ) | __ao2_link((arg1), (arg2)) |
Add an object to a container.
| arg1 | the container to operate on. |
| arg2 | the object to be added. |
| arg3 | used for debuging. |
| NULL | on errors. |
| newobj | on success. |
This function inserts an object in a container according its key.
Definition at line 773 of file astobj2.h.
Referenced by create_new_generic_list(), cc_core_init_instance(), sip_threadinfo_create(), realtime_peer(), create_addr_from_peer(), sip_alloc(), parse_register_contact(), register_verify(), sip_prune_realtime(), sip_send_mwi_to_peer(), sip_poke_peer(), sip_request_call(), reload_config(), authenticate(), __init_manager(), _moh_register(), ast_srtp_create(), and ast_srtp_add_stream().
| #define ao2_t_ref | ( | o, | |
| delta, | |||
| tag | |||
| ) | __ao2_ref((o), (delta)) |
Reference/unreference an object and return the old refcount.
| o | A pointer to the object |
| delta | Value to add to the reference counter. |
| tag | used for debugging |
Increase/decrease the reference counter according the value of delta.
If the refcount goes to zero, the object is destroyed.
Definition at line 460 of file astobj2.h.
Referenced by cc_ref(), cc_unref(), sip_monitor_instance_destructor(), sip_cc_monitor_request_cc(), sip_cc_monitor_cancel_available_timer(), sip_threadinfo_destructor(), sip_threadinfo_create(), sip_tcptls_write(), _sip_tcp_helper_thread(), unref_peer(), ref_peer(), sip_destroy_peer(), create_addr_from_peer(), sip_call(), __sip_destroy(), sip_alloc(), check_peer_ok(), sip_show_tcp(), peer_dump_func(), dialog_dump_func(), _sip_show_peer(), sip_show_settings(), sip_show_channel(), sip_show_history(), build_reply_digest(), local_attended_transfer(), handle_request_do(), sip_tcp_locate(), sip_prepare_socket(), temp_peer(), build_peer(), reload_config(), unload_module(), session_destructor(), authenticate(), __init_manager(), ast_srtp_policy_destroy(), ast_srtp_unprotect(), ast_srtp_destroy(), ast_srtp_add_stream(), and ast_srtp_change_source().
| #define ao2_t_unlink | ( | arg1, | |
| arg2, | |||
| arg3 | |||
| ) | __ao2_unlink((arg1), (arg2)) |
Remove an object from a container.
| arg1 | the container |
| arg2 | the object to unlink |
| arg3 | tag for debugging |
| NULL,always |
Definition at line 805 of file astobj2.h.
Referenced by cc_generic_monitor_destructor(), cc_complete(), cc_failed(), _sip_tcp_helper_thread(), unlink_peer_from_tables(), dialog_unlink_all(), create_addr_from_peer(), expire_register(), parse_register_contact(), sip_prune_realtime(), sip_prepare_socket(), sip_send_mwi_to_peer(), sip_poke_peer(), and sip_request_call().
| #define ao2_trylock | ( | a | ) | __ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
Definition at line 495 of file astobj2.h.
Referenced by caldav_load_calendar(), ewscal_load_calendar(), exchangecal_load_calendar(), and ical_load_calendar().
| #define ao2_unlink | ( | arg1, | |
| arg2 | |||
| ) | __ao2_unlink((arg1), (arg2)) |
Definition at line 806 of file astobj2.h.
Referenced by leave_conference_bridge(), conf_run(), free_members(), find_queue_by_name_rt(), update_realtime_members(), remove_from_queue(), multiplexed_bridge_destroy(), destroy_pvts(), remove_by_transfercallno(), remove_by_peercallno(), peercnt_remove(), handle_cli_iax2_prune_realtime(), unlink_peer(), build_user(), prune_users(), local_hangup(), local_request(), publish_expire(), create_new_sip_etag(), sip_cc_monitor_destructor(), handle_sip_publish_remove(), ast_channel_release(), ast_hangup(), ast_change_name(), ast_do_masquerade(), data_provider_release(), data_provider_release_all(), ast_data_remove_node(), dialgroup_write(), get_lock(), ast_unregister_indication_country(), session_destroy(), build_calendar(), merge_events_cb(), generic_fax_exec(), reload(), delete_users(), delete_routes(), delete_profiles(), kqueue_timer_close(), timerfd_timer_close(), and ast_taskprocessor_unreference().
| #define ao2_unlock | ( | a | ) | __ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
Definition at line 486 of file astobj2.h.
Referenced by play_prompt_to_channel(), post_join_marked(), post_join_unmarked(), join_conference_bridge(), leave_conference_bridge(), menu_callback(), conf_run(), set_queue_variables(), get_member_status(), handle_statechange(), extension_state_cb(), find_queue_by_name_rt(), load_realtime_queue(), update_realtime_members(), join_queue(), recalc_holdtime(), leave_queue(), compare_weight(), ring_entry(), record_abandoned(), is_our_turn(), update_queue(), try_calling(), remove_from_queue(), add_to_queue(), set_member_paused(), set_member_penalty(), get_member_penalty(), reload_queue_members(), queue_function_var(), queue_function_qac(), queue_function_qac_dep(), queue_function_queuewaitingcount(), queue_function_queuememberlist(), reload_single_queue(), reload_queues(), clear_stats(), __queues_show(), manager_queues_summary(), manager_queues_status(), complete_queue_remove_member(), queues_data_provider_get(), inprocess_count(), __ao2_link_debug(), __ao2_link(), internal_ao2_callback(), __ao2_iterator_next_debug(), __ao2_iterator_next(), attended_abort_transfer(), multiplexed_bridge_create(), multiplexed_bridge_destroy(), multiplexed_thread_function(), multiplexed_add_or_remove(), softmix_bridge_thread(), generic_thread_loop(), bridge_thread(), ast_bridge_destroy(), smart_bridge_operation(), bridge_channel_join_multithreaded(), bridge_channel_join_singlethreaded(), bridge_channel_join(), ast_bridge_depart(), ast_bridge_remove(), ast_bridge_merge(), ast_bridge_suspend(), ast_bridge_unsuspend(), ast_bridge_dtmf_stream(), peercnt_add(), peercnt_remove(), build_callno_limits(), add_calltoken_ignore(), get_unused_callno(), replace_callno(), awesome_locking(), local_setoption(), local_bridgedchannel(), local_queryoption(), local_queue_frame(), local_answer(), check_bridge(), local_write(), local_fixup(), local_indicate(), local_digit_begin(), local_digit_end(), local_sendtext(), local_sendhtml(), local_call(), local_hangup(), locals_show(), manager_optimize_away(), handle_cli_misdn_send_facility(), sip_tcptls_write(), _sip_tcp_helper_thread(), create_addr_from_peer(), update_call_counter(), mwi_event_cb(), register_verify(), sip_show_inuse(), sip_show_users(), _sip_show_peers(), sip_prune_realtime(), _sip_show_peer(), complete_sip_user(), sip_show_user(), build_reply_digest(), handle_request_subscribe(), build_peer(), sip_poke_all_peers(), peers_data_provider_get(), ast_hangup(), ast_do_masquerade(), event_update_cache(), build_parkinglot(), ast_set_indication_country(), ast_get_indication_zone(), ast_get_indication_tone(), ast_register_indication_country(), ast_unregister_indication_country(), load_indications(), handle_showmanconn(), set_eventmask(), action_waitevent(), process_events(), get_input(), session_do(), purge_sessions(), __ast_manager_event_multichan(), find_session(), find_session_by_nonce(), astman_is_authed(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), generic_http_callback(), auth_http_callback(), ast_extension_state_add(), ast_extension_state_del(), ast_remove_hint(), ast_add_hint(), ast_change_hint(), handle_show_hints(), complete_core_show_hint(), handle_show_hint(), ast_merge_contexts_and_delete(), calendar_destructor(), schedule_calendar_event(), caldav_load_calendar(), ewscal_load_calendar(), exchangecal_load_calendar(), ical_load_calendar(), generic_fax_exec(), cli_fax_show_sessions(), spandsp_fax_cli_show_session(), monmp3thread(), mohalloc(), moh_release(), pthread_timer_open(), pthread_timer_set_rate(), pthread_timer_ack(), pthread_timer_enable_continuous(), pthread_timer_disable_continuous(), pthread_timer_get_event(), run_timer(), timerfd_timer_set_rate(), timerfd_timer_ack(), timerfd_timer_enable_continuous(), timerfd_timer_disable_continuous(), timerfd_timer_get_event(), ast_taskprocessor_get(), and ast_taskprocessor_unreference().
| typedef int( ao2_callback_data_fn)(void *obj, void *arg, void *data, int flags) |
Type of a generic callback function.
| obj | pointer to the (user-defined part) of an object. |
| arg | callback argument from ao2_callback() |
| data | arbitrary data from ao2_callback() |
| flags | flags from ao2_callback() |
The return values are a combination of enum _cb_results. Callback functions are used to search or manipulate objects in a container.
| typedef int( ao2_callback_fn)(void *obj, void *arg, int flags) |
Type of a generic callback function.
| obj | pointer to the (user-defined part) of an object. |
| arg | callback argument from ao2_callback() |
| flags | flags from ao2_callback() |
The return values are a combination of enum _cb_results. Callback functions are used to search or manipulate objects in a container.
| typedef void(* ao2_destructor_fn)(void *) |
| typedef int( ao2_hash_fn)(const void *obj, const int flags) |
Type of a generic function to generate a hash value from an object. flags is ignored at the moment. Eventually, it will include the value of OBJ_POINTER passed to ao2_callback().
| enum _cb_results |
A callback function will return a combination of CMP_MATCH and CMP_STOP. The latter will terminate the search in a container.
| enum ao2_iterator_flags |
Flags that can be passed to ao2_iterator_init() to modify the behavior of the iterator.
| AO2_ITERATOR_DONTLOCK |
Prevents ao2_iterator_next() from locking the container while retrieving the next object from it. |
| AO2_ITERATOR_MALLOCD |
Indicates that the iterator was dynamically allocated by astobj2 API and should be freed by ao2_iterator_destroy(). |
| AO2_ITERATOR_UNLINK |
Indicates that before the iterator returns an object from the container being iterated, the object should be unlinked from the container. |
Definition at line 1060 of file astobj2.h.
{
/*! Prevents ao2_iterator_next() from locking the container
* while retrieving the next object from it.
*/
AO2_ITERATOR_DONTLOCK = (1 << 0),
/*! Indicates that the iterator was dynamically allocated by
* astobj2 API and should be freed by ao2_iterator_destroy().
*/
AO2_ITERATOR_MALLOCD = (1 << 1),
/*! Indicates that before the iterator returns an object from
* the container being iterated, the object should be unlinked
* from the container.
*/
AO2_ITERATOR_UNLINK = (1 << 2),
};
| enum search_flags |
Flags passed to ao2_callback() and ao2_hash_fn() to modify its behaviour.
| OBJ_UNLINK |
Unlink the object for which the callback function returned CMP_MATCH. |
| OBJ_NODATA |
On match, don't return the object hence do not increase its refcount. |
| OBJ_MULTIPLE |
Don't stop at the first match in ao2_callback() unless the result of of the callback function == (CMP_STOP | CMP_MATCH). |
| OBJ_POINTER |
obj is an object of the same type as the one being searched for, so use the object's hash function for optimized searching. The search function is unaffected (i.e. use the one passed as argument, or match_by_addr if none specified). |
| OBJ_CONTINUE |
Continue if a match is not found in the hashed out bucket. This flag is to be used in combination with OBJ_POINTER. This tells the ao2_callback() core to keep searching through the rest of the buckets if a match is not found in the starting bucket defined by the hash value on the argument. |
Definition at line 649 of file astobj2.h.
{
/*! Unlink the object for which the callback function
* returned CMP_MATCH.
*/
OBJ_UNLINK = (1 << 0),
/*! On match, don't return the object hence do not increase
* its refcount.
*/
OBJ_NODATA = (1 << 1),
/*! Don't stop at the first match in ao2_callback() unless the result of
* of the callback function == (CMP_STOP | CMP_MATCH).
*/
OBJ_MULTIPLE = (1 << 2),
/*! obj is an object of the same type as the one being searched for,
* so use the object's hash function for optimized searching.
* The search function is unaffected (i.e. use the one passed as
* argument, or match_by_addr if none specified).
*/
OBJ_POINTER = (1 << 3),
/*!
* \brief Continue if a match is not found in the hashed out bucket
*
* This flag is to be used in combination with OBJ_POINTER. This tells
* the ao2_callback() core to keep searching through the rest of the
* buckets if a match is not found in the starting bucket defined by
* the hash value on the argument.
*/
OBJ_CONTINUE = (1 << 4),
};
| void* __ao2_alloc | ( | const size_t | data_size, |
| ao2_destructor_fn | destructor_fn | ||
| ) |
Definition at line 338 of file astobj2.c.
References internal_ao2_alloc().
Referenced by __ao2_container_alloc().
{
return internal_ao2_alloc(data_size, destructor_fn, __FILE__, __LINE__, __FUNCTION__);
}
| void* __ao2_alloc_debug | ( | const size_t | data_size, |
| ao2_destructor_fn | destructor_fn, | ||
| char * | tag, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | funcname, | ||
| int | ref_debug | ||
| ) |
Definition at line 317 of file astobj2.c.
References REF_FILE, and internal_ao2_alloc().
Referenced by __ao2_container_alloc_debug(), __ast_channel_alloc_ap(), ast_dummy_channel_alloc(), and _moh_class_malloc().
{
/* allocation */
void *obj;
FILE *refo = ref_debug ? fopen(REF_FILE,"a") : NULL;
if ((obj = internal_ao2_alloc(data_size, destructor_fn, file, line, funcname)) == NULL) {
fclose(refo);
return NULL;
}
if (refo) {
fprintf(refo, "%p =1 %s:%d:%s (%s)\n", obj, file, line, funcname, tag);
fclose(refo);
}
/* return a pointer to the user data */
return obj;
}
| void* __ao2_callback | ( | struct ao2_container * | c, |
| enum search_flags | flags, | ||
| ao2_callback_fn * | cb_fn, | ||
| void * | arg | ||
| ) |
Definition at line 766 of file astobj2.c.
References internal_ao2_callback(), and DEFAULT.
Referenced by __ao2_unlink(), __ao2_find(), and container_destruct().
{
return internal_ao2_callback(c,flags, cb_fn, arg, NULL, DEFAULT, NULL, NULL, 0, NULL);
}
| void* __ao2_callback_data | ( | struct ao2_container * | c, |
| enum search_flags | flags, | ||
| ao2_callback_data_fn * | cb_fn, | ||
| void * | arg, | ||
| void * | data | ||
| ) |
Definition at line 780 of file astobj2.c.
References internal_ao2_callback(), and WITH_DATA.
{
return internal_ao2_callback(c, flags, cb_fn, arg, data, WITH_DATA, NULL, NULL, 0, NULL);
}
| void* __ao2_callback_data_debug | ( | struct ao2_container * | c, |
| enum search_flags | flags, | ||
| ao2_callback_data_fn * | cb_fn, | ||
| void * | arg, | ||
| void * | data, | ||
| char * | tag, | ||
| char * | file, | ||
| int | line, | ||
| const char * | funcname | ||
| ) |
Definition at line 772 of file astobj2.c.
References internal_ao2_callback(), and WITH_DATA.
{
return internal_ao2_callback(c, flags, cb_fn, arg, data, WITH_DATA, tag, file, line, funcname);
}
| void* __ao2_callback_debug | ( | struct ao2_container * | c, |
| enum search_flags | flags, | ||
| ao2_callback_fn * | cb_fn, | ||
| void * | arg, | ||
| char * | tag, | ||
| char * | file, | ||
| int | line, | ||
| const char * | funcname | ||
| ) |
Definition at line 758 of file astobj2.c.
References internal_ao2_callback(), and DEFAULT.
Referenced by __ao2_unlink_debug(), __ao2_find_debug(), and container_destruct_debug().
{
return internal_ao2_callback(c,flags, cb_fn, arg, NULL, DEFAULT, tag, file, line, funcname);
}
| struct ao2_container* __ao2_container_alloc | ( | const unsigned int | n_buckets, |
| ao2_hash_fn * | hash_fn, | ||
| ao2_callback_fn * | cmp_fn | ||
| ) | [read] |
Definition at line 438 of file astobj2.c.
References __ao2_alloc(), container_destruct(), and internal_ao2_container_alloc().
Referenced by internal_ao2_callback().
{
/* XXX maybe consistency check on arguments ? */
/* compute the container size */
const unsigned int num_buckets = hash_fn ? n_buckets : 1;
size_t container_size = sizeof(struct ao2_container) + num_buckets * sizeof(struct bucket);
struct ao2_container *c = __ao2_alloc(container_size, container_destruct);
return internal_ao2_container_alloc(c, num_buckets, hash_fn, cmp_fn);
}
| struct ao2_container* __ao2_container_alloc_debug | ( | const unsigned int | n_buckets, |
| ao2_hash_fn * | hash_fn, | ||
| ao2_callback_fn * | cmp_fn, | ||
| char * | tag, | ||
| char * | file, | ||
| int | line, | ||
| const char * | funcname, | ||
| int | ref_debug | ||
| ) | [read] |
Definition at line 425 of file astobj2.c.
References __ao2_alloc_debug(), container_destruct_debug(), and internal_ao2_container_alloc().
{
/* XXX maybe consistency check on arguments ? */
/* compute the container size */
const unsigned int num_buckets = hash_fn ? n_buckets : 1;
size_t container_size = sizeof(struct ao2_container) + num_buckets * sizeof(struct bucket);
struct ao2_container *c = __ao2_alloc_debug(container_size, container_destruct_debug, tag, file, line, funcname, ref_debug);
return internal_ao2_container_alloc(c, num_buckets, hash_fn, cmp_fn);
}
| void* __ao2_find | ( | struct ao2_container * | c, |
| void * | arg, | ||
| enum search_flags | flags | ||
| ) |
Definition at line 794 of file astobj2.c.
References __ao2_callback(), and ao2_container::cmp_fn.
Referenced by _get_mohbyname().
{
return __ao2_callback(c, flags, c->cmp_fn, arg);
}
| void* __ao2_find_debug | ( | struct ao2_container * | c, |
| void * | arg, | ||
| enum search_flags | flags, | ||
| char * | tag, | ||
| char * | file, | ||
| int | line, | ||
| const char * | funcname | ||
| ) |
the find function just invokes the default callback with some reasonable flags.
Definition at line 789 of file astobj2.c.
References __ao2_callback_debug(), and ao2_container::cmp_fn.
Referenced by _get_mohbyname().
{
return __ao2_callback_debug(c, flags, c->cmp_fn, arg, tag, file, line, funcname);
}
| void* __ao2_iterator_next | ( | struct ao2_iterator * | a | ) |
Definition at line 915 of file astobj2.c.
References internal_ao2_iterator_next(), __ao2_ref(), ao2_iterator::flags, AO2_ITERATOR_DONTLOCK, ao2_unlock, and ao2_iterator::c.
{
struct bucket_entry *p = NULL;
void *ret = NULL;
ret = internal_ao2_iterator_next(a, &p);
if (p) {
/* inc refcount of returned object */
__ao2_ref(ret, 1);
}
if (!(a->flags & AO2_ITERATOR_DONTLOCK))
ao2_unlock(a->c);
return ret;
}
| void* __ao2_iterator_next_debug | ( | struct ao2_iterator * | a, |
| char * | tag, | ||
| char * | file, | ||
| int | line, | ||
| const char * | funcname | ||
| ) |
Definition at line 897 of file astobj2.c.
References internal_ao2_iterator_next(), __ao2_ref_debug(), ao2_iterator::flags, AO2_ITERATOR_DONTLOCK, ao2_unlock, and ao2_iterator::c.
{
struct bucket_entry *p;
void *ret = NULL;
ret = internal_ao2_iterator_next(a, &p);
if (p) {
/* inc refcount of returned object */
__ao2_ref_debug(ret, 1, tag, file, line, funcname);
}
if (!(a->flags & AO2_ITERATOR_DONTLOCK))
ao2_unlock(a->c);
return ret;
}
| void* __ao2_link | ( | struct ao2_container * | c, |
| void * | newobj | ||
| ) |
Definition at line 515 of file astobj2.c.
References internal_ao2_link(), __ao2_ref(), and ao2_unlock.
Referenced by internal_ao2_callback().
{
struct bucket_entry *p = internal_ao2_link(c, user_data, __FILE__, __LINE__, __PRETTY_FUNCTION__);
if (p) {
__ao2_ref(user_data, +1);
ao2_unlock(c);
}
return p;
}
| void* __ao2_link_debug | ( | struct ao2_container * | c, |
| void * | new_obj, | ||
| char * | tag, | ||
| char * | file, | ||
| int | line, | ||
| const char * | funcname | ||
| ) |
Definition at line 504 of file astobj2.c.
References internal_ao2_link(), __ao2_ref_debug(), and ao2_unlock.
Referenced by internal_ao2_callback().
{
struct bucket_entry *p = internal_ao2_link(c, user_data, file, line, funcname);
if (p) {
__ao2_ref_debug(user_data, +1, tag, file, line, funcname);
ao2_unlock(c);
}
return p;
}
| int __ao2_lock | ( | void * | a, |
| const char * | file, | ||
| const char * | func, | ||
| int | line, | ||
| const char * | var | ||
| ) |
Lock an object.
| a | A pointer to the object we want to lock. |
Definition at line 146 of file astobj2.c.
References INTERNAL_OBJ(), ast_atomic_fetchadd_int(), __ast_pthread_mutex_lock(), astobj2::priv_data, and __priv_data::lock.
{
struct astobj2 *p = INTERNAL_OBJ(user_data);
if (p == NULL)
return -1;
#ifdef AO2_DEBUG
ast_atomic_fetchadd_int(&ao2.total_locked, 1);
#endif
return __ast_pthread_mutex_lock(file, line, func, var, &p->priv_data.lock);
}
| int __ao2_ref | ( | void * | o, |
| int | delta | ||
| ) |
Definition at line 225 of file astobj2.c.
References INTERNAL_OBJ(), and internal_ao2_ref().
Referenced by __ao2_link(), internal_ao2_callback(), __ao2_iterator_next(), and cd_cb().
{
struct astobj2 *obj = INTERNAL_OBJ(user_data);
if (obj == NULL)
return -1;
return internal_ao2_ref(user_data, delta);
}
| int __ao2_ref_debug | ( | void * | o, |
| int | delta, | ||
| char * | tag, | ||
| char * | file, | ||
| int | line, | ||
| const char * | funcname | ||
| ) |
Definition at line 205 of file astobj2.c.
References INTERNAL_OBJ(), REF_FILE, astobj2::priv_data, __priv_data::ref_counter, __priv_data::destructor_fn, and internal_ao2_ref().
Referenced by __ao2_link_debug(), internal_ao2_callback(), __ao2_iterator_next_debug(), cd_cb_debug(), dialog_ref_debug(), and dialog_unref_debug().
{
struct astobj2 *obj = INTERNAL_OBJ(user_data);
if (obj == NULL)
return -1;
if (delta != 0) {
FILE *refo = fopen(REF_FILE,"a");
fprintf(refo, "%p %s%d %s:%d:%s (%s) [@%d]\n", user_data, (delta<0? "":"+"), delta, file, line, funcname, tag, obj ? obj->priv_data.ref_counter : -1);
fclose(refo);
}
if (obj->priv_data.ref_counter + delta == 0 && obj->priv_data.destructor_fn != NULL) { /* this isn't protected with lock; just for o/p */
FILE *refo = fopen(REF_FILE,"a");
fprintf(refo, "%p **call destructor** %s:%d:%s (%s)\n", user_data, file, line, funcname, tag);
fclose(refo);
}
return internal_ao2_ref(user_data, delta);
}
| int __ao2_trylock | ( | void * | a, |
| const char * | file, | ||
| const char * | func, | ||
| int | line, | ||
| const char * | var | ||
| ) |
Try locking-- (don't block if fail)
| a | A pointer to the object we want to lock. |
Definition at line 174 of file astobj2.c.
References INTERNAL_OBJ(), __ast_pthread_mutex_trylock(), astobj2::priv_data, __priv_data::lock, and ast_atomic_fetchadd_int().
{
struct astobj2 *p = INTERNAL_OBJ(user_data);
int ret;
if (p == NULL)
return -1;
ret = __ast_pthread_mutex_trylock(file, line, func, var, &p->priv_data.lock);
#ifdef AO2_DEBUG
if (!ret)
ast_atomic_fetchadd_int(&ao2.total_locked, 1);
#endif
return ret;
}
| void* __ao2_unlink | ( | struct ao2_container * | c, |
| void * | obj | ||
| ) |
Definition at line 549 of file astobj2.c.
References INTERNAL_OBJ(), __ao2_callback(), OBJ_UNLINK, OBJ_POINTER, OBJ_NODATA, and ao2_match_by_addr.
{
if (INTERNAL_OBJ(user_data) == NULL) /* safety check on the argument */
return NULL;
__ao2_callback(c, OBJ_UNLINK | OBJ_POINTER | OBJ_NODATA, ao2_match_by_addr, user_data);
return NULL;
}
| void* __ao2_unlink_debug | ( | struct ao2_container * | c, |
| void * | obj, | ||
| char * | tag, | ||
| char * | file, | ||
| int | line, | ||
| const char * | funcname | ||
| ) |
Definition at line 538 of file astobj2.c.
References INTERNAL_OBJ(), __ao2_callback_debug(), OBJ_UNLINK, OBJ_POINTER, OBJ_NODATA, and ao2_match_by_addr.
{
if (INTERNAL_OBJ(user_data) == NULL) /* safety check on the argument */
return NULL;
__ao2_callback_debug(c, OBJ_UNLINK | OBJ_POINTER | OBJ_NODATA, ao2_match_by_addr, user_data, tag, file, line, funcname);
return NULL;
}
| int __ao2_unlock | ( | void * | a, |
| const char * | file, | ||
| const char * | func, | ||
| int | line, | ||
| const char * | var | ||
| ) |
Unlock an object.
| a | A pointer to the object we want unlock. |
Definition at line 160 of file astobj2.c.
References INTERNAL_OBJ(), ast_atomic_fetchadd_int(), __ast_pthread_mutex_unlock(), astobj2::priv_data, and __priv_data::lock.
{
struct astobj2 *p = INTERNAL_OBJ(user_data);
if (p == NULL)
return -1;
#ifdef AO2_DEBUG
ast_atomic_fetchadd_int(&ao2.total_locked, -1);
#endif
return __ast_pthread_mutex_unlock(file, line, func, var, &p->priv_data.lock);
}
| void ao2_bt | ( | void | ) |
Definition at line 83 of file astobj2.c.
References N1, ast_bt_get_symbols(), ast_verbose(), and free.
{
int c, i;
#define N1 20
void *addresses[N1];
char **strings;
c = backtrace(addresses, N1);
strings = ast_bt_get_symbols(addresses,c);
ast_verbose("backtrace returned: %d\n", c);
for(i = 0; i < c; i++) {
ast_verbose("%d: %p %s\n", i, addresses[i], strings[i]);
}
free(strings);
}
| int ao2_container_count | ( | struct ao2_container * | c | ) |
Returns the number of elements in a container.
return the number of elements in the container
Definition at line 454 of file astobj2.c.
References ao2_container::elements.
Referenced by meetme_data_provider_get(), __queues_show(), cc_cli_output_status(), handle_cli_iax2_show_callno_limits(), get_unused_callno(), locals_show(), _sip_show_peers(), ast_active_channels(), data_provider_release(), data_provider_release_all(), __ast_data_register(), ast_data_search_match(), lock_broker(), unload_module(), ast_tone_zone_count(), match_filter(), __ast_manager_event_multichan(), handle_show_hints(), handle_show_hint(), ast_merge_contexts_and_delete(), hints_data_provider_get(), cleanup(), endelm(), cli_fax_show_sessions(), data_odbc_provider_handler(), ast_srtp_unprotect(), pthread_timer_open(), do_timing(), and cli_tps_report().
{
return c->elements;
}
| void ao2_iterator_destroy | ( | struct ao2_iterator * | i | ) |
Destroy a container iterator.
| i | the iterator to destroy |
| none | This function will release the container reference held by the iterator and any other resources it may be holding. |
destroy an iterator
Definition at line 817 of file astobj2.c.
References ao2_ref, ao2_iterator::c, ao2_iterator::flags, AO2_ITERATOR_MALLOCD, and ast_free.
Referenced by complete_meetmecmd(), meetme_show_cmd(), conf_queue_dtmf(), conf_run(), action_meetmelist(), get_member_status(), handle_statechange(), extension_state_cb(), clear_queue(), rt_handle_member_record(), free_members(), find_queue_by_name_rt(), update_realtime_members(), num_available_members(), compare_weight(), update_queue(), try_calling(), interface_exists(), dump_queue_members(), set_member_paused(), set_member_penalty(), queue_function_qac(), queue_function_qac_dep(), queue_function_queuememberlist(), clear_stats(), __queues_show(), complete_queue(), manager_queues_summary(), manager_queues_status(), complete_queue_remove_member(), queues_data_provider_get(), unload_module(), kill_duplicate_offers(), complete_core_id(), cli_list_devices(), cli_console_active(), destroy_pvts(), stop_streams(), iax2_getpeername(), handle_cli_iax2_show_callno_limits(), complete_iax2_peers(), iax2_getpeertrunk(), handle_cli_iax2_show_users(), __iax2_show_peers(), complete_iax2_unregister(), manager_iax2_show_peer_list(), check_access(), authenticate_reply(), prune_users(), prune_peers(), poke_all_peers(), peers_data_provider_get(), users_data_provider_get(), local_devicestate(), locals_show(), manager_optimize_away(), find_call(), sip_show_inuse(), sip_show_tcp(), sip_show_users(), _sip_show_peers(), sip_prune_realtime(), complete_sip_user(), complete_sipch(), complete_sip_peer(), complete_sip_registered_peer(), sip_show_channel(), sip_show_history(), sip_poke_all_peers(), ast_channel_iterator_destroy(), data_provider_release_all(), __ast_data_search_cmp_structure(), ast_data_search_match(), data_filter_find(), data_result_generate_node(), data_get_xml_add_child(), ast_data_iterator_end(), __data_result_print_cli(), data_provider_print_cli(), data_result_manager_output(), do_parking_thread(), build_dialplan_useage_map(), handle_feature_show(), handle_parkedcalls(), manager_parking_status(), dialgroup_read(), handle_showmanconn(), authenticate(), purge_sessions(), __ast_manager_event_multichan(), find_session(), find_session_by_nonce(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), handle_show_hints(), complete_core_show_hint(), handle_show_hint(), hints_data_provider_get(), calendar_query_exec(), handle_show_calendars(), handle_show_calendar(), alias_show(), fax_session_tab_complete(), cli_fax_show_sessions(), moh_rescan_files(), handle_cli_moh_show_files(), handle_cli_moh_show_classes(), handle_cli_odbc_show(), reload(), delete_users(), delete_routes(), delete_profiles(), pp_each_user_helper(), handle_show_routes(), and ast_srtp_unprotect().
| struct ao2_iterator ao2_iterator_init | ( | struct ao2_container * | c, |
| int | flags | ||
| ) | [read] |
Create an iterator for a container.
| c | the container |
| flags | one or more flags from ao2_iterator_flags |
| the | constructed iterator |
This function will take a reference on the container being iterated.
initialize an iterator so we start from the first object
Definition at line 802 of file astobj2.c.
References ao2_iterator::c, ao2_iterator::flags, and ao2_ref.
Referenced by complete_meetmecmd(), meetme_show_cmd(), conf_queue_dtmf(), conf_run(), action_meetmelist(), get_member_status(), handle_statechange(), extension_state_cb(), clear_queue(), rt_handle_member_record(), free_members(), find_queue_by_name_rt(), update_realtime_members(), num_available_members(), compare_weight(), update_queue(), try_calling(), interface_exists(), dump_queue_members(), set_member_paused(), set_member_penalty(), queue_function_qac(), queue_function_qac_dep(), queue_function_queuememberlist(), clear_stats(), __queues_show(), complete_queue(), manager_queues_summary(), manager_queues_status(), complete_queue_remove_member(), queues_data_provider_get_helper(), queues_data_provider_get(), unload_module(), internal_ao2_callback(), complete_core_id(), cli_list_devices(), cli_console_active(), destroy_pvts(), stop_streams(), iax2_getpeername(), handle_cli_iax2_show_callno_limits(), complete_iax2_peers(), iax2_getpeertrunk(), handle_cli_iax2_show_users(), __iax2_show_peers(), complete_iax2_unregister(), manager_iax2_show_peer_list(), check_access(), authenticate_reply(), prune_users(), prune_peers(), poke_all_peers(), peers_data_provider_get(), users_data_provider_get(), local_devicestate(), locals_show(), manager_optimize_away(), sip_show_inuse(), sip_show_tcp(), sip_show_users(), _sip_show_peers(), sip_prune_realtime(), complete_sip_user(), complete_sipch(), complete_sip_peer(), complete_sip_registered_peer(), sip_show_channel(), sip_show_history(), sip_poke_all_peers(), ast_channel_iterator_all_new(), data_provider_release_all(), __ast_data_search_cmp_structure(), ast_data_search_match(), data_filter_find(), data_result_generate_node(), data_get_xml_add_child(), ast_data_iterator_init(), __data_result_print_cli(), data_provider_print_cli(), data_result_manager_output(), do_parking_thread(), build_dialplan_useage_map(), handle_feature_show(), handle_parkedcalls(), manager_parking_status(), dialgroup_read(), ast_tone_zone_iterator_init(), complete_country(), handle_showmanconn(), authenticate(), purge_sessions(), __ast_manager_event_multichan(), find_session(), find_session_by_nonce(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), handle_show_hints(), complete_core_show_hint(), handle_show_hint(), ast_merge_contexts_and_delete(), hints_data_provider_get(), calendar_query_exec(), handle_show_calendars(), handle_show_calendar(), alias_show(), fax_session_tab_complete(), cli_fax_show_sessions(), moh_rescan_files(), handle_cli_moh_show_files(), handle_cli_moh_show_classes(), handle_cli_odbc_show(), data_odbc_provider_handler(), reload(), delete_users(), delete_routes(), delete_profiles(), pp_each_user_helper(), handle_show_routes(), ast_srtp_unprotect(), tps_taskprocessor_tab_complete(), and cli_tps_report().
{
struct ao2_iterator a = {
.c = c,
.flags = flags
};
ao2_ref(c, +1);
return a;
}
| void* ao2_object_get_lockaddr | ( | void * | obj | ) |
Return the lock address of an object.
| [in] | obj | A pointer to the object we want. |
This function comes in handy mainly for debugging locking situations, where the locking trace code reports the lock address, this allows you to correlate against object address, to match objects to reported locks.
Definition at line 190 of file astobj2.c.
References INTERNAL_OBJ(), astobj2::priv_data, and __priv_data::lock.
{
struct astobj2 *p = INTERNAL_OBJ(obj);
if (p == NULL)
return NULL;
return &p->priv_data.lock;
}
| ao2_callback_fn ao2_match_by_addr |
a very common callback is one that matches by address.
Definition at line 635 of file astobj2.h.
Referenced by __ao2_unlink_debug(), __ao2_unlink(), load_odbc_config(), and load_module().