diff options
| author | markus <> | 2002-09-05 12:51:52 +0000 |
|---|---|---|
| committer | markus <> | 2002-09-05 12:51:52 +0000 |
| commit | 5514995a9d5ed91db089875adb509c7781357c0e (patch) | |
| tree | 2484410a46ba6c05ef94c253da36fbceef990b64 /src/lib/libcrypto/bio | |
| parent | fd9566423b542798f5c8b06e68101a9ea5bb9885 (diff) | |
| download | openbsd-5514995a9d5ed91db089875adb509c7781357c0e.tar.gz openbsd-5514995a9d5ed91db089875adb509c7781357c0e.tar.bz2 openbsd-5514995a9d5ed91db089875adb509c7781357c0e.zip | |
import openssl-0.9.7-beta1
Diffstat (limited to 'src/lib/libcrypto/bio')
| -rw-r--r-- | src/lib/libcrypto/bio/bss_rtcp.c | 67 |
1 files changed, 32 insertions, 35 deletions
diff --git a/src/lib/libcrypto/bio/bss_rtcp.c b/src/lib/libcrypto/bio/bss_rtcp.c index 6eb434dee8..7dae485564 100644 --- a/src/lib/libcrypto/bio/bss_rtcp.c +++ b/src/lib/libcrypto/bio/bss_rtcp.c | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | 58 | ||
| 59 | /* Written by David L. Jones <jonesd@kcgl1.eng.ohio-state.edu> | 59 | /* Written by David L. Jones <jonesd@kcgl1.eng.ohio-state.edu> |
| 60 | * Date: 22-JUL-1996 | 60 | * Date: 22-JUL-1996 |
| 61 | * Revised: 25-SEP-1997 Update for 0.8.1, BIO_CTRL_SET -> BIO_C_SET_FD | ||
| 61 | */ | 62 | */ |
| 62 | /* VMS */ | 63 | /* VMS */ |
| 63 | #include <stdio.h> | 64 | #include <stdio.h> |
| @@ -65,10 +66,11 @@ | |||
| 65 | #include <string.h> | 66 | #include <string.h> |
| 66 | #include <errno.h> | 67 | #include <errno.h> |
| 67 | #include "cryptlib.h" | 68 | #include "cryptlib.h" |
| 68 | #include "bio.h" | 69 | #include <openssl/bio.h> |
| 69 | 70 | ||
| 70 | #include <iodef.h> /* VMS IO$_ definitions */ | 71 | #include <iodef.h> /* VMS IO$_ definitions */ |
| 71 | extern int SYS$QIOW(); | 72 | #include <starlet.h> |
| 73 | |||
| 72 | typedef unsigned short io_channel; | 74 | typedef unsigned short io_channel; |
| 73 | /*************************************************************************/ | 75 | /*************************************************************************/ |
| 74 | struct io_status { short status, count; long flags; }; | 76 | struct io_status { short status, count; long flags; }; |
| @@ -86,11 +88,11 @@ struct rpc_ctx { | |||
| 86 | struct rpc_msg msg; | 88 | struct rpc_msg msg; |
| 87 | }; | 89 | }; |
| 88 | 90 | ||
| 89 | static int rtcp_write(BIO *h,char *buf,int num); | 91 | static int rtcp_write(BIO *h,const char *buf,int num); |
| 90 | static int rtcp_read(BIO *h,char *buf,int size); | 92 | static int rtcp_read(BIO *h,char *buf,int size); |
| 91 | static int rtcp_puts(BIO *h,char *str); | 93 | static int rtcp_puts(BIO *h,const char *str); |
| 92 | static int rtcp_gets(BIO *h,char *str,int size); | 94 | static int rtcp_gets(BIO *h,char *str,int size); |
| 93 | static long rtcp_ctrl(BIO *h,int cmd,long arg1,char *arg2); | 95 | static long rtcp_ctrl(BIO *h,int cmd,long arg1,void *arg2); |
| 94 | static int rtcp_new(BIO *h); | 96 | static int rtcp_new(BIO *h); |
| 95 | static int rtcp_free(BIO *data); | 97 | static int rtcp_free(BIO *data); |
| 96 | 98 | ||
| @@ -105,20 +107,27 @@ static BIO_METHOD rtcp_method= | |||
| 105 | rtcp_ctrl, | 107 | rtcp_ctrl, |
| 106 | rtcp_new, | 108 | rtcp_new, |
| 107 | rtcp_free, | 109 | rtcp_free, |
| 110 | NULL, | ||
| 108 | }; | 111 | }; |
| 109 | 112 | ||
| 110 | BIO_METHOD *BIO_s_rtcp() | 113 | BIO_METHOD *BIO_s_rtcp(void) |
| 111 | { | 114 | { |
| 112 | return(&rtcp_method); | 115 | return(&rtcp_method); |
| 113 | } | 116 | } |
| 114 | /*****************************************************************************/ | 117 | /*****************************************************************************/ |
| 115 | /* Decnet I/O routines. | 118 | /* Decnet I/O routines. |
| 116 | */ | 119 | */ |
| 120 | |||
| 121 | #ifdef __DECC | ||
| 122 | #pragma message save | ||
| 123 | #pragma message disable DOLLARID | ||
| 124 | #endif | ||
| 125 | |||
| 117 | static int get ( io_channel chan, char *buffer, int maxlen, int *length ) | 126 | static int get ( io_channel chan, char *buffer, int maxlen, int *length ) |
| 118 | { | 127 | { |
| 119 | int status; | 128 | int status; |
| 120 | struct io_status iosb; | 129 | struct io_status iosb; |
| 121 | status = SYS$QIOW ( 0, chan, IO$_READVBLK, &iosb, 0, 0, | 130 | status = sys$qiow ( 0, chan, IO$_READVBLK, &iosb, 0, 0, |
| 122 | buffer, maxlen, 0, 0, 0, 0 ); | 131 | buffer, maxlen, 0, 0, 0, 0 ); |
| 123 | if ( (status&1) == 1 ) status = iosb.status; | 132 | if ( (status&1) == 1 ) status = iosb.status; |
| 124 | if ( (status&1) == 1 ) *length = iosb.count; | 133 | if ( (status&1) == 1 ) *length = iosb.count; |
| @@ -129,40 +138,40 @@ static int put ( io_channel chan, char *buffer, int length ) | |||
| 129 | { | 138 | { |
| 130 | int status; | 139 | int status; |
| 131 | struct io_status iosb; | 140 | struct io_status iosb; |
| 132 | status = SYS$QIOW ( 0, chan, IO$_WRITEVBLK, &iosb, 0, 0, | 141 | status = sys$qiow ( 0, chan, IO$_WRITEVBLK, &iosb, 0, 0, |
| 133 | buffer, length, 0, 0, 0, 0 ); | 142 | buffer, length, 0, 0, 0, 0 ); |
| 134 | if ( (status&1) == 1 ) status = iosb.status; | 143 | if ( (status&1) == 1 ) status = iosb.status; |
| 135 | return status; | 144 | return status; |
| 136 | } | 145 | } |
| 146 | |||
| 147 | #ifdef __DECC | ||
| 148 | #pragma message restore | ||
| 149 | #endif | ||
| 150 | |||
| 137 | /***************************************************************************/ | 151 | /***************************************************************************/ |
| 138 | 152 | ||
| 139 | static int rtcp_new(bi) | 153 | static int rtcp_new(BIO *bi) |
| 140 | BIO *bi; | ||
| 141 | { | 154 | { |
| 142 | struct rpc_ctx *ctx; | 155 | struct rpc_ctx *ctx; |
| 143 | bi->init=1; | 156 | bi->init=1; |
| 144 | bi->num=0; | 157 | bi->num=0; |
| 145 | bi->flags = 0; | 158 | bi->flags = 0; |
| 146 | bi->ptr=Malloc(sizeof(struct rpc_ctx)); | 159 | bi->ptr=OPENSSL_malloc(sizeof(struct rpc_ctx)); |
| 147 | ctx = (struct rpc_ctx *) bi->ptr; | 160 | ctx = (struct rpc_ctx *) bi->ptr; |
| 148 | ctx->filled = 0; | 161 | ctx->filled = 0; |
| 149 | ctx->pos = 0; | 162 | ctx->pos = 0; |
| 150 | return(1); | 163 | return(1); |
| 151 | } | 164 | } |
| 152 | 165 | ||
| 153 | static int rtcp_free(a) | 166 | static int rtcp_free(BIO *a) |
| 154 | BIO *a; | ||
| 155 | { | 167 | { |
| 156 | if (a == NULL) return(0); | 168 | if (a == NULL) return(0); |
| 157 | if ( a->ptr ) Free ( a->ptr ); | 169 | if ( a->ptr ) OPENSSL_free ( a->ptr ); |
| 158 | a->ptr = NULL; | 170 | a->ptr = NULL; |
| 159 | return(1); | 171 | return(1); |
| 160 | } | 172 | } |
| 161 | 173 | ||
| 162 | static int rtcp_read(b,out,outl) | 174 | static int rtcp_read(BIO *b, char *out, int outl) |
| 163 | BIO *b; | ||
| 164 | char *out; | ||
| 165 | int outl; | ||
| 166 | { | 175 | { |
| 167 | int status, length; | 176 | int status, length; |
| 168 | struct rpc_ctx *ctx; | 177 | struct rpc_ctx *ctx; |
| @@ -209,10 +218,7 @@ int outl; | |||
| 209 | return length; | 218 | return length; |
| 210 | } | 219 | } |
| 211 | 220 | ||
| 212 | static int rtcp_write(b,in,inl) | 221 | static int rtcp_write(BIO *b, const char *in, int inl) |
| 213 | BIO *b; | ||
| 214 | char *in; | ||
| 215 | int inl; | ||
| 216 | { | 222 | { |
| 217 | int status, i, segment, length; | 223 | int status, i, segment, length; |
| 218 | struct rpc_ctx *ctx; | 224 | struct rpc_ctx *ctx; |
| @@ -241,11 +247,7 @@ int inl; | |||
| 241 | return(i); | 247 | return(i); |
| 242 | } | 248 | } |
| 243 | 249 | ||
| 244 | static long rtcp_ctrl(b,cmd,num,ptr) | 250 | static long rtcp_ctrl(BIO *b, int cmd, long num, void *ptr) |
| 245 | BIO *b; | ||
| 246 | int cmd; | ||
| 247 | long num; | ||
| 248 | char *ptr; | ||
| 249 | { | 251 | { |
| 250 | long ret=1; | 252 | long ret=1; |
| 251 | 253 | ||
| @@ -255,7 +257,7 @@ char *ptr; | |||
| 255 | case BIO_CTRL_EOF: | 257 | case BIO_CTRL_EOF: |
| 256 | ret = 1; | 258 | ret = 1; |
| 257 | break; | 259 | break; |
| 258 | case BIO_CTRL_SET: | 260 | case BIO_C_SET_FD: |
| 259 | b->num = num; | 261 | b->num = num; |
| 260 | ret = 1; | 262 | ret = 1; |
| 261 | break; | 263 | break; |
| @@ -276,17 +278,12 @@ char *ptr; | |||
| 276 | return(ret); | 278 | return(ret); |
| 277 | } | 279 | } |
| 278 | 280 | ||
| 279 | static int rtcp_gets(bp,buf,size) | 281 | static int rtcp_gets(BIO *bp, char *buf, int size) |
| 280 | BIO *bp; | ||
| 281 | char *buf; | ||
| 282 | int size; | ||
| 283 | { | 282 | { |
| 284 | return(0); | 283 | return(0); |
| 285 | } | 284 | } |
| 286 | 285 | ||
| 287 | static int rtcp_puts(bp,str) | 286 | static int rtcp_puts(BIO *bp, const char *str) |
| 288 | BIO *bp; | ||
| 289 | char *str; | ||
| 290 | { | 287 | { |
| 291 | int length; | 288 | int length; |
| 292 | if (str == NULL) return(0); | 289 | if (str == NULL) return(0); |
