-/* $OpenBSD: bio.h,v 1.37 2018/02/20 18:13:31 tb Exp $ */
+/* $OpenBSD: bio.h,v 1.38 2018/02/20 18:17:17 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int BIO_method_type(const BIO *b);
typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long);
+typedef int BIO_info_cb(BIO *, int, int);
typedef struct bio_method_st {
int type;
int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *));
int (*BIO_meth_get_destroy(BIO_METHOD *biom))(BIO *);
int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *));
+long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))(BIO *, int, BIO_info_cb *);
+int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
+ long (*callback_ctrl)(BIO *, int, BIO_info_cb *));
/* connect BIO stuff */
#define BIO_CONN_S_BEFORE 1
-/* $OpenBSD: bio_meth.c,v 1.3 2018/02/20 18:13:31 tb Exp $ */
+/* $OpenBSD: bio_meth.c,v 1.4 2018/02/20 18:17:17 tb Exp $ */
/*
* Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
*
biom->destroy = destroy;
return 1;
}
+
+long
+(*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))(BIO *, int, BIO_info_cb *)
+{
+ return
+ (long (*)(BIO *, int, BIO_info_cb*))biom->callback_ctrl; /* XXX */
+}
+
+int
+BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
+ long (*callback_ctrl)(BIO *, int, BIO_info_cb *))
+{
+ biom->callback_ctrl =
+ (long (*)(BIO *, int, bio_info_cb *))callback_ctrl; /* XXX */
+ return 1;
+}