Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk.h"
#include <pjsip.h>
#include "asterisk/res_pjsip.h"
#include "asterisk/module.h"
#include "asterisk/logger.h"
#include "asterisk/sorcery.h"
#include "asterisk/acl.h"
#include "asterisk/stasis.h"
#include "asterisk/security_events.h"
Go to the source code of this file.
Data Structures | |
struct | ast_sip_acl |
SIP ACL details and configuration. More... | |
Macros | |
#define | SIP_SORCERY_ACL_TYPE "acl" |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void * | acl_alloc (const char *name) |
static void | acl_change_stasis_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | acl_destroy (void *obj) |
static int | acl_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static pj_bool_t | acl_on_rx_msg (pjsip_rx_data *rdata) |
static int | apply_acl (pjsip_rx_data *rdata, struct ast_acl_list *acl) |
static int | apply_contact_acl (pjsip_rx_data *rdata, struct ast_acl_list *contact_acl) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | check_acls (void *obj, void *arg, int flags) |
static int | extract_contact_addr (pjsip_contact_hdr *contact, struct ast_sockaddr **addrs) |
static int | load_module (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP ACL Resource" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND, .requires = "res_pjsip", } |
static struct stasis_subscription * | acl_change_sub |
static pjsip_module | acl_module |
static const struct ast_module_info * | ast_module_info = &__mod_info |
#define SIP_SORCERY_ACL_TYPE "acl" |
Definition at line 192 of file res_pjsip_acl.c.
|
static |
Definition at line 343 of file res_pjsip_acl.c.
|
static |
Definition at line 343 of file res_pjsip_acl.c.
|
static |
Definition at line 279 of file res_pjsip_acl.c.
References acl_destroy(), and ast_sorcery_generic_alloc().
Referenced by load_module().
|
static |
Definition at line 287 of file res_pjsip_acl.c.
References ast_named_acl_change_type(), ast_sip_get_sorcery(), ast_sorcery_force_reload_object(), SIP_SORCERY_ACL_TYPE, and stasis_message_type().
Referenced by load_module().
|
static |
Definition at line 272 of file res_pjsip_acl.c.
References ast_sip_acl::acl, ast_free_acl_list(), and ast_sip_acl::contact_acl.
Referenced by acl_alloc().
|
static |
Definition at line 237 of file res_pjsip_acl.c.
References ast_sip_acl::acl, ast_append_acl(), ast_log, ast_sip_acl::contact_acl, error(), sip_to_pjsip::ignore(), LOG_ERROR, NULL, and var.
Referenced by load_module().
|
static |
Definition at line 215 of file res_pjsip_acl.c.
References ao2_callback, ao2_cleanup, ast_log, AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sip_get_pjsip_endpoint(), ast_sip_get_sorcery(), ast_sorcery_retrieve_by_fields(), check_acls(), LOG_ERROR, NULL, RAII_VAR, and SIP_SORCERY_ACL_TYPE.
|
static |
Definition at line 121 of file res_pjsip_acl.c.
References ast_acl_list_is_empty(), ast_apply_acl(), ast_log, AST_SENSE_ALLOW, ast_sockaddr_parse(), ast_sockaddr_set_port, ast_sockaddr_stringify(), LOG_WARNING, and PARSE_PORT_FORBID.
Referenced by check_acls().
|
static |
Definition at line 158 of file res_pjsip_acl.c.
References ast_acl_list_is_empty(), ast_apply_acl(), ast_free, ast_log, AST_SENSE_ALLOW, ast_sockaddr_stringify(), extract_contact_addr(), if(), and LOG_WARNING.
Referenced by check_acls().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 343 of file res_pjsip_acl.c.
|
static |
Definition at line 203 of file res_pjsip_acl.c.
References ast_sip_acl::acl, apply_acl(), apply_contact_acl(), CMP_MATCH, CMP_STOP, and ast_sip_acl::contact_acl.
Referenced by acl_on_rx_msg().
|
static |
Definition at line 140 of file res_pjsip_acl.c.
References AST_AF_UNSPEC, ast_copy_pj_str(), ast_sockaddr_resolve(), NULL, and PARSE_PORT_FORBID.
Referenced by apply_contact_acl().
|
static |
Definition at line 297 of file res_pjsip_acl.c.
References acl_alloc(), acl_change_stasis_cb(), acl_change_sub, acl_handler(), acl_module, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_named_acl_change_type(), ast_security_topic(), ast_sip_get_sorcery(), ast_sip_register_service(), ast_sorcery_apply_config, ast_sorcery_apply_default, ast_sorcery_load_object(), ast_sorcery_object_field_register, ast_sorcery_object_field_register_custom, ast_sorcery_object_register, LOG_ERROR, NULL, OPT_NOOP_T, SIP_SORCERY_ACL_TYPE, stasis_subscribe, stasis_subscription_accept_message_type(), STASIS_SUBSCRIPTION_FILTER_SELECTIVE, and stasis_subscription_set_filter().
|
static |
Definition at line 330 of file res_pjsip_acl.c.
References acl_change_sub, acl_module, ast_sip_unregister_service(), and stasis_unsubscribe_and_join().
|
static |
Definition at line 343 of file res_pjsip_acl.c.
|
static |
Definition at line 119 of file res_pjsip_acl.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 265 of file res_pjsip_acl.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 343 of file res_pjsip_acl.c.