tport
1.12.11
|
00001 /* 00002 * This file is part of the Sofia-SIP package 00003 * 00004 * Copyright (C) 2005 Nokia Corporation. 00005 * 00006 * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden> 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation; either version 2.1 of 00011 * the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00021 * 02110-1301 USA 00022 * 00023 */ 00024 00025 #ifndef TPORT_TAG_H 00026 00027 #define TPORT_TAG_H 00028 00037 #ifndef SU_TAG_H 00038 #include <sofia-sip/su_tag.h> 00039 #endif 00040 00041 SOFIA_BEGIN_DECLS 00042 00044 TPORT_DLL extern tagi_t tport_tag_list[]; 00045 00047 TPORT_DLL extern tagi_t tport_tags[]; 00048 00050 #define TPTAG_ANY() tptag_any, ((tag_value_t)0) 00051 TPORT_DLL extern tag_typedef_t tptag_any; 00052 00053 TPORT_DLL extern tag_typedef_t tptag_ident; 00054 #define TPTAG_IDENT(x) tptag_ident, tag_str_v((x)) 00055 00056 TPORT_DLL extern tag_typedef_t tptag_ident_ref; 00057 #define TPTAG_IDENT_REF(x) tptag_ident_ref, tag_str_vr(&(x)) 00058 00059 TPORT_DLL extern tag_typedef_t tptag_reuse; 00060 #define TPTAG_REUSE(x) tptag_reuse, tag_bool_v((x)) 00061 00062 TPORT_DLL extern tag_typedef_t tptag_reuse_ref; 00063 #define TPTAG_REUSE_REF(x) tptag_reuse_ref, tag_bool_vr(&(x)) 00064 00065 TPORT_DLL extern tag_typedef_t tptag_fresh; 00066 #define TPTAG_FRESH(x) tptag_fresh, tag_bool_v((x)) 00067 00068 TPORT_DLL extern tag_typedef_t tptag_fresh_ref; 00069 #define TPTAG_FRESH_REF(x) tptag_fresh_ref, tag_bool_vr(&(x)) 00070 00071 TPORT_DLL extern tag_typedef_t tptag_server; 00072 #define TPTAG_SERVER(x) tptag_server, tag_bool_v((x)) 00073 00074 TPORT_DLL extern tag_typedef_t tptag_server_ref; 00075 #define TPTAG_SERVER_REF(x) tptag_server_ref, tag_bool_vr(&(x)) 00076 00081 typedef enum tport_via { 00082 tport_type_local = 0, 00083 tport_type_server = 0, 00084 tport_type_client = 1, 00085 tport_type_stun = 2, 00086 tport_type_upnp = 3, 00087 tport_type_connect = 4, 00088 tport_type_socks = 5, 00089 } tport_pri_type_t; 00090 00091 TPORT_DLL extern tag_typedef_t tptag_public; 00092 #define TPTAG_PUBLIC(x) tptag_public, tag_int_v((x)) 00093 00094 TPORT_DLL extern tag_typedef_t tptag_public_ref; 00095 #define TPTAG_PUBLIC_REF(x) tptag_public_ref, tag_int_vr(&(x)) 00096 00097 TPORT_DLL extern tag_typedef_t tptag_mtu; 00098 #define TPTAG_MTU(x) tptag_mtu, tag_usize_v((x)) 00099 00100 TPORT_DLL extern tag_typedef_t tptag_mtu_ref; 00101 #define TPTAG_MTU_REF(x) tptag_mtu_ref, tag_usize_vr(&(x)) 00102 00103 TPORT_DLL extern tag_typedef_t tptag_connect; 00104 #define TPTAG_CONNECT(x) tptag_connect, tag_bool_v((x)) 00105 00106 TPORT_DLL extern tag_typedef_t tptag_connect_ref; 00107 #define TPTAG_CONNECT_REF(x) tptag_connect_ref, tag_bool_vr(&(x)) 00108 00109 TPORT_DLL extern tag_typedef_t tptag_queuesize; 00110 #define TPTAG_QUEUESIZE(x) tptag_queuesize, tag_uint_v((x)) 00111 00112 TPORT_DLL extern tag_typedef_t tptag_queuesize_ref; 00113 #define TPTAG_QUEUESIZE_REF(x) tptag_queuesize_ref, tag_uint_vr(&(x)) 00114 00115 TPORT_DLL extern tag_typedef_t tptag_sdwn_error; 00116 #define TPTAG_SDWN_ERROR(x) tptag_sdwn_error, tag_bool_v((x)) 00117 00118 TPORT_DLL extern tag_typedef_t tptag_sdwn_error_ref; 00119 #define TPTAG_SDWN_ERROR_REF(x) tptag_sdwn_error_ref, tag_bool_vr(&(x)) 00120 00121 TPORT_DLL extern tag_typedef_t tptag_sdwn_after; 00122 #define TPTAG_SDWN_AFTER(x) tptag_sdwn_after, tag_bool_v((x)) 00123 00124 TPORT_DLL extern tag_typedef_t tptag_sdwn_after_ref; 00125 #define TPTAG_SDWN_AFTER_REF(x) tptag_sdwn_after_ref, tag_bool_vr(&(x)) 00126 00127 TPORT_DLL extern tag_typedef_t tptag_close_after; 00128 #define TPTAG_CLOSE_AFTER(x) tptag_close_after, tag_bool_v((x)) 00129 00130 TPORT_DLL extern tag_typedef_t tptag_close_after_ref; 00131 #define TPTAG_CLOSE_AFTER_REF(x) tptag_close_after_ref, tag_bool_vr(&(x)) 00132 00133 TPORT_DLL extern tag_typedef_t tptag_idle; 00134 #define TPTAG_IDLE(x) tptag_idle, tag_uint_v((x)) 00135 00136 TPORT_DLL extern tag_typedef_t tptag_idle_ref; 00137 #define TPTAG_IDLE_REF(x) tptag_idle_ref, tag_uint_vr(&(x)) 00138 00139 TPORT_DLL extern tag_typedef_t tptag_timeout; 00140 #define TPTAG_TIMEOUT(x) tptag_timeout, tag_uint_v((x)) 00141 00142 TPORT_DLL extern tag_typedef_t tptag_timeout_ref; 00143 #define TPTAG_TIMEOUT_REF(x) tptag_timeout_ref, tag_uint_vr(&(x)) 00144 00145 TPORT_DLL extern tag_typedef_t tptag_keepalive; 00146 #define TPTAG_KEEPALIVE(x) tptag_keepalive, tag_uint_v((x)) 00147 00148 TPORT_DLL extern tag_typedef_t tptag_keepalive_ref; 00149 #define TPTAG_KEEPALIVE_REF(x) tptag_keepalive_ref, tag_uint_vr(&(x)) 00150 00151 TPORT_DLL extern tag_typedef_t tptag_pingpong; 00152 #define TPTAG_PINGPONG(x) tptag_pingpong, tag_uint_v((x)) 00153 00154 TPORT_DLL extern tag_typedef_t tptag_pingpong_ref; 00155 #define TPTAG_PINGPONG_REF(x) tptag_pingpong_ref, tag_uint_vr(&(x)) 00156 00157 TPORT_DLL extern tag_typedef_t tptag_pong2ping; 00158 #define TPTAG_PONG2PING(x) tptag_pong2ping, tag_bool_v((x)) 00159 00160 TPORT_DLL extern tag_typedef_t tptag_pong2ping_ref; 00161 #define TPTAG_PONG2PING_REF(x) tptag_pong2ping_ref, tag_bool_vr(&(x)) 00162 00163 TPORT_DLL extern tag_typedef_t tptag_sigcomp_lifetime; 00164 #define TPTAG_SIGCOMP_LIFETIME(x) tptag_sigcomp_lifetime, tag_uint_v((x)) 00165 00166 TPORT_DLL extern tag_typedef_t tptag_sigcomp_lifetime_ref; 00167 #define TPTAG_SIGCOMP_LIFETIME_REF(x) \ 00168 tptag_sigcomp_lifetime_ref, tag_uint_vr(&(x)) 00169 00170 TPORT_DLL extern tag_typedef_t tptag_compartment; 00171 #define TPTAG_COMPARTMENT(x) tptag_compartment, tag_ptr_v((x)) 00172 00173 TPORT_DLL extern tag_typedef_t tptag_compartment_ref; 00174 #define TPTAG_COMPARTMENT_REF(x) \ 00175 tptag_compartment_ref, tag_ptr_vr(&(x), x) 00176 00177 TPORT_DLL extern tag_typedef_t tptag_certificate; 00178 #define TPTAG_CERTIFICATE(x) tptag_certificate, tag_str_v((x)) 00179 00180 TPORT_DLL extern tag_typedef_t tptag_certificate_ref; 00181 #define TPTAG_CERTIFICATE_REF(x) tptag_certificate_ref, tag_str_vr(&(x)) 00182 00183 TPORT_DLL extern tag_typedef_t tptag_tls_version; 00184 #define TPTAG_TLS_VERSION(x) tptag_tls_version, tag_uint_v((x)) 00185 00186 TPORT_DLL extern tag_typedef_t tptag_tls_version_ref; 00187 #define TPTAG_TLS_VERSION_REF(x) tptag_tls_version_ref, tag_uint_vr(&(x)) 00188 00189 enum tport_tls_verify_policy { 00190 TPTLS_VERIFY_NONE = 0x0, 00191 TPTLS_VERIFY_INCOMING = 0x1, 00192 TPTLS_VERIFY_IN = 0x1, 00193 TPTLS_VERIFY_OUTGOING = 0x2, 00194 TPTLS_VERIFY_OUT = 0x2, 00195 TPTLS_VERIFY_ALL = 0x3, 00196 TPTLS_VERIFY_SUBJECTS_IN = 0x5, /* 0x4 | TPTLS_VERIFY_INCOMING */ 00197 TPTLS_VERIFY_SUBJECTS_OUT = 0xA, /* 0x8 | TPTLS_VERIFY_OUTGOING */ 00198 TPTLS_VERIFY_SUBJECTS_ALL = 0xF, 00199 }; 00200 00201 TPORT_DLL extern tag_typedef_t tptag_tls_passphrase; 00202 #define TPTAG_TLS_PASSPHRASE(x) tptag_tls_passphrase, tag_str_v(x) 00203 00204 TPORT_DLL extern tag_typedef_t tptag_tls_passphrase_ref; 00205 #define TPTAG_TLS_PASSPHRASE_REF(x) tptag_tls_passphrase_ref, tag_str_vr(&(x)) 00206 00207 TPORT_DLL extern tag_typedef_t tptag_tls_verify_policy; 00208 #define TPTAG_TLS_VERIFY_POLICY(x) tptag_tls_verify_policy, tag_uint_v((x)) 00209 00210 TPORT_DLL extern tag_typedef_t tptag_tls_verify_policy_ref; 00211 #define TPTAG_TLS_VERIFY_POLICY_REF(x) tptag_tls_verify_policy_ref, tag_uint_vr(&(x)) 00212 00213 TPORT_DLL extern tag_typedef_t tptag_tls_verify_depth; 00214 #define TPTAG_TLS_VERIFY_DEPTH(x) tptag_tls_verify_depth, tag_uint_v((x)) 00215 00216 TPORT_DLL extern tag_typedef_t tptag_tls_verify_depth_ref; 00217 #define TPTAG_TLS_VERIFY_DEPTH_REF(x) \ 00218 tptag_tls_verify_depth_ref, tag_uint_vr(&(x)) 00219 00220 TPORT_DLL extern tag_typedef_t tptag_tls_verify_date; 00221 #define TPTAG_TLS_VERIFY_DATE(x) tptag_tls_verify_date, tag_uint_v((x)) 00222 00223 TPORT_DLL extern tag_typedef_t tptag_tls_verify_date_ref; 00224 #define TPTAG_TLS_VERIFY_DATE_REF(x) \ 00225 tptag_tls_verify_date_ref, tag_uint_vr(&(x)) 00226 00227 TPORT_DLL extern tag_typedef_t tptag_tls_verify_subjects; 00228 #define TPTAG_TLS_VERIFY_SUBJECTS(x) tptag_tls_verify_subjects, tag_cptr_v((x)) 00229 00230 TPORT_DLL extern tag_typedef_t tptag_tls_verify_subjects_ref; 00231 #define TPTAG_TLS_VERIFY_SUBJECTS_REF(x) \ 00232 tptag_tls_verify_subjects_ref, tag_cptr_vr(&(x), (x)) 00233 00234 /* TPTAG_TLS_VERIFY_PEER is depreciated - Use TPTAG_TLS_VERIFY_POLICY */ 00235 TPORT_DLL extern tag_typedef_t tptag_tls_verify_peer; 00236 #define TPTAG_TLS_VERIFY_PEER(x) TPTAG_TLS_VERIFY_POLICY( (x) ? \ 00237 TPTLS_VERIFY_ALL : TPTLS_VERIFY_NONE) 00238 00239 TPORT_DLL extern tag_typedef_t tptag_tls_verify_peer_ref; 00240 #define TPTAG_TLS_VERIFY_PEER_REF(x) tptag_tls_verify_peer_ref, tag_uint_vr(&(x)) 00241 00242 #if 0 00243 TPORT_DLL extern tag_typedef_t tport_x509_subject; 00244 #define TPTAG_X509_SUBJECT(x) tptag_x509_subject, tag_str_v((x)) 00245 00246 TPORT_DLL extern tag_typedef_t tptag_x509_subject_ref; 00247 #define TPTAG_X509_SUBJECT_REF(x) tptag_x509_subject_ref, tag_str_vr(&(x)) 00248 #endif 00249 00250 TPORT_DLL extern tag_typedef_t tptag_debug_drop; 00251 #define TPTAG_DEBUG_DROP(x) tptag_debug_drop, tag_uint_v((x)) 00252 00253 TPORT_DLL extern tag_typedef_t tptag_debug_drop_ref; 00254 #define TPTAG_DEBUG_DROP_REF(x) tptag_debug_drop_ref, tag_uint_vr(&(x)) 00255 00256 TPORT_DLL extern tag_typedef_t tptag_udp_rmem; 00257 #define TPTAG_UDP_RMEM(x) tptag_udp_rmem, tag_uint_v((x)) 00258 00259 TPORT_DLL extern tag_typedef_t tptag_udp_rmem_ref; 00260 #define TPTAG_UDP_RMEM_REF(x) tptag_udp_rmem_ref, tag_uint_vr(&(x)) 00261 00262 TPORT_DLL extern tag_typedef_t tptag_udp_wmem; 00263 #define TPTAG_UDP_WMEM(x) tptag_udp_wmem, tag_uint_v((x)) 00264 00265 TPORT_DLL extern tag_typedef_t tptag_udp_wmem_ref; 00266 #define TPTAG_UDP_WMEM_REF(x) tptag_udp_wmem_ref, tag_uint_vr(&(x)) 00267 00268 TPORT_DLL extern tag_typedef_t tptag_thrpsize; 00269 #define TPTAG_THRPSIZE(x) tptag_thrpsize, tag_uint_v((x)) 00270 00271 TPORT_DLL extern tag_typedef_t tptag_thrpsize_ref; 00272 #define TPTAG_THRPSIZE_REF(x) tptag_thrpsize_ref, tag_uint_vr(&(x)) 00273 00274 TPORT_DLL extern tag_typedef_t tptag_thrprqsize; 00275 #define TPTAG_THRPRQSIZE(x) tptag_thrprqsize, tag_uint_v((x)) 00276 00277 TPORT_DLL extern tag_typedef_t tptag_thrprqsize_ref; 00278 #define TPTAG_THRPRQSIZE_REF(x) tptag_thrprqsize_ref, tag_uint_vr(&(x)) 00279 00280 TPORT_DLL extern tag_typedef_t tptag_http_connect; 00281 #define TPTAG_HTTP_CONNECT(x) tptag_http_connect, tag_str_v((x)) 00282 00283 TPORT_DLL extern tag_typedef_t tptag_http_connect_ref; 00284 #define TPTAG_HTTP_CONNECT_REF(x) tptag_http_connect_ref, tag_str_vr(&(x)) 00285 00286 TPORT_DLL extern tag_typedef_t tptag_stun_server; 00287 #define TPTAG_STUN_SERVER(x) tptag_stun_server, tag_bool_v((x)) 00288 00289 TPORT_DLL extern tag_typedef_t tptag_stun_server_ref; 00290 #define TPTAG_STUN_SERVER_REF(x) tptag_stun_server_ref, tag_bool_vr(&(x)) 00291 00292 TPORT_DLL extern tag_typedef_t tptag_tos; 00293 #define TPTAG_TOS(x) tptag_tos, tag_int_v((x)) 00294 00295 TPORT_DLL extern tag_typedef_t tptag_tos_ref; 00296 #define TPTAG_TOS_REF(x) tptag_tos_ref, tag_int_vr(&(x)) 00297 00298 TPORT_DLL extern tag_typedef_t tptag_log; 00299 #define TPTAG_LOG(x) tptag_log, tag_bool_v((x)) 00300 00301 TPORT_DLL extern tag_typedef_t tptag_log_ref; 00302 #define TPTAG_LOG_REF(x) tptag_log_ref, tag_bool_vr(&(x)) 00303 00304 TPORT_DLL extern tag_typedef_t tptag_dump; 00305 #define TPTAG_DUMP(x) tptag_dump, tag_str_v((x)) 00306 00307 TPORT_DLL extern tag_typedef_t tptag_dump_ref; 00308 #define TPTAG_DUMP_REF(x) tptag_dump_ref, tag_str_vr(&(x)) 00309 00310 TPORT_DLL extern tag_typedef_t tptag_capt; 00311 #define TPTAG_CAPT(x) tptag_capt, tag_str_v((x)) 00312 00313 TPORT_DLL extern tag_typedef_t tptag_capt_ref; 00314 #define TPTAG_CAPT_REF(x) tptag_capt_ref, tag_str_vr(&(x)) 00315 00316 SOFIA_END_DECLS 00317 00318 #endif /* !defined TPORT_TAG_H */