*
*/
-#ifndef QIO_CHANNEL_TLS_H__
-#define QIO_CHANNEL_TLS_H__
+#ifndef QIO_CHANNEL_TLS_H
+#define QIO_CHANNEL_TLS_H
#include "io/channel.h"
#include "io/task.h"
#include "crypto/tlssession.h"
+#include "qom/object.h"
#define TYPE_QIO_CHANNEL_TLS "qio-channel-tls"
-#define QIO_CHANNEL_TLS(obj) \
- OBJECT_CHECK(QIOChannelTLS, (obj), TYPE_QIO_CHANNEL_TLS)
-
typedef struct QIOChannelTLS QIOChannelTLS;
+DECLARE_INSTANCE_CHECKER(QIOChannelTLS, QIO_CHANNEL_TLS,
+ TYPE_QIO_CHANNEL_TLS)
+
/**
* QIOChannelTLS
QIOChannel parent;
QIOChannel *master;
QCryptoTLSSession *session;
+ QIOChannelShutdown shutdown;
};
/**
* @master: the underlying channel object
* @creds: the credentials to use for TLS handshake
* @aclname: the access control list for validating clients
- * @errp: pointer to an uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Create a new TLS channel that runs the server side of
* a TLS session. The TLS session handshake will use the
* @master: the underlying channel object
* @creds: the credentials to use for TLS handshake
* @hostname: the user specified server hostname
- * @errp: pointer to an uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Create a new TLS channel that runs the client side of
* a TLS session. The TLS session handshake will use the
* @func: the callback to invoke when completed
* @opaque: opaque data to pass to @func
* @destroy: optional callback to free @opaque
+ * @context: the context that TLS handshake will run with. If %NULL,
+ * the default context will be used
*
* Perform the TLS session handshake. This method
* will return immediately and the handshake will
void qio_channel_tls_handshake(QIOChannelTLS *ioc,
QIOTaskFunc func,
gpointer opaque,
- GDestroyNotify destroy);
+ GDestroyNotify destroy,
+ GMainContext *context);
/**
* qio_channel_tls_get_session:
QCryptoTLSSession *
qio_channel_tls_get_session(QIOChannelTLS *ioc);
-#endif /* QIO_CHANNEL_TLS_H__ */
+#endif /* QIO_CHANNEL_TLS_H */