]>
git.ipfire.org Git - thirdparty/openssl.git/blob - crypto/bio/bio_lcl.h
24f8b1859529a3104c553be5fd3d847aae898d9c
4 /* BEGIN BIO_ADDRINFO/BIO_ADDR stuff. */
6 #ifndef OPENSSL_NO_SOCK
8 * Throughout this file and b_addr.c, the existence of the macro
9 * AI_PASSIVE is used to detect the availability of struct addrinfo,
10 * getnameinfo() and getaddrinfo(). If that macro doesn't exist,
11 * we use our own implementation instead.
15 * It's imperative that these macros get defined before openssl/bio.h gets
16 * included. Otherwise, the AI_PASSIVE hack will not work properly.
17 * For clarity, we check for internal/cryptlib.h since it's a common header
18 * that also includes bio.h.
20 # ifdef HEADER_CRYPTLIB_H
21 # error internal/cryptlib.h included before bio_lcl.h
24 # error openssl/bio.h included before bio_lcl.h
28 * Undefine AF_UNIX on systems that define it but don't support it.
30 # if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_VMS)
35 # define bio_addrinfo_st addrinfo
36 # define bai_family ai_family
37 # define bai_socktype ai_socktype
38 # define bai_protocol ai_protocol
39 # define bai_addrlen ai_addrlen
40 # define bai_addr ai_addr
41 # define bai_next ai_next
43 struct bio_addrinfo_st
{
48 struct sockaddr
*bai_addr
;
49 struct bio_addrinfo_st
*bai_next
;
56 struct sockaddr_in6 s_in6
;
58 struct sockaddr_in s_in
;
60 struct sockaddr_un s_un
;
65 /* END BIO_ADDRINFO/BIO_ADDR stuff. */
67 #include "internal/cryptlib.h"
68 #include <openssl/bio.h>
70 #ifndef OPENSSL_NO_SOCK
71 # ifdef OPENSSL_SYS_VMS
72 typedef unsigned int socklen_t
;
75 int BIO_ADDR_make(BIO_ADDR
*ap
, const struct sockaddr
*sa
);
76 const struct sockaddr
*BIO_ADDR_sockaddr(const BIO_ADDR
*ap
);
77 struct sockaddr
*BIO_ADDR_sockaddr_noconst(BIO_ADDR
*ap
);
78 socklen_t
BIO_ADDR_sockaddr_size(const BIO_ADDR
*ap
);
79 socklen_t
BIO_ADDRINFO_sockaddr_size(const BIO_ADDRINFO
*bai
);
80 const struct sockaddr
*BIO_ADDRINFO_sockaddr(const BIO_ADDRINFO
*bai
);
83 #if BIO_FLAGS_UPLINK==0
84 /* Shortcut UPLINK calls on most platforms... */
85 # define UP_stdin stdin
86 # define UP_stdout stdout
87 # define UP_stderr stderr
88 # define UP_fprintf fprintf
89 # define UP_fgets fgets
90 # define UP_fread fread
91 # define UP_fwrite fwrite
94 # define UP_fclose fclose
96 # define UP_fopen fopen
97 # define UP_fseek fseek
98 # define UP_ftell ftell
99 # define UP_fflush fflush
100 # define UP_ferror ferror
102 # define UP_fileno _fileno
103 # define UP_open _open
104 # define UP_read _read
105 # define UP_write _write
106 # define UP_lseek _lseek
107 # define UP_close _close
109 # define UP_fileno fileno
110 # define UP_open open
111 # define UP_read read
112 # define UP_write write
113 # define UP_lseek lseek
114 # define UP_close close