soa_tag.h 9.31 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7
/*
 * This file is part of the Sofia-SIP package
 *
 * Copyright (C) 2005 Nokia Corporation.
 *
 * Contact: Pekka Pessi <pekka.pessi@nokia.com>
 *
8
 * This library is free software; you can redistribute it and/or
Pekka Pessi's avatar
Pekka Pessi committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 * 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 SOA_TAG_H
Pekka Pessi's avatar
Pekka Pessi committed
26
#define SOA_TAG_H
Pekka Pessi's avatar
Pekka Pessi committed
27
/**@file sofia-sip/soa_tag.h  Tags for SDP Offer/Answer Application Interface.
Pekka Pessi's avatar
Pekka Pessi committed
28 29 30 31 32 33 34
 *
 * @author Pekka Pessi <Pekka.Pessi@nokia.com>
 *
 * @date Created: Mon Aug 1 15:43:53 EEST 2005 ppessi
 */

#ifndef SU_TAG_H
35
#include <sofia-sip/su_tag.h>
Pekka Pessi's avatar
Pekka Pessi committed
36
#endif
37
#ifndef SDP_TAG_H
38
#include <sofia-sip/sdp_tag.h>
39
#endif
Pekka Pessi's avatar
Pekka Pessi committed
40

41 42
SOFIA_BEGIN_DECLS

43
/** List of base SOA tags (defined in base SOA module). */
Pekka Pessi's avatar
Pekka Pessi committed
44
SOFIAPUBVAR tagi_t soa_tag_list[];
45

46 47
/** Filter tag matching any soa tag. */
#define SOATAG_ANY()         soatag_any, ((tag_value_t)0)
Pekka Pessi's avatar
Pekka Pessi committed
48
SOFIAPUBVAR tag_typedef_t soatag_any;
49

Pekka Pessi's avatar
Pekka Pessi committed
50
/**
51
 * Media states
Pekka Pessi's avatar
Pekka Pessi committed
52 53 54
 */
enum {
  SOA_ACTIVE_REJECTED = -8, /**< Media rejected in negotiation */
55 56 57 58
  SOA_ACTIVE_DISABLED = -4, /**< Media not negotiated */
  SOA_ACTIVE_INACTIVE = 0,  /**< Media is inactive: no RTP */
  SOA_ACTIVE_SENDONLY = 1,  /**< Media is sent only */
  SOA_ACTIVE_RECVONLY = 2,  /**< Media is received only */
Pekka Pessi's avatar
Pekka Pessi committed
59
  SOA_ACTIVE_SENDRECV = SOA_ACTIVE_SENDONLY | SOA_ACTIVE_RECVONLY
60
			    /**< Media is bidirectional */
Pekka Pessi's avatar
Pekka Pessi committed
61 62
};

Pekka Pessi's avatar
Pekka Pessi committed
63 64 65 66 67 68 69
#define SOA_ACTIVE_DISABLED SOA_ACTIVE_DISABLED
#define SOA_ACTIVE_REJECTED SOA_ACTIVE_REJECTED
#define SOA_ACTIVE_INACTIVE SOA_ACTIVE_INACTIVE
#define SOA_ACTIVE_SENDONLY SOA_ACTIVE_SENDONLY
#define SOA_ACTIVE_RECVONLY SOA_ACTIVE_RECVONLY
#define SOA_ACTIVE_SENDRECV SOA_ACTIVE_SENDRECV

Pekka Pessi's avatar
Pekka Pessi committed
70 71 72 73 74
/*
 * SOA engine and media parameters set by soa_set_params(), get by
 * soa_get_params() or soa_get_paramlist()
 */

75
#define SOATAG_USER_SDP(x)  soatag_user_sdp, sdptag_session_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
76
SOFIAPUBVAR tag_typedef_t soatag_user_sdp;
Pekka Pessi's avatar
Pekka Pessi committed
77
#define SOATAG_USER_SDP_REF(x) \
78
  soatag_user_sdp_ref, sdptag_session_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
79
SOFIAPUBVAR tag_typedef_t soatag_user_sdp_ref;
Pekka Pessi's avatar
Pekka Pessi committed
80 81

#define SOATAG_USER_SDP_STR(x)  soatag_user_sdp_str, tag_str_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
82
SOFIAPUBVAR tag_typedef_t soatag_user_sdp_str;
Pekka Pessi's avatar
Pekka Pessi committed
83 84
#define SOATAG_USER_SDP_STR_REF(x) \
  soatag_user_sdp_str_ref, tag_str_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
85
SOFIAPUBVAR tag_typedef_t soatag_user_sdp_str_ref;
Pekka Pessi's avatar
Pekka Pessi committed
86

87
#define SOATAG_CAPS_SDP(x)  soatag_caps_sdp, sdptag_session_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
88
SOFIAPUBVAR tag_typedef_t soatag_caps_sdp;
Pekka Pessi's avatar
Pekka Pessi committed
89
#define SOATAG_CAPS_SDP_REF(x) \
90
  soatag_caps_sdp_ref, sdptag_session_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
91
SOFIAPUBVAR tag_typedef_t soatag_caps_sdp_ref;
Pekka Pessi's avatar
Pekka Pessi committed
92 93

#define SOATAG_CAPS_SDP_STR(x)  soatag_caps_sdp_str, tag_str_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
94
SOFIAPUBVAR tag_typedef_t soatag_caps_sdp_str;
Pekka Pessi's avatar
Pekka Pessi committed
95 96
#define SOATAG_CAPS_SDP_STR_REF(x) \
  soatag_caps_sdp_str_ref, tag_str_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
97
SOFIAPUBVAR tag_typedef_t soatag_caps_sdp_str_ref;
Pekka Pessi's avatar
Pekka Pessi committed
98

99
#define SOATAG_REMOTE_SDP(x)  soatag_remote_sdp, sdptag_session_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
100
SOFIAPUBVAR tag_typedef_t soatag_remote_sdp;
Pekka Pessi's avatar
Pekka Pessi committed
101
#define SOATAG_REMOTE_SDP_REF(x) \
102
  soatag_remote_sdp_ref, sdptag_session_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
103
SOFIAPUBVAR tag_typedef_t soatag_remote_sdp_ref;
Pekka Pessi's avatar
Pekka Pessi committed
104 105

#define SOATAG_REMOTE_SDP_STR(x)  soatag_remote_sdp_str, tag_str_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
106
SOFIAPUBVAR tag_typedef_t soatag_remote_sdp_str;
Pekka Pessi's avatar
Pekka Pessi committed
107 108
#define SOATAG_REMOTE_SDP_STR_REF(x) \
  soatag_remote_sdp_str_ref, tag_str_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
109
SOFIAPUBVAR tag_typedef_t soatag_remote_sdp_str_ref;
Pekka Pessi's avatar
Pekka Pessi committed
110

111
#define SOATAG_LOCAL_SDP(x)  soatag_local_sdp, sdptag_session_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
112
SOFIAPUBVAR tag_typedef_t soatag_local_sdp;
113 114
#define SOATAG_LOCAL_SDP_REF(x) \
  soatag_local_sdp_ref, sdptag_session_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
115
SOFIAPUBVAR tag_typedef_t soatag_local_sdp_ref;
Pekka Pessi's avatar
Pekka Pessi committed
116

117
#define SOATAG_LOCAL_SDP_STR(x)  soatag_local_sdp_str, tag_str_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
118
SOFIAPUBVAR tag_typedef_t soatag_local_sdp_str;
119 120
#define SOATAG_LOCAL_SDP_STR_REF(x) \
  soatag_local_sdp_str_ref, tag_str_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
121
SOFIAPUBVAR tag_typedef_t soatag_session_sdp_str_ref;
Pekka Pessi's avatar
Pekka Pessi committed
122

Pekka Pessi's avatar
Pekka Pessi committed
123
#define SOATAG_AF(x)             soatag_af, tag_int_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
124
SOFIAPUBVAR tag_typedef_t soatag_af;
Pekka Pessi's avatar
Pekka Pessi committed
125

Pekka Pessi's avatar
Pekka Pessi committed
126
#define SOATAG_AF_REF(x)         soatag_af_ref, tag_int_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
127
SOFIAPUBVAR tag_typedef_t soatag_af_ref;
Pekka Pessi's avatar
Pekka Pessi committed
128

Pekka Pessi's avatar
Pekka Pessi committed
129
/** SOATAG_AF() parameter type */
Pekka Pessi's avatar
Pekka Pessi committed
130
enum soa_af {
Pekka Pessi's avatar
Pekka Pessi committed
131 132 133 134 135
  SOA_AF_ANY,			/**< Use any address family. */
  SOA_AF_IP4_ONLY,		/**< Use IP version 4 only */
  SOA_AF_IP6_ONLY,		/**< Use IP version 6 only */
  SOA_AF_IP4_IP6,		/**< Prefer IP4 to IP6 */
  SOA_AF_IP6_IP4		/**< Prefer IP6 to IP4 */
Pekka Pessi's avatar
Pekka Pessi committed
136 137 138 139 140 141 142 143 144
};

#define SOA_AF_ANY      SOA_AF_ANY
#define SOA_AF_IP4_ONLY SOA_AF_IP4_ONLY
#define SOA_AF_IP6_ONLY SOA_AF_IP6_ONLY
#define SOA_AF_IP4_IP6  SOA_AF_IP4_IP6
#define SOA_AF_IP6_IP4  SOA_AF_IP6_IP4

#define SOATAG_ADDRESS(x)  soatag_address, tag_str_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
145
SOFIAPUBVAR tag_typedef_t soatag_address;
Pekka Pessi's avatar
Pekka Pessi committed
146
#define SOATAG_ADDRESS_REF(x) soatag_address_ref, tag_str_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
147
SOFIAPUBVAR tag_typedef_t soatag_address_ref;
Pekka Pessi's avatar
Pekka Pessi committed
148

149
#define SOATAG_RTP_SELECT(x)  soatag_rtp_select, tag_int_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
150
SOFIAPUBVAR tag_typedef_t soatag_rtp_select;
151
#define SOATAG_RTP_SELECT_REF(x)  soatag_rtp_select_ref, tag_int_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
152
SOFIAPUBVAR tag_typedef_t soatag_rtp_select_ref;
153

Pekka Pessi's avatar
Pekka Pessi committed
154
/** Parameter type for SOATAG_RTP_SELECT() */
155
enum {
Pekka Pessi's avatar
Pekka Pessi committed
156 157 158 159
  SOA_RTP_SELECT_SINGLE,	/**< Select the best common codec */
  SOA_RTP_SELECT_COMMON,	/**< Select all common codecs */
  SOA_RTP_SELECT_ALL		/**< Select all local codecs */
 };
160

161 162 163 164 165
#define SOATAG_AUDIO_AUX(x)      soatag_audio_aux, tag_str_v(x)
SOFIAPUBVAR tag_typedef_t soatag_audio_aux;
#define SOATAG_AUDIO_AUX_REF(x)  soatag_audio_aux_ref, tag_str_vr(&(x))
SOFIAPUBVAR tag_typedef_t soatag_audio_aux_ref;

166
#define SOATAG_RTP_SORT(x)  soatag_rtp_sort, tag_int_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
167
SOFIAPUBVAR tag_typedef_t soatag_rtp_sort;
168
#define SOATAG_RTP_SORT_REF(x) soatag_rtp_sort_ref, tag_int_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
169
SOFIAPUBVAR tag_typedef_t soatag_rtp_sort_ref;
170

Pekka Pessi's avatar
Pekka Pessi committed
171 172 173
/** Parameter type for SOATAG_RTP_SORT() */
enum {
  SOA_RTP_SORT_DEFAULT,		/**< Select codecs by local preference
174
				 *  when media is recvonly,
Pekka Pessi's avatar
Pekka Pessi committed
175 176 177 178 179
				 * remote preference othewise.
				 */
  SOA_RTP_SORT_LOCAL,		/**< Select codecs by local preference. */
  SOA_RTP_SORT_REMOTE		/**< Select codecs by remote preference. */
 };
180 181

#define SOATAG_RTP_MISMATCH(x) soatag_rtp_mismatch, tag_bool_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
182
SOFIAPUBVAR tag_typedef_t soatag_rtp_mismatch;
183
#define SOATAG_RTP_MISMATCH_REF(x) soatag_rtp_mismatch_ref, tag_bool_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
184
SOFIAPUBVAR tag_typedef_t soatag_rtp_mismatch_ref;
185

Pekka Pessi's avatar
Pekka Pessi committed
186
#define SOATAG_ACTIVE_AUDIO(x) soatag_active_audio, tag_int_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
187
SOFIAPUBVAR tag_typedef_t soatag_active_audio;
Pekka Pessi's avatar
Pekka Pessi committed
188 189

#define SOATAG_ACTIVE_AUDIO_REF(x) soatag_active_audio_ref, tag_int_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
190
SOFIAPUBVAR tag_typedef_t soatag_active_audio_ref;
Pekka Pessi's avatar
Pekka Pessi committed
191 192

#define SOATAG_ACTIVE_VIDEO(x) soatag_active_video, tag_int_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
193
SOFIAPUBVAR tag_typedef_t soatag_active_video;
Pekka Pessi's avatar
Pekka Pessi committed
194 195

#define SOATAG_ACTIVE_VIDEO_REF(x) soatag_active_video_ref, tag_int_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
196
SOFIAPUBVAR tag_typedef_t soatag_active_video_ref;
Pekka Pessi's avatar
Pekka Pessi committed
197 198

#define SOATAG_ACTIVE_IMAGE(x) soatag_active_image, tag_int_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
199
SOFIAPUBVAR tag_typedef_t soatag_active_image;
Pekka Pessi's avatar
Pekka Pessi committed
200 201

#define SOATAG_ACTIVE_IMAGE_REF(x) soatag_active_image_ref, tag_int_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
202
SOFIAPUBVAR tag_typedef_t soatag_active_image_ref;
Pekka Pessi's avatar
Pekka Pessi committed
203 204

#define SOATAG_ACTIVE_CHAT(x) soatag_active_chat, tag_int_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
205
SOFIAPUBVAR tag_typedef_t soatag_active_chat;
Pekka Pessi's avatar
Pekka Pessi committed
206 207

#define SOATAG_ACTIVE_CHAT_REF(x) soatag_active_chat_ref, tag_int_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
208
SOFIAPUBVAR tag_typedef_t soatag_active_chat_ref;
Pekka Pessi's avatar
Pekka Pessi committed
209

Pekka Pessi's avatar
Pekka Pessi committed
210 211
/** Enable SRTP */
#define SOATAG_SRTP_ENABLE(x)  soatag_srtp_enable, tag_bool_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
212
SOFIAPUBVAR tag_typedef_t soatag_srtp_enable;
Pekka Pessi's avatar
Pekka Pessi committed
213 214

#define SOATAG_SRTP_ENABLE_REF(x) soatag_srtp_enable_ref, tag_bool_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
215
SOFIAPUBVAR tag_typedef_t soatag_srtp_enable_ref;
Pekka Pessi's avatar
Pekka Pessi committed
216 217

#define SOATAG_SRTP_CONFIDENTIALITY(x)  soatag_srtp_confidentiality, tag_bool_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
218
SOFIAPUBVAR tag_typedef_t soatag_srtp_confidentiality;
Pekka Pessi's avatar
Pekka Pessi committed
219
#define SOATAG_SRTP_CONFIDENTIALITY_REF(x) soatag_srtp_confidentiality_ref, tag_bool_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
220
SOFIAPUBVAR tag_typedef_t soatag_srtp_confidentiality_ref;
Pekka Pessi's avatar
Pekka Pessi committed
221 222 223

/** Enable SRTP integrity protection */
#define SOATAG_SRTP_INTEGRITY(x)  soatag_srtp_integrity, tag_bool_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
224
SOFIAPUBVAR tag_typedef_t soatag_srtp_integrity;
Pekka Pessi's avatar
Pekka Pessi committed
225 226 227

#define SOATAG_SRTP_INTEGRITY_REF(x) \
  soatag_srtp_integrity_ref, tag_bool_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
228
SOFIAPUBVAR tag_typedef_t soatag_srtp_integrity_ref;
Pekka Pessi's avatar
Pekka Pessi committed
229 230

#define SOATAG_HOLD(x)           soatag_hold, tag_str_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
231
SOFIAPUBVAR tag_typedef_t soatag_hold;
Pekka Pessi's avatar
Pekka Pessi committed
232
#define SOATAG_HOLD_REF(x)       soatag_hold_ref, tag_str_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
233
SOFIAPUBVAR tag_typedef_t soatag_hold_ref;
Pekka Pessi's avatar
Pekka Pessi committed
234

235 236 237 238 239 240 241 242 243 244 245 246 247 248
#define SOATAG_ORDERED_USER(x) soatag_ordered_user, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t soatag_ordered_user;

#define SOATAG_ORDERED_USER_REF(x) \
  soatag_ordered_user_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t soatag_ordered_user_ref;

#define SOATAG_REUSE_REJECTED(x) soatag_reuse_rejected, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t soatag_reuse_rejected;

#define SOATAG_REUSE_REJECTED_REF(x) \
  soatag_reuse_rejected_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t soatag_reuse_rejected_ref;

249 250 251 252 253 254
#define SOATAG_DELAYED_OFFER_ENABLE(x)  soatag_delayed_offer_enable, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t soatag_delayed_offer_enable;

#define SOATAG_DELAYED_OFFER_ENABLE_REF(x) soatag_delayed_offer_enable_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t soatag_delayed_offer_enable_ref;

255 256
SOFIA_END_DECLS

Pekka Pessi's avatar
Pekka Pessi committed
257
#endif /* SOA_TAG_H */