📄 sip_msg.h
字号:
typedef sip_hdr_value_t sip_ppassertedid_value_t;typedef sip_hdr_value_t sip_ppreferredid_value_t;typedef sip_hdr_value_t sip_pxy_req_value_t;typedef sip_hdr_value_t sip_req_value_t;typedef sip_hdr_value_t sip_subject_value_t;typedef sip_hdr_value_t sip_svr_value_t;typedef sip_hdr_value_t sip_support_value_t;typedef sip_hdr_value_t sip_unsupport_value_t;typedef sip_hdr_value_t sip_usr_agt_value_t;typedef sip_hdr_value_t sip_err_info_value_t;typedef sip_hdr_value_t sip_date_value_t;typedef sip_hdr_value_t sip_allert_value_t;typedef sip_hdr_value_t sip_callid_value_t;/* hdr value contain one int only */typedef sip_hdr_value_t sip_expr_value_t;typedef sip_hdr_value_t sip_min_expr_value_t;typedef sip_hdr_value_t sip_retry_value_t;typedef sip_hdr_value_t sip_timestamp_value_t;typedef sip_hdr_value_t sip_rseq_value_t;typedef sip_hdr_value_t sip_content_len_value_t;typedef sip_hdr_value_t sip_max_forwards_value_t;typedef sip_hdr_value_t sip_allow_value_t;/* hdr value contain one int, two strings */typedef sip_hdr_value_t sip_warn_value_t;/* hdr field value is a list of param=param_val */typedef sip_hdr_value_t sip_authen_value_t;typedef sip_hdr_value_t sip_authen_info_value_t;typedef sip_hdr_value_t sip_pxy_authen_value_t;typedef sip_hdr_value_t sip_pxy_author_value_t;typedef sip_hdr_value_t sip_3w_authen_value_t;/* SIP request line structure */typedef struct sip_request { sip_method_t sip_request_method; sip_str_t sip_request_uri; sip_uri_t sip_parse_uri;} sip_request_t;/* SIP response line structure */typedef struct sip_response { int sip_response_code; sip_str_t sip_response_phrase;} sip_response_t;/* SIP message type - request or response */typedef struct sip_message_type { boolean_t is_request; sip_proto_version_t sip_proto_version; union { sip_request_t sip_request; sip_response_t sip_response; } U; /* This is to save old value when we use a recvd message. */ struct sip_message_type *sip_next;} sip_message_type_t;/* Increment reference count on SIP message */#define SIP_MSG_REFCNT_INCR(sip_msg) { \ (void) pthread_mutex_lock(&(sip_msg)->sip_msg_mutex); \ (sip_msg)->sip_msg_ref_cnt++; \ (void) pthread_mutex_unlock(&(sip_msg)->sip_msg_mutex); \}/* Decrement reference count on SIP message */#define SIP_MSG_REFCNT_DECR(sip_msg) { \ (void) pthread_mutex_lock(&(sip_msg)->sip_msg_mutex); \ assert((sip_msg)->sip_msg_ref_cnt > 0); \ if (--(sip_msg)->sip_msg_ref_cnt == 0) { \ (void) pthread_mutex_unlock(&(sip_msg)->sip_msg_mutex); \ sip_destroy_msg(sip_msg); \ } else { \ (void) pthread_mutex_unlock(&(sip_msg)->sip_msg_mutex); \ } \}/* SIP message structure */typedef struct sip_message { char *sip_msg_buf; /* Message */ char *sip_msg_old_buf; boolean_t sip_msg_modified; boolean_t sip_msg_cannot_be_modified; int sip_msg_len; size_t sip_msg_content_len; /* content length */ sip_content_t *sip_msg_content; /* All fields synchronizes on this */ pthread_mutex_t sip_msg_mutex; /* doubly linked list of headers */ _sip_header_t *sip_msg_headers_start; _sip_header_t *sip_msg_headers_end; _sip_header_t *sip_msg_start_line; sip_message_type_t *sip_msg_req_res; int sip_msg_ref_cnt;}_sip_msg_t;extern char *sip_get_tcp_msg(sip_conn_object_t, char *, size_t *);extern char *sip_msg_to_msgbuf(_sip_msg_t *msg, int *error);extern char *_sip_startline_to_str(_sip_msg_t *sip_msg, int *error);extern int sip_adjust_msgbuf(_sip_msg_t *msg);extern void sip_delete_all_headers(_sip_msg_t *sip_msg);extern _sip_header_t *sip_dup_header(_sip_header_t *from);extern int _sip_copy_header(_sip_msg_t *, _sip_header_t *, char *, boolean_t);extern int _sip_find_and_copy_header(_sip_msg_t *, _sip_msg_t *, char *, char *);extern int _sip_find_and_copy_all_header(_sip_msg_t *, _sip_msg_t *, char *header_name);extern _sip_header_t *sip_search_for_header(_sip_msg_t *, char *, _sip_header_t *);extern void _sip_add_header(_sip_msg_t *, _sip_header_t *, boolean_t, boolean_t, char *);extern _sip_header_t *sip_new_header(int);extern int sip_create_nonOKack(sip_msg_t, sip_msg_t, sip_msg_t);extern void sip_destroy_msg(_sip_msg_t *);extern void sip_free_header(_sip_header_t *sip_header);extern void sip_free_phdr(sip_parsed_header_t *);extern void sip_free_cftr_header(sip_parsed_header_t *);extern int sip_parse_allow_events_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_event_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_substate_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_acpt_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_acpt_encode_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_acpt_lang_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_alert_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_allow_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_useragt_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_usupport_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_timestamp_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_support_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_subject_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_server_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_retryaft_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_require_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_replyto_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_passertedid_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_ppreferredid_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_priority_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_org_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_mimeversion_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_minexpire_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_rseq_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_inreplyto_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_privacy_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_expire_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_errorinfo_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_contentlang_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_contentencode_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_contentdis_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_callinfo_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_date_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_warn_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_cftr_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_cseq_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_cid_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_first_line(_sip_header_t *, sip_message_type_t **);extern int sip_parse_via_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_clen_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_maxf_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_ctype_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_unknown_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_ainfo_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_preq_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_author_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_pauthor_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_pauthen_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_wauthen_header(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_rseq(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_rack(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_passertedid(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_ppreferredid(_sip_header_t *, sip_parsed_header_t **);extern int sip_parse_privacy_header(_sip_header_t *, sip_parsed_header_t **);extern boolean_t sip_ok_to_modify_message(_sip_msg_t *);extern sip_param_t *sip_get_param_from_list(sip_param_t *, char *);extern int sip_copy_values(char *, _sip_header_t *);extern int sip_add_content_length(_sip_msg_t *, int);/* Useful access macros */#define sip_resp_phrase_len U.sip_response.sip_response_phrase.sip_str_len#define sip_resp_phrase_ptr U.sip_response.sip_response_phrase.sip_str_ptr#define sip_resp_code U.sip_response.sip_response_code#define sip_resp_phrase U.sip_response.sip_response_phrase#define sip_req_method U.sip_request.sip_request_method#define sip_req_uri U.sip_request.sip_request_uri#define sip_req_uri_ptr U.sip_request.sip_request_uri.sip_str_ptr#define sip_req_uri_len U.sip_request.sip_request_uri.sip_str_ptr#define sip_req_parse_uri U.sip_request.sip_parse_uri#define sip_header_parse sip_header_functions->header_parse_func#define sip_header_name sip_header_functions->header_name#define sip_hdr_start sip_hdr_general.sip_hdr_start#define sip_hdr_end sip_hdr_general.sip_hdr_end#define sip_hdr_current sip_hdr_general.sip_hdr_current#define sip_hdr_parsed sip_hdr_general.sip_hdr_parsed#ifdef __cplusplus}#endif#endif /* _SIP_MSG_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -