📄 sip.h
字号:
/* * This file is part of the Sofia-SIP package * * Copyright (C) 2005 Nokia Corporation. * * Contact: Pekka Pessi <pekka.pessi@nokia.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */#ifndef SIP_H/** Defined when <sofia-sip/sip.h> has been included. */#define SIP_H/**@file sofia-sip/sip/sip.h * * SIP objects. * * @author Pekka Pessi <Pekka.Pessi@nokia.com>. * * @date Created : Thu Jun 8 19:28:55 2000 ppessi */#ifndef MSG_TYPES_H#include <sofia-sip/msg_types.h>#endif#ifndef MSG_MIME_H#include <sofia-sip/msg_mime.h>#endifSOFIA_BEGIN_DECLS/** IDs for well-known SIP methods. */typedef enum { sip_method_invalid = -1, /**< Invalid method name */ sip_method_unknown = 0, /**< Unknown method, use @c method_name */ sip_method_invite, /**< INVITE */ sip_method_ack, /**< ACK */ sip_method_cancel, /**< CANCEL */ sip_method_bye, /**< BYE */ sip_method_options, /**< OPTIONS */ sip_method_register, /**< REGISTER */ sip_method_info, /**< INFO */ sip_method_prack, /**< PRACK */ sip_method_update, /**< UPDATE */ sip_method_message, /**< MESSAGE */ sip_method_subscribe, /**< SUBSCRIBE */ sip_method_notify, /**< NOTIFY */ sip_method_refer, /**< REFER */ sip_method_publish, /**< PUBLISH */} sip_method_t;#define SIP_METHOD(s) sip_method_unknown, #s#define SIP_METHOD_ACK sip_method_ack, "ACK"#define SIP_METHOD_CANCEL sip_method_cancel, "CANCEL"#define SIP_METHOD_BYE sip_method_bye, "BYE"#define SIP_METHOD_INVITE sip_method_invite, "INVITE"#define SIP_METHOD_OPTIONS sip_method_options, "OPTIONS"#define SIP_METHOD_REGISTER sip_method_register, "REGISTER"#define SIP_METHOD_INFO sip_method_info, "INFO"#define SIP_METHOD_PRACK sip_method_prack, "PRACK"#define SIP_METHOD_UPDATE sip_method_update, "UPDATE"#define SIP_METHOD_MESSAGE sip_method_message, "MESSAGE"#define SIP_METHOD_SUBSCRIBE sip_method_subscribe, "SUBSCRIBE"#define SIP_METHOD_NOTIFY sip_method_notify, "NOTIFY"#define SIP_METHOD_REFER sip_method_refer, "REFER"#define SIP_METHOD_PUBLISH sip_method_publish, "PUBLISH"/** Magic pointer value - never valid for SIP headers. @HI */#define SIP_NONE ((void const *)-1L)/** SIP protocol identifier @HIDE */#define SIP_PROTOCOL_TAG ((void *)0x53495020) /* 'SIP'20 */enum { /** Default port for SIP as integer */ SIP_DEFAULT_PORT = 5060,#define SIP_DEFAULT_PORT SIP_DEFAULT_PORT/** Default port for SIP as string */#define SIP_DEFAULT_SERV "5060" /** Default port for SIPS as integer */ SIPS_DEFAULT_PORT = 5061,#define SIPS_DEFAULT_PORT SIPS_DEFAULT_PORT /** Default port for SIPS as string */#define SIPS_DEFAULT_SERV "5061"};/** Time in seconds */typedef msg_time_t sip_time_t;/** Latest time that can be expressed with sip_time_t. @HIDE */#define SIP_TIME_MAX ((sip_time_t)MSG_TIME_MAX)/** SIP message object. */typedef struct sip_s sip_t;/** Any SIP header - union of all possible SIP headers. */typedef union sip_header_u sip_header_t;/** Type of a generic SIP header. */typedef struct msg_generic_s sip_generic_t;#define g_value g_string/** Common part of all the header structures. */typedef msg_common_t sip_common_t;/** SIP parameter string. */typedef msg_param_t sip_param_t;/** To or From header. */typedef struct sip_addr_s sip_addr_t;/** Authorization, Proxy-Authenticate, WWW-Authenticate */typedef msg_auth_t sip_auth_t;/** Request line. */typedef struct sip_request_s sip_request_t;/** Status line. */typedef struct sip_status_s sip_status_t;/** Erroneous headers. */typedef msg_error_t sip_error_t;/** Unkown headers. */typedef msg_unknown_t sip_unknown_t;/** Separator line between payload and headers */typedef msg_separator_t sip_separator_t;/** SIP payload */typedef msg_payload_t sip_payload_t;typedef struct sip_accept_s sip_accept_t;typedef msg_accept_any_t sip_accept_encoding_t;typedef msg_accept_any_t sip_accept_language_t;typedef msg_list_t sip_allow_t;typedef struct sip_authentication_info_s sip_authentication_info_t;typedef sip_auth_t sip_authorization_t;typedef struct sip_call_id_s sip_call_id_t;typedef struct sip_call_info_s sip_call_info_t;typedef struct sip_contact_s sip_contact_t;typedef struct sip_cseq_s sip_cseq_t;typedef sip_generic_t sip_etag_t;typedef sip_generic_t sip_if_match_t;typedef msg_content_disposition_t sip_content_disposition_t;typedef msg_list_t sip_content_encoding_t;typedef msg_list_t sip_content_language_t;typedef struct sip_content_length_s sip_content_length_t;typedef struct msg_content_type_s sip_content_type_t;typedef sip_generic_t sip_mime_version_t;typedef struct sip_date_s sip_date_t;typedef struct sip_error_info_s sip_error_info_t;typedef struct sip_expires_s sip_expires_t;typedef struct sip_addr_s sip_from_t;typedef msg_list_t sip_in_reply_to_t;typedef struct sip_max_forwards_s sip_max_forwards_t;typedef struct sip_min_expires_s sip_min_expires_t;typedef struct sip_min_se_s sip_min_se_t;typedef sip_generic_t sip_organization_t;typedef sip_generic_t sip_priority_t;typedef sip_auth_t sip_proxy_authenticate_t;typedef struct sip_authentication_info_s sip_proxy_authentication_info_t;typedef sip_auth_t sip_proxy_authorization_t;typedef msg_list_t sip_proxy_require_t;typedef struct sip_rack_s sip_rack_t;typedef struct sip_reason_s sip_reason_t;typedef struct sip_route_s sip_record_route_t;typedef struct sip_refer_to_s sip_refer_to_t;typedef struct sip_referred_by_s sip_referred_by_t;typedef struct sip_replaces_s sip_replaces_t;typedef struct sip_request_disposition_s sip_request_disposition_t;typedef struct sip_caller_prefs_s sip_caller_prefs_t;typedef struct sip_caller_prefs_s sip_accept_contact_t;typedef struct sip_caller_prefs_s sip_reject_contact_t;typedef msg_list_t sip_require_t;typedef struct sip_retry_after_s sip_retry_after_t;typedef struct sip_route_s sip_route_t;typedef struct sip_rseq_s sip_rseq_t; typedef sip_generic_t sip_server_t;typedef struct sip_session_expires_s sip_session_expires_t;typedef sip_generic_t sip_subject_t;typedef struct sip_subscription_state_s sip_subscription_state_t;typedef msg_list_t sip_supported_t;typedef struct sip_timestamp_s sip_timestamp_t;typedef struct sip_addr_s sip_to_t;typedef msg_list_t sip_unsupported_t;typedef sip_generic_t sip_user_agent_t;typedef struct sip_via_s sip_via_t;typedef msg_warning_t sip_warning_t;typedef sip_auth_t sip_www_authenticate_t;typedef struct sip_event_s sip_event_t;typedef msg_list_t sip_allow_events_t;/* RFC 3323 - Privacy */typedef struct sip_privacy_s sip_privacy_t;/* RFC 3327 - Path */typedef struct sip_route_s sip_path_t;/* RFC 3329 - Security Mechanism Agreement */typedef struct sip_security_agree_s sip_security_client_t;typedef struct sip_security_agree_s sip_security_server_t;typedef struct sip_security_agree_s sip_security_verify_t;/* RFC 3608 - Service Route */typedef struct sip_route_s sip_service_route_t;/**SIP message object. * * This structure contains a SIP message object. It is used to access the * headers and payload within the message. The generic transport aspects of * the message, like network address, is accessed using a @b msg_t object * directly. */struct sip_s { msg_common_t sip_common[1]; /**< For recursive inclusion */ msg_pub_t *sip_next; void *sip_user; /**< Application data */ unsigned sip_size; int sip_flags; sip_error_t *sip_error; /**< Erroneous headers */ /* Pseudoheaders */ sip_request_t *sip_request; /**< Request line */ sip_status_t *sip_status; /**< Status line */ /* === Headers start here */ sip_via_t *sip_via; /**< Via (v) */ sip_route_t *sip_route; /**< Route */ sip_record_route_t *sip_record_route; /**< Record-Route */ sip_max_forwards_t *sip_max_forwards; /**< Max-Forwards */ sip_proxy_require_t *sip_proxy_require; /**< Proxy-Require */ sip_from_t *sip_from; /**< From (f) */ sip_to_t *sip_to; /**< To (t) */ sip_call_id_t *sip_call_id; /**< Call-ID (i) */ sip_cseq_t *sip_cseq; /**< CSeq */ sip_contact_t *sip_contact; /**< Contact (m) */ sip_rseq_t *sip_rseq; /**< RSeq */ sip_rack_t *sip_rack; /**< RAck */ /* Caller Preferences */ sip_request_disposition_t *sip_request_disposition; /**< Request-Disposition (d) */ sip_accept_contact_t *sip_accept_contact;/**< Accept-Contact (a) */ sip_reject_contact_t *sip_reject_contact;/**< Reject-Contact (j) */ sip_expires_t *sip_expires; /**< Expires */ sip_date_t *sip_date; /**< Date */ sip_retry_after_t *sip_retry_after; /**< Retry-After */ sip_timestamp_t *sip_timestamp; /**< Timestamp */ sip_min_expires_t *sip_min_expires; /**< Min-Expires */ sip_subject_t *sip_subject; /**< Subject (s) */ sip_priority_t *sip_priority; /**< Priority */ sip_call_info_t *sip_call_info; /**< Call-Info */ sip_organization_t *sip_organization; /**< Organization */ sip_server_t *sip_server; /**< Server */ sip_user_agent_t *sip_user_agent; /**< User-Agent */ sip_in_reply_to_t *sip_in_reply_to; /**< In-Reply-To */ sip_accept_t *sip_accept; /**< Accept */ sip_accept_encoding_t *sip_accept_encoding; /**< Accept-Encoding */ sip_accept_language_t *sip_accept_language; /**< Accept-Language */ sip_allow_t *sip_allow; /**< Allow */ sip_require_t *sip_require; /**< Require */ sip_supported_t *sip_supported; /**< Supported (k) */ sip_unsupported_t *sip_unsupported; /**< Unsupported */ /* RFC 3265 */ sip_event_t *sip_event; /**< Event (o) */ sip_allow_events_t *sip_allow_events; /**< Allow-Events (u) */ sip_subscription_state_t *sip_subscription_state; /**< Subscription-State */ sip_proxy_authenticate_t *sip_proxy_authenticate; /**< Proxy-Authenticate */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -