Logo Search packages:      
Sourcecode: sofia-sip version File versions

sip.h

Go to the documentation of this file.
/*
 * 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.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>
#endif

SOFIA_BEGIN_DECLS

/** IDs for well-known SIP methods. */
00048 typedef enum {
00049   sip_method_invalid = -1,    /**< Invalid method name */
00050   sip_method_unknown = 0,     /**< Unknown method, use @c method_name */
00051   sip_method_invite,          /**< INVITE */
00052   sip_method_ack,       /**< ACK */
00053   sip_method_cancel,          /**< CANCEL */
00054   sip_method_bye,       /**< BYE */
00055   sip_method_options,         /**< OPTIONS */
00056   sip_method_register,        /**< REGISTER */
00057   sip_method_info,            /**< INFO */
00058   sip_method_prack,           /**< PRACK */
00059   sip_method_update,          /**< UPDATE */
00060   sip_method_message,         /**< MESSAGE */
00061   sip_method_subscribe,       /**< SUBSCRIBE */
00062   sip_method_notify,          /**< NOTIFY */
00063   sip_method_refer,           /**< REFER */
00064   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 */
00084 #define SIP_NONE ((void const *)-1L)

/** SIP protocol identifier @HIDE */
00087 #define SIP_PROTOCOL_TAG   ((void *)0x53495020) /* 'SIP'20 */

enum {
  /** Default port for SIP as integer */
00091  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 */
00098  SIPS_DEFAULT_PORT = 5061,
#define SIPS_DEFAULT_PORT SIPS_DEFAULT_PORT
 /** Default port for SIPS as string */
00101 #define SIPS_DEFAULT_SERV "5061"
};

/** Time in seconds since Jan 01 1900.  */
00105 typedef msg_time_t sip_time_t;

/** Latest time that can be expressed with #sip_time_t. @HIDE */
00108 #define SIP_TIME_MAX ((sip_time_t)MSG_TIME_MAX)

/** SIP message object. */
00111 typedef struct sip_s                sip_t;

/** Any SIP header - union of all possible SIP headers. */
00114 typedef union sip_header_u          sip_header_t;

/** Type of a generic SIP header. */
00117 typedef struct msg_generic_s        sip_generic_t;
#define g_value g_string

/** Common part of all the header structures. */
00121 typedef msg_common_t                sip_common_t;

/** SIP parameter string. */
00124 typedef msg_param_t                 sip_param_t;

/** @To or @From header. */
00127 typedef struct sip_addr_s           sip_addr_t;

/** @Authorization, @ProxyAuthenticate, @WWWAuthenticate */
00130 typedef msg_auth_t                  sip_auth_t;

typedef struct sip_request_s      sip_request_t;
00133 typedef struct sip_status_s       sip_status_t;
00134 typedef msg_error_t                 sip_error_t;
00135 typedef msg_unknown_t               sip_unknown_t;
00136 typedef msg_separator_t             sip_separator_t;
00137 typedef msg_payload_t               sip_payload_t;

00139 typedef struct sip_accept_s       sip_accept_t;
00140 typedef msg_accept_any_t                sip_accept_encoding_t;
00141 typedef msg_accept_any_t                sip_accept_language_t;
00142 typedef struct sip_allow_s        sip_allow_t;
00143 typedef struct msg_auth_info_s      sip_authentication_info_t;
typedef struct msg_auth_s         sip_authorization_t;
00145 typedef struct sip_call_id_s      sip_call_id_t;
00146 typedef struct sip_call_info_s      sip_call_info_t;
00147 typedef struct sip_contact_s      sip_contact_t;
00148 typedef struct sip_cseq_s         sip_cseq_t;
00149 typedef struct msg_generic_s        sip_etag_t;
00150 typedef struct msg_generic_s        sip_if_match_t;
00151 typedef msg_content_disposition_t   sip_content_disposition_t;
00152 typedef msg_list_t                      sip_content_encoding_t;
00153 typedef msg_list_t                      sip_content_language_t;
00154 typedef struct sip_content_length_s sip_content_length_t;
00155 typedef struct msg_content_type_s   sip_content_type_t;
00156 typedef struct msg_generic_s        sip_mime_version_t;
00157 typedef struct sip_date_s         sip_date_t;
00158 typedef struct sip_error_info_s     sip_error_info_t;
00159 typedef struct sip_expires_s        sip_expires_t;
00160 typedef struct sip_addr_s         sip_from_t;
00161 typedef msg_list_t                  sip_in_reply_to_t;
00162 typedef struct sip_max_forwards_s   sip_max_forwards_t;
00163 typedef struct sip_min_expires_s    sip_min_expires_t;
00164 typedef struct sip_min_se_s         sip_min_se_t;
00165 typedef struct msg_generic_s        sip_organization_t;
00166 typedef struct msg_generic_s        sip_priority_t;
typedef struct msg_auth_s         sip_proxy_authenticate_t;
00168 typedef struct msg_auth_info_s      sip_proxy_authentication_info_t;
typedef struct msg_auth_s               sip_proxy_authorization_t;
00170 typedef msg_list_t                sip_proxy_require_t;
00171 typedef struct sip_rack_s           sip_rack_t;
00172 typedef struct sip_reason_s         sip_reason_t;
00173 typedef struct sip_route_s              sip_record_route_t;

00175 typedef struct sip_refer_to_s       sip_refer_to_t;
00176 typedef struct sip_referred_by_s    sip_referred_by_t;
00177 typedef struct sip_replaces_s       sip_replaces_t;

00179 typedef struct sip_request_disposition_s sip_request_disposition_t;

typedef struct sip_caller_prefs_s   sip_caller_prefs_t;
00182 typedef struct sip_caller_prefs_s   sip_accept_contact_t;
00183 typedef struct sip_caller_prefs_s   sip_reject_contact_t;

00185 typedef msg_list_t                sip_require_t;
00186 typedef struct sip_retry_after_s    sip_retry_after_t;
00187 typedef struct sip_route_s              sip_route_t;
00188 typedef struct sip_rseq_s           sip_rseq_t;     
00189 typedef struct msg_generic_s        sip_server_t;
00190 typedef struct sip_session_expires_s
                                    sip_session_expires_t;
00192 typedef struct msg_generic_s        sip_subject_t;
00193 typedef struct sip_subscription_state_s
                                    sip_subscription_state_t;
00195 typedef msg_list_t                sip_supported_t;
00196 typedef struct sip_timestamp_s          sip_timestamp_t;
00197 typedef struct sip_addr_s           sip_to_t;
00198 typedef msg_list_t                sip_unsupported_t;
00199 typedef struct msg_generic_s        sip_user_agent_t;
00200 typedef struct sip_via_s          sip_via_t;
00201 typedef msg_warning_t               sip_warning_t;
typedef struct msg_auth_s         sip_www_authenticate_t;

00204 typedef struct sip_event_s          sip_event_t;
00205 typedef msg_list_t                  sip_allow_events_t;

/* RFC 3323 - @Privacy */
00208 typedef struct sip_privacy_s sip_privacy_t;

/* RFC 3327 - @Path */
00211 typedef struct sip_route_s              sip_path_t;

/* RFC 3329 - Security Mechanism Agreement */
00214 typedef struct sip_security_agree_s sip_security_client_t;
00215 typedef struct sip_security_agree_s sip_security_server_t;
00216 typedef struct sip_security_agree_s sip_security_verify_t;

/* RFC 3608 - Service Route */
00219 typedef struct sip_route_s              sip_service_route_t;


/**SIP message object.
 *
 * This structure contains a parsed SIP message. The struct is usually
 * referred with typedef #sip_t. It is used to access the headers and
 * payload within the SIP message. The generic transport aspects of the
 * message, like network address, is accessed using the #msg_t object
 * directly.
 */
00230 struct sip_s {
00231   msg_common_t               sip_common[1];     /**< For recursive inclusion */
00232   msg_pub_t                 *sip_next;          /**< Dummy link to msgfrag */
00233   void                      *sip_user;            /**< Application data */
00234   unsigned                   sip_size;          /**< Size of structure */
00235   int                        sip_flags;           /**< Parser flags */

00237   sip_error_t               *sip_error;           /**< Erroneous headers */

  /* Pseudoheaders */
00240   sip_request_t             *sip_request;       /**< Request line  */
00241   sip_status_t              *sip_status;        /**< Status line */

  /* === Headers start here */
00244   sip_via_t                 *sip_via;           /**< Via (v) */
00245   sip_route_t               *sip_route;         /**< Route */
00246   sip_record_route_t        *sip_record_route;  /**< Record-Route */
00247   sip_max_forwards_t        *sip_max_forwards;  /**< Max-Forwards */
00248   sip_proxy_require_t       *sip_proxy_require; /**< Proxy-Require */

00250   sip_from_t                *sip_from;          /**< From (f) */
00251   sip_to_t                  *sip_to;            /**< To (t) */
00252   sip_call_id_t             *sip_call_id; /**< Call-ID (i) */
00253   sip_cseq_t                *sip_cseq;          /**< CSeq */
00254   sip_contact_t             *sip_contact; /**< Contact (m) */
00255   sip_rseq_t                *sip_rseq;          /**< RSeq */
00256   sip_rack_t                *sip_rack;          /**< RAck */

  /* Caller Preferences */
  sip_request_disposition_t *sip_request_disposition; 
00260                                                 /**< Request-Disposition (d) */
00261   sip_accept_contact_t      *sip_accept_contact;/**< Accept-Contact (a) */
00262   sip_reject_contact_t      *sip_reject_contact;/**< Reject-Contact (j) */

00264   sip_expires_t             *sip_expires; /**< Expires */
00265   sip_date_t                *sip_date;          /**< Date */
00266   sip_retry_after_t         *sip_retry_after;   /**< Retry-After */
00267   sip_timestamp_t           *sip_timestamp;     /**< Timestamp */
00268   sip_min_expires_t         *sip_min_expires;   /**< Min-Expires */

00270   sip_subject_t             *sip_subject; /**< Subject (s) */
00271   sip_priority_t            *sip_priority;      /**< Priority */

00273   sip_call_info_t           *sip_call_info;     /**< Call-Info */
00274   sip_organization_t        *sip_organization;  /**< Organization */
00275   sip_server_t              *sip_server;  /**< Server */
00276   sip_user_agent_t          *sip_user_agent;    /**< User-Agent */
00277   sip_in_reply_to_t         *sip_in_reply_to;   /**< In-Reply-To */

00279   sip_accept_t              *sip_accept;  /**< Accept */
00280   sip_accept_encoding_t     *sip_accept_encoding; /**< Accept-Encoding */
00281   sip_accept_language_t     *sip_accept_language; /**< Accept-Language */

00283   sip_allow_t               *sip_allow;         /**< Allow */
00284   sip_require_t             *sip_require; /**< Require */
00285   sip_supported_t           *sip_supported;     /**< Supported (k) */
00286   sip_unsupported_t         *sip_unsupported;   /**< Unsupported */

  /* RFC 3265 */
00289   sip_event_t               *sip_event;           /**< Event (o) */
00290   sip_allow_events_t        *sip_allow_events;  /**< Allow-Events (u) */
  sip_subscription_state_t  *sip_subscription_state; 
00292                         /**< Subscription-State */

  sip_proxy_authenticate_t  *sip_proxy_authenticate;
00295                         /**< Proxy-Authenticate */
  sip_proxy_authentication_info_t *sip_proxy_authentication_info;
00297                         /**< Proxy-Authentication-Info */
  sip_proxy_authorization_t *sip_proxy_authorization;
00299                         /**< Proxy-Authorization */
  sip_authorization_t       *sip_authorization;       
00301                         /**< Authorization */
  sip_www_authenticate_t    *sip_www_authenticate;
00303                         /**< WWW-Authenticate */
  sip_authentication_info_t *sip_authentication_info;
00305                                 /**< Authentication-Info */
00306   sip_error_info_t          *sip_error_info;    /**< Error-Info */
00307   sip_warning_t             *sip_warning; /**< Warning */

  /* RFC 3515 */
00310   sip_refer_to_t            *sip_refer_to;      /**< Refer-To (r) */
00311   sip_referred_by_t         *sip_referred_by;   /**< Referred-By (b) */
00312   sip_replaces_t            *sip_replaces;      /**< Replaces */

  /* draft-ietf-sip-session-timer */
  sip_session_expires_t     *sip_session_expires;
00316                         /**< Session-Expires (x) */
00317   sip_min_se_t              *sip_min_se;        /**< Min-SE */

00319   sip_path_t                *sip_path;        /**< Path */
00320   sip_service_route_t       *sip_service_route; /**< Service-Route */

00322   sip_reason_t              *sip_reason;        /**< Reason */

00324   sip_security_client_t     *sip_security_client; /**< Security-Client */
00325   sip_security_server_t     *sip_security_server; /**< Security-Server */
00326   sip_security_verify_t     *sip_security_verify; /**< Security-Verify */

00328   sip_privacy_t             *sip_privacy; /**< Privacy */

00330   sip_etag_t                *sip_etag;          /**< SIP-ETag */
00331   sip_if_match_t            *sip_if_match;      /**< SIP-If-Match */

  /* Entity headers */
00334   sip_mime_version_t        *sip_mime_version;  /**< MIME-Version */
00335   sip_content_type_t        *sip_content_type;  /**< Content-Type (c) */
  sip_content_encoding_t    *sip_content_encoding; 
00337                         /**< Content-Encoding (e) */
00338   sip_content_language_t    *sip_content_language; /**< Content-Language */
  sip_content_disposition_t *sip_content_disposition; 
00340                         /**< Content-Disposition */
00341   sip_content_length_t      *sip_content_length;/**< Content-Length (l) */

  /* === Headers end here */

00345   sip_unknown_t             *sip_unknown;       /**< Unknown headers */
  sip_separator_t           *sip_separator;     
00347                         /**< Separator between headers and payload */
00348   sip_payload_t             *sip_payload; /**< Message payload */
00349   msg_multipart_t           *sip_multipart;     /**< Multipart MIME payload */
};


/** @ingroup sip_request
 * @brief Structure for @ref sip_request "SIP request line".
 */
00356 struct sip_request_s
{
00358   sip_common_t     rq_common[1];   /**< Common fragment info */
00359   sip_error_t     *rq_next;      /**< Link to next (dummy) */
00360   sip_method_t     rq_method;    /**< Method enum */
00361   char const      *rq_method_name; /**< Method name */
00362   url_t            rq_url[1];    /**< RequestURI */
00363   char const      *rq_version;     /**< Protocol version */
};

/**@ingroup sip_status
 * @brief Structure for @ref sip_status "SIP status line".
 */
00369 struct sip_status_s
{
00371   sip_common_t   st_common[1];      /**< Common fragment info */
00372   sip_error_t   *st_next;     /**< Link to next (dummy) */
00373   char const    *st_version;  /**< Protocol version */
00374   int            st_status;   /**< Status code */
00375   char const    *st_phrase;   /**< Status phrase */
};

/**@ingroup sip_from
 * @brief Structure for @From and @To headers.
 */
00381 struct sip_addr_s
{
00383   sip_common_t       a_common[1];   /**< Common fragment info */
  sip_error_t       *a_next;
00385   char const        *a_display;         /**< Display name */
00386   url_t              a_url[1];          /**< URL */
00387   msg_param_t const *a_params;          /**< Parameter table  */
00388   char const        *a_comment;         /**< Comment */
 
00390   char const        *a_tag;       /**< Tag parameter */
};

#define a_user a_url->url_user
#define a_host a_url->url_host

/**@ingroup sip_accept
 * @brief Structure for @Accept header field.
 */
00399 struct sip_accept_s
{
00401   sip_common_t        ac_common[1]; /**< Common fragment info */
00402   sip_accept_t       *ac_next;          /**< Pointer to next @Accept value */
00403   char const         *ac_type;          /**< Pointer to type/subtype */
00404   char const         *ac_subtype;   /**< Points after first slash in type */
00405   msg_param_t const  *ac_params;    /**< List of parameters */
00406   char const         *ac_q;       /**< Value of q parameter */
};

/**@ingroup sip_allow
 * @brief Structure for @Allow header field.
 *
 * @NEW_1_12_5 (before used struct msg_list_s with @Allow).
 */
00414 struct sip_allow_s
{
00416   msg_common_t       k_common[1];   /**< Common fragment info */
00417   msg_list_t        *k_next;      /**< Link to next */
00418   msg_param_t       *k_items;     /**< List of allowed items */
00419   uint32_t           k_bitmap;          /**< Bitmap of allowed methods. 
                               @NEW_1_12_5 */
};

/**@ingroup sip_authentication_info
 * @brief Structure for @AuthenticationInfo header.
 *
 * @deprecated Use struct msg_auth_info_s instead.
 */
00428 struct sip_authentication_info_s
{
00430   sip_common_t        ai_common[1]; /**< Common fragment info */
00431   sip_error_t        *ai_next;          /**< Dummy link to next */
00432   msg_param_t const  *ai_params;    /**< List of authentication info */
};

/**@ingroup sip_call_id 
 * @brief Structure for @CallID (and @InReplyTo) header fields.
 */
00438 struct sip_call_id_s {        
00439   sip_common_t   i_common[1];     /**< Common fragment info */
00440   sip_call_id_t *i_next;          /**< Link to next (In-Reply-To) */
00441   char const    *i_id;            /**< ID value */
00442   uint32_t       i_hash;          /**< Hash value (always nonzero) */
};

/**@ingroup sip_call_info
 * @brief Structure for @CallInfo header.
 */
00448 struct sip_call_info_s
{
00450   sip_common_t        ci_common[1]; /**< Common fragment info */
00451   sip_call_info_t    *ci_next;          /**< Link to next @CallInfo */
00452   url_t               ci_url[1];    /**< URI to call info  */
00453   msg_param_t const  *ci_params;    /**< List of parameters */
00454   char const         *ci_purpose;   /**< Value of @b purpose parameter */
};

/**@ingroup sip_cseq
 * @brief Structure for @CSeq header.
 */
00460 struct sip_cseq_s
{
00462   sip_common_t   cs_common[1];          /**< Common fragment info */
00463   sip_error_t   *cs_next;         /**< Link to next (dummy) */
00464   uint32_t       cs_seq;          /**< Sequence number */
00465   sip_method_t   cs_method;       /**< Method enum */
00466   char const    *cs_method_name;    /**< Method name */
};

/**@ingroup sip_contact
 * @brief Structure for @Contact header field.
 */
00472 struct sip_contact_s
{
00474   sip_common_t        m_common[1];  /**< Common fragment info */
00475   sip_contact_t      *m_next;     /**< Link to next @Contact header */
00476   char const         *m_display;    /**< Display name */
00477   url_t               m_url[1];         /**< SIP URL */
00478   msg_param_t const  *m_params;         /**< List of contact-params */
00479   char const         *m_comment;    /**< Comment */

00481   char const         *m_q;        /**< @Priority */
00482   char const         *m_expires;    /**< Expiration time */
};

/**@ingroup sip_content_length
 * @brief Structure for @ContentLength header.
 */
00488 struct sip_content_length_s
{
00490   sip_common_t   l_common[1];     /**< Common fragment info */
00491   sip_error_t   *l_next;          /**< Link to next (dummy) */
00492   uint32_t       l_length;        /**< Length in bytes */
};

#if DOCUMENTATION_ONLY
/**@ingroup sip_content_type
 *
 * @brief Structure for @ContentType header.
 */
struct sip_content_type_s
{
  sip_common_t        c_common[1];  /**< Common fragment info */
  sip_error_t        *c_next;     /**< Dummy link to next */
  char const         *c_type;     /**< Pointer to type/subtype */
  char const         *c_subtype;    /**< Points after first slash in type */
  msg_param_t const  *c_params;         /**< List of parameters */
};
#endif

/**@ingroup sip_date
 * @brief Structure for @Date header.
 */
00513 struct sip_date_s
{
00515   sip_common_t   d_common[1];     /**< Common fragment info */
00516   sip_date_t    *d_next;          /**< Link to next (dummy) */
00517   sip_time_t     d_time;          /**< Seconds since Jan 1, 1900 */
};

/**@ingroup sip_error_info
 * @brief Structure for @ErrorInfo header.
 */
00523 struct sip_error_info_s
{
00525   sip_common_t        ei_common[1]; /**< Common fragment info */
00526   sip_call_info_t    *ei_next;          /**< Link to next @ErrorInfo */
00527   url_t               ei_url[1];    /**< URI to error description */
00528   msg_param_t const  *ei_params;    /**< List of parameters */
};

/**@ingroup sip_event
 * @brief Structure for @Event header.
 */
00534 struct sip_event_s 
{
00536   sip_common_t        o_common[1];  /**< Common fragment info */
00537   sip_error_t        *o_next;     /**< Link to next (dummy) */
00538   char const *        o_type;     /**< @Event type */
00539   msg_param_t const  *o_params;         /**< List of parameters */
00540   char const         *o_id;       /**< @Event ID */
};

/**@ingroup sip_expires
 * @brief Structure for @Expires header.
 */
00546 struct sip_expires_s
{
00548   sip_common_t        ex_common[1]; /**< Common fragment info */
00549   sip_error_t        *ex_next;          /**< Link to next (dummy) */
00550   sip_time_t          ex_date;          /**< Seconds since Jan 1, 1900 */
# define ex_time ex_date
00552   sip_time_t          ex_delta;         /**< Delta seconds */
};

/**@ingroup sip_max_forwards
 * @brief Structure for @MaxForwards header.
 */
00558 struct sip_max_forwards_s
{
00560   sip_common_t        mf_common[1]; /**< Common fragment info */
00561   sip_error_t        *mf_next;          /**< Link to next (dummy) */
00562   unsigned long       mf_count;         /**< Forwarding count */
};

/**@ingroup sip_min_expires
 * @brief Structure for @MinExpires header.
 */
00568 struct sip_min_expires_s
{
00570   sip_common_t        me_common[1]; /**< Common fragment info */
00571   sip_error_t        *me_next;          /**< Link to next (dummy) */
00572   unsigned long       me_delta;         /**< Seconds */
};

/**@ingroup sip_rack
 * @brief Structure for @b Rack header.
 */
00578 struct sip_rack_s
{
00580   sip_common_t        ra_common;        /**< Common fragment info */
00581   sip_error_t        *ra_next;            /**< Dummy link to next */
00582   uint32_t            ra_response;  /**< Sequence number of response */
00583   uint32_t            ra_cseq;            /**< Sequence number of request  */
00584   sip_method_t        ra_method;    /**< Original request method */
00585   char const         *ra_method_name;     /**< Original request method name */
};

/**@ingroup sip_refer_to
 * @brief Structure for @ReferTo header.
 */
00591 struct sip_refer_to_s
{
00593   sip_common_t        r_common[1];  /**< Common fragment info */
00594   sip_error_t        *r_next;     /**< Link to next (dummy) */
  char const         *r_display;
00596   url_t               r_url[1];         /**< URI to reference */
00597   msg_param_t const  *r_params;         /**< List of parameters */
};

/**@ingroup sip_referred_by
 * @brief Structure for @ReferredBy header.
 */
00603 struct sip_referred_by_s
{
00605   sip_common_t        b_common[1];  /**< Common fragment info */
00606   sip_error_t        *b_next;     /**< Link to next (dummy) */
  char const         *b_display;
00608   url_t               b_url[1];         /**< Referrer-URI */
00609   msg_param_t const  *b_params;         /**< List of parameters */
00610   char const         *b_cid;      /**< The cid parameter */
};


/**@ingroup sip_replaces
 * @brief Structure for @Replaces header.
 */
00617 struct sip_replaces_s
{
00619   sip_common_t        rp_common[1];   /**< Common fragment info */
00620   sip_error_t        *rp_next;            /**< Link to next (dummy) */
00621   char const         *rp_call_id;     /**< @CallID of dialog to replace */
00622   msg_param_t const  *rp_params;      /**< List of parameters */
00623   char const         *rp_to_tag;      /**< Value of "to-tag" parameter */
00624   char const         *rp_from_tag;    /**< Value of "from-tag" parameter */
00625   unsigned            rp_early_only;  /**< early-only parameter */
};


/**@ingroup sip_retry_after
 * @brief Structure for @RetryAfter header.
 */
00632 struct sip_retry_after_s {
00633   sip_common_t        af_common[1]; /**< Common fragment info */
00634   sip_error_t        *af_next;          /**< Link to next (dummy) */
00635   sip_time_t          af_delta;         /**< Seconds to before retry */
00636   char const         *af_comment;   /**< Comment string */
00637   msg_param_t const  *af_params;    /**< List of parameters */
00638   char const         *af_duration;  /**< Value of "duration" parameter */
};

/**@ingroup sip_request_disposition
 * @brief Structure for @RequestDisposition header.
 */
00644 struct sip_request_disposition_s
{
00646   sip_common_t        rd_common[1]; /**< Common fragment info */
00647   sip_error_t        *rd_next;          /**< Link to next (dummy) */
00648   msg_param_t        *rd_items;     /**< List of directives */
};

/**@ingroup sip_caller_preferences
 * @brief Structure for @AcceptContact and @RejectContact header fields.
 */
00654 struct sip_caller_prefs_s
{
00656   sip_common_t        cp_common[1];   /**< Common fragment info */
00657   sip_caller_prefs_t *cp_next;            /**< Link to next (dummy) */
00658   msg_param_t const  *cp_params;      /**< List of parameters */
00659   char const         *cp_q;           /**< @Priority */
00660   unsigned            cp_require :1;  /**< Value of "require" parameter */
00661   unsigned            cp_explicit :1; /**< Value of "explicit" parameter */
};

/**@ingroup sip_reason
 * @brief Structure for @Reason header field.
 */
00667 struct sip_reason_s
{
00669   sip_common_t        re_common[1]; /**< Common fragment info */
00670   sip_reason_t       *re_next;          /**< Link to next */
00671   char const         *re_protocol;  /**< Protocol */
00672   msg_param_t const  *re_params;    /**< List of reason parameters */
00673   char const         *re_cause;         /**< Value of cause parameter */
00674   char const         *re_text;          /**< Value of text parameter */
};

/**@ingroup sip_route
 * @brief Structure for @Route and @RecordRoute header fields.
 */
00680 struct sip_route_s
{
00682   sip_common_t        r_common[1];  /**< Common fragment info */
00683   sip_route_t        *r_next;     /**< Link to next */
00684   char const         *r_display;    /**< Display name */
00685   url_t               r_url[1];         /**< @Route URL */
00686   msg_param_t const  *r_params;         /**< List of route parameters */
};

/**@ingroup sip_rseq 
 * @brief Structure for @RSeq header.
 */
00692 struct sip_rseq_s
{
00694   sip_common_t        rs_common[1]; /**< Common fragment info */
00695   sip_error_t        *rs_next;            /**< Dummy link to next */
00696   unsigned long       rs_response;  /**< Sequence number of response */
};

/**@ingroup sip_session_expires 
 * @brief Structure for @SessionExpires header.
 */
00702 struct sip_session_expires_s
{
00704   sip_common_t        x_common[1];  /**< Common fragment info */
00705   sip_error_t        *x_next;       /**< Dummy link to next */
00706   unsigned long       x_delta;            /**< Delta-seconds */
00707   msg_param_t const  *x_params;           /**< List of parameters */
00708   char const         *x_refresher;  /**< Value of "refresher"
                               * parameter: UAS or UAC */
};

/**@ingroup sip_min_se 
 * @brief Structure for @MinSE header.
 */
00715 struct sip_min_se_s
{
00717   sip_common_t        min_common[1];      /**< Common fragment info */
00718   sip_error_t        *min_next;           /**< Dummy link to next */
00719   unsigned long       min_delta;    /**< Delta-seconds */
00720   msg_param_t const  *min_params;   /**< List of extension parameters */
};

/**@ingroup sip_subscription_state 
 * @brief Structure for @SubscriptionState header.
 */
00726 struct sip_subscription_state_s
{
00728   sip_common_t        ss_common[1];   /**< Common fragment info */
00729   sip_error_t        *ss_next;            /**< Dummy link to next */
  /** Subscription state: "pending", "active" or "terminated" */
00731   char const         *ss_substate; 
00732   msg_param_t const  *ss_params;      /**< List of parameters */
00733   char const         *ss_reason;      /**< Reason for termination  */
00734   char const         *ss_expires;     /**< Subscription lifetime */
00735   char const         *ss_retry_after; /**< Value of retry-after parameter */
};

/**@ingroup sip_timestamp
 * @brief Structure for @Timestamp header.
 */
00741 struct sip_timestamp_s 
{
00743   sip_common_t        ts_common[1]; /**< Common fragment info */
00744   sip_error_t        *ts_next;          /**< Dummy link to next */
00745   char const         *ts_stamp;         /**< Original timestamp */
00746   char const         *ts_delay;         /**< Delay at UAS */
};

/**@ingroup sip_via
 * @brief Structure for @Via header field.
 */
00752 struct sip_via_s
{
00754   sip_common_t        v_common[1];  /**< Common fragment info */
00755   sip_via_t          *v_next;     /**< Link to next @Via header */
00756   char const         *v_protocol;   /**< Application and transport protocol */
00757   char const         *v_host;     /**< Hostname */
00758   char const         *v_port;     /**< Port number */
00759   msg_param_t const  *v_params;         /**< List of via-params */
00760   char const         *v_comment;    /**< Comment */
00761   char const         *v_ttl;      /**< Value of "ttl" parameter */
00762   char const         *v_maddr;          /**< Value of "maddr" parameter */
00763   char const         *v_received;   /**< Value of "received" parameter*/
00764   char const         *v_branch;         /**< Value of "branch" parameter */
00765   char const         *v_rport;          /**< Value of "rport" parameter */
00766   char const         *v_comp;     /**< Value of "comp" parameter */
};

/**@ingroup sip_security_client
 * @brief Structure for @SecurityClient, @SecurityServer, and
 * @SecurityVerify headers.
 */
00773 struct sip_security_agree_s
{
00775   sip_common_t        sa_common[1]; /**< Common fragment info */
00776   struct sip_security_agree_s 
                     *sa_next;          /**< Link to next mechanism */
00778   char const         *sa_mec;     /**< Security mechanism */
00779   msg_param_t const  *sa_params;    /**< List of mechanism parameters */
00780   char const         *sa_q;       /**< Value of q (preference) parameter */
00781   char const         *sa_d_alg;         /**< Value of d-alg parameter */
00782   char const         *sa_d_qop;         /**< Value of d-qop parameter */
00783   char const         *sa_d_ver;         /**< Value of d-ver parameter */
};

/**@ingroup sip_privacy
 * @brief Structure for @Privacy header.
 */
00789 struct sip_privacy_s
{
00791   sip_common_t       priv_common[1];/**< Common fragment info */
00792   sip_error_t       *priv_next;         /**< Dummy link */
00793   msg_param_t const *priv_values;   /**< @Privacy values */
};

/* union representing any SIP header
 * these are arrays of size 1 for easy casting
 */
union sip_header_u
{
  sip_common_t               sh_common[1]; 
  struct
  {
    sip_common_t             shn_common;
    sip_header_t            *shn_next;
  }                          sh_header_next[1];
#define sh_next              sh_header_next->shn_next
#define sh_class sh_common->h_class
#define sh_succ  sh_common->h_succ
#define sh_prev  sh_common->h_prev
#define sh_data  sh_common->h_data
#define sh_len   sh_common->h_len

  sip_addr_t                 sh_addr[1];
  sip_auth_t                 sh_auth[1];
  sip_generic_t              sh_generic[1];

  sip_request_t              sh_request[1];
  sip_status_t               sh_status[1];

  sip_error_t                sh_error[1];

  sip_via_t                  sh_via[1];
  sip_route_t                sh_route[1];
  sip_record_route_t         sh_record_route[1];
  sip_max_forwards_t         sh_max_forwards[1];

  sip_from_t                 sh_from[1];
  sip_to_t                   sh_to[1];
  sip_contact_t              sh_contact[1];
  sip_call_id_t              sh_call_id[1];
  sip_cseq_t                 sh_cseq[1];
  sip_rseq_t                 sh_rseq[1];
  sip_rack_t                 sh_rack[1];
                             
  sip_subject_t              sh_subject[1];
  sip_priority_t             sh_priority[1];

  sip_date_t                 sh_date[1];
  sip_retry_after_t          sh_retry_after[1];
  sip_timestamp_t            sh_timestamp[1];
  sip_expires_t              sh_expires[1];
  sip_min_expires_t          sh_min_expires[1];

  sip_call_info_t            sh_call_info[1];
  sip_organization_t         sh_organization[1];
  sip_server_t               sh_server[1];
  sip_user_agent_t           sh_user_agent[1];
  sip_in_reply_to_t          sh_in_reply_to[1];

  sip_accept_t               sh_accept[1];
  sip_accept_encoding_t      sh_accept_encoding[1];
  sip_accept_language_t      sh_accept_language[1];
                             
  sip_allow_t                sh_allow[1];
  sip_require_t              sh_require[1];
  sip_proxy_require_t        sh_proxy_require[1];
  sip_supported_t            sh_supported[1];
  sip_unsupported_t          sh_unsupported[1];

  sip_event_t                sh_event[1];
  sip_allow_events_t         sh_allow_events[1];
  sip_subscription_state_t   sh_subscription_state[1];

  sip_proxy_authenticate_t   sh_proxy_authenticate[1];
  sip_proxy_authentication_info_t sh_proxy_authentication_info[1];
  sip_proxy_authorization_t  sh_proxy_authorization[1]; 
                             
  sip_authorization_t        sh_authorization[1];
  sip_www_authenticate_t     sh_www_authenticate[1];
  sip_authentication_info_t  sh_authentication_info[1];

  sip_error_info_t           sh_error_info[1];
  sip_warning_t              sh_warning[1];

  sip_refer_to_t             sh_refer_to[1];
  sip_referred_by_t          sh_referred_by[1];
  sip_replaces_t             sh_replaces[1];

  /* Caller-Preferences */
  sip_caller_prefs_t         sh_caller_prefs[1];
  sip_request_disposition_t  sh_request_disposition[1];
  sip_accept_contact_t       sh_accept_contact[1];
  sip_reject_contact_t       sh_reject_contact[1];
   
  sip_session_expires_t      sh_session_expires[1];
  sip_min_se_t               sh_min_se[1];

  sip_path_t                 sh_path[1];
  sip_service_route_t        sh_service_route[1];

  sip_reason_t               sh_reason[1];

  sip_security_client_t      sh_security_client[1];
  sip_security_server_t      sh_security_server[1];
  sip_security_verify_t      sh_security_verify[1];

  sip_privacy_t              sh_privacy[1];

  sip_etag_t                 sh_etag[1];
  sip_if_match_t             sh_if_match[1];
    
  /* Entity headers */
  sip_mime_version_t         sh_mime_version[1];
  sip_content_type_t         sh_content_type[1];
  sip_content_encoding_t     sh_content_encoding[1];
  sip_content_language_t     sh_content_language[1];
  sip_content_length_t       sh_content_length[1];
  sip_content_disposition_t  sh_content_disposition[1];

  sip_unknown_t              sh_unknown[1];

  sip_separator_t            sh_separator[1];
  sip_payload_t              sh_payload[1];
};

SOFIA_END_DECLS

#endif /* !defined(SIP_H) */

Generated by  Doxygen 1.6.0   Back to index