1
/* $Id: sip_types.h 4262 2012-09-20 06:00:23Z bennylp $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJSIP_SIP_TYPES_H__
21
#define __PJSIP_SIP_TYPES_H__
25
* My note: Doxygen PJSIP and PJSIP_CORE group is declared in
31
* @brief Basic PJSIP types.
34
#include <pjsip/sip_config.h>
38
* @addtogroup PJSIP_BASE
41
/* @defgroup PJSIP_TYPES Basic Data Types
43
* @brief Basic data types.
50
* Forward declaration for SIP transport.
52
typedef struct pjsip_transport pjsip_transport;
55
* Forward declaration for transport manager.
57
typedef struct pjsip_tpmgr pjsip_tpmgr;
62
typedef enum pjsip_transport_type_e
65
PJSIP_TRANSPORT_UNSPECIFIED,
79
/** Loopback (stream, reliable) */
82
/** Loopback (datagram, unreliable) */
83
PJSIP_TRANSPORT_LOOP_DGRAM,
85
/** Start of user defined transport */
86
PJSIP_TRANSPORT_START_OTHER,
88
/** Start of IPv6 transports */
89
PJSIP_TRANSPORT_IPV6 = 128,
92
PJSIP_TRANSPORT_UDP6 = PJSIP_TRANSPORT_UDP + PJSIP_TRANSPORT_IPV6,
95
PJSIP_TRANSPORT_TCP6 = PJSIP_TRANSPORT_TCP + PJSIP_TRANSPORT_IPV6,
98
PJSIP_TRANSPORT_TLS6 = PJSIP_TRANSPORT_TLS + PJSIP_TRANSPORT_IPV6
100
} pjsip_transport_type_e;
104
* Forward declaration for endpoint (sip_endpoint.h).
106
typedef struct pjsip_endpoint pjsip_endpoint;
109
* Forward declaration for transactions (sip_transaction.h).
111
typedef struct pjsip_transaction pjsip_transaction;
114
* Forward declaration for events (sip_event.h).
116
typedef struct pjsip_event pjsip_event;
119
* Forward declaration for transmit data/buffer (sip_transport.h).
121
typedef struct pjsip_tx_data pjsip_tx_data;
124
* Forward declaration for receive data/buffer (sip_transport.h).
126
typedef struct pjsip_rx_data pjsip_rx_data;
129
* Forward declaration for message (sip_msg.h).
131
typedef struct pjsip_msg pjsip_msg;
134
* Forward declaration for message body (sip_msg.h).
136
typedef struct pjsip_msg_body pjsip_msg_body;
139
* Forward declaration for header field (sip_msg.h).
141
typedef struct pjsip_hdr pjsip_hdr;
144
* Forward declaration for URI (sip_uri.h).
146
typedef struct pjsip_uri pjsip_uri;
149
* Forward declaration for SIP method (sip_msg.h)
151
typedef struct pjsip_method pjsip_method;
154
* Opaque data type for the resolver engine (sip_resolve.h).
156
typedef struct pjsip_resolver_t pjsip_resolver_t;
159
* Forward declaration for credential.
161
typedef struct pjsip_cred_info pjsip_cred_info;
165
* Forward declaration for module (sip_module.h).
167
typedef struct pjsip_module pjsip_module;
171
* Forward declaration for user agent type (sip_ua_layer.h).
173
typedef pjsip_module pjsip_user_agent;
176
* Forward declaration for dialog (sip_dialog.h).
178
typedef struct pjsip_dialog pjsip_dialog;
183
typedef enum pjsip_role_e
185
PJSIP_ROLE_UAC, /**< Role is UAC. */
186
PJSIP_ROLE_UAS, /**< Role is UAS. */
190
PJSIP_UAC_ROLE = PJSIP_ROLE_UAC, /**< Role is UAC. */
191
PJSIP_UAS_ROLE = PJSIP_ROLE_UAS /**< Role is UAS. */
197
* General purpose buffer.
199
typedef struct pjsip_buffer
201
/** The start of the buffer. */
204
/** Pointer to current end of the buffer, which also indicates the position
205
of subsequent buffer write.
209
/** The absolute end of the buffer. */
216
* General host:port pair, used for example as Via sent-by.
218
typedef struct pjsip_host_port
220
pj_str_t host; /**< Host part or IP address. */
221
int port; /**< Port number. */
227
typedef struct pjsip_host_info
229
unsigned flag; /**< Flags of pjsip_transport_flags_e. */
230
pjsip_transport_type_e type; /**< Transport type. */
231
pjsip_host_port addr; /**< Address information. */
236
* Convert exception ID into pj_status_t status.
238
* @param exception_id Exception Id.
240
* @return Error code for the specified exception Id.
242
PJ_DECL(pj_status_t) pjsip_exception_to_status(int exception_id);
245
* Return standard pj_status_t status from current exception.
247
#define PJSIP_RETURN_EXCEPTION() pjsip_exception_to_status(PJ_GET_EXCEPTION())
250
* Attributes to inform that the function may throw exceptions.
252
#define PJSIP_THROW_SPEC(list)
259
#endif /* __PJSIP_SIP_TYPES_H__ */