140cb5e5vi/*
240cb5e5vi * CDDL HEADER START
340cb5e5vi *
440cb5e5vi * The contents of this file are subject to the terms of the
540cb5e5vi * Common Development and Distribution License (the "License").
640cb5e5vi * You may not use this file except in compliance with the License.
740cb5e5vi *
840cb5e5vi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
940cb5e5vi * or http://www.opensolaris.org/os/licensing.
1040cb5e5vi * See the License for the specific language governing permissions
1140cb5e5vi * and limitations under the License.
1240cb5e5vi *
1340cb5e5vi * When distributing Covered Code, include this CDDL HEADER in each
1440cb5e5vi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1540cb5e5vi * If applicable, add the following below this CDDL HEADER, with the
1640cb5e5vi * fields enclosed by brackets "[]" replaced with your own identifying
1740cb5e5vi * information: Portions Copyright [yyyy] [name of copyright owner]
1840cb5e5vi *
1940cb5e5vi * CDDL HEADER END
2040cb5e5vi */
2140cb5e5vi
2240cb5e5vi/*
23943efbcgm * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
2440cb5e5vi * Use is subject to license terms.
2540cb5e5vi */
2640cb5e5vi
2740cb5e5vi#ifndef	_SIP_H
2840cb5e5vi#define	_SIP_H
2940cb5e5vi
3040cb5e5vi#pragma ident	"%Z%%M%	%I%	%E% SMI"
3140cb5e5vi
3240cb5e5vi#ifdef	__cplusplus
3340cb5e5viextern "C" {
3440cb5e5vi#endif
3540cb5e5vi
3640cb5e5vi#include <sys/types.h>
3740cb5e5vi#include <netinet/in.h>
38943efbcgm#include <stdio.h>
3940cb5e5vi
4040cb5e5vi/* Send a SIP message statefully */
4140cb5e5vi#define	SIP_SEND_STATEFUL	0x0001
4240cb5e5vi
4340cb5e5vi/* Enable multiple dialogs if a request is forked */
4440cb5e5vi#define	SIP_DIALOG_ON_FORK	0x0010
4540cb5e5vi
4640cb5e5vi#define	SIP_CRLF 		"\r\n"
4740cb5e5vi#define	SKIP_CRLF(msg_ptr)	(msg_ptr = msg_ptr + 2)
4840cb5e5vi#define	SIP_VERSION		"SIP/2.0"
4940cb5e5vi#define	SIP			"SIP"
5040cb5e5vi
5140cb5e5vi/* SIP headers */
5240cb5e5vi#define	SIP_TO				"TO"
5340cb5e5vi#define	SIP_FROM			"FROM"
5440cb5e5vi#define	SIP_TAG				"TAG="
5540cb5e5vi#define	SIP_CONTENT_LENGTH		"CONTENT-LENGTH"
5640cb5e5vi#define	SIP_CONTENT_TYPE		"CONTENT-TYPE"
5740cb5e5vi#define	SIP_CALL_ID			"CALL-ID"
5840cb5e5vi#define	SIP_CSEQ			"CSEQ"
5940cb5e5vi#define	SIP_MAX_FORWARDS		"MAX-FORWARDS"
6040cb5e5vi#define	SIP_CONTACT			"CONTACT"
6140cb5e5vi#define	SIP_VIA				"Via"
6240cb5e5vi#define	SIP_RECORD_ROUTE		"RECORD-ROUTE"
6340cb5e5vi#define	SIP_ROUTE			"ROUTE"
6440cb5e5vi#define	SIP_ACCEPT			"ACCEPT"
6540cb5e5vi#define	SIP_ACCEPT_ENCODE		"ACCEPT-ENCODING"
6640cb5e5vi#define	SIP_ACCEPT_LANG			"ACCEPT-LANGUAGE"
6740cb5e5vi#define	SIP_ALERT_INFO			"ALERT-INFO"
6840cb5e5vi#define	SIP_ALLOW			"ALLOW"
6940cb5e5vi#define	SIP_CALL_INFO			"CALL-INFO"
7040cb5e5vi#define	SIP_CONTENT_DIS			"CONTENT-DISPOSITION"
7140cb5e5vi#define	SIP_CONTENT_ENCODE		"CONTENT-ENCODING"
7240cb5e5vi#define	SIP_CONTENT_LANG		"CONTENT-LANGUAGE"
7340cb5e5vi#define	SIP_DATE			"DATE"
7440cb5e5vi#define	SIP_ERROR_INFO			"ERROR-INFO"
7540cb5e5vi#define	SIP_EXPIRE			"EXPIRES"
7640cb5e5vi#define	SIP_IN_REPLY_TO			"IN-REPLY-TO"
7740cb5e5vi#define	SIP_MIN_EXPIRE			"MIN-EXPIRES"
7840cb5e5vi#define	SIP_MIME_VERSION		"MIME-VERSION"
7940cb5e5vi#define	SIP_ORGANIZATION		"ORGANIZATION"
8040cb5e5vi#define	SIP_PRIORITY			"PRIORITY"
8140cb5e5vi#define	SIP_REQUIRE			"REQUIRE"
8240cb5e5vi#define	SIP_REPLYTO			"REPLY-TO"
8340cb5e5vi#define	SIP_RETRY_AFTER			"RETRY-AFTER"
8440cb5e5vi#define	SIP_SERVER			"SERVER"
8540cb5e5vi#define	SIP_SUBJECT			"SUBJECT"
8640cb5e5vi#define	SIP_SUPPORT			"SUPPORTED"
8740cb5e5vi#define	SIP_TIMESTAMP			"TIMESTAMP"
8840cb5e5vi#define	SIP_UNSUPPORT			"UNSUPPORTED"
8940cb5e5vi#define	SIP_USER_AGENT			"USER-AGENT"
9040cb5e5vi#define	SIP_WARNING			"WARNING"
9140cb5e5vi#define	SIP_ALLOW_EVENTS		"ALLOW-EVENTS"
9240cb5e5vi#define	SIP_EVENT			"EVENT"
9340cb5e5vi#define	SIP_SUBSCRIPTION_STATE		"SUBSCRIPTION-STATE"
9440cb5e5vi#define	SIP_WWW_AUTHEN			"WWW-AUTHENTICATE"
9540cb5e5vi#define	SIP_AUTHOR			"AUTHORIZATION"
9640cb5e5vi#define	SIP_AUTHEN_INFO			"AUTHENTICATION-INFO"
9740cb5e5vi#define	SIP_PROXY_AUTHOR		"PROXY-AUTHORIZATION"
9840cb5e5vi#define	SIP_PROXY_AUTHEN		"PROXY-AUTHENTICATE"
9940cb5e5vi#define	SIP_PROXY_REQ			"PROXY-REQUIRE"
10040cb5e5vi#define	SIP_PASSERTEDID			"P-ASSERTED-IDENTITY"
10140cb5e5vi#define	SIP_PPREFERREDID		"P-PREFERRED-IDENTITY"
10240cb5e5vi#define	SIP_PRIVACY			"PRIVACY"
10340cb5e5vi#define	SIP_RACK			"RACK"
10440cb5e5vi#define	SIP_RSEQ			"RSEQ"
10540cb5e5vi
10640cb5e5vi/* SIP Response Codes */
10740cb5e5vi
10840cb5e5vi/* 1XX - Provisional */
10940cb5e5vi#define	SIP_TRYING			100
11040cb5e5vi#define	SIP_RINGING			180
11140cb5e5vi#define	SIP_CALL_IS_BEING_FORWARDED 	181
11240cb5e5vi#define	SIP_QUEUED			182
11340cb5e5vi#define	SIP_SESSION_PROGRESS		183
11440cb5e5vi
11540cb5e5vi/* 2XX - Success */
11640cb5e5vi#define	SIP_OK				200
11740cb5e5vi#define	SIP_ACCEPTED			202
11840cb5e5vi
11940cb5e5vi/* 3XX - Redirection */
12040cb5e5vi#define	SIP_MULTIPLE_CHOICES		300
12140cb5e5vi#define	SIP_MOVED_PERMANENTLY		301
12240cb5e5vi#define	SIP_MOVED_TEMPORARILY		302
12340cb5e5vi#define	SIP_USE_PROXY			303
12440cb5e5vi#define	SIP_ALTERNATIVE_SERVICE		304
12540cb5e5vi
12640cb5e5vi/* 4XX - Request Failed */
12740cb5e5vi#define	SIP_BAD_REQUEST			400
12840cb5e5vi#define	SIP_UNAUTHORIZED		401
12940cb5e5vi#define	SIP_PAYMENT_REQUIRED		402
13040cb5e5vi#define	SIP_FORBIDDEN			403
13140cb5e5vi#define	SIP_NOT_FOUND			404
13240cb5e5vi#define	SIP_METHOD_NOT_ALLOWED		405
13340cb5e5vi#define	SIP_NOT_ACCEPTABLE		406
13440cb5e5vi#define	SIP_PROXY_AUTH_REQUIRED		407
13540cb5e5vi#define	SIP_REQUEST_TIMEOUT		408
13640cb5e5vi#define	SIP_GONE			410
13740cb5e5vi#define	SIP_REQUEST_ENTITY_2_LARGE	413
13840cb5e5vi#define	SIP_REQUEST_URI_2_LONG		414
13940cb5e5vi#define	SIP_UNSUPPORTED_MEDIA_TYPE	415
14040cb5e5vi#define	SIP_UNSUPPORTED_URI_SCHEME	416
14140cb5e5vi#define	SIP_BAD_EXTENSION		420
14240cb5e5vi#define	SIP_EXTENSION_REQUIRED		421
14340cb5e5vi#define	SIP_INTERVAL_2_BRIEF		423
14440cb5e5vi#define	SIP_TEMPORARILY_UNAVAIL		480
14540cb5e5vi#define	SIP_CALL_NON_EXISTANT		481
14640cb5e5vi#define	SIP_LOOP_DETECTED		482
14740cb5e5vi#define	SIP_TOO_MANY_HOOPS		483
14840cb5e5vi#define	SIP_ADDRESS_INCOMPLETE		484
14940cb5e5vi#define	SIP_AMBIGUOUS			485
15040cb5e5vi#define	SIP_BUSY_HERE			486
15140cb5e5vi#define	SIP_REQUEST_TERMINATED		487
15240cb5e5vi#define	SIP_NOT_ACCEPTABLE_HERE		488
15340cb5e5vi#define	SIP_BAD_EVENT			489
15440cb5e5vi#define	SIP_REQUEST_PENDING		491
15540cb5e5vi#define	SIP_UNDECIPHERABLE		493
15640cb5e5vi
15740cb5e5vi/* 5XX - Server Failure */
15840cb5e5vi#define	SIP_SERVER_INTERNAL_ERROR	500
15940cb5e5vi#define	SIP_NOT_IMPLEMENTED		501
16040cb5e5vi#define	SIP_BAD_GATEWAY			502
16140cb5e5vi#define	SIP_SERVICE_UNAVAILABLE		503
16240cb5e5vi#define	SIP_SERVER_TIMEOUT		504
16340cb5e5vi#define	SIP_VERSION_NOT_SUPPORTED	505
16440cb5e5vi#define	SIP_MESSAGE_2_LARGE		513
16540cb5e5vi
16640cb5e5vi/* 6XX - Global Failures */
16740cb5e5vi#define	SIP_BUSY_EVERYWHERE		600
16840cb5e5vi#define	SIP_DECLINE			601
16940cb5e5vi#define	SIP_DOES_NOT_EXIST_ANYWHERE 	604
17040cb5e5vi#define	SIP_NOT_ACCEPTABLE_ANYWHERE	606
17140cb5e5vi
17240cb5e5vi/* Response error types */
17340cb5e5vi#define	SIP_PROVISIONAL_RESP(resp)	((resp) >= 100 && (resp) < 200)
17440cb5e5vi#define	SIP_FINAL_RESP(resp)		((resp) >= 200 && (resp) < 700)
17540cb5e5vi#define	SIP_OK_RESP(resp)		((resp) >= 200 && (resp) < 300)
17640cb5e5vi#define	SIP_NONOK_FINAL_RESP(resp)	((resp) >= 300 && (resp) < 700)
17740cb5e5vi#define	SIP_REDIRECT_RESP(resp)		((resp) >= 300 && (resp) < 400)
17840cb5e5vi#define	SIP_REQFAIL_RESP(resp)		((resp) >= 400 && (resp) < 500)
17940cb5e5vi#define	SIP_SRVFAIL_RESP(resp)		((resp) >= 500 && (resp) < 600)
18040cb5e5vi#define	SIP_GLOBFAIL_RESP(resp)		((resp) >= 600 && (resp) < 700)
18140cb5e5vi
18240cb5e5vi/* Types of transactions */
18340cb5e5vi#define	SIP_CLIENT_TRANSACTION		1
18440cb5e5vi#define	SIP_SERVER_TRANSACTION		2
18540cb5e5vi
18640cb5e5vi/* Transaction states */
18740cb5e5vi#define	SIP_NEW_TRANSACTION		0
18840cb5e5vi
18940cb5e5vi/* Client Transaction States */
19040cb5e5vi#define	SIP_CLNT_CALLING		1
19140cb5e5vi#define	SIP_CLNT_INV_PROCEEDING 	2
19240cb5e5vi#define	SIP_CLNT_INV_TERMINATED 	3
19340cb5e5vi#define	SIP_CLNT_INV_COMPLETED		4
19440cb5e5vi#define	SIP_CLNT_TRYING		5
19540cb5e5vi#define	SIP_CLNT_NONINV_PROCEEDING 	6
19640cb5e5vi#define	SIP_CLNT_NONINV_TERMINATED 	7
19740cb5e5vi#define	SIP_CLNT_NONINV_COMPLETED	8
19840cb5e5vi
19940cb5e5vi/* Server Transaction States */
20040cb5e5vi#define	SIP_SRV_INV_PROCEEDING		9
20140cb5e5vi#define	SIP_SRV_INV_COMPLETED		10
20240cb5e5vi#define	SIP_SRV_CONFIRMED		11
20340cb5e5vi#define	SIP_SRV_INV_TERMINATED		12
20440cb5e5vi#define	SIP_SRV_TRYING			13
20540cb5e5vi#define	SIP_SRV_NONINV_PROCEEDING	14
20640cb5e5vi#define	SIP_SRV_NONINV_COMPLETED	15
20740cb5e5vi#define	SIP_SRV_NONINV_TERMINATED	16
20840cb5e5vi
20940cb5e5vi/* Dialog types */
21040cb5e5vi#define	SIP_UAC_DIALOG			1
21140cb5e5vi#define	SIP_UAS_DIALOG			2
21240cb5e5vi
21340cb5e5vi/* Dialog state */
21440cb5e5vitypedef enum dialog_state {
21540cb5e5vi	SIP_DLG_NEW = 0,	/* New dialog, no reply received yet */
21640cb5e5vi	SIP_DLG_EARLY,		/* Early dialog, provisional reply received */
21740cb5e5vi	SIP_DLG_CONFIRMED,	/* Confirmed dialog, 2xx reply received */
21840cb5e5vi	SIP_DLG_DESTROYED	/* Destroyed dialog */
21940cb5e5vi} dialog_state_t;
22040cb5e5vi
22140cb5e5vi/* SIP URI parse errors */
22240cb5e5vi#define	SIP_URIERR_SCHEME	0x00000001 /* invalid URL SCHEME name */
22340cb5e5vi#define	SIP_URIERR_USER		0x00000002 /* invalid user name */
22440cb5e5vi#define	SIP_URIERR_PASS		0x00000004 /* invalid password  */
22540cb5e5vi#define	SIP_URIERR_HOST		0x00000008 /* invalid domain name */
22640cb5e5vi#define	SIP_URIERR_PORT		0x00000010 /* invalid port number */
22740cb5e5vi#define	SIP_URIERR_PARAM	0x00000020 /* parameter specific error */
22840cb5e5vi#define	SIP_URIERR_HEADER	0x00000040 /* headers specific error */
22940cb5e5vi#define	SIP_URIERR_OPAQUE	0x00000080 /* opaque specific error */
23040cb5e5vi#define	SIP_URIERR_QUERY	0x00000100 /* query specific error */
23140cb5e5vi#define	SIP_URIERR_PATH		0x00000200 /* path specific error */
23240cb5e5vi#define	SIP_URIERR_REGNAME	0x00000400 /* reg-name specific error */
23340cb5e5vi#define	SIP_URIERR_NOURI	0x00000800 /* No URI */
23440cb5e5vi#define	SIP_URIERR_MEMORY	0x00001000 /* out of memory */
23540cb5e5vi
236943efbcgm/* SIP traffic counters */
237943efbcgmtypedef enum sip_traffic_counter_names {
238943efbcgm	SIP_TOTAL_BYTES_RCVD = 0,
239943efbcgm	SIP_TOTAL_BYTES_SENT,
240943efbcgm	SIP_TOTAL_REQ_RCVD,
241943efbcgm	SIP_TOTAL_REQ_SENT,
242943efbcgm	SIP_TOTAL_RESP_RCVD,
243943efbcgm	SIP_TOTAL_RESP_SENT,
244943efbcgm	SIP_ACK_REQ_RCVD,
245943efbcgm	SIP_ACK_REQ_SENT,
246943efbcgm	SIP_BYE_REQ_RCVD,
247943efbcgm	SIP_BYE_REQ_SENT,
248943efbcgm	SIP_CANCEL_REQ_RCVD,
249943efbcgm	SIP_CANCEL_REQ_SENT,
250943efbcgm	SIP_INFO_REQ_RCVD,
251943efbcgm	SIP_INFO_REQ_SENT,
252943efbcgm	SIP_INVITE_REQ_RCVD,
253943efbcgm	SIP_INVITE_REQ_SENT,
254943efbcgm	SIP_NOTIFY_REQ_RCVD,
255943efbcgm	SIP_NOTIFY_REQ_SENT,
256943efbcgm	SIP_OPTIONS_REQ_RCVD,
257943efbcgm	SIP_OPTIONS_REQ_SENT,
258943efbcgm	SIP_PRACK_REQ_RCVD,
259943efbcgm	SIP_PRACK_REQ_SENT,
260943efbcgm	SIP_REFER_REQ_RCVD,
261943efbcgm	SIP_REFER_REQ_SENT,
262943efbcgm	SIP_REGISTER_REQ_RCVD,
263943efbcgm	SIP_REGISTER_REQ_SENT,
264943efbcgm	SIP_SUBSCRIBE_REQ_RCVD,
265943efbcgm	SIP_SUBSCRIBE_REQ_SENT,
266943efbcgm	SIP_UPDATE_REQ_RCVD,
267943efbcgm	SIP_UPDATE_REQ_SENT,
268943efbcgm	SIP_1XX_RESP_RCVD,
269943efbcgm	SIP_1XX_RESP_SENT,
270943efbcgm	SIP_2XX_RESP_RCVD,
271943efbcgm	SIP_2XX_RESP_SENT,
272943efbcgm	SIP_3XX_RESP_RCVD,
273943efbcgm	SIP_3XX_RESP_SENT,
274943efbcgm	SIP_4XX_RESP_RCVD,
275943efbcgm	SIP_4XX_RESP_SENT,
276943efbcgm	SIP_5XX_RESP_RCVD,
277943efbcgm	SIP_5XX_RESP_SENT,
278943efbcgm	SIP_6XX_RESP_RCVD,
279943efbcgm	SIP_6xx_RESP_SENT,
280943efbcgm	SIP_COUNTER_START_TIME,
281943efbcgm	SIP_COUNTER_STOP_TIME
282943efbcgm} sip_traffic_counter_names_t;
283943efbcgm
284943efbcgm/* SIP Traffic counter group */
285943efbcgm#define	SIP_TRAFFIC_COUNTERS	0x0001	/* measures end to end SIP traffic */
286943efbcgm
287943efbcgm/* SIP Logging Levels */
288943efbcgm#define	SIP_DETAIL_LOGGING	0x0001	/* logs the entire sip message */
289943efbcgm
29040cb5e5vi#ifdef		__linux__
29140cb5e5vi#define		B_FALSE		0
29240cb5e5vi#define		B_TRUE		1
29340cb5e5vi
29440cb5e5vitypedef int		boolean_t;
29540cb5e5vitypedef unsigned char	uchar_t;
29640cb5e5vitypedef unsigned int	uint_t;
29740cb5e5vitypedef unsigned int	uint32_t;
29840cb5e5vi#endif
29940cb5e5vi
30040cb5e5vitypedef struct sip_message	*sip_msg_t;
30140cb5e5vitypedef struct sip_header	*sip_header_t;
30240cb5e5vitypedef struct sip_value	*sip_header_value_t;
30340cb5e5vitypedef struct sip_dialog	*sip_dialog_t;
30440cb5e5vitypedef struct sip_uri		*sip_uri_t;
30540cb5e5vitypedef struct sip_conn_object	*sip_conn_object_t;
30640cb5e5vitypedef	struct sip_xaction	*sip_transaction_t;
30740cb5e5vi
30840cb5e5vitypedef struct sip_str {
30940cb5e5vi	char	*sip_str_ptr;
31040cb5e5vi	int	sip_str_len;
31140cb5e5vi}sip_str_t;
31240cb5e5vi
31340cb5e5vi
31440cb5e5vi/* SIP parameter */
31540cb5e5vitypedef struct sip_param {
31640cb5e5vi	sip_str_t	param_name;
31740cb5e5vi	sip_str_t	param_value;
31840cb5e5vi	struct sip_param *param_next;
31940cb5e5vi}sip_param_t;
32040cb5e5vi
32140cb5e5vi
32240cb5e5vi/* Parsed header structure */
32340cb5e5vitypedef struct sip_parsed_header {
32440cb5e5vi	int		 sip_parsed_header_version;
32540cb5e5vi	struct sip_value *value;
32640cb5e5vi	sip_header_t	sip_header;
32740cb5e5vi}sip_parsed_header_t;
32840cb5e5vi
32940cb5e5vi#define	SIP_PARSED_HEADER_VERSION_1	1
33040cb5e5vi
33140cb5e5vi/* Value states */
33240cb5e5vitypedef enum {
33340cb5e5vi	SIP_VALUE_ACTIVE = 0,
33440cb5e5vi	SIP_VALUE_BAD,
33540cb5e5vi	SIP_VALUE_DELETED
33640cb5e5vi}sip_value_state_t;
33740cb5e5vi
33840cb5e5vi/* SIP header value */
33940cb5e5vitypedef struct sip_value {
34040cb5e5vi	int			sip_value_version;
34140cb5e5vi	void			*next;
34240cb5e5vi	sip_param_t		*param_list;
34340cb5e5vi	sip_value_state_t	value_state; /* Active/Deleted */
34440cb5e5vi	sip_parsed_header_t	*parsed_header;
34540cb5e5vi	char			*value_start;
34640cb5e5vi	char			*value_end;
34740cb5e5vi	sip_str_t		*sip_value_uri_str;
34840cb5e5vi	sip_uri_t		sip_value_parse_uri;
34940cb5e5vi}sip_value_t;
35040cb5e5vi
35140cb5e5vi#define	SIP_VALUE_VERSION_1	1
35240cb5e5vi
35340cb5e5vitypedef struct sip_header_general {
35440cb5e5vi	char			*sip_hdr_start;
35540cb5e5vi	char			*sip_hdr_end;
35640cb5e5vi	char			*sip_hdr_current;
35740cb5e5vi	sip_parsed_header_t	*sip_hdr_parsed;
35840cb5e5vi}sip_hdr_general_t;
35940cb5e5vi
36040cb5e5vi/* SIP methods */
36140cb5e5vitypedef enum {
36240cb5e5vi	UNKNOWN = 0,
36340cb5e5vi	INVITE,
36440cb5e5vi	ACK,
36540cb5e5vi	OPTIONS,
36640cb5e5vi	BYE,
36740cb5e5vi	CANCEL,
36840cb5e5vi	REGISTER,
36940cb5e5vi	REFER,
37040cb5e5vi	INFO,
37140cb5e5vi	SUBSCRIBE,
37240cb5e5vi	NOTIFY,
37340cb5e5vi	PRACK
37440cb5e5vi}sip_method_t;
37540cb5e5vi
37640cb5e5vi#define	MAX_SIP_METHODS	12
37740cb5e5vi
37840cb5e5vitypedef struct sip_methods {
37940cb5e5vi	char *name;	/* Name of the method */
38040cb5e5vi	int  len;	/* Length for comparison */
38140cb5e5vi}sip_methods_t;
38240cb5e5vi
38340cb5e5viextern sip_methods_t sip_methods[];
38440cb5e5vi
38540cb5e5vi/* SIP header function table */
38640cb5e5vitypedef struct header_function_table {
38740cb5e5vi	char		*header_name;
38840cb5e5vi	char		*header_short_name;
38940cb5e5vi	int		(*header_parse_func)(struct sip_header *,
39040cb5e5vi			    struct sip_parsed_header **);
39140cb5e5vi	boolean_t	(*header_check_compliance)(struct sip_parsed_header *);
39240cb5e5vi	boolean_t	(*header_is_equal)(struct sip_parsed_header *,
39340cb5e5vi			    struct sip_parsed_header *);
39440cb5e5vi	void		(*header_free)(struct sip_parsed_header *);
39540cb5e5vi}sip_header_function_t;
39640cb5e5vi
39740cb5e5vi/* Connection Manager interface */
39840cb5e5vitypedef struct sip_io_pointers_s {
39940cb5e5vi	int	(*sip_conn_send)(const sip_conn_object_t, char *, int);
40040cb5e5vi	void	(*sip_hold_conn_object)(sip_conn_object_t);
40140cb5e5vi	void	(*sip_rel_conn_object)(sip_conn_object_t);
40240cb5e5vi	boolean_t	(*sip_conn_is_stream)(sip_conn_object_t);
40340cb5e5vi	boolean_t	(*sip_conn_is_reliable)(sip_conn_object_t);
40440cb5e5vi	int 	(*sip_conn_remote_address)(sip_conn_object_t, struct sockaddr *,
40540cb5e5vi		    socklen_t *);
40640cb5e5vi	int 	(*sip_conn_local_address)(sip_conn_object_t, struct sockaddr *,
40740cb5e5vi		    socklen_t *);
40840cb5e5vi	int	(*sip_conn_transport)(sip_conn_object_t);
40940cb5e5vi	int	(*sip_conn_timer1)(sip_conn_object_t);
41040cb5e5vi	int	(*sip_conn_timer2)(sip_conn_object_t);
41140cb5e5vi	int	(*sip_conn_timer4)(sip_conn_object_t);
41240cb5e5vi	int	(*sip_conn_timerd)(sip_conn_object_t);
41340cb5e5vi}sip_io_pointers_t;
41440cb5e5vi
41540cb5e5vi/* Upper layer registerations */
41640cb5e5vitypedef struct sip_ulp_pointers_s {
41740cb5e5vi	void		(*sip_ulp_recv)(const sip_conn_object_t,
41840cb5e5vi			    sip_msg_t, const sip_dialog_t);
41940cb5e5vi	uint_t		(*sip_ulp_timeout)(void *, void (*func)(void *),
42040cb5e5vi			    struct timeval *);
42140cb5e5vi	boolean_t	(*sip_ulp_untimeout)(uint_t);
42240cb5e5vi	int		(*sip_ulp_trans_error)(sip_transaction_t, int, void *);
42340cb5e5vi	void		(*sip_ulp_dlg_del)(sip_dialog_t, sip_msg_t, void *);
42440cb5e5vi	void		(*sip_ulp_trans_state_cb)(sip_transaction_t,
42540cb5e5vi			    sip_msg_t, int, int);
42640cb5e5vi	void		(*sip_ulp_dlg_state_cb)(sip_dialog_t, sip_msg_t, int,
42740cb5e5vi			    int);
42840cb5e5vi}sip_ulp_pointers_t;
42940cb5e5vi
43040cb5e5vi/* SIP stack initialization structure */
43140cb5e5vitypedef struct sip_stack_init_s {
43240cb5e5vi	int			sip_version;
43340cb5e5vi	int			sip_stack_flags;
43440cb5e5vi	sip_io_pointers_t	*sip_io_pointers;
43540cb5e5vi	sip_ulp_pointers_t	*sip_ulp_pointers;
43640cb5e5vi	sip_header_function_t	*sip_function_table;
43740cb5e5vi}sip_stack_init_t;
43840cb5e5vi
43940cb5e5vi/* SIP stack version */
44040cb5e5vi#define	SIP_STACK_VERSION		1
44140cb5e5vi
44240cb5e5vi/* Flags for sip_stack_flags */
44340cb5e5vi#define	SIP_STACK_DIALOGS		0x0001
44440cb5e5vi
44540cb5e5viextern int		sip_init_conn_object(sip_conn_object_t);
44640cb5e5viextern void		sip_clear_stale_data(sip_conn_object_t);
44740cb5e5viextern void		sip_conn_destroyed(sip_conn_object_t);
44840cb5e5vi
44940cb5e5viextern int		(*sip_stack_send)(const sip_conn_object_t, char *, int);
45040cb5e5viextern void		(*sip_refhold_conn)(sip_conn_object_t);
45140cb5e5viextern void		(*sip_refrele_conn)(sip_conn_object_t);
45240cb5e5viextern boolean_t	(*sip_is_conn_stream)(sip_conn_object_t);
45340cb5e5viextern boolean_t	(*sip_is_conn_reliable)(sip_conn_object_t);
45440cb5e5viextern int 		(*sip_conn_rem_addr)(sip_conn_object_t,
45540cb5e5vi			    struct sockaddr *, socklen_t *);
45640cb5e5viextern int		(*sip_conn_local_addr)(sip_conn_object_t,
45740cb5e5vi			    struct sockaddr *, socklen_t *);
45840cb5e5viextern int		(*sip_conn_transport)(sip_conn_object_t);
45940cb5e5viextern int		(*sip_conn_timer1)(sip_conn_object_t);
46040cb5e5viextern int		(*sip_conn_timer2)(sip_conn_object_t);
46140cb5e5viextern int		(*sip_conn_timer4)(sip_conn_object_t);
46240cb5e5viextern int		(*sip_conn_timerd)(sip_conn_object_t);
46340cb5e5vi
46440cb5e5viextern uint_t		(*sip_stack_timeout)(void *, void (*func)(void *),
46540cb5e5vi			    struct timeval *);
46640cb5e5viextern boolean_t	(*sip_stack_untimeout)(uint_t);
46740cb5e5vi
46840cb5e5viextern sip_msg_t	sip_new_msg();
46940cb5e5viextern void		sip_free_msg(sip_msg_t);
47040cb5e5viextern void		sip_hold_msg(sip_msg_t);
47140cb5e5viextern int		sip_stack_init(sip_stack_init_t *);
47240cb5e5viextern int		sip_sendmsg(sip_conn_object_t, sip_msg_t, sip_dialog_t,
47340cb5e5vi			    uint32_t);
47440cb5e5viextern void		sip_process_new_packet(sip_conn_object_t, void *,
47540cb5e5vi			    size_t);
47640cb5e5viextern char 		*sip_guid();
47740cb5e5viextern char		*sip_sent_by_to_str(int *);
47840cb5e5viextern int		sip_register_sent_by(char *);
47940cb5e5viextern void		sip_unregister_sent_by(char *);
48040cb5e5viextern void		sip_unregister_all_sent_by();
48140cb5e5viextern char 		*sip_branchid(sip_msg_t);
48240cb5e5viextern uint32_t		sip_get_cseq();
48340cb5e5viextern uint32_t		sip_get_rseq();
48440cb5e5viextern int		sip_get_num_via(sip_msg_t, int *);
48540cb5e5vi
48640cb5e5viextern int 		sip_add_from(sip_msg_t, char *, char *, char *,
48740cb5e5vi			    boolean_t, char *);
48840cb5e5viextern int 		sip_add_to(sip_msg_t, char *, char *, char *,
48940cb5e5vi			    boolean_t, char *);
49040cb5e5viextern int 		sip_add_response_line(sip_msg_t, int, char *);
49140cb5e5viextern int 		sip_add_request_line(sip_msg_t, sip_method_t, char *);
49240cb5e5viextern int 		sip_add_via(sip_msg_t, char *, char *, int, char *);
49340cb5e5viextern int 		sip_add_maxforward(sip_msg_t, uint_t);
49440cb5e5viextern int 		sip_add_callid(sip_msg_t, char *);
49540cb5e5viextern int 		sip_add_cseq(sip_msg_t, sip_method_t, uint32_t);
49640cb5e5viextern int 		sip_add_content_type(sip_msg_t, char *, char *);
49740cb5e5viextern int 		sip_add_content(sip_msg_t, char *);
49840cb5e5viextern int 		sip_add_contact(sip_msg_t, char *, char *, boolean_t,
49940cb5e5vi			    char *);
50040cb5e5viextern int 		sip_add_route(sip_msg_t, char *, char *, char *);
50140cb5e5viextern int 		sip_add_record_route(sip_msg_t, char *, char *, char *);
50240cb5e5viextern int 		sip_add_branchid_to_via(sip_msg_t, char *);
50340cb5e5viextern int 		sip_add_accept(sip_msg_t, char *, char *, char *,
50440cb5e5vi			    char *);
50540cb5e5viextern int		sip_add_author(sip_msg_t, char *,  char *);
50640cb5e5viextern int		sip_add_authen_info(sip_msg_t, char *);
50740cb5e5viextern int		sip_add_proxy_authen(sip_msg_t, char *,  char *);
50840cb5e5viextern int		sip_add_proxy_author(sip_msg_t, char *, char *);
50940cb5e5viextern int		sip_add_proxy_require(sip_msg_t, char *);
51040cb5e5viextern int		sip_add_www_authen(sip_msg_t, char *, char *);
51140cb5e5viextern int		sip_add_accept_enc(sip_msg_t, char *, char *);
51240cb5e5viextern int		sip_add_accept_lang(sip_msg_t, char *, char *);
51340cb5e5viextern int		sip_add_alert_info(sip_msg_t, char *, char *);
51440cb5e5viextern int		sip_add_allow(sip_msg_t, sip_method_t);
51540cb5e5viextern int		sip_add_call_info(sip_msg_t, char *, char *);
51640cb5e5viextern int		sip_add_content_disp(sip_msg_t, char *, char *);
51740cb5e5viextern int		sip_add_content_enc(sip_msg_t, char *);
51840cb5e5viextern int		sip_add_content_lang(sip_msg_t, char *);
51940cb5e5viextern int		sip_add_date(sip_msg_t, char *);
52040cb5e5viextern int		sip_add_error_info(sip_msg_t, char *, char *);
52140cb5e5viextern int		sip_add_expires(sip_msg_t, int);
52240cb5e5viextern int		sip_add_in_reply_to(sip_msg_t, char *);
52340cb5e5viextern int		sip_add_mime_version(sip_msg_t, char *);
52440cb5e5viextern int		sip_add_min_expires(sip_msg_t, int);
52540cb5e5viextern int		sip_add_org(sip_msg_t, char *);
52640cb5e5viextern int		sip_add_priority(sip_msg_t, char *);
52740cb5e5viextern int		sip_add_reply_to(sip_msg_t, char *, char *, char *,
52840cb5e5vi			    boolean_t);
52940cb5e5viextern int		sip_add_require(sip_msg_t, char *);
53040cb5e5viextern int		sip_add_retry_after(sip_msg_t, int, char *, char *);
53140cb5e5viextern int		sip_add_server(sip_msg_t, char *);
53240cb5e5viextern int		sip_add_subject(sip_msg_t, char *);
53340cb5e5viextern int		sip_add_supported(sip_msg_t, char *);
53440cb5e5viextern int		sip_add_tstamp(sip_msg_t, char *, char *);
53540cb5e5viextern int		sip_add_unsupported(sip_msg_t, char *);
53640cb5e5viextern int		sip_add_user_agent(sip_msg_t, char *);
53740cb5e5viextern int		sip_add_warning(sip_msg_t, int, char *, char *);
53840cb5e5viextern int		sip_add_allow_events(sip_msg_t, char *);
53940cb5e5viextern int		sip_add_event(sip_msg_t, char *, char *);
54040cb5e5viextern int		sip_add_substate(sip_msg_t, char *, char *);
54140cb5e5viextern int		sip_add_privacy(sip_msg_t, char *);
54240cb5e5viextern int		sip_add_passertedid(sip_msg_t, char *, char *,
54340cb5e5vi			    boolean_t);
54440cb5e5viextern int		sip_add_ppreferredid(sip_msg_t, char *, char *,
54540cb5e5vi			    boolean_t);
54640cb5e5viextern int		sip_add_rack(sip_msg_t, int, int, sip_method_t);
54740cb5e5viextern int		sip_add_rseq(sip_msg_t, int);
54840cb5e5viextern const sip_str_t *sip_get_author_scheme(sip_msg_t, int *);
54940cb5e5viextern const sip_str_t *sip_get_author_param(sip_msg_t, char *, int *);
55040cb5e5viextern const sip_str_t *sip_get_authen_info(sip_header_value_t, int *);
55140cb5e5viextern const sip_str_t *sip_get_proxy_authen_scheme(sip_msg_t, int *);
55240cb5e5viextern const sip_str_t *sip_get_proxy_authen_param(sip_msg_t, char *, int *);
55340cb5e5viextern const sip_str_t *sip_get_proxy_author_scheme(sip_msg_t, int *);
55440cb5e5viextern const sip_str_t *sip_get_proxy_author_param(sip_msg_t, char *, int *);
55540cb5e5viextern const sip_str_t *sip_get_proxy_require(sip_header_value_t, int *);
55640cb5e5viextern const sip_str_t *sip_get_www_authen_scheme(sip_msg_t, int *);
55740cb5e5viextern const sip_str_t *sip_get_www_authen_param(sip_msg_t, char *, int *);
55840cb5e5viextern const sip_str_t	*sip_get_allow_events(sip_header_value_t, int *);
55940cb5e5viextern const sip_str_t	*sip_get_event(sip_msg_t, int *);
56040cb5e5viextern const sip_str_t	*sip_get_substate(sip_msg_t, int *);
56140cb5e5viextern const sip_str_t	*sip_get_accept_type(sip_header_value_t, int *);
56240cb5e5viextern const sip_str_t	*sip_get_accept_sub_type(sip_header_value_t, int *);
56340cb5e5viextern const sip_str_t	*sip_get_accept_enc(sip_header_value_t, int *);
56440cb5e5viextern const sip_str_t	*sip_get_accept_lang(sip_header_value_t, int *);
56540cb5e5viextern const sip_str_t	*sip_get_alert_info_uri(sip_header_value_t, int *);
56640cb5e5viextern sip_method_t	sip_get_allow_method(sip_header_value_t, int *);
56740cb5e5viextern int		sip_get_min_expires(sip_msg_t, int *);
56840cb5e5viextern const sip_str_t	*sip_get_mime_version(sip_msg_t, int *);
56940cb5e5viextern const sip_str_t	*sip_get_org(sip_msg_t, int *);
57040cb5e5viextern const sip_str_t	*sip_get_priority(sip_msg_t, int *);
57140cb5e5viextern const sip_str_t	*sip_get_replyto_display_name(sip_msg_t, int *);
57240cb5e5viextern const sip_str_t	*sip_get_replyto_uri_str(sip_msg_t, int *);
57340cb5e5viextern const sip_str_t	*sip_get_date_time(sip_msg_t, int *);
57440cb5e5viextern int		sip_get_date_day(sip_msg_t, int *);
57540cb5e5viextern const sip_str_t	*sip_get_date_month(sip_msg_t, int *);
57640cb5e5viextern const sip_str_t	*sip_get_date_wkday(sip_msg_t, int *);
57740cb5e5viextern int		sip_get_date_year(sip_msg_t, int *);
57840cb5e5viextern const sip_str_t	*sip_get_date_timezone(sip_msg_t, int *);
57940cb5e5viextern const sip_str_t	*sip_get_content_disp(sip_msg_t, int *);
58040cb5e5viextern const sip_str_t	*sip_get_content_lang(sip_header_value_t, int *);
58140cb5e5viextern const sip_str_t	*sip_get_content_enc(sip_header_value_t, int *);
58240cb5e5viextern const sip_str_t	*sip_get_error_info_uri(sip_header_value_t, int *);
58340cb5e5viextern int		sip_get_expires(sip_msg_t, int *);
58440cb5e5viextern const sip_str_t	*sip_get_require(sip_header_value_t, int *);
58540cb5e5viextern const sip_str_t	*sip_get_subject(sip_msg_t, int *);
58640cb5e5viextern const sip_str_t	*sip_get_supported(sip_header_value_t, int *);
58740cb5e5viextern const sip_str_t	*sip_get_tstamp_delay(sip_msg_t, int *);
58840cb5e5viextern const sip_str_t	*sip_get_tstamp_value(sip_msg_t, int *);
58940cb5e5viextern const sip_str_t	*sip_get_unsupported(sip_header_value_t, int *);
59040cb5e5viextern const sip_str_t	*sip_get_server(sip_msg_t, int *);
59140cb5e5viextern const sip_str_t	*sip_get_user_agent(sip_msg_t, int *);
59240cb5e5viextern int		sip_get_warning_code(sip_header_value_t, int *);
59340cb5e5viextern const sip_str_t	*sip_get_warning_agent(sip_header_value_t, int *);
59440cb5e5viextern const sip_str_t	*sip_get_warning_text(sip_header_value_t, int *);
59540cb5e5viextern const sip_str_t	*sip_get_call_info_uri(sip_header_value_t, int *);
59640cb5e5viextern const sip_str_t	*sip_get_in_reply_to(sip_header_value_t, int *);
59740cb5e5viextern int		sip_get_retry_after_time(sip_msg_t, int *);
59840cb5e5viextern const sip_str_t	*sip_get_retry_after_cmts(sip_msg_t, int *);
59940cb5e5viextern const sip_str_t	*sip_get_passertedid_display_name(sip_header_value_t,
60040cb5e5vi			    int *);
60140cb5e5viextern const sip_str_t	*sip_get_passertedid_uri_str(sip_header_value_t,
60240cb5e5vi			    int *);
60340cb5e5viextern const sip_str_t	*sip_get_ppreferredid_display_name(sip_header_value_t,
60440cb5e5vi			    int *);
60540cb5e5viextern const sip_str_t	*sip_get_ppreferredid_uri_str(sip_header_value_t,
60640cb5e5vi			    int *);
60740cb5e5viextern const sip_str_t	*sip_get_priv_value(sip_header_value_t, int *);
60840cb5e5viextern int		sip_get_rack_resp_num(sip_msg_t, int *);
60940cb5e5viextern int		sip_get_rack_cseq_num(sip_msg_t, int *);
61040cb5e5viextern sip_method_t	sip_get_rack_method(sip_msg_t, int *);
61140cb5e5viextern int		sip_get_rseq_resp_num(sip_msg_t, int *);
61240cb5e5vi
61340cb5e5viextern int		sip_copy_start_line(sip_msg_t, sip_msg_t);
61440cb5e5viextern int		sip_delete_start_line(sip_msg_t sip_msg);
61540cb5e5viextern int		sip_copy_header(sip_msg_t, sip_header_t, char *);
61640cb5e5viextern int		sip_copy_header_by_name(sip_msg_t, sip_msg_t, char *,
61740cb5e5vi			    char *);
61840cb5e5viextern int		sip_copy_all_headers(sip_msg_t, sip_msg_t);
61940cb5e5viextern int		sip_delete_header_by_name(sip_msg_t, char *);
62040cb5e5viextern int		sip_add_header(sip_msg_t, char *);
62140cb5e5viextern sip_header_t	sip_add_param(sip_header_t, char *, int *);
62240cb5e5viextern int		sip_delete_header(sip_header_t);
62340cb5e5viextern int		sip_delete_value(sip_header_t, sip_header_value_t);
62440cb5e5viextern sip_msg_t	sip_clone_msg(const sip_msg_t);
62540cb5e5viextern sip_msg_t	sip_create_response(const sip_msg_t, int, char *,
62640cb5e5vi			    char *, char *);
62740cb5e5viextern int		sip_create_OKack(const sip_msg_t, sip_msg_t, char *,
62840cb5e5vi			    char *, int, char *);
62940cb5e5viextern char 		*sip_get_resp_desc(int);
63040cb5e5viextern char		*sip_get_branchid(const sip_msg_t, int *);
63140cb5e5vi
63240cb5e5viextern const struct sip_header	*sip_get_header(sip_msg_t, char *, sip_header_t,
63340cb5e5vi				    int *);
63440cb5e5viextern const struct sip_value	*sip_get_header_value(
63540cb5e5vi				    const struct sip_header *, int *);
63640cb5e5viextern const struct sip_value	*sip_get_next_value(sip_header_value_t, int *);
63740cb5e5viextern const sip_str_t		*sip_get_param_value(sip_header_value_t,
63840cb5e5vi				    char *, int *);
63940cb5e5viextern const sip_param_t	*sip_get_params(sip_header_value_t, int *);
64040cb5e5viextern boolean_t		sip_is_param_present(const sip_param_t *,
64140cb5e5vi				    char *, int);
64240cb5e5vi
64340cb5e5viextern char		*sip_msg_to_str(sip_msg_t, int *);
64440cb5e5viextern char		*sip_hdr_to_str(sip_header_t, int *);
64540cb5e5viextern char		*sip_reqline_to_str(sip_msg_t, int *);
64640cb5e5viextern char		*sip_respline_to_str(sip_msg_t, int *);
64740cb5e5viextern boolean_t	sip_msg_is_request(const sip_msg_t, int *);
64840cb5e5viextern boolean_t	sip_msg_is_response(const sip_msg_t, int *);
64940cb5e5viextern sip_method_t	sip_get_request_method(const sip_msg_t, int *);
65040cb5e5viextern const sip_str_t	*sip_get_request_uri_str(sip_msg_t, int *);
65140cb5e5viextern int		sip_get_response_code(sip_msg_t, int *);
65240cb5e5viextern const sip_str_t	*sip_get_response_phrase(sip_msg_t, int *);
65340cb5e5viextern const sip_str_t	*sip_get_sip_version(sip_msg_t, int *);
65440cb5e5viextern int		sip_get_msg_len(sip_msg_t, int *);
65540cb5e5viextern const sip_str_t	*sip_get_route_uri_str(sip_header_value_t, int *);
65640cb5e5viextern const sip_str_t	*sip_get_route_display_name(sip_header_value_t, int *);
65740cb5e5viextern const sip_str_t	*sip_get_contact_uri_str(sip_header_value_t, int *);
65840cb5e5viextern const sip_str_t	*sip_get_contact_display_name(sip_header_value_t,
65940cb5e5vi			    int *);
66040cb5e5viextern const sip_str_t	*sip_get_from_uri_str(sip_msg_t, int *);
66140cb5e5viextern const sip_str_t	*sip_get_from_display_name(sip_msg_t, int *);
66240cb5e5viextern const sip_str_t	*sip_get_from_tag(sip_msg_t, int *);
66340cb5e5viextern const sip_str_t	*sip_get_to_uri_str(sip_msg_t, int *);
66440cb5e5viextern const sip_str_t	*sip_get_to_display_name(sip_msg_t, int *);
66540cb5e5viextern const sip_str_t	*sip_get_to_tag(sip_msg_t, int *);
66640cb5e5viextern const sip_str_t	*sip_get_callid(sip_msg_t, int *);
66740cb5e5viextern int		sip_get_callseq_num(sip_msg_t, int *);
66840cb5e5viextern sip_method_t	sip_get_callseq_method(sip_msg_t, int *);
66940cb5e5viextern const sip_str_t	*sip_get_via_sent_by_host(sip_header_value_t, int *);
67040cb5e5viextern int		sip_get_via_sent_by_port(sip_header_value_t, int *);
67140cb5e5viextern const sip_str_t	*sip_get_via_sent_protocol_version(sip_header_value_t,
67240cb5e5vi			    int *);
67340cb5e5viextern const sip_str_t	*sip_get_via_sent_protocol_name(sip_header_value_t,
67440cb5e5vi			    int *);
67540cb5e5viextern const sip_str_t	*sip_get_via_sent_transport(sip_header_value_t,
67640cb5e5vi			    int *);
67740cb5e5viextern int 		sip_get_maxforward(sip_msg_t, int *);
67840cb5e5viextern int 		sip_get_content_length(sip_msg_t, int *);
67940cb5e5viextern const sip_str_t	*sip_get_content_type(sip_msg_t, int *);
68040cb5e5viextern const sip_str_t	*sip_get_content_sub_type(sip_msg_t, int *);
68140cb5e5viextern char		*sip_get_content(sip_msg_t, int *);
68240cb5e5viextern sip_msg_t	sip_create_dialog_req(sip_method_t, sip_dialog_t,
68340cb5e5vi			    char *, char *, int, char *, uint32_t, int);
684df4705egmextern sip_msg_t	sip_create_dialog_req_nocontact(sip_method_t,
685df4705egm			    sip_dialog_t, char *, char *, int, char *,
686df4705egm			    uint32_t, int);
68740cb5e5viextern int			sip_get_dialog_state(sip_dialog_t, int *);
68840cb5e5viextern int			sip_get_dialog_method(sip_dialog_t, int *);
689943efbcgmextern int			sip_get_dialog_msgcnt(sip_dialog_t, int *);
69040cb5e5viextern const sip_str_t		*sip_get_dialog_callid(sip_dialog_t, int *);
69140cb5e5viextern const sip_str_t		*sip_get_dialog_local_tag(sip_dialog_t, int *);
69240cb5e5viextern const sip_str_t		*sip_get_dialog_remote_tag(sip_dialog_t, int *);
69340cb5e5viextern const struct sip_uri	*sip_get_dialog_local_uri(sip_dialog_t, int *);
69440cb5e5viextern const struct sip_uri	*sip_get_dialog_remote_uri(sip_dialog_t, int *);
69540cb5e5viextern const struct sip_uri	*sip_get_dialog_remote_target_uri(sip_dialog_t,
69640cb5e5vi				    int *);
697df4705egmextern const struct sip_uri	*sip_get_dialog_local_contact_uri(sip_dialog_t,
698df4705egm				    int *);
69940cb5e5viextern const sip_str_t		*sip_get_dialog_route_set(sip_dialog_t, int *);
70040cb5e5viextern boolean_t		sip_is_dialog_secure(sip_dialog_t, int *);
70140cb5e5viextern uint32_t			sip_get_dialog_local_cseq(sip_dialog_t, int *);
70240cb5e5viextern uint32_t			sip_get_dialog_remote_cseq(sip_dialog_t, int *);
70340cb5e5viextern int			sip_get_dialog_type(sip_dialog_t dialog, int *);
70440cb5e5vi
70540cb5e5viextern void			sip_hold_dialog(sip_dialog_t);
70640cb5e5viextern void			sip_release_dialog(sip_dialog_t);
70740cb5e5viextern void			sip_delete_dialog(sip_dialog_t);
70840cb5e5vi
70940cb5e5viextern sip_uri_t		sip_parse_uri(sip_str_t *, int *);
71040cb5e5viextern void			sip_free_parsed_uri(sip_uri_t);
71140cb5e5viextern boolean_t		sip_is_sipuri(const struct sip_uri *);
71240cb5e5viextern const sip_str_t		*sip_get_uri_scheme(const struct sip_uri *,
71340cb5e5vi				    int *);
71440cb5e5viextern const sip_str_t		*sip_get_uri_user(const struct sip_uri *,
71540cb5e5vi				    int *);
71640cb5e5viextern const sip_str_t		*sip_get_uri_password(const struct sip_uri *,
71740cb5e5vi				    int *);
71840cb5e5viextern const sip_str_t		*sip_get_uri_host(const struct sip_uri *,
71940cb5e5vi				    int *);
72040cb5e5viextern int			sip_get_uri_port(const struct sip_uri *,
72140cb5e5vi				    int *error);
72240cb5e5viextern const sip_param_t	*sip_get_uri_params(const struct sip_uri *,
72340cb5e5vi				    int *);
72440cb5e5viextern const sip_str_t		*sip_get_uri_headers(const struct sip_uri *,
72540cb5e5vi				    int *);
72640cb5e5viextern const sip_str_t		*sip_get_uri_opaque(const struct sip_uri *,
72740cb5e5vi				    int *);
72840cb5e5viextern const sip_str_t		*sip_get_uri_query(const struct sip_uri *,
72940cb5e5vi				    int *);
73040cb5e5viextern const sip_str_t		*sip_get_uri_path(const struct sip_uri *,
73140cb5e5vi				    int *);
73240cb5e5viextern const sip_str_t		*sip_get_uri_regname(const struct sip_uri *,
73340cb5e5vi				    int *);
73440cb5e5viextern boolean_t		sip_is_uri_teluser(const struct sip_uri *);
73540cb5e5viextern int			sip_get_uri_errflags(const struct sip_uri *,
73640cb5e5vi				    int *);
73740cb5e5viextern char			*sip_uri_errflags_to_str(int);
73840cb5e5vi
73940cb5e5viextern const struct sip_uri	*sip_get_request_uri(sip_msg_t, int *);
74040cb5e5viextern const struct sip_uri	*sip_get_uri_parsed(sip_header_value_t, int *);
74140cb5e5vi
74240cb5e5vi/* Transaction functions */
74340cb5e5viextern const struct sip_xaction	*sip_get_trans(sip_msg_t, int, int *);
74440cb5e5viextern char 			*sip_get_trans_branchid(sip_transaction_t,
74540cb5e5vi				    int *);
74640cb5e5viextern sip_method_t		sip_get_trans_method(sip_transaction_t,
74740cb5e5vi				    int *);
74840cb5e5viextern int			sip_get_trans_state(sip_transaction_t, int *);
74940cb5e5viextern const struct sip_message	*sip_get_trans_resp_msg(sip_transaction_t,
75040cb5e5vi				    int *);
75140cb5e5viextern const struct sip_message	*sip_get_trans_orig_msg(sip_transaction_t,
75240cb5e5vi				    int *);
75340cb5e5viextern void			sip_hold_trans(sip_transaction_t);
75440cb5e5viextern void			sip_release_trans(sip_transaction_t);
75540cb5e5viextern const struct sip_conn_object	*sip_get_trans_conn_obj(
75640cb5e5vi					    sip_transaction_t, int *);
757943efbcgm
758943efbcgm/* Logging functions */
759943efbcgmextern int			sip_enable_trans_logging(FILE *, int);
760943efbcgmextern int			sip_enable_dialog_logging(FILE *, int);
761943efbcgmextern void			sip_disable_trans_logging();
762943efbcgmextern void			sip_disable_dialog_logging();
763943efbcgm
764943efbcgm/* Traffic measurement functions */
765943efbcgmextern int		sip_get_counter_value(int, int, void *, size_t);
766943efbcgmextern int		sip_enable_counters(int);
767943efbcgmextern int		sip_disable_counters(int);
768943efbcgm
769943efbcgm
77040cb5e5vi#ifdef	__cplusplus
77140cb5e5vi}
77240cb5e5vi#endif
77340cb5e5vi
77440cb5e5vi#endif	/* _SIP_H */
775