X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fs_apps.h;h=57af7c0f8cf04f8cf915bf37c77be8b312d17bf5;hp=68d6a73b9b079c929f59526b5b14f17e44495042;hb=863fe2ecac0a86475900655899ea78b472941e52;hpb=a9be3af5ad4836f7e50f0546311ca90c717b861e diff --git a/apps/s_apps.h b/apps/s_apps.h index 68d6a73b9b..57af7c0f8c 100644 --- a/apps/s_apps.h +++ b/apps/s_apps.h @@ -56,11 +56,34 @@ * [including the GNU Public Licence.] */ +#include +#if (defined(VMS) || defined(__VMS)) && !defined(FD_SET) +/* VAX C does not defined fd_set and friends, but it's actually quite simple */ +/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */ +#define MAX_NOFILE 32 +#define NBBY 8 /* number of bits in a byte */ + +#ifndef FD_SETSIZE +#define FD_SETSIZE MAX_NOFILE +#endif /* FD_SETSIZE */ + +/* How many things we'll allow select to use. 0 if unlimited */ +#define MAXSELFD MAX_NOFILE +typedef int fd_mask; /* int here! VMS prototypes int, not long */ +#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask (power of 2!)*/ +#define NFDSHIFT 5 /* Shift based on above */ + +typedef fd_mask fd_set; +#define FD_SET(n, p) (*(p) |= (1 << ((n) % NFDBITS))) +#define FD_CLR(n, p) (*(p) &= ~(1 << ((n) % NFDBITS))) +#define FD_ISSET(n, p) (*(p) & (1 << ((n) % NFDBITS))) +#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) +#endif + #define PORT 4433 #define PORT_STR "4433" #define PROTOCOL "tcp" -int do_accept(int acc_sock, int *sock, char **host); int do_server(int port, int *ret, int (*cb) (), char *context); #ifdef HEADER_X509_H int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx); @@ -73,17 +96,9 @@ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file); int set_cert_stuff(char *ctx, char *cert_file, char *key_file); #endif int init_client(int *sock, char *server, int port); -int init_client_ip(int *sock,unsigned char ip[4], int port); -int nbio_init_client_ip(int *sock,unsigned char ip[4], int port); -int nbio_sock_error(int sock); -int spawn(int argc, char **argv, int *in, int *out); -int init_server(int *sock, int port); -int init_server_long(int *sock, int port,char *ip); int should_retry(int i); -void sock_cleanup(void ); int extract_port(char *str, short *port_ptr); int extract_host_port(char *str,char **host_ptr,unsigned char *ip,short *p); -int host_ip(char *str, unsigned char ip[4]); long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp, int argi, long argl, long ret);