summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bio_local.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/bio_local.h')
-rw-r--r--src/lib/libcrypto/bio/bio_local.h59
1 files changed, 58 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bio/bio_local.h b/src/lib/libcrypto/bio/bio_local.h
index 9c2e8f4808..62a9793d00 100644
--- a/src/lib/libcrypto/bio/bio_local.h
+++ b/src/lib/libcrypto/bio/bio_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_local.h,v 1.1 2022/01/07 09:02:17 tb Exp $ */ 1/* $OpenBSD: bio_local.h,v 1.2 2022/01/14 08:18:55 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -61,6 +61,63 @@
61 61
62__BEGIN_HIDDEN_DECLS 62__BEGIN_HIDDEN_DECLS
63 63
64struct bio_method_st {
65 int type;
66 const char *name;
67 int (*bwrite)(BIO *, const char *, int);
68 int (*bread)(BIO *, char *, int);
69 int (*bputs)(BIO *, const char *);
70 int (*bgets)(BIO *, char *, int);
71 long (*ctrl)(BIO *, int, long, void *);
72 int (*create)(BIO *);
73 int (*destroy)(BIO *);
74 long (*callback_ctrl)(BIO *, int, bio_info_cb *);
75} /* BIO_METHOD */;
76
77struct bio_st {
78 const BIO_METHOD *method;
79 /* bio, mode, argp, argi, argl, ret */
80 long (*callback)(struct bio_st *, int, const char *, int, long, long);
81 char *cb_arg; /* first argument for the callback */
82
83 int init;
84 int shutdown;
85 int flags; /* extra storage */
86 int retry_reason;
87 int num;
88 void *ptr;
89 struct bio_st *next_bio; /* used by filter BIOs */
90 struct bio_st *prev_bio; /* used by filter BIOs */
91 int references;
92 unsigned long num_read;
93 unsigned long num_write;
94
95 CRYPTO_EX_DATA ex_data;
96} /* BIO */;
97
98typedef struct bio_f_buffer_ctx_struct {
99 /* Buffers are setup like this:
100 *
101 * <---------------------- size ----------------------->
102 * +---------------------------------------------------+
103 * | consumed | remaining | free space |
104 * +---------------------------------------------------+
105 * <-- off --><------- len ------->
106 */
107
108 /* BIO *bio; */ /* this is now in the BIO struct */
109 int ibuf_size; /* how big is the input buffer */
110 int obuf_size; /* how big is the output buffer */
111
112 char *ibuf; /* the char array */
113 int ibuf_len; /* how many bytes are in it */
114 int ibuf_off; /* write/read offset */
115
116 char *obuf; /* the char array */
117 int obuf_len; /* how many bytes are in it */
118 int obuf_off; /* write/read offset */
119} BIO_F_BUFFER_CTX;
120
64__END_HIDDEN_DECLS 121__END_HIDDEN_DECLS
65 122
66#endif /* !HEADER_BIO_LOCAL_H */ 123#endif /* !HEADER_BIO_LOCAL_H */