@@ -400,48 +400,51 @@ struct bio_dgram_sctp_prinfo {
400
400
# define BIO_set_app_data (s ,arg ) BIO_set_ex_data(s,0,arg)
401
401
# define BIO_get_app_data (s ) BIO_get_ex_data(s,0)
402
402
403
+ # define BIO_set_nbio (b ,n ) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
404
+
405
+ # ifndef OPENSSL_NO_SOCK
403
406
/* IP families we support, for BIO_s_connect() and BIO_s_accept() */
404
407
/* Note: the underlying operating system may not support some of them */
405
- # define BIO_FAMILY_IPV4 4
406
- # define BIO_FAMILY_IPV6 6
407
- # define BIO_FAMILY_IPANY 256
408
+ # define BIO_FAMILY_IPV4 4
409
+ # define BIO_FAMILY_IPV6 6
410
+ # define BIO_FAMILY_IPANY 256
408
411
409
412
/* BIO_s_connect() */
410
- # define BIO_set_conn_hostname (b ,name ) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name)
411
- # define BIO_set_conn_port (b ,port ) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port)
412
- # define BIO_set_conn_address (b ,addr ) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)addr)
413
- # define BIO_set_conn_ip_family (b ,f ) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,f)
414
- # define BIO_get_conn_hostname (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0,NULL))
415
- # define BIO_get_conn_port (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1,NULL))
416
- # define BIO_get_conn_address (b ) ((const BIO_ADDR *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2,NULL))
417
- # define BIO_get_conn_ip_family (b ) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)
418
- # define BIO_set_conn_mode (b ,n ) BIO_ctrl(b,BIO_C_SET_CONNECT_MODE,(n),NULL)
419
-
420
- # define BIO_set_nbio (b ,n ) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
413
+ # define BIO_set_conn_hostname (b ,name ) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name)
414
+ # define BIO_set_conn_port (b ,port ) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port)
415
+ # define BIO_set_conn_address (b ,addr ) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)addr)
416
+ # define BIO_set_conn_ip_family (b ,f ) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,f)
417
+ # define BIO_get_conn_hostname (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0,NULL))
418
+ # define BIO_get_conn_port (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1,NULL))
419
+ # define BIO_get_conn_address (b ) ((const BIO_ADDR *)BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2,NULL))
420
+ # define BIO_get_conn_ip_family (b ) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)
421
+ # define BIO_set_conn_mode (b ,n ) BIO_ctrl(b,BIO_C_SET_CONNECT_MODE,(n),NULL)
421
422
422
423
/* BIO_s_accept() */
423
- # define BIO_set_accept_name (b ,name ) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)
424
- # define BIO_set_accept_port (b ,port ) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(char *)port)
425
- # define BIO_get_accept_name (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0))
426
- # define BIO_get_accept_port (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,1))
427
- # define BIO_get_peer_name (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,2))
428
- # define BIO_get_peer_port (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,3))
424
+ # define BIO_set_accept_name (b ,name ) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)
425
+ # define BIO_set_accept_port (b ,port ) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(char *)port)
426
+ # define BIO_get_accept_name (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0))
427
+ # define BIO_get_accept_port (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,1))
428
+ # define BIO_get_peer_name (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,2))
429
+ # define BIO_get_peer_port (b ) ((const char *)BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,3))
429
430
/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
430
- # define BIO_set_nbio_accept (b ,n ) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(n)?(void *)"a":NULL)
431
- # define BIO_set_accept_bios (b ,bio ) BIO_ctrl(b,BIO_C_SET_ACCEPT,3,(char *)bio)
432
- # define BIO_set_accept_ip_family (b ,f ) BIO_int_ctrl(b,BIO_C_SET_ACCEPT,4,f)
433
- # define BIO_get_accept_ip_family (b ) BIO_ctrl(b,BIO_C_GET_ACCEPT,4,NULL)
431
+ # define BIO_set_nbio_accept (b ,n ) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(n)?(void *)"a":NULL)
432
+ # define BIO_set_accept_bios (b ,bio ) BIO_ctrl(b,BIO_C_SET_ACCEPT,3,(char *)bio)
433
+ # define BIO_set_accept_ip_family (b ,f ) BIO_int_ctrl(b,BIO_C_SET_ACCEPT,4,f)
434
+ # define BIO_get_accept_ip_family (b ) BIO_ctrl(b,BIO_C_GET_ACCEPT,4,NULL)
434
435
435
436
/* Aliases kept for backward compatibility */
436
- # define BIO_BIND_NORMAL 0
437
- # define BIO_BIND_REUSEADDR BIO_SOCK_REUSEADDR
438
- # define BIO_BIND_REUSEADDR_IF_UNUSED BIO_SOCK_REUSEADDR
439
- # define BIO_set_bind_mode (b ,mode ) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
440
- # define BIO_get_bind_mode (b ) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
437
+ # define BIO_BIND_NORMAL 0
438
+ # define BIO_BIND_REUSEADDR BIO_SOCK_REUSEADDR
439
+ # define BIO_BIND_REUSEADDR_IF_UNUSED BIO_SOCK_REUSEADDR
440
+ # define BIO_set_bind_mode (b ,mode ) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
441
+ # define BIO_get_bind_mode (b ) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
441
442
442
443
/* BIO_s_accept() and BIO_s_connect() */
443
- # define BIO_do_connect (b ) BIO_do_handshake(b)
444
- # define BIO_do_accept (b ) BIO_do_handshake(b)
444
+ # define BIO_do_connect (b ) BIO_do_handshake(b)
445
+ # define BIO_do_accept (b ) BIO_do_handshake(b)
446
+ # endif /* OPENSSL_NO_SOCK */
447
+
445
448
# define BIO_do_handshake (b ) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
446
449
447
450
/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */
@@ -624,9 +627,11 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,
624
627
const BIO_METHOD * BIO_s_mem (void );
625
628
const BIO_METHOD * BIO_s_secmem (void );
626
629
BIO * BIO_new_mem_buf (const void * buf , int len );
630
+ # ifndef OPENSSL_NO_SOCK
627
631
const BIO_METHOD * BIO_s_socket (void );
628
632
const BIO_METHOD * BIO_s_connect (void );
629
633
const BIO_METHOD * BIO_s_accept (void );
634
+ # endif
630
635
const BIO_METHOD * BIO_s_fd (void );
631
636
const BIO_METHOD * BIO_s_log (void );
632
637
const BIO_METHOD * BIO_s_bio (void );
@@ -653,8 +658,10 @@ int BIO_dgram_sctp_msg_waiting(BIO *b);
653
658
# endif
654
659
# endif
655
660
661
+ # ifndef OPENSSL_NO_SOCK
656
662
int BIO_sock_should_retry (int i );
657
663
int BIO_sock_non_fatal_error (int error );
664
+ # endif
658
665
659
666
int BIO_fd_should_retry (int i );
660
667
int BIO_fd_non_fatal_error (int error );
@@ -671,6 +678,7 @@ int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent);
671
678
int BIO_hex_string (BIO * out , int indent , int width , unsigned char * data ,
672
679
int datalen );
673
680
681
+ # ifndef OPENSSL_NO_SOCK
674
682
BIO_ADDR * BIO_ADDR_new (void );
675
683
int BIO_ADDR_rawmake (BIO_ADDR * ap , int family ,
676
684
const void * where , size_t wherelen , unsigned short port );
@@ -705,9 +713,9 @@ int BIO_sock_error(int sock);
705
713
int BIO_socket_ioctl (int fd , long type , void * arg );
706
714
int BIO_socket_nbio (int fd , int mode );
707
715
int BIO_sock_init (void );
708
- #if OPENSSL_API_COMPAT < 0x10100000L
709
- # define BIO_sock_cleanup () while(0) continue
710
- #endif
716
+ # if OPENSSL_API_COMPAT < 0x10100000L
717
+ # define BIO_sock_cleanup () while(0) continue
718
+ # endif
711
719
int BIO_set_tcp_ndelay (int sock , int turn_on );
712
720
713
721
DEPRECATEDIN_1_1_0 (struct hostent * BIO_gethostbyname (const char * name ))
@@ -725,11 +733,11 @@ enum BIO_sock_info_type {
725
733
int BIO_sock_info (int sock ,
726
734
enum BIO_sock_info_type type , union BIO_sock_info_u * info );
727
735
728
- # define BIO_SOCK_REUSEADDR 0x01
729
- # define BIO_SOCK_V6_ONLY 0x02
730
- # define BIO_SOCK_KEEPALIVE 0x04
731
- # define BIO_SOCK_NONBLOCK 0x08
732
- # define BIO_SOCK_NODELAY 0x10
736
+ # define BIO_SOCK_REUSEADDR 0x01
737
+ # define BIO_SOCK_V6_ONLY 0x02
738
+ # define BIO_SOCK_KEEPALIVE 0x04
739
+ # define BIO_SOCK_NONBLOCK 0x08
740
+ # define BIO_SOCK_NODELAY 0x10
733
741
734
742
int BIO_socket (int domain , int socktype , int protocol , int options );
735
743
int BIO_connect (int sock , const BIO_ADDR * addr , int options );
@@ -738,9 +746,11 @@ int BIO_accept_ex(int accept_sock, BIO_ADDR *addr, int options);
738
746
int BIO_closesocket (int sock );
739
747
740
748
BIO * BIO_new_socket (int sock , int close_flag );
741
- BIO * BIO_new_fd (int fd , int close_flag );
742
749
BIO * BIO_new_connect (const char * host_port );
743
750
BIO * BIO_new_accept (const char * host_port );
751
+ # endif /* OPENSSL_NO_SOCK*/
752
+
753
+ BIO * BIO_new_fd (int fd , int close_flag );
744
754
745
755
int BIO_new_bio_pair (BIO * * bio1 , size_t writebuf1 ,
746
756
BIO * * bio2 , size_t writebuf2 );
0 commit comments