Asterisk - The Open Source Telephony Project
18.5.0
|
Generate security events in the PJSIP channel. More...
#include "asterisk.h"
#include <pjsip.h>
#include "asterisk/res_pjsip.h"
#include "asterisk/security_events.h"
Go to the source code of this file.
Functions | |
void | ast_sip_report_auth_challenge_sent (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, pjsip_tx_data *tdata) |
Send a security event notification for when an authentication challenge is sent. More... | |
void | ast_sip_report_auth_failed_challenge_response (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) |
Send a security event notification for when a challenge response has failed. More... | |
void | ast_sip_report_auth_success (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) |
Send a security event notification for when authentication succeeds. More... | |
void | ast_sip_report_failed_acl (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, const char *name) |
Send a security event notification for when an ACL check fails. More... | |
void | ast_sip_report_invalid_endpoint (const char *name, pjsip_rx_data *rdata) |
Send a security event notification for when an invalid endpoint is requested. More... | |
void | ast_sip_report_mem_limit (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) |
Send a security event notification for when a memory limit is hit. More... | |
void | ast_sip_report_req_no_support (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, const char *req_type) |
Send a security event notification for when a request is not supported. More... | |
static const char * | get_account_id (struct ast_sip_endpoint *endpoint) |
static enum ast_transport | security_event_get_transport (pjsip_rx_data *rdata) |
static void | security_event_populate (pjsip_rx_data *rdata, char *call_id, size_t call_id_size, struct ast_sockaddr *local, struct ast_sockaddr *remote) |
Generate security events in the PJSIP channel.
Definition in file res/res_pjsip/security_events.c.
void ast_sip_report_auth_challenge_sent | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata, | ||
pjsip_tx_data * | tdata | ||
) |
Send a security event notification for when an authentication challenge is sent.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
tdata | Sent message |
Definition at line 197 of file res/res_pjsip/security_events.c.
References ast_copy_pj_str(), AST_SEC_EVT, AST_SECURITY_EVENT_CHAL_SENT, AST_SECURITY_EVENT_CHAL_SENT_VERSION, ast_security_event_report(), ast_security_event_chal_sent::common, ast_security_event_common::event_type, get_account_id(), NULL, security_event_get_transport(), and security_event_populate().
Referenced by authenticate().
void ast_sip_report_auth_failed_challenge_response | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata | ||
) |
Send a security event notification for when a challenge response has failed.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
Definition at line 130 of file res/res_pjsip/security_events.c.
References ast_copy_pj_str(), AST_SEC_EVT, AST_SECURITY_EVENT_CHAL_RESP_FAILED, AST_SECURITY_EVENT_CHAL_RESP_FAILED_VERSION, ast_security_event_report(), ast_security_event_chal_resp_failed::common, ast_security_event_common::event_type, get_account_id(), NULL, ast_security_event_chal_resp_failed::response, security_event_get_transport(), and security_event_populate().
Referenced by authenticate().
void ast_sip_report_auth_success | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata | ||
) |
Send a security event notification for when authentication succeeds.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
Definition at line 168 of file res/res_pjsip/security_events.c.
References AST_SEC_EVT, ast_security_event_report(), AST_SECURITY_EVENT_SUCCESSFUL_AUTH, AST_SECURITY_EVENT_SUCCESSFUL_AUTH_VERSION, ast_security_event_successful_auth::common, ast_security_event_common::event_type, get_account_id(), NULL, security_event_get_transport(), and security_event_populate().
Referenced by authenticate().
void ast_sip_report_failed_acl | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata, | ||
const char * | name | ||
) |
Send a security event notification for when an ACL check fails.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
name | Name of the ACL |
Definition at line 102 of file res/res_pjsip/security_events.c.
References AST_SEC_EVT, AST_SECURITY_EVENT_FAILED_ACL, AST_SECURITY_EVENT_FAILED_ACL_VERSION, ast_security_event_report(), ast_security_event_failed_acl::common, ast_security_event_common::event_type, get_account_id(), name, security_event_get_transport(), and security_event_populate().
Referenced by apply_endpoint_acl(), apply_endpoint_contact_acl(), register_aor_core(), and registrar_on_rx_request().
void ast_sip_report_invalid_endpoint | ( | const char * | name, |
pjsip_rx_data * | rdata | ||
) |
Send a security event notification for when an invalid endpoint is requested.
name | Name of the endpoint requested |
rdata | Received message |
Definition at line 75 of file res/res_pjsip/security_events.c.
References AST_SEC_EVT, AST_SECURITY_EVENT_INVAL_ACCT_ID, AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION, ast_security_event_report(), ast_security_event_inval_acct_id::common, ast_security_event_common::event_type, name, security_event_get_transport(), and security_event_populate().
Referenced by check_endpoint(), and endpoint_lookup().
void ast_sip_report_mem_limit | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata | ||
) |
Send a security event notification for when a memory limit is hit.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
Definition at line 259 of file res/res_pjsip/security_events.c.
References AST_SEC_EVT, AST_SECURITY_EVENT_MEM_LIMIT, AST_SECURITY_EVENT_MEM_LIMIT_VERSION, ast_security_event_report(), ast_security_event_mem_limit::common, ast_security_event_common::event_type, get_account_id(), security_event_get_transport(), and security_event_populate().
void ast_sip_report_req_no_support | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata, | ||
const char * | req_type | ||
) |
Send a security event notification for when a request is not supported.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
req_type | the type of request |
Definition at line 230 of file res/res_pjsip/security_events.c.
References AST_SEC_EVT, ast_security_event_report(), AST_SECURITY_EVENT_REQ_NO_SUPPORT, AST_SECURITY_EVENT_REQ_NO_SUPPORT_VERSION, ast_security_event_req_no_support::common, ast_security_event_common::event_type, get_account_id(), security_event_get_transport(), and security_event_populate().
Referenced by find_registrar_aor(), and registrar_on_rx_request().
|
static |
Definition at line 68 of file res/res_pjsip/security_events.c.
References ao2_cleanup, ast_sip_get_artificial_endpoint(), ast_sorcery_object_get_id(), and RAII_VAR.
Referenced by ast_sip_report_auth_challenge_sent(), ast_sip_report_auth_failed_challenge_response(), ast_sip_report_auth_success(), ast_sip_report_failed_acl(), ast_sip_report_mem_limit(), and ast_sip_report_req_no_support().
|
static |
Definition at line 34 of file res/res_pjsip/security_events.c.
References AST_TRANSPORT_TCP, AST_TRANSPORT_TLS, AST_TRANSPORT_UDP, AST_TRANSPORT_WS, and AST_TRANSPORT_WSS.
Referenced by ast_sip_report_auth_challenge_sent(), ast_sip_report_auth_failed_challenge_response(), ast_sip_report_auth_success(), ast_sip_report_failed_acl(), ast_sip_report_invalid_endpoint(), ast_sip_report_mem_limit(), and ast_sip_report_req_no_support().
|
static |
Definition at line 54 of file res/res_pjsip/security_events.c.
References ast_copy_pj_str(), ast_sockaddr_parse(), ast_sockaddr_set_port, host, and PARSE_PORT_FORBID.
Referenced by ast_sip_report_auth_challenge_sent(), ast_sip_report_auth_failed_challenge_response(), ast_sip_report_auth_success(), ast_sip_report_failed_acl(), ast_sip_report_invalid_endpoint(), ast_sip_report_mem_limit(), and ast_sip_report_req_no_support().