1
/* $Id: sip_types.h 3553 2011-05-05 06:14:19Z nanang $ */
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
97
} pjsip_transport_type_e;
101
* Forward declaration for endpoint (sip_endpoint.h).
103
typedef struct pjsip_endpoint pjsip_endpoint;
106
* Forward declaration for transactions (sip_transaction.h).
108
typedef struct pjsip_transaction pjsip_transaction;
111
* Forward declaration for events (sip_event.h).
113
typedef struct pjsip_event pjsip_event;
116
* Forward declaration for transmit data/buffer (sip_transport.h).
118
typedef struct pjsip_tx_data pjsip_tx_data;
121
* Forward declaration for receive data/buffer (sip_transport.h).
123
typedef struct pjsip_rx_data pjsip_rx_data;
126
* Forward declaration for message (sip_msg.h).
128
typedef struct pjsip_msg pjsip_msg;
131
* Forward declaration for message body (sip_msg.h).
133
typedef struct pjsip_msg_body pjsip_msg_body;
136
* Forward declaration for header field (sip_msg.h).
138
typedef struct pjsip_hdr pjsip_hdr;
141
* Forward declaration for URI (sip_uri.h).
143
typedef struct pjsip_uri pjsip_uri;
146
* Forward declaration for SIP method (sip_msg.h)
148
typedef struct pjsip_method pjsip_method;
151
* Opaque data type for the resolver engine (sip_resolve.h).
153
typedef struct pjsip_resolver_t pjsip_resolver_t;
156
* Forward declaration for credential.
158
typedef struct pjsip_cred_info pjsip_cred_info;
162
* Forward declaration for module (sip_module.h).
164
typedef struct pjsip_module pjsip_module;
168
* Forward declaration for user agent type (sip_ua_layer.h).
170
typedef pjsip_module pjsip_user_agent;
173
* Forward declaration for dialog (sip_dialog.h).
175
typedef struct pjsip_dialog pjsip_dialog;
180
typedef enum pjsip_role_e
182
PJSIP_ROLE_UAC, /**< Role is UAC. */
183
PJSIP_ROLE_UAS, /**< Role is UAS. */
187
PJSIP_UAC_ROLE = PJSIP_ROLE_UAC, /**< Role is UAC. */
188
PJSIP_UAS_ROLE = PJSIP_ROLE_UAS /**< Role is UAS. */
194
* General purpose buffer.
196
typedef struct pjsip_buffer
198
/** The start of the buffer. */
201
/** Pointer to current end of the buffer, which also indicates the position
202
of subsequent buffer write.
206
/** The absolute end of the buffer. */
213
* General host:port pair, used for example as Via sent-by.
215
typedef struct pjsip_host_port
217
pj_str_t host; /**< Host part or IP address. */
218
int port; /**< Port number. */
224
typedef struct pjsip_host_info
226
unsigned flag; /**< Flags of pjsip_transport_flags_e. */
227
pjsip_transport_type_e type; /**< Transport type. */
228
pjsip_host_port addr; /**< Address information. */
233
* Convert exception ID into pj_status_t status.
235
* @param exception_id Exception Id.
237
* @return Error code for the specified exception Id.
239
PJ_DECL(pj_status_t) pjsip_exception_to_status(int exception_id);
242
* Return standard pj_status_t status from current exception.
244
#define PJSIP_RETURN_EXCEPTION() pjsip_exception_to_status(PJ_GET_EXCEPTION())
247
* Attributes to inform that the function may throw exceptions.
249
#define PJSIP_THROW_SPEC(list)
256
#endif /* __PJSIP_SIP_TYPES_H__ */