• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/openssl/crypto/bio/

Lines Matching defs:bio

1 /* crypto/bio/bss_bio.c  -*- Mode: C; c-file-style: "eay" -*- */
82 #include <openssl/bio.h>
96 static int bio_new(BIO *bio);
97 static int bio_free(BIO *bio);
98 static int bio_read(BIO *bio, char *buf, int size);
99 static int bio_write(BIO *bio, const char *buf, int num);
100 static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr);
101 static int bio_puts(BIO *bio, const char *str);
104 static void bio_destroy_pair(BIO *bio);
145 static int bio_new(BIO *bio)
157 bio->ptr = b;
162 static int bio_free(BIO *bio)
166 if (bio == NULL)
168 b = bio->ptr;
173 bio_destroy_pair(bio);
187 static int bio_read(BIO *bio, char *buf, int size_)
193 BIO_clear_retry_flags(bio);
195 if (!bio->init)
198 b = bio->ptr;
216 BIO_set_retry_read(bio); /* buffer is empty */
280 static ssize_t bio_nread0(BIO *bio, char **buf)
285 BIO_clear_retry_flags(bio);
287 if (!bio->init)
290 b = bio->ptr;
304 return bio_read(bio, &dummy, 1); /* returns 0 or -1 */
318 static ssize_t bio_nread(BIO *bio, char **buf, size_t num_)
328 available = bio_nread0(bio, buf);
334 b = bio->ptr;
352 static int bio_write(BIO *bio, const char *buf, int num_)
358 BIO_clear_retry_flags(bio);
360 if (!bio->init || buf == NULL || num == 0)
363 b = bio->ptr;
380 BIO_set_retry_write(bio); /* buffer is full */
431 static ssize_t bio_nwrite0(BIO *bio, char **buf)
437 BIO_clear_retry_flags(bio);
439 if (!bio->init)
442 b = bio->ptr;
458 BIO_set_retry_write(bio);
479 static ssize_t bio_nwrite(BIO *bio, char **buf, size_t num_)
489 space = bio_nwrite0(bio, buf);
494 b = bio->ptr;
503 static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
506 struct bio_bio_st *b = bio->ptr;
550 if (bio_make_pair(bio, other_bio))
560 bio_destroy_pair(bio);
597 ret = (long) bio_nread0(bio, ptr);
602 ret = (long) bio_nread(bio, ptr, (size_t) num);
607 ret = (long) bio_nwrite0(bio, ptr);
612 ret = (long) bio_nwrite(bio, ptr, (size_t) num);
628 ret = bio->shutdown;
632 bio->shutdown = (int) num;
698 static int bio_puts(BIO *bio, const char *str)
700 return bio_write(bio, str, strlen(str));
757 static void bio_destroy_pair(BIO *bio)
759 struct bio_bio_st *b = bio->ptr;
770 assert(peer_b->peer == bio);
779 bio->init = 0;
841 size_t BIO_ctrl_get_write_guarantee(BIO *bio)
843 return BIO_ctrl(bio, BIO_C_GET_WRITE_GUARANTEE, 0, NULL);
846 size_t BIO_ctrl_get_read_request(BIO *bio)
848 return BIO_ctrl(bio, BIO_C_GET_READ_REQUEST, 0, NULL);
851 int BIO_ctrl_reset_read_request(BIO *bio)
853 return (BIO_ctrl(bio, BIO_C_RESET_READ_REQUEST, 0, NULL) != 0);
860 int BIO_nread0(BIO *bio, char **buf)
864 if (!bio->init)
870 ret = BIO_ctrl(bio, BIO_C_NREAD0, 0, buf);
877 int BIO_nread(BIO *bio, char **buf, int num)
881 if (!bio->init)
887 ret = (int) BIO_ctrl(bio, BIO_C_NREAD, num, buf);
889 bio->num_read += ret;
893 int BIO_nwrite0(BIO *bio, char **buf)
897 if (!bio->init)
903 ret = BIO_ctrl(bio, BIO_C_NWRITE0, 0, buf);
910 int BIO_nwrite(BIO *bio, char **buf, int num)
914 if (!bio->init)
920 ret = BIO_ctrl(bio, BIO_C_NWRITE, num, buf);
922 bio->num_read += ret;