diff options
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/secret.h | 6 | ||||
-rw-r--r-- | include/crypto/secret_common.h | 12 | ||||
-rw-r--r-- | include/crypto/secret_keyring.h | 24 | ||||
-rw-r--r-- | include/crypto/tls-cipher-suites.h | 9 | ||||
-rw-r--r-- | include/crypto/tlscreds.h | 6 | ||||
-rw-r--r-- | include/crypto/tlscredsanon.h | 7 | ||||
-rw-r--r-- | include/crypto/tlscredspsk.h | 7 | ||||
-rw-r--r-- | include/crypto/tlscredsx509.h | 7 |
8 files changed, 31 insertions, 47 deletions
diff --git a/include/crypto/secret.h b/include/crypto/secret.h index 2deb461d2f..5d20ae6d2f 100644 --- a/include/crypto/secret.h +++ b/include/crypto/secret.h @@ -26,10 +26,10 @@ #include "crypto/secret_common.h" #define TYPE_QCRYPTO_SECRET "secret" -#define QCRYPTO_SECRET(obj) \ - OBJECT_CHECK(QCryptoSecret, (obj), TYPE_QCRYPTO_SECRET) - typedef struct QCryptoSecret QCryptoSecret; +DECLARE_INSTANCE_CHECKER(QCryptoSecret, QCRYPTO_SECRET, + TYPE_QCRYPTO_SECRET) + typedef struct QCryptoSecretClass QCryptoSecretClass; /** diff --git a/include/crypto/secret_common.h b/include/crypto/secret_common.h index 980c02ab71..daf00c3b2a 100644 --- a/include/crypto/secret_common.h +++ b/include/crypto/secret_common.h @@ -25,17 +25,9 @@ #include "qom/object.h" #define TYPE_QCRYPTO_SECRET_COMMON "secret_common" -#define QCRYPTO_SECRET_COMMON(obj) \ - OBJECT_CHECK(QCryptoSecretCommon, (obj), TYPE_QCRYPTO_SECRET_COMMON) -#define QCRYPTO_SECRET_COMMON_CLASS(class) \ - OBJECT_CLASS_CHECK(QCryptoSecretCommonClass, \ - (class), TYPE_QCRYPTO_SECRET_COMMON) -#define QCRYPTO_SECRET_COMMON_GET_CLASS(obj) \ - OBJECT_GET_CLASS(QCryptoSecretCommonClass, \ - (obj), TYPE_QCRYPTO_SECRET_COMMON) +OBJECT_DECLARE_TYPE(QCryptoSecretCommon, QCryptoSecretCommonClass, + qcrypto_secret_common, QCRYPTO_SECRET_COMMON) -typedef struct QCryptoSecretCommon QCryptoSecretCommon; -typedef struct QCryptoSecretCommonClass QCryptoSecretCommonClass; struct QCryptoSecretCommon { Object parent_obj; diff --git a/include/crypto/secret_keyring.h b/include/crypto/secret_keyring.h index 9f371ad251..73d2a8f501 100644 --- a/include/crypto/secret_keyring.h +++ b/include/crypto/secret_keyring.h @@ -26,27 +26,15 @@ #include "crypto/secret_common.h" #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring" -#define QCRYPTO_SECRET_KEYRING(obj) \ - OBJECT_CHECK(QCryptoSecretKeyring, (obj), \ - TYPE_QCRYPTO_SECRET_KEYRING) -#define QCRYPTO_SECRET_KEYRING_CLASS(class) \ - OBJECT_CLASS_CHECK(QCryptoSecretKeyringClass, \ - (class), TYPE_QCRYPTO_SECRET_KEYRING) -#define QCRYPTO_SECRET_KEYRING_GET_CLASS(class) \ - OBJECT_GET_CLASS(QCryptoSecretKeyringClass, \ - (class), TYPE_QCRYPTO_SECRET_KEYRING) - -typedef struct QCryptoSecretKeyring QCryptoSecretKeyring; -typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass; - -typedef struct QCryptoSecretKeyring { +OBJECT_DECLARE_SIMPLE_TYPE(QCryptoSecretKeyring, qcrypto_secret_keyring, + QCRYPTO_SECRET_KEYRING, QCryptoSecretCommonClass) + + +struct QCryptoSecretKeyring { QCryptoSecretCommon parent; int32_t serial; -} QCryptoSecretKeyring; +}; -typedef struct QCryptoSecretKeyringClass { - QCryptoSecretCommonClass parent; -} QCryptoSecretKeyringClass; #endif /* QCRYPTO_SECRET_KEYRING_H */ diff --git a/include/crypto/tls-cipher-suites.h b/include/crypto/tls-cipher-suites.h index 28b3a73ce1..bb9ee53e03 100644 --- a/include/crypto/tls-cipher-suites.h +++ b/include/crypto/tls-cipher-suites.h @@ -15,14 +15,15 @@ #include "crypto/tlscreds.h" #define TYPE_QCRYPTO_TLS_CIPHER_SUITES "tls-cipher-suites" -#define QCRYPTO_TLS_CIPHER_SUITES(obj) \ - OBJECT_CHECK(QCryptoTLSCipherSuites, (obj), TYPE_QCRYPTO_TLS_CIPHER_SUITES) +typedef struct QCryptoTLSCipherSuites QCryptoTLSCipherSuites; +DECLARE_INSTANCE_CHECKER(QCryptoTLSCipherSuites, QCRYPTO_TLS_CIPHER_SUITES, + TYPE_QCRYPTO_TLS_CIPHER_SUITES) -typedef struct QCryptoTLSCipherSuites { +struct QCryptoTLSCipherSuites { /* <private> */ QCryptoTLSCreds parent_obj; /* <public> */ -} QCryptoTLSCipherSuites; +}; /** * qcrypto_tls_cipher_suites_get_data: diff --git a/include/crypto/tlscreds.h b/include/crypto/tlscreds.h index fd7a284aa2..079e376047 100644 --- a/include/crypto/tlscreds.h +++ b/include/crypto/tlscreds.h @@ -29,10 +29,10 @@ #endif #define TYPE_QCRYPTO_TLS_CREDS "tls-creds" -#define QCRYPTO_TLS_CREDS(obj) \ - OBJECT_CHECK(QCryptoTLSCreds, (obj), TYPE_QCRYPTO_TLS_CREDS) - typedef struct QCryptoTLSCreds QCryptoTLSCreds; +DECLARE_INSTANCE_CHECKER(QCryptoTLSCreds, QCRYPTO_TLS_CREDS, + TYPE_QCRYPTO_TLS_CREDS) + typedef struct QCryptoTLSCredsClass QCryptoTLSCredsClass; #define QCRYPTO_TLS_CREDS_DH_PARAMS "dh-params.pem" diff --git a/include/crypto/tlscredsanon.h b/include/crypto/tlscredsanon.h index 9e9a5ce1a8..3f464a3809 100644 --- a/include/crypto/tlscredsanon.h +++ b/include/crypto/tlscredsanon.h @@ -22,13 +22,14 @@ #define QCRYPTO_TLSCREDSANON_H #include "crypto/tlscreds.h" +#include "qom/object.h" #define TYPE_QCRYPTO_TLS_CREDS_ANON "tls-creds-anon" -#define QCRYPTO_TLS_CREDS_ANON(obj) \ - OBJECT_CHECK(QCryptoTLSCredsAnon, (obj), TYPE_QCRYPTO_TLS_CREDS_ANON) +typedef struct QCryptoTLSCredsAnon QCryptoTLSCredsAnon; +DECLARE_INSTANCE_CHECKER(QCryptoTLSCredsAnon, QCRYPTO_TLS_CREDS_ANON, + TYPE_QCRYPTO_TLS_CREDS_ANON) -typedef struct QCryptoTLSCredsAnon QCryptoTLSCredsAnon; typedef struct QCryptoTLSCredsAnonClass QCryptoTLSCredsAnonClass; /** diff --git a/include/crypto/tlscredspsk.h b/include/crypto/tlscredspsk.h index 907035a29b..d7e6bdb5ed 100644 --- a/include/crypto/tlscredspsk.h +++ b/include/crypto/tlscredspsk.h @@ -22,12 +22,13 @@ #define QCRYPTO_TLSCREDSPSK_H #include "crypto/tlscreds.h" +#include "qom/object.h" #define TYPE_QCRYPTO_TLS_CREDS_PSK "tls-creds-psk" -#define QCRYPTO_TLS_CREDS_PSK(obj) \ - OBJECT_CHECK(QCryptoTLSCredsPSK, (obj), TYPE_QCRYPTO_TLS_CREDS_PSK) - typedef struct QCryptoTLSCredsPSK QCryptoTLSCredsPSK; +DECLARE_INSTANCE_CHECKER(QCryptoTLSCredsPSK, QCRYPTO_TLS_CREDS_PSK, + TYPE_QCRYPTO_TLS_CREDS_PSK) + typedef struct QCryptoTLSCredsPSKClass QCryptoTLSCredsPSKClass; #define QCRYPTO_TLS_CREDS_PSKFILE "keys.psk" diff --git a/include/crypto/tlscredsx509.h b/include/crypto/tlscredsx509.h index e1542e5c8c..c6d89b7881 100644 --- a/include/crypto/tlscredsx509.h +++ b/include/crypto/tlscredsx509.h @@ -22,12 +22,13 @@ #define QCRYPTO_TLSCREDSX509_H #include "crypto/tlscreds.h" +#include "qom/object.h" #define TYPE_QCRYPTO_TLS_CREDS_X509 "tls-creds-x509" -#define QCRYPTO_TLS_CREDS_X509(obj) \ - OBJECT_CHECK(QCryptoTLSCredsX509, (obj), TYPE_QCRYPTO_TLS_CREDS_X509) - typedef struct QCryptoTLSCredsX509 QCryptoTLSCredsX509; +DECLARE_INSTANCE_CHECKER(QCryptoTLSCredsX509, QCRYPTO_TLS_CREDS_X509, + TYPE_QCRYPTO_TLS_CREDS_X509) + typedef struct QCryptoTLSCredsX509Class QCryptoTLSCredsX509Class; #define QCRYPTO_TLS_CREDS_X509_CA_CERT "ca-cert.pem" |