aboutsummaryrefslogtreecommitdiff
path: root/plugins/ice/vapi
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ice/vapi')
-rw-r--r--plugins/ice/vapi/gnutls.vapi419
-rw-r--r--plugins/ice/vapi/metadata/Nice-0.1.metadata11
-rw-r--r--plugins/ice/vapi/nice.vapi386
3 files changed, 816 insertions, 0 deletions
diff --git a/plugins/ice/vapi/gnutls.vapi b/plugins/ice/vapi/gnutls.vapi
new file mode 100644
index 00000000..bc3f13d0
--- /dev/null
+++ b/plugins/ice/vapi/gnutls.vapi
@@ -0,0 +1,419 @@
+[CCode (cprefix = "gnutls_", lower_case_cprefix = "gnutls_", cheader_filename = "gnutls/gnutls.h")]
+namespace GnuTLS {
+
+ public int global_init();
+
+ [CCode (cname = "gnutls_pull_func", has_target = false)]
+ public delegate ssize_t PullFunc(void* transport_ptr, [CCode (ctype = "void*", array_length_type="size_t")] uint8[] array);
+
+ [CCode (cname = "gnutls_pull_timeout_func", has_target = false)]
+ public delegate int PullTimeoutFunc(void* transport_ptr, uint ms);
+
+ [CCode (cname = "gnutls_push_func", has_target = false)]
+ public delegate ssize_t PushFunc(void* transport_ptr, [CCode (ctype = "void*", array_length_type="size_t")] uint8[] array);
+
+ [CCode (cname = "gnutls_certificate_verify_function", has_target = false)]
+ public delegate int VerifyFunc(Session session);
+
+ [Compact]
+ [CCode (cname = "struct gnutls_session_int", free_function = "gnutls_deinit")]
+ public class Session {
+
+ public static Session? create(int con_end) throws GLib.Error {
+ Session result;
+ var ret = init(out result, con_end);
+ throw_if_error(ret);
+ return result;
+ }
+
+ [CCode (cname = "gnutls_init")]
+ private static int init(out Session session, int con_end);
+
+ [CCode (cname = "gnutls_transport_set_push_function")]
+ public void set_push_function(PushFunc func);
+
+ [CCode (cname = "gnutls_transport_set_pull_function")]
+ public void set_pull_function(PullFunc func);
+
+ [CCode (cname = "gnutls_transport_set_pull_timeout_function")]
+ public void set_pull_timeout_function(PullTimeoutFunc func);
+
+ [CCode (cname = "gnutls_transport_set_ptr")]
+ public void set_transport_pointer(void* ptr);
+
+ [CCode (cname = "gnutls_transport_get_ptr")]
+ public void* get_transport_pointer();
+
+ [CCode (cname = "gnutls_heartbeat_enable")]
+ public int enable_heartbeat(uint type);
+
+ [CCode (cname = "gnutls_certificate_server_set_request")]
+ public void server_set_request(CertificateRequest req);
+
+ [CCode (cname = "gnutls_credentials_set")]
+ public int set_credentials_(CredentialsType type, void* cred);
+ [CCode (cname = "gnutls_credentials_set_")]
+ public void set_credentials(CredentialsType type, void* cred) throws GLib.Error {
+ int err = set_credentials_(type, cred);
+ throw_if_error(err);
+ }
+
+ [CCode (cname = "gnutls_priority_set_direct")]
+ public int set_priority_from_string_(string priority, out unowned string err_pos = null);
+ [CCode (cname = "gnutls_priority_set_direct_")]
+ public void set_priority_from_string(string priority, out unowned string err_pos = null) throws GLib.Error {
+ int err = set_priority_from_string_(priority, out err_pos);
+ throw_if_error(err);
+ }
+
+ [CCode (cname = "gnutls_srtp_set_profile_direct")]
+ public int set_srtp_profile_direct_(string profiles, out unowned string err_pos = null);
+ [CCode (cname = "gnutls_srtp_set_profile_direct_")]
+ public void set_srtp_profile_direct(string profiles, out unowned string err_pos = null) throws GLib.Error {
+ int err = set_srtp_profile_direct_(profiles, out err_pos);
+ throw_if_error(err);
+ }
+
+ [CCode (cname = "gnutls_transport_set_int")]
+ public void transport_set_int(int fd);
+
+ [CCode (cname = "gnutls_handshake")]
+ public int handshake();
+
+ [CCode (cname = "gnutls_srtp_get_keys")]
+ public int get_srtp_keys_(void *key_material, uint32 key_material_size, out Datum client_key, out Datum client_salt, out Datum server_key, out Datum server_salt);
+ [CCode (cname = "gnutls_srtp_get_keys_")]
+ public void get_srtp_keys(void *key_material, uint32 key_material_size, out Datum client_key, out Datum client_salt, out Datum server_key, out Datum server_salt) throws GLib.Error {
+ get_srtp_keys_(key_material, key_material_size, out client_key, out client_salt, out server_key, out server_salt);
+ }
+
+ [CCode (cname = "gnutls_certificate_get_peers", array_length_type = "unsigned int")]
+ public unowned Datum[]? get_peer_certificates();
+
+ [CCode (cname = "gnutls_session_set_verify_function")]
+ public void set_verify_function(VerifyFunc func);
+ }
+
+ [Compact]
+ [CCode (cname = "struct gnutls_certificate_credentials_st", free_function = "gnutls_certificate_free_credentials", cprefix = "gnutls_certificate_")]
+ public class CertificateCredentials {
+
+ [CCode (cname = "gnutls_certificate_allocate_credentials")]
+ private static int allocate(out CertificateCredentials credentials);
+
+ public static CertificateCredentials create() throws GLib.Error {
+ CertificateCredentials result;
+ var ret = allocate (out result);
+ throw_if_error(ret);
+ return result;
+ }
+
+ public void get_x509_crt(uint index, [CCode (array_length_type = "unsigned int")] out unowned X509.Certificate[] x509_ca_list);
+
+ public int set_x509_key(X509.Certificate[] cert_list, X509.PrivateKey key);
+ }
+
+ [CCode (cheader_filename = "gnutls/x509.h", cprefix = "GNUTLS_")]
+ namespace X509 {
+
+ [Compact]
+ [CCode (cname = "struct gnutls_x509_crt_int", cprefix = "gnutls_x509_crt_", free_function = "gnutls_x509_crt_deinit")]
+ public class Certificate {
+
+ [CCode (cname = "gnutls_x509_crt_init")]
+ private static int init (out Certificate cert);
+ public static Certificate create() throws GLib.Error {
+ Certificate result;
+ var ret = init (out result);
+ throw_if_error(ret);
+ return result;
+ }
+
+ [CCode (cname = "gnutls_x509_crt_import")]
+ public int import_(ref Datum data, CertificateFormat format);
+ [CCode (cname = "gnutls_x509_crt_import_")]
+ public void import(ref Datum data, CertificateFormat format) throws GLib.Error {
+ int err = import_(ref data, format);
+ throw_if_error(err);
+ }
+
+ [CCode (cname = "gnutls_x509_crt_set_version")]
+ public int set_version_(uint version);
+ [CCode (cname = "gnutls_x509_crt_set_version_")]
+ public void set_version(uint version) throws GLib.Error {
+ int err = set_version_(version);
+ throw_if_error(err);
+ }
+
+ [CCode (cname = "gnutls_x509_crt_set_key")]
+ public int set_key_(PrivateKey key);
+ [CCode (cname = "gnutls_x509_crt_set_key_")]
+ public void set_key(PrivateKey key) throws GLib.Error {
+ int err = set_key_(key);
+ throw_if_error(err);
+ }
+
+ [CCode (cname = "gnutls_x509_crt_set_activation_time")]
+ public int set_activation_time_(time_t act_time);
+ [CCode (cname = "gnutls_x509_crt_set_activation_time_")]
+ public void set_activation_time(time_t act_time) throws GLib.Error {
+ int err = set_activation_time_(act_time);
+ throw_if_error(err);
+ }
+
+ [CCode (cname = "gnutls_x509_crt_set_expiration_time")]
+ public int set_expiration_time_(time_t exp_time);
+ [CCode (cname = "gnutls_x509_crt_set_expiration_time_")]
+ public void set_expiration_time(time_t exp_time) throws GLib.Error {
+ int err = set_expiration_time_(exp_time);
+ throw_if_error(err);
+ }
+
+ [CCode (cname = "gnutls_x509_crt_set_serial")]
+ public int set_serial_(void* serial, size_t serial_size);
+ [CCode (cname = "gnutls_x509_crt_set_serial_")]
+ public void set_serial(void* serial, size_t serial_size) throws GLib.Error {
+ int err = set_serial_(serial, serial_size);
+ throw_if_error(err);
+ }
+
+ [CCode (cname = "gnutls_x509_crt_sign")]
+ public int sign_(Certificate issuer, PrivateKey issuer_key);
+ [CCode (cname = "gnutls_x509_crt_sign_")]
+ public void sign(Certificate issuer, PrivateKey issuer_key) throws GLib.Error {
+ int err = sign_(issuer, issuer_key);
+ throw_if_error(err);
+ }
+
+ [CCode (cname = "gnutls_x509_crt_get_fingerprint")]
+ public int get_fingerprint_(DigestAlgorithm algo, void* buf, ref size_t buf_size);
+ [CCode (cname = "gnutls_x509_crt_get_fingerprint_")]
+ public void get_fingerprint(DigestAlgorithm algo, void* buf, ref size_t buf_size) throws GLib.Error {
+ int err = get_fingerprint_(algo, buf, ref buf_size);
+ throw_if_error(err);
+ }
+ }
+
+ [Compact]
+ [CCode (cname = "struct gnutls_x509_privkey_int", cprefix = "gnutls_x509_privkey_", free_function = "gnutls_x509_privkey_deinit")]
+ public class PrivateKey {
+ private static int init (out PrivateKey key);
+ public static PrivateKey create () throws GLib.Error {
+ PrivateKey result;
+ var ret = init (out result);
+ throw_if_error(ret);
+ return result;
+ }
+
+ public int generate(PKAlgorithm algo, uint bits, uint flags = 0);
+ }
+
+ }
+
+ [CCode (cname = "gnutls_certificate_request_t", cprefix = "GNUTLS_CERT_", has_type_id = false)]
+ public enum CertificateRequest {
+ IGNORE,
+ REQUEST,
+ REQUIRE
+ }
+
+ [CCode (cname = "gnutls_pk_algorithm_t", cprefix = "GNUTLS_PK_", has_type_id = false)]
+ public enum PKAlgorithm {
+ UNKNOWN,
+ RSA,
+ DSA;
+ }
+
+ [CCode (cname = "gnutls_digest_algorithm_t", cprefix = "GNUTLS_DIG_", has_type_id = false)]
+ public enum DigestAlgorithm {
+ NULL,
+ MD5,
+ SHA1,
+ RMD160,
+ MD2,
+ SHA224,
+ SHA256,
+ SHA384,
+ SHA512;
+ }
+
+ [Flags]
+ [CCode (cname = "gnutls_init_flags_t", cprefix = "GNUTLS_", has_type_id = false)]
+ public enum InitFlags {
+ SERVER,
+ CLIENT,
+ DATAGRAM
+ }
+
+ [CCode (cname = "gnutls_credentials_type_t", cprefix = "GNUTLS_CRD_", has_type_id = false)]
+ public enum CredentialsType {
+ CERTIFICATE,
+ ANON,
+ SRP,
+ PSK,
+ IA
+ }
+
+ [CCode (cname = "gnutls_x509_crt_fmt_t", cprefix = "GNUTLS_X509_FMT_", has_type_id = false)]
+ public enum CertificateFormat {
+ DER,
+ PEM
+ }
+
+ [Flags]
+ [CCode (cname = "gnutls_certificate_status_t", cprefix = "GNUTLS_CERT_", has_type_id = false)]
+ public enum CertificateStatus {
+ INVALID, // will be set if the certificate was not verified.
+ REVOKED, // in X.509 this will be set only if CRLs are checked
+ SIGNER_NOT_FOUND,
+ SIGNER_NOT_CA,
+ INSECURE_ALGORITHM
+ }
+
+ [SimpleType]
+ [CCode (cname = "gnutls_datum_t", has_type_id = false)]
+ public struct Datum {
+ public uint8* data;
+ public uint size;
+
+ public uint8[] extract() {
+ uint8[] ret = new uint8[size];
+ for (int i = 0; i < size; i++) {
+ ret[i] = data[i];
+ }
+ return ret;
+ }
+ }
+
+ // Gnutls error codes. The mapping to a TLS alert is also shown in comments.
+ [CCode (cname = "int", cprefix = "GNUTLS_E_", lower_case_cprefix = "gnutls_error_", has_type_id = false)]
+ public enum ErrorCode {
+ SUCCESS,
+ UNKNOWN_COMPRESSION_ALGORITHM,
+ UNKNOWN_CIPHER_TYPE,
+ LARGE_PACKET,
+ UNSUPPORTED_VERSION_PACKET, // GNUTLS_A_PROTOCOL_VERSION
+ UNEXPECTED_PACKET_LENGTH, // GNUTLS_A_RECORD_OVERFLOW
+ INVALID_SESSION,
+ FATAL_ALERT_RECEIVED,
+ UNEXPECTED_PACKET, // GNUTLS_A_UNEXPECTED_MESSAGE
+ WARNING_ALERT_RECEIVED,
+ ERROR_IN_FINISHED_PACKET,
+ UNEXPECTED_HANDSHAKE_PACKET,
+ UNKNOWN_CIPHER_SUITE, // GNUTLS_A_HANDSHAKE_FAILURE
+ UNWANTED_ALGORITHM,
+ MPI_SCAN_FAILED,
+ DECRYPTION_FAILED, // GNUTLS_A_DECRYPTION_FAILED, GNUTLS_A_BAD_RECORD_MAC
+ MEMORY_ERROR,
+ DECOMPRESSION_FAILED, // GNUTLS_A_DECOMPRESSION_FAILURE
+ COMPRESSION_FAILED,
+ AGAIN,
+ EXPIRED,
+ DB_ERROR,
+ SRP_PWD_ERROR,
+ INSUFFICIENT_CREDENTIALS,
+ HASH_FAILED,
+ BASE64_DECODING_ERROR,
+ MPI_PRINT_FAILED,
+ REHANDSHAKE, // GNUTLS_A_NO_RENEGOTIATION
+ GOT_APPLICATION_DATA,
+ RECORD_LIMIT_REACHED,
+ ENCRYPTION_FAILED,
+ PK_ENCRYPTION_FAILED,
+ PK_DECRYPTION_FAILED,
+ PK_SIGN_FAILED,
+ X509_UNSUPPORTED_CRITICAL_EXTENSION,
+ KEY_USAGE_VIOLATION,
+ NO_CERTIFICATE_FOUND, // GNUTLS_A_BAD_CERTIFICATE
+ INVALID_REQUEST,
+ SHORT_MEMORY_BUFFER,
+ INTERRUPTED,
+ PUSH_ERROR,
+ PULL_ERROR,
+ RECEIVED_ILLEGAL_PARAMETER, // GNUTLS_A_ILLEGAL_PARAMETER
+ REQUESTED_DATA_NOT_AVAILABLE,
+ PKCS1_WRONG_PAD,
+ RECEIVED_ILLEGAL_EXTENSION,
+ INTERNAL_ERROR,
+ DH_PRIME_UNACCEPTABLE,
+ FILE_ERROR,
+ TOO_MANY_EMPTY_PACKETS,
+ UNKNOWN_PK_ALGORITHM,
+ // returned if libextra functionality was requested but
+ // gnutls_global_init_extra() was not called.
+
+ INIT_LIBEXTRA,
+ LIBRARY_VERSION_MISMATCH,
+ // returned if you need to generate temporary RSA
+ // parameters. These are needed for export cipher suites.
+
+ NO_TEMPORARY_RSA_PARAMS,
+ LZO_INIT_FAILED,
+ NO_COMPRESSION_ALGORITHMS,
+ NO_CIPHER_SUITES,
+ OPENPGP_GETKEY_FAILED,
+ PK_SIG_VERIFY_FAILED,
+ ILLEGAL_SRP_USERNAME,
+ SRP_PWD_PARSING_ERROR,
+ NO_TEMPORARY_DH_PARAMS,
+ // For certificate and key stuff
+
+ ASN1_ELEMENT_NOT_FOUND,
+ ASN1_IDENTIFIER_NOT_FOUND,
+ ASN1_DER_ERROR,
+ ASN1_VALUE_NOT_FOUND,
+ ASN1_GENERIC_ERROR,
+ ASN1_VALUE_NOT_VALID,
+ ASN1_TAG_ERROR,
+ ASN1_TAG_IMPLICIT,
+ ASN1_TYPE_ANY_ERROR,
+ ASN1_SYNTAX_ERROR,
+ ASN1_DER_OVERFLOW,
+ OPENPGP_UID_REVOKED,
+ CERTIFICATE_ERROR,
+ CERTIFICATE_KEY_MISMATCH,
+ UNSUPPORTED_CERTIFICATE_TYPE, // GNUTLS_A_UNSUPPORTED_CERTIFICATE
+ X509_UNKNOWN_SAN,
+ OPENPGP_FINGERPRINT_UNSUPPORTED,
+ X509_UNSUPPORTED_ATTRIBUTE,
+ UNKNOWN_HASH_ALGORITHM,
+ UNKNOWN_PKCS_CONTENT_TYPE,
+ UNKNOWN_PKCS_BAG_TYPE,
+ INVALID_PASSWORD,
+ MAC_VERIFY_FAILED, // for PKCS #12 MAC
+ CONSTRAINT_ERROR,
+ WARNING_IA_IPHF_RECEIVED,
+ WARNING_IA_FPHF_RECEIVED,
+ IA_VERIFY_FAILED,
+ UNKNOWN_ALGORITHM,
+ BASE64_ENCODING_ERROR,
+ INCOMPATIBLE_CRYPTO_LIBRARY,
+ INCOMPATIBLE_LIBTASN1_LIBRARY,
+ OPENPGP_KEYRING_ERROR,
+ X509_UNSUPPORTED_OID,
+ RANDOM_FAILED,
+ BASE64_UNEXPECTED_HEADER_ERROR,
+ OPENPGP_SUBKEY_ERROR,
+ CRYPTO_ALREADY_REGISTERED,
+ HANDSHAKE_TOO_LARGE,
+ UNIMPLEMENTED_FEATURE,
+ APPLICATION_ERROR_MAX, // -65000
+ APPLICATION_ERROR_MIN; // -65500
+
+ [CCode (cname = "gnutls_error_is_fatal")]
+ public bool is_fatal();
+
+ [CCode (cname = "gnutls_perror")]
+ public void print();
+
+ [CCode (cname = "gnutls_strerror")]
+ public unowned string to_string();
+ }
+
+ public void throw_if_error(int err_int) throws GLib.Error {
+ ErrorCode error = (ErrorCode)err_int;
+ if (error != ErrorCode.SUCCESS) {
+ throw new GLib.Error(-1, error, "%s%s", error.to_string(), error.is_fatal() ? " fatal" : "");
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/ice/vapi/metadata/Nice-0.1.metadata b/plugins/ice/vapi/metadata/Nice-0.1.metadata
new file mode 100644
index 00000000..7fcf046a
--- /dev/null
+++ b/plugins/ice/vapi/metadata/Nice-0.1.metadata
@@ -0,0 +1,11 @@
+Nice cheader_filename="nice.h"
+Address.to_string.dst type="char[]"
+Agent.new_reliable#constructor name="create_reliable"
+Agent.attach_recv skip=false
+Agent.send.buf type="uint8[]" array_length_idx=2
+AgentRecvFunc.buf type="uint8[]" array_length_idx=3
+PseudoTcpCallbacks#record skip
+PseudoTcpSocket#class skip
+
+# Not yet supported by vapigen
+# Candidate copy_function="nice_candidate_copy" free_function="nice_candidate_free" type_id=""
diff --git a/plugins/ice/vapi/nice.vapi b/plugins/ice/vapi/nice.vapi
new file mode 100644
index 00000000..540e2b4e
--- /dev/null
+++ b/plugins/ice/vapi/nice.vapi
@@ -0,0 +1,386 @@
+/* nice.vapi generated by vapigen, do not modify. */
+
+[CCode (cprefix = "Nice", gir_namespace = "Nice", gir_version = "0.1", lower_case_cprefix = "nice_")]
+namespace Nice {
+ [CCode (cheader_filename = "nice.h", type_id = "nice_agent_get_type ()")]
+ public class Agent : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public Agent (GLib.MainContext ctx, Nice.Compatibility compat);
+ public bool add_local_address (Nice.Address addr);
+ public uint add_stream (uint n_components);
+ public bool attach_recv (uint stream_id, uint component_id, GLib.MainContext ctx, Nice.AgentRecvFunc func);
+ [Version (since = "0.1.16")]
+ public async void close_async ();
+ [CCode (cname = "nice_agent_new_reliable", has_construct_function = false)]
+ [Version (since = "0.0.11")]
+ public Agent.create_reliable (GLib.MainContext ctx, Nice.Compatibility compat);
+ [Version (since = "0.1.6")]
+ public bool forget_relays (uint stream_id, uint component_id);
+ [CCode (has_construct_function = false)]
+ [Version (since = "0.1.15")]
+ public Agent.full (GLib.MainContext ctx, Nice.Compatibility compat, Nice.AgentOption flags);
+ public bool gather_candidates (uint stream_id);
+ [Version (since = "0.1.4")]
+ public string generate_local_candidate_sdp (Nice.Candidate candidate);
+ [Version (since = "0.1.4")]
+ public string generate_local_sdp ();
+ [Version (since = "0.1.4")]
+ public string generate_local_stream_sdp (uint stream_id, bool include_non_ice);
+ [Version (since = "0.1.8")]
+ public Nice.ComponentState get_component_state (uint stream_id, uint component_id);
+ public Nice.Candidate get_default_local_candidate (uint stream_id, uint component_id);
+ [Version (since = "0.1.5")]
+ public GLib.IOStream get_io_stream (uint stream_id, uint component_id);
+ public GLib.SList<Nice.Candidate> get_local_candidates (uint stream_id, uint component_id);
+ public bool get_local_credentials (uint stream_id, out string ufrag, out string pwd);
+ public GLib.SList<Nice.Candidate> get_remote_candidates (uint stream_id, uint component_id);
+ public bool get_selected_pair (uint stream_id, uint component_id, Nice.Candidate local, Nice.Candidate remote);
+ [Version (since = "0.1.5")]
+ public GLib.Socket? get_selected_socket (uint stream_id, uint component_id);
+ [Version (since = "0.1.4")]
+ public unowned string get_stream_name (uint stream_id);
+ [Version (since = "0.1.4")]
+ public Nice.Candidate parse_remote_candidate_sdp (uint stream_id, string sdp);
+ [Version (since = "0.1.4")]
+ public int parse_remote_sdp (string sdp);
+ [Version (since = "0.1.4")]
+ public GLib.SList<Nice.Candidate> parse_remote_stream_sdp (uint stream_id, string sdp, string ufrag, string pwd);
+ [Version (since = "0.1.16")]
+ public bool peer_candidate_gathering_done (uint stream_id);
+ [Version (since = "0.1.5")]
+ public ssize_t recv (uint stream_id, uint component_id, [CCode (array_length_cname = "buf_len", array_length_pos = 3.5, array_length_type = "gsize")] out unowned uint8[] buf, GLib.Cancellable? cancellable = null) throws GLib.Error;
+ [Version (since = "0.1.5")]
+ public int recv_messages (uint stream_id, uint component_id, [CCode (array_length_cname = "n_messages", array_length_pos = 3.5, array_length_type = "guint")] out unowned Nice.InputMessage[] messages, GLib.Cancellable? cancellable = null) throws GLib.Error;
+ [Version (since = "0.1.5")]
+ public int recv_messages_nonblocking (uint stream_id, uint component_id, [CCode (array_length_cname = "n_messages", array_length_pos = 3.5, array_length_type = "guint")] out unowned Nice.InputMessage[] messages, GLib.Cancellable? cancellable = null) throws GLib.Error;
+ [Version (since = "0.1.5")]
+ public ssize_t recv_nonblocking (uint stream_id, uint component_id, [CCode (array_length_cname = "buf_len", array_length_pos = 3.5, array_length_type = "gsize")] out unowned uint8[] buf, GLib.Cancellable? cancellable = null) throws GLib.Error;
+ public void remove_stream (uint stream_id);
+ public bool restart ();
+ [Version (since = "0.1.6")]
+ public bool restart_stream (uint stream_id);
+ public int send (uint stream_id, uint component_id, [CCode (array_length_cname = "len", array_length_pos = 2.5, array_length_type = "guint", type = "const gchar*")] uint8[] buf);
+ [Version (since = "0.1.5")]
+ public int send_messages_nonblocking (uint stream_id, uint component_id, [CCode (array_length_cname = "n_messages", array_length_pos = 3.5, array_length_type = "guint")] Nice.OutputMessage[] messages, GLib.Cancellable? cancellable = null) throws GLib.Error;
+ public bool set_local_credentials (uint stream_id, string ufrag, string pwd);
+ public void set_port_range (uint stream_id, uint component_id, uint min_port, uint max_port);
+ public bool set_relay_info (uint stream_id, uint component_id, string server_ip, uint server_port, string username, string password, Nice.RelayType type);
+ public int set_remote_candidates (uint stream_id, uint component_id, GLib.SList<Nice.Candidate> candidates);
+ public bool set_remote_credentials (uint stream_id, string ufrag, string pwd);
+ public bool set_selected_pair (uint stream_id, uint component_id, string lfoundation, string rfoundation);
+ public bool set_selected_remote_candidate (uint stream_id, uint component_id, Nice.Candidate candidate);
+ [Version (since = "0.0.10")]
+ public void set_software (string software);
+ [Version (since = "0.1.4")]
+ public bool set_stream_name (uint stream_id, string name);
+ [Version (since = "0.0.9")]
+ public void set_stream_tos (uint stream_id, int tos);
+ [NoAccessorMethod]
+ [Version (since = "0.1.8")]
+ public bool bytestream_tcp { get; }
+ [NoAccessorMethod]
+ public uint compatibility { get; construct; }
+ [NoAccessorMethod]
+ public bool controlling_mode { get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.1.14")]
+ public bool force_relay { get; set; }
+ [NoAccessorMethod]
+ public bool full_mode { get; construct; }
+ [NoAccessorMethod]
+ [Version (since = "0.1.8")]
+ public bool ice_tcp { get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.1.16")]
+ public bool ice_trickle { get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.1.8")]
+ public bool ice_udp { get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.1.8")]
+ public bool keepalive_conncheck { get; set; }
+ [NoAccessorMethod]
+ public void* main_context { get; construct; }
+ [NoAccessorMethod]
+ public uint max_connectivity_checks { get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.0.4")]
+ public string proxy_ip { owned get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.0.4")]
+ public string proxy_password { owned get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.0.4")]
+ public uint proxy_port { get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.0.4")]
+ public uint proxy_type { get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.0.4")]
+ public string proxy_username { owned get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.0.11")]
+ public bool reliable { get; construct; }
+ [NoAccessorMethod]
+ [Version (since = "0.1.15")]
+ public uint stun_initial_timeout { get; set construct; }
+ [NoAccessorMethod]
+ [Version (since = "0.1.15")]
+ public uint stun_max_retransmissions { get; set construct; }
+ [NoAccessorMethod]
+ public uint stun_pacing_timer { get; set construct; }
+ [NoAccessorMethod]
+ [Version (since = "0.1.15")]
+ public uint stun_reliable_timeout { get; set construct; }
+ [NoAccessorMethod]
+ public string stun_server { owned get; set; }
+ [NoAccessorMethod]
+ public uint stun_server_port { get; set; }
+ [NoAccessorMethod]
+ public bool support_renomination { get; set; }
+ [NoAccessorMethod]
+ [Version (since = "0.0.7")]
+ public bool upnp { get; set construct; }
+ [NoAccessorMethod]
+ [Version (since = "0.0.7")]
+ public uint upnp_timeout { get; set construct; }
+ public signal void candidate_gathering_done (uint stream_id);
+ public signal void component_state_changed (uint stream_id, uint component_id, uint state);
+ public signal void initial_binding_request_received (uint stream_id);
+ [Version (deprecated = true, deprecated_since = "0.1.8")]
+ public signal void new_candidate (uint stream_id, uint component_id, string foundation);
+ [Version (since = "0.1.8")]
+ public signal void new_candidate_full (Nice.Candidate candidate);
+ [Version (deprecated = true, deprecated_since = "0.1.8")]
+ public signal void new_remote_candidate (uint stream_id, uint component_id, string foundation);
+ [Version (since = "0.1.8")]
+ public signal void new_remote_candidate_full (Nice.Candidate candidate);
+ [Version (deprecated = true, deprecated_since = "0.1.8")]
+ public signal void new_selected_pair (uint stream_id, uint component_id, string lfoundation, string rfoundation);
+ [Version (since = "0.1.8")]
+ public signal void new_selected_pair_full (uint stream_id, uint component_id, Nice.Candidate lcandidate, Nice.Candidate rcandidate);
+ [Version (since = "0.0.11")]
+ public signal void reliable_transport_writable (uint stream_id, uint component_id);
+ [Version (since = "0.1.5")]
+ public signal void streams_removed ([CCode (array_length = false, array_null_terminated = true)] uint[] stream_ids);
+ }
+ [CCode (cheader_filename = "nice.h", copy_function = "nice_candidate_copy", free_function = "nice_candidate_free")]
+ [Compact]
+ public class Candidate {
+ public Nice.Address addr;
+ public Nice.Address base_addr;
+ public uint component_id;
+ [CCode (array_length = false)]
+ public weak char foundation[33];
+ public weak string password;
+ public uint32 priority;
+ public void* sockptr;
+ public uint stream_id;
+ public Nice.CandidateTransport transport;
+ public Nice.TurnServer turn;
+ public Nice.CandidateType type;
+ public weak string username;
+ [CCode (has_construct_function = false)]
+ public Candidate (Nice.CandidateType type);
+ public Nice.Candidate copy ();
+ [Version (since = "0.1.15")]
+ public bool equal_target (Nice.Candidate candidate2);
+ public void free ();
+ }
+ [CCode (cheader_filename = "nice.h", has_type_id = false)]
+ public struct Address {
+ [CCode (cname = "s.addr")]
+ public void* s_addr;
+ [CCode (cname = "s.ip4")]
+ public void* s_ip4;
+ [CCode (cname = "s.ip6")]
+ public void* s_ip6;
+ public void copy_to_sockaddr (void* sin);
+ public bool equal (Nice.Address b);
+ [Version (since = "0.1.8")]
+ public bool equal_no_port (Nice.Address b);
+ public void free ();
+ public uint get_port ();
+ public void init ();
+ public int ip_version ();
+ public bool is_private ();
+ public bool is_valid ();
+ public void set_from_sockaddr (void* sin);
+ public bool set_from_string (string str);
+ public void set_ipv4 (uint32 addr_ipv4);
+ public void set_ipv6 (uint8 addr_ipv6);
+ public void set_port (uint port);
+ public void to_string ([CCode (array_length = false, type = "gchar*")] char[] dst);
+ }
+ [CCode (cheader_filename = "nice.h", has_type_id = false)]
+ [Version (since = "0.1.5")]
+ public struct InputMessage {
+ [CCode (array_length_cname = "n_buffers")]
+ public weak GLib.InputVector[] buffers;
+ public int n_buffers;
+ public Nice.Address from;
+ public size_t length;
+ }
+ [CCode (cheader_filename = "nice.h", has_type_id = false)]
+ [Version (since = "0.1.5")]
+ public struct OutputMessage {
+ [CCode (array_length_cname = "n_buffers")]
+ public weak GLib.OutputVector[] buffers;
+ public int n_buffers;
+ }
+ [CCode (cheader_filename = "nice.h", cname = "TurnServer", has_type_id = false)]
+ public struct TurnServer {
+ public int ref_count;
+ public Nice.Address server;
+ public weak string username;
+ public weak string password;
+ public Nice.RelayType type;
+ }
+ [CCode (cheader_filename = "nice.h", cprefix = "NICE_AGENT_OPTION_", has_type_id = false)]
+ [Flags]
+ [Version (since = "0.1.15")]
+ public enum AgentOption {
+ REGULAR_NOMINATION,
+ RELIABLE,
+ LITE_MODE,
+ ICE_TRICKLE,
+ SUPPORT_RENOMINATION
+ }
+ [CCode (cheader_filename = "nice.h", cprefix = "NICE_CANDIDATE_TRANSPORT_", has_type_id = false)]
+ public enum CandidateTransport {
+ UDP,
+ TCP_ACTIVE,
+ TCP_PASSIVE,
+ TCP_SO
+ }
+ [CCode (cheader_filename = "nice.h", cprefix = "NICE_CANDIDATE_TYPE_", has_type_id = false)]
+ public enum CandidateType {
+ HOST,
+ SERVER_REFLEXIVE,
+ PEER_REFLEXIVE,
+ RELAYED
+ }
+ [CCode (cheader_filename = "nice.h", cprefix = "NICE_COMPATIBILITY_", has_type_id = false)]
+ public enum Compatibility {
+ RFC5245,
+ DRAFT19,
+ GOOGLE,
+ MSN,
+ WLM2009,
+ OC2007,
+ OC2007R2,
+ LAST
+ }
+ [CCode (cheader_filename = "nice.h", cprefix = "NICE_COMPONENT_STATE_", has_type_id = false)]
+ public enum ComponentState {
+ DISCONNECTED,
+ GATHERING,
+ CONNECTING,
+ CONNECTED,
+ READY,
+ FAILED,
+ LAST;
+ [Version (since = "0.1.6")]
+ public unowned string to_string ();
+ }
+ [CCode (cheader_filename = "nice.h", cprefix = "NICE_COMPONENT_TYPE_", has_type_id = false)]
+ public enum ComponentType {
+ RTP,
+ RTCP
+ }
+ [CCode (cheader_filename = "nice.h", cprefix = "NICE_NOMINATION_MODE_", has_type_id = false)]
+ [Version (since = "0.1.15")]
+ public enum NominationMode {
+ REGULAR,
+ AGGRESSIVE
+ }
+ [CCode (cheader_filename = "nice.h", cprefix = "NICE_PROXY_TYPE_", has_type_id = false)]
+ [Version (since = "0.0.4")]
+ public enum ProxyType {
+ NONE,
+ SOCKS5,
+ HTTP,
+ LAST
+ }
+ [CCode (cheader_filename = "nice.h", cname = "PseudoTcpDebugLevel", cprefix = "PSEUDO_TCP_DEBUG_", has_type_id = false)]
+ [Version (since = "0.0.11")]
+ public enum PseudoTcpDebugLevel {
+ NONE,
+ NORMAL,
+ VERBOSE
+ }
+ [CCode (cheader_filename = "nice.h", cname = "PseudoTcpShutdown", cprefix = "PSEUDO_TCP_SHUTDOWN_", has_type_id = false)]
+ [Version (since = "0.1.8")]
+ public enum PseudoTcpShutdown {
+ RD,
+ WR,
+ RDWR
+ }
+ [CCode (cheader_filename = "nice.h", cname = "PseudoTcpState", cprefix = "PSEUDO_TCP_", has_type_id = false)]
+ [Version (since = "0.0.11")]
+ public enum PseudoTcpState {
+ LISTEN,
+ SYN_SENT,
+ SYN_RECEIVED,
+ ESTABLISHED,
+ CLOSED,
+ FIN_WAIT_1,
+ FIN_WAIT_2,
+ CLOSING,
+ TIME_WAIT,
+ CLOSE_WAIT,
+ LAST_ACK
+ }
+ [CCode (cheader_filename = "nice.h", cname = "PseudoTcpWriteResult", cprefix = "WR_", has_type_id = false)]
+ [Version (since = "0.0.11")]
+ public enum PseudoTcpWriteResult {
+ SUCCESS,
+ TOO_LARGE,
+ FAIL
+ }
+ [CCode (cheader_filename = "nice.h", cprefix = "NICE_RELAY_TYPE_TURN_", has_type_id = false)]
+ public enum RelayType {
+ UDP,
+ TCP,
+ TLS
+ }
+ [CCode (cheader_filename = "nice.h", instance_pos = 4.9)]
+ public delegate void AgentRecvFunc (Nice.Agent agent, uint stream_id, uint component_id, [CCode (array_length_cname = "len", array_length_pos = 3.5, array_length_type = "guint", type = "gchar*")] uint8[] buf);
+ [CCode (cheader_filename = "nice.h", cname = "NICE_AGENT_MAX_REMOTE_CANDIDATES")]
+ public const int AGENT_MAX_REMOTE_CANDIDATES;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_DIRECTION_MS_PREF_ACTIVE")]
+ public const int CANDIDATE_DIRECTION_MS_PREF_ACTIVE;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_DIRECTION_MS_PREF_PASSIVE")]
+ public const int CANDIDATE_DIRECTION_MS_PREF_PASSIVE;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_MAX_FOUNDATION")]
+ public const int CANDIDATE_MAX_FOUNDATION;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_TRANSPORT_MS_PREF_TCP")]
+ public const int CANDIDATE_TRANSPORT_MS_PREF_TCP;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_TRANSPORT_MS_PREF_UDP")]
+ public const int CANDIDATE_TRANSPORT_MS_PREF_UDP;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_TYPE_PREF_HOST")]
+ public const int CANDIDATE_TYPE_PREF_HOST;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_TYPE_PREF_NAT_ASSISTED")]
+ public const int CANDIDATE_TYPE_PREF_NAT_ASSISTED;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE")]
+ public const int CANDIDATE_TYPE_PREF_PEER_REFLEXIVE;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_TYPE_PREF_RELAYED")]
+ public const int CANDIDATE_TYPE_PREF_RELAYED;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_TYPE_PREF_RELAYED_UDP")]
+ public const int CANDIDATE_TYPE_PREF_RELAYED_UDP;
+ [CCode (cheader_filename = "nice.h", cname = "NICE_CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE")]
+ public const int CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE;
+ [CCode (cheader_filename = "nice.h")]
+ public static void debug_disable (bool with_stun);
+ [CCode (cheader_filename = "nice.h")]
+ public static void debug_enable (bool with_stun);
+ [CCode (cheader_filename = "nice.h")]
+ public static string? interfaces_get_ip_for_interface (string interface_name);
+ [CCode (cheader_filename = "nice.h")]
+ public static GLib.List<string> interfaces_get_local_interfaces ();
+ [CCode (cheader_filename = "nice.h")]
+ public static GLib.List<string> interfaces_get_local_ips (bool include_loopback);
+ [CCode (cheader_filename = "nice.h", cname = "pseudo_tcp_set_debug_level")]
+ [Version (since = "0.0.11")]
+ public static void pseudo_tcp_set_debug_level (Nice.PseudoTcpDebugLevel level);
+}