84 #define RPC_HDR_SIZE (sizeof(struct rpc_msg) - 4092)
91 static int rtcp_write(
BIO *
h,
const char *buf,
int num);
92 static int rtcp_read(
BIO *
h,
char *buf,
int size);
93 static int rtcp_puts(
BIO *
h,
const char *str);
94 static int rtcp_gets(
BIO *
h,
char *str,
int size);
95 static long rtcp_ctrl(
BIO *
h,
int cmd,
long arg1,
void *arg2);
96 static int rtcp_new(
BIO *
h);
97 static int rtcp_free(
BIO *
data);
115 return(&rtcp_method);
123 #pragma message disable DOLLARID
130 status = sys$qiow ( 0, chan, IO$_READVBLK, &iosb, 0, 0,
131 buffer, maxlen, 0, 0, 0, 0 );
132 if ( (status&1) == 1 ) status = iosb.status;
133 if ( (status&1) == 1 ) *
length = iosb.count;
141 status = sys$qiow ( 0, chan, IO$_WRITEVBLK, &iosb, 0, 0,
142 buffer, length, 0, 0, 0, 0 );
143 if ( (status&1) == 1 ) status = iosb.status;
148 #pragma message restore
153 static int rtcp_new(
BIO *bi)
166 static int rtcp_free(
BIO *
a)
168 if (a == NULL)
return(0);
174 static int rtcp_read(
BIO *
b,
char *out,
int outl)
184 if ( length > outl ) length = outl;
185 memmove ( out, &ctx->
msg.
data[ctx->
pos], length );
196 if ( (status&1) == 0 ) {
203 status =
get ( b->
num, (
char *) &ctx->
msg,
sizeof(ctx->
msg), &
length );
204 if ( (status&1) == 0 ) length = -1;
212 if ( length > outl ) length = outl;
213 memmove ( out, ctx->
msg.
data, length );
221 static int rtcp_write(
BIO *b,
const char *in,
int inl)
223 int status, i, segment,
length;
229 for ( i = 0; i < inl; i += segment ) {
231 if ( segment >
sizeof(ctx->
msg.
data) ) segment =
sizeof(ctx->
msg.
data);
235 memmove ( ctx->
msg.
data, &in[i], segment );
236 status = put ( b->
num, (
char *) &ctx->
msg, segment + RPC_HDR_SIZE );
237 if ((status&1) == 0 ) { i = -1;
break; }
239 status =
get ( b->
num, (
char *) &ctx->
msg,
sizeof(ctx->
msg), &
length );
240 if ( ((status&1) == 0) || (length < RPC_HDR_SIZE) ) { i = -1;
break; }
242 printf(
"unexpected response when confirming put %c %c\n",
250 static long rtcp_ctrl(
BIO *b,
int cmd,
long num,
void *
ptr)
281 static int rtcp_gets(
BIO *
bp,
char *buf,
int size)
286 static int rtcp_puts(
BIO *bp,
const char *str)
289 if (str == NULL)
return(0);
290 length = strlen ( str );
291 if ( length == 0 )
return (0);
292 return rtcp_write ( bp,str, length );