/* defines for compatibility with older versions.
 */

#define gnutls_DN gnutls_x509_dn
#define GNUTLS_X509_SUBJECT_ALT_NAME gnutls_x509_subject_alt_name

#define GNUTLS_RSA_PARAMS gnutls_rsa_params
#define GNUTLS_DH_PARAMS gnutls_dh_params
#define GNUTLS_STATE gnutls_session
#define GNUTLS_LIST const int*
#define GNUTLS_TRANSPORT_PTR gnutls_transport_ptr
#define GNUTLS_PKAlgorithm gnutls_pk_algorithm
#define GNUTLS_X509_CertificateFmt gnutls_x509_certificate_format
#define GNUTLS_CertificateType gnutls_certificate_type
#define GNUTLS_Version gnutls_protocol_version
#define GNUTLS_CloseRequest gnutls_close_request
#define GNUTLS_OpenPGPKeyStatus gnutls_openpgp_key_status
#define GNUTLS_CertificateRequest gnutls_certificate_request
#define GNUTLS_CertificateStatus gnutls_certificate_status
#define GNUTLS_ConnectionEnd gnutls_connection_end
#define GNUTLS_CompressionMethod gnutls_compression_method
#define GNUTLS_DigestAlgorithm gnutls_digest_algorithm
#define GNUTLS_CredType gnutls_credentials_type
#define GNUTLS_KXAlgorithm gnutls_kx_algorithm
#define GNUTLS_BulkCipherAlgorithm gnutls_cipher_algorithm
#define GNUTLS_MACAlgorithm gnutls_mac_algorithm
#define GNUTLS_AlertLevel gnutls_alert_level
#define GNUTLS_AlertDescription gnutls_alert_description
#define GNUTLS_CERTIFICATE_CLIENT_CREDENTIALS gnutls_certificate_client_credentials
#define GNUTLS_CERTIFICATE_SERVER_CREDENTIALS gnutls_certificate_server_credentials
#define GNUTLS_CERTIFICATE_CREDENTIALS gnutls_certificate_credentials
#define GNUTLS_ANON_SERVER_CREDENTIALS gnutls_anon_server_credentials
#define GNUTLS_ANON_CLIENT_CREDENTIALS gnutls_anon_client_credentials
#define gnutls_transport_set_push_func gnutls_transport_set_push_function
#define gnutls_transport_set_pull_func gnutls_transport_set_pull_function
#define gnutls_global_set_log_func gnutls_global_set_log_function
#define gnutls_global_set_mem_func gnutls_global_set_mem_functions

#define gnutls_certificate_free_sc gnutls_certificate_free_credentials
#define gnutls_certificate_allocate_sc gnutls_certificate_allocate_credentials
#define gnutls_certificate_free_cred gnutls_certificate_free_credentials
#define gnutls_certificate_allocate_cred gnutls_certificate_allocate_credentials

#define gnutls_anon_free_client_sc gnutls_anon_free_client_credentials
#define gnutls_anon_allocate_client_sc gnutls_anon_allocate_client_credentials
#define gnutls_anon_free_server_sc gnutls_anon_free_server_credentials
#define gnutls_anon_allocate_server_sc gnutls_anon_allocate_server_credentials

#define gnutls_anon_free_client_cred gnutls_anon_free_client_credentials
#define gnutls_anon_allocate_client_cred gnutls_anon_allocate_client_credentials
#define gnutls_anon_free_server_cred gnutls_anon_free_server_credentials
#define gnutls_anon_allocate_server_cred gnutls_anon_allocate_server_credentials

#define gnutls_state_get_ptr gnutls_session_get_ptr
#define gnutls_state_set_ptr gnutls_session_set_ptr
#define gnutls_handshake_set_exportable_detection(x,y) 0
#define gnutls_cert_type_get gnutls_certificate_type_get
#define gnutls_cert_type_set_priority gnutls_certificate_type_set_priority
#define gnutls_cert_type_get_name gnutls_certificate_type_get_name
#define gnutls_cred_set	gnutls_credentials_set

#define gnutls_b64_encode_fmt gnutls_pem_base64_encode
#define gnutls_b64_encode_fmt2 gnutls_pem_base64_encode_alloc
#define gnutls_b64_decode_fmt(a,b,c) gnutls_pem_base64_decode( NULL,a,b,c)
#define gnutls_b64_decode_fmt2(a,b)  gnutls_pem_base64_decode_alloc(NULL,a,b)

#define gnutls_handshake_get_direction gnutls_record_get_direction

#define gnutls_certificate_client_select_func gnutls_certificate_client_select_function
#define gnutls_certificate_server_select_func gnutls_certificate_server_select_function

#define gnutls_certificate_client_set_select_func gnutls_certificate_client_set_select_function
#define gnutls_certificate_server_set_select_func gnutls_certificate_server_set_select_function

/* Defines for gnutls-extra */

#define gnutls_srp_server_select_func gnutls_srp_server_select_function
#define gnutls_srp_server_set_select_func gnutls_srp_server_set_select_function

#define GNUTLS_SRP_SERVER_CREDENTIALS gnutls_srp_server_credentials
#define GNUTLS_SRP_CLIENT_CREDENTIALS gnutls_srp_client_credentials

#define gnutls_srp_free_client_sc gnutls_srp_free_client_credentials
#define gnutls_srp_allocate_client_sc gnutls_srp_allocate_client_credentials
#define gnutls_srp_free_client_cred gnutls_srp_free_client_credentials
#define gnutls_srp_allocate_client_cred gnutls_srp_allocate_client_credentials
#define gnutls_srp_set_client_cred gnutls_srp_set_client_credentials

#define gnutls_srp_free_server_sc gnutls_srp_free_server_credentials
#define gnutls_srp_allocate_server_sc gnutls_srp_allocate_server_credentials
#define gnutls_srp_free_server_cred gnutls_srp_free_server_credentials
#define gnutls_srp_allocate_server_cred gnutls_srp_allocate_server_credentials
#define gnutls_srp_set_server_cred_file gnutls_srp_set_server_credentials_file

#define gnutls_set_server_name gnutls_server_name_set
#define gnutls_get_server_name gnutls_server_name_get

#define GNUTLS_E_PARSING_ERROR GNUTLS_E_BASE64_DECODING_ERROR
#define GNUTLS_E_PWD_ERROR GNUTLS_E_SRP_PWD_ERROR
#define GNUTLS_E_ASCII_ARMOR_ERROR GNUTLS_E_BASE64_DECODING_ERROR
