diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-01-03 22:43:04 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-01-03 22:43:04 +0000 |
commit | eef0c1f34c7b7d6a38e02f3294eb509aef081749 (patch) | |
tree | fb49441433ca3bf20230eeeca5a6e423a9888174 /crypto/bio | |
parent | 82a243132723ac27a81d689722e94e05e18992a0 (diff) |
Netware support.
Submitted by: Guenter Knauf <eflash@gmx.net>
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/b_sock.c | 22 | ||||
-rw-r--r-- | crypto/bio/bss_dgram.c | 6 | ||||
-rw-r--r-- | crypto/bio/bss_file.c | 8 |
3 files changed, 26 insertions, 10 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index 4ed8aa3679..0eee25a0bc 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -63,7 +63,11 @@ #include "cryptlib.h" #include <openssl/bio.h> #if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_BSDSOCK) -#include "netdb.h" +#include <netdb.h> +#if defined(NETWARE_CLIB) +#include <sys/ioctl.h> +NETDB_DEFINE_CONTEXT +#endif #endif #ifndef OPENSSL_NO_SOCK @@ -181,11 +185,11 @@ int BIO_get_port(const char *str, unsigned short *port_ptr) /* Note: under VMS with SOCKETSHR, it seems like the first * parameter is 'char *', instead of 'const char *' */ - s=getservbyname( #ifndef CONST_STRICT - (char *) + s=getservbyname((char *)str,"tcp"); +#else + s=getservbyname(str,"tcp"); #endif - str,"tcp"); if(s != NULL) *port_ptr=ntohs((unsigned short)s->s_port); CRYPTO_w_unlock(CRYPTO_LOCK_GETSERVBYNAME); @@ -367,7 +371,11 @@ struct hostent *BIO_gethostbyname(const char *name) #if 1 /* Caching gethostbyname() results forever is wrong, * so we have to let the true gethostbyname() worry about this */ +#if (defined(NETWARE_BSDSOCK) && !defined(__NOVELL_LIBC__)) + return gethostbyname((char*)name); +#else return gethostbyname(name); +#endif #else struct hostent *ret; int i,lowi=0,j; @@ -407,11 +415,11 @@ struct hostent *BIO_gethostbyname(const char *name) /* Note: under VMS with SOCKETSHR, it seems like the first * parameter is 'char *', instead of 'const char *' */ - ret=gethostbyname( # ifndef CONST_STRICT - (char *) + ret=gethostbyname((char *)name); +# else + ret=gethostbyname(name); # endif - name); if (ret == NULL) goto end; diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 771003e8ac..286972217f 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -208,9 +208,13 @@ static int dgram_write(BIO *b, const char *in, int inl) clear_socket_error(); if ( data->connected ) - ret=send(b->num,in,inl,0); + ret=writesocket(b->num,in,inl); else +#if defined(NETWARE_CLIB) && defined(NETWARE_BSDSOCK) + ret=sendto(b->num, (char *)in, inl, 0, &data->peer, sizeof(data->peer)); +#else ret=sendto(b->num, in, inl, 0, &data->peer, sizeof(data->peer)); +#endif BIO_clear_retry_flags(b); if (ret <= 0) diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index b7504baf20..545c1b2bdd 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -89,6 +89,10 @@ #include "bio_lcl.h" #include <openssl/err.h> +#if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_CLIB) +#include <nwfileio.h> +#endif + #if !defined(OPENSSL_NO_STDIO) static int MS_CALLBACK file_write(BIO *h, const char *buf, int num); @@ -284,9 +288,9 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr) int fd = fileno((FILE*)ptr); /* Under CLib there are differences in file modes */ if (num & BIO_FP_TEXT) - _setmode(fd,O_TEXT); + setmode(fd,O_TEXT); else - _setmode(fd,O_BINARY); + setmode(fd,O_BINARY); #elif defined(OPENSSL_SYS_MSDOS) int fd = fileno((FILE*)ptr); /* Set correct text/binary mode */ |