diff options
Diffstat (limited to 'src/lib/libcrypto/bio')
-rw-r--r-- | src/lib/libcrypto/bio/Makefile.ssl | 216 | ||||
-rw-r--r-- | src/lib/libcrypto/bio/b_dump.c | 24 | ||||
-rw-r--r-- | src/lib/libcrypto/bio/b_print.c | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/bio/b_sock.c | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/bio/bio_cb.c | 30 | ||||
-rw-r--r-- | src/lib/libcrypto/bio/bss_conn.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/bio/bss_file.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/bio/bss_rtcp.c | 294 |
8 files changed, 557 insertions, 47 deletions
diff --git a/src/lib/libcrypto/bio/Makefile.ssl b/src/lib/libcrypto/bio/Makefile.ssl new file mode 100644 index 0000000000..d0b9e297b0 --- /dev/null +++ b/src/lib/libcrypto/bio/Makefile.ssl | |||
@@ -0,0 +1,216 @@ | |||
1 | # | ||
2 | # SSLeay/crypto/bio/Makefile | ||
3 | # | ||
4 | |||
5 | DIR= bio | ||
6 | TOP= ../.. | ||
7 | CC= cc | ||
8 | INCLUDES= -I.. -I$(TOP) -I../../include | ||
9 | CFLAG=-g | ||
10 | INSTALL_PREFIX= | ||
11 | OPENSSLDIR= /usr/local/ssl | ||
12 | INSTALLTOP=/usr/local/ssl | ||
13 | MAKE= make -f Makefile.ssl | ||
14 | MAKEDEPPROG= makedepend | ||
15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
16 | MAKEFILE= Makefile.ssl | ||
17 | AR= ar r | ||
18 | |||
19 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
20 | |||
21 | GENERAL=Makefile | ||
22 | TEST= | ||
23 | APPS= | ||
24 | |||
25 | LIB=$(TOP)/libcrypto.a | ||
26 | LIBSRC= bio_lib.c bio_cb.c bio_err.c \ | ||
27 | bss_mem.c bss_null.c bss_fd.c \ | ||
28 | bss_file.c bss_sock.c bss_conn.c \ | ||
29 | bf_null.c bf_buff.c b_print.c b_dump.c \ | ||
30 | b_sock.c bss_acpt.c bf_nbio.c bss_log.c bss_bio.c | ||
31 | # bf_lbuf.c | ||
32 | LIBOBJ= bio_lib.o bio_cb.o bio_err.o \ | ||
33 | bss_mem.o bss_null.o bss_fd.o \ | ||
34 | bss_file.o bss_sock.o bss_conn.o \ | ||
35 | bf_null.o bf_buff.o b_print.o b_dump.o \ | ||
36 | b_sock.o bss_acpt.o bf_nbio.o bss_log.o bss_bio.o | ||
37 | # bf_lbuf.o | ||
38 | |||
39 | SRC= $(LIBSRC) | ||
40 | |||
41 | EXHEADER= bio.h | ||
42 | HEADER= bss_file.c $(EXHEADER) | ||
43 | |||
44 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
45 | |||
46 | top: | ||
47 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
48 | |||
49 | all: lib | ||
50 | |||
51 | lib: $(LIBOBJ) | ||
52 | $(AR) $(LIB) $(LIBOBJ) | ||
53 | $(RANLIB) $(LIB) || echo Never mind. | ||
54 | @touch lib | ||
55 | |||
56 | files: | ||
57 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | ||
58 | |||
59 | links: | ||
60 | @sh $(TOP)/util/point.sh Makefile.ssl Makefile | ||
61 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) | ||
62 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) | ||
63 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | ||
64 | |||
65 | install: | ||
66 | @for i in $(EXHEADER); \ | ||
67 | do \ | ||
68 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | ||
69 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | ||
70 | done; | ||
71 | |||
72 | tags: | ||
73 | ctags $(SRC) | ||
74 | |||
75 | tests: | ||
76 | |||
77 | lint: | ||
78 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
79 | |||
80 | depend: | ||
81 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | ||
82 | |||
83 | dclean: | ||
84 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
85 | mv -f Makefile.new $(MAKEFILE) | ||
86 | |||
87 | clean: | ||
88 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
89 | |||
90 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
91 | |||
92 | b_dump.o: ../../e_os.h ../../include/openssl/bio.h | ||
93 | b_dump.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
94 | b_dump.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
95 | b_dump.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
96 | b_dump.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
97 | b_dump.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
98 | b_dump.o: ../cryptlib.h b_dump.c | ||
99 | b_print.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
100 | b_print.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
101 | b_print.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
102 | b_print.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
103 | b_print.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
104 | b_print.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
105 | b_print.o: ../cryptlib.h b_print.c | ||
106 | b_sock.o: ../../e_os.h ../../include/openssl/bio.h | ||
107 | b_sock.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
108 | b_sock.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
109 | b_sock.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
110 | b_sock.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
111 | b_sock.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
112 | b_sock.o: ../cryptlib.h b_sock.c | ||
113 | bf_buff.o: ../../e_os.h ../../include/openssl/bio.h | ||
114 | bf_buff.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
115 | bf_buff.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
116 | bf_buff.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
117 | bf_buff.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
118 | bf_buff.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
119 | bf_buff.o: ../cryptlib.h bf_buff.c | ||
120 | bf_nbio.o: ../../e_os.h ../../include/openssl/bio.h | ||
121 | bf_nbio.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
122 | bf_nbio.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
123 | bf_nbio.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
124 | bf_nbio.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
125 | bf_nbio.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h | ||
126 | bf_nbio.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
127 | bf_nbio.o: ../cryptlib.h bf_nbio.c | ||
128 | bf_null.o: ../../e_os.h ../../include/openssl/bio.h | ||
129 | bf_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
130 | bf_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
131 | bf_null.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
132 | bf_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
133 | bf_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
134 | bf_null.o: ../cryptlib.h bf_null.c | ||
135 | bio_cb.o: ../../e_os.h ../../include/openssl/bio.h | ||
136 | bio_cb.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
137 | bio_cb.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
138 | bio_cb.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
139 | bio_cb.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
140 | bio_cb.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
141 | bio_cb.o: ../cryptlib.h bio_cb.c | ||
142 | bio_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h | ||
143 | bio_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
144 | bio_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
145 | bio_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
146 | bio_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
147 | bio_err.o: bio_err.c | ||
148 | bio_lib.o: ../../e_os.h ../../include/openssl/bio.h | ||
149 | bio_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
150 | bio_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
151 | bio_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
152 | bio_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
153 | bio_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
154 | bio_lib.o: ../cryptlib.h bio_lib.c | ||
155 | bss_acpt.o: ../../e_os.h ../../include/openssl/bio.h | ||
156 | bss_acpt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
157 | bss_acpt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
158 | bss_acpt.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
159 | bss_acpt.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
160 | bss_acpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
161 | bss_acpt.o: ../cryptlib.h bss_acpt.c | ||
162 | bss_bio.o: ../../e_os.h ../../include/openssl/bio.h | ||
163 | bss_bio.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
164 | bss_bio.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
165 | bss_bio.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
166 | bss_bio.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
167 | bss_bio.o: ../../include/openssl/symhacks.h bss_bio.c | ||
168 | bss_conn.o: ../../e_os.h ../../include/openssl/bio.h | ||
169 | bss_conn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
170 | bss_conn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
171 | bss_conn.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
172 | bss_conn.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
173 | bss_conn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
174 | bss_conn.o: ../cryptlib.h bss_conn.c | ||
175 | bss_fd.o: ../../e_os.h ../../include/openssl/bio.h | ||
176 | bss_fd.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
177 | bss_fd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
178 | bss_fd.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
179 | bss_fd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
180 | bss_fd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
181 | bss_fd.o: ../cryptlib.h bss_fd.c | ||
182 | bss_file.o: ../../e_os.h ../../include/openssl/bio.h | ||
183 | bss_file.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
184 | bss_file.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
185 | bss_file.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
186 | bss_file.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
187 | bss_file.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
188 | bss_file.o: ../cryptlib.h bss_file.c | ||
189 | bss_log.o: ../../e_os.h ../../include/openssl/bio.h | ||
190 | bss_log.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
191 | bss_log.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
192 | bss_log.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
193 | bss_log.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
194 | bss_log.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
195 | bss_log.o: ../cryptlib.h bss_log.c | ||
196 | bss_mem.o: ../../e_os.h ../../include/openssl/bio.h | ||
197 | bss_mem.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
198 | bss_mem.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
199 | bss_mem.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
200 | bss_mem.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
201 | bss_mem.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
202 | bss_mem.o: ../cryptlib.h bss_mem.c | ||
203 | bss_null.o: ../../e_os.h ../../include/openssl/bio.h | ||
204 | bss_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
205 | bss_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
206 | bss_null.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
207 | bss_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
208 | bss_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
209 | bss_null.o: ../cryptlib.h bss_null.c | ||
210 | bss_sock.o: ../../e_os.h ../../include/openssl/bio.h | ||
211 | bss_sock.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
212 | bss_sock.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
213 | bss_sock.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
214 | bss_sock.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
215 | bss_sock.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
216 | bss_sock.o: ../cryptlib.h bss_sock.c | ||
diff --git a/src/lib/libcrypto/bio/b_dump.c b/src/lib/libcrypto/bio/b_dump.c index f671e722fa..983604fb49 100644 --- a/src/lib/libcrypto/bio/b_dump.c +++ b/src/lib/libcrypto/bio/b_dump.c | |||
@@ -104,41 +104,41 @@ int BIO_dump_indent(BIO *bio, const char *s, int len, int indent) | |||
104 | for(i=0;i<rows;i++) | 104 | for(i=0;i<rows;i++) |
105 | { | 105 | { |
106 | buf[0]='\0'; /* start with empty string */ | 106 | buf[0]='\0'; /* start with empty string */ |
107 | BUF_strlcpy(buf,str,sizeof buf); | 107 | strlcpy(buf,str,sizeof buf); |
108 | BIO_snprintf(tmp,sizeof tmp,"%04x - ",i*dump_width); | 108 | snprintf(tmp,sizeof tmp,"%04x - ",i*dump_width); |
109 | BUF_strlcat(buf,tmp,sizeof buf); | 109 | strlcat(buf,tmp,sizeof buf); |
110 | for(j=0;j<dump_width;j++) | 110 | for(j=0;j<dump_width;j++) |
111 | { | 111 | { |
112 | if (((i*dump_width)+j)>=len) | 112 | if (((i*dump_width)+j)>=len) |
113 | { | 113 | { |
114 | BUF_strlcat(buf," ",sizeof buf); | 114 | strlcat(buf," ",sizeof buf); |
115 | } | 115 | } |
116 | else | 116 | else |
117 | { | 117 | { |
118 | ch=((unsigned char)*(s+i*dump_width+j)) & 0xff; | 118 | ch=((unsigned char)*(s+i*dump_width+j)) & 0xff; |
119 | BIO_snprintf(tmp,sizeof tmp,"%02x%c",ch, | 119 | snprintf(tmp,sizeof tmp,"%02x%c",ch, |
120 | j==7?'-':' '); | 120 | j==7?'-':' '); |
121 | BUF_strlcat(buf,tmp,sizeof buf); | 121 | strlcat(buf,tmp,sizeof buf); |
122 | } | 122 | } |
123 | } | 123 | } |
124 | BUF_strlcat(buf," ",sizeof buf); | 124 | strlcat(buf," ",sizeof buf); |
125 | for(j=0;j<dump_width;j++) | 125 | for(j=0;j<dump_width;j++) |
126 | { | 126 | { |
127 | if (((i*dump_width)+j)>=len) | 127 | if (((i*dump_width)+j)>=len) |
128 | break; | 128 | break; |
129 | ch=((unsigned char)*(s+i*dump_width+j)) & 0xff; | 129 | ch=((unsigned char)*(s+i*dump_width+j)) & 0xff; |
130 | #ifndef CHARSET_EBCDIC | 130 | #ifndef CHARSET_EBCDIC |
131 | BIO_snprintf(tmp,sizeof tmp,"%c", | 131 | snprintf(tmp,sizeof tmp,"%c", |
132 | ((ch>=' ')&&(ch<='~'))?ch:'.'); | 132 | ((ch>=' ')&&(ch<='~'))?ch:'.'); |
133 | #else | 133 | #else |
134 | BIO_snprintf(tmp,sizeof tmp,"%c", | 134 | snprintf(tmp,sizeof tmp,"%c", |
135 | ((ch>=os_toascii[' '])&&(ch<=os_toascii['~'])) | 135 | ((ch>=os_toascii[' '])&&(ch<=os_toascii['~'])) |
136 | ? os_toebcdic[ch] | 136 | ? os_toebcdic[ch] |
137 | : '.'); | 137 | : '.'); |
138 | #endif | 138 | #endif |
139 | BUF_strlcat(buf,tmp,sizeof buf); | 139 | strlcat(buf,tmp,sizeof buf); |
140 | } | 140 | } |
141 | BUF_strlcat(buf,"\n",sizeof buf); | 141 | strlcat(buf,"\n",sizeof buf); |
142 | /* if this is the last call then update the ddt_dump thing so that | 142 | /* if this is the last call then update the ddt_dump thing so that |
143 | * we will move the selection point in the debug window | 143 | * we will move the selection point in the debug window |
144 | */ | 144 | */ |
@@ -147,7 +147,7 @@ int BIO_dump_indent(BIO *bio, const char *s, int len, int indent) | |||
147 | #ifdef TRUNCATE | 147 | #ifdef TRUNCATE |
148 | if (trunc > 0) | 148 | if (trunc > 0) |
149 | { | 149 | { |
150 | BIO_snprintf(buf,sizeof buf,"%s%04x - <SPACES/NULS>\n",str, | 150 | snprintf(buf,sizeof buf,"%s%04x - <SPACES/NULS>\n",str, |
151 | len+trunc); | 151 | len+trunc); |
152 | ret+=BIO_write(bio,(char *)buf,strlen(buf)); | 152 | ret+=BIO_write(bio,(char *)buf,strlen(buf)); |
153 | } | 153 | } |
diff --git a/src/lib/libcrypto/bio/b_print.c b/src/lib/libcrypto/bio/b_print.c index fbff331796..2cfc689dd6 100644 --- a/src/lib/libcrypto/bio/b_print.c +++ b/src/lib/libcrypto/bio/b_print.c | |||
@@ -576,12 +576,12 @@ abs_val(LDOUBLE value) | |||
576 | } | 576 | } |
577 | 577 | ||
578 | static LDOUBLE | 578 | static LDOUBLE |
579 | pow10(int in_exp) | 579 | pow10(int exp) |
580 | { | 580 | { |
581 | LDOUBLE result = 1; | 581 | LDOUBLE result = 1; |
582 | while (in_exp) { | 582 | while (exp) { |
583 | result *= 10; | 583 | result *= 10; |
584 | in_exp--; | 584 | exp--; |
585 | } | 585 | } |
586 | return result; | 586 | return result; |
587 | } | 587 | } |
@@ -652,8 +652,8 @@ fmtfp( | |||
652 | (caps ? "0123456789ABCDEF" | 652 | (caps ? "0123456789ABCDEF" |
653 | : "0123456789abcdef")[intpart % 10]; | 653 | : "0123456789abcdef")[intpart % 10]; |
654 | intpart = (intpart / 10); | 654 | intpart = (intpart / 10); |
655 | } while (intpart && (iplace < sizeof iconvert)); | 655 | } while (intpart && (iplace < sizeof iplace)); |
656 | if (iplace == sizeof iconvert) | 656 | if (iplace == sizeof iplace) |
657 | iplace--; | 657 | iplace--; |
658 | iconvert[iplace] = 0; | 658 | iconvert[iplace] = 0; |
659 | 659 | ||
@@ -664,7 +664,7 @@ fmtfp( | |||
664 | : "0123456789abcdef")[fracpart % 10]; | 664 | : "0123456789abcdef")[fracpart % 10]; |
665 | fracpart = (fracpart / 10); | 665 | fracpart = (fracpart / 10); |
666 | } while (fplace < max); | 666 | } while (fplace < max); |
667 | if (fplace == sizeof fconvert) | 667 | if (fplace == sizeof fplace) |
668 | fplace--; | 668 | fplace--; |
669 | fconvert[fplace] = 0; | 669 | fconvert[fplace] = 0; |
670 | 670 | ||
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c index c851298d1e..5282f8a8f7 100644 --- a/src/lib/libcrypto/bio/b_sock.c +++ b/src/lib/libcrypto/bio/b_sock.c | |||
@@ -709,12 +709,12 @@ int BIO_accept(int sock, char **addr) | |||
709 | } | 709 | } |
710 | *addr=p; | 710 | *addr=p; |
711 | } | 711 | } |
712 | BIO_snprintf(*addr,24,"%d.%d.%d.%d:%d", | 712 | snprintf(*addr,24,"%d.%d.%d.%d:%d", |
713 | (unsigned char)(l>>24L)&0xff, | 713 | (unsigned char)(l>>24L)&0xff, |
714 | (unsigned char)(l>>16L)&0xff, | 714 | (unsigned char)(l>>16L)&0xff, |
715 | (unsigned char)(l>> 8L)&0xff, | 715 | (unsigned char)(l>> 8L)&0xff, |
716 | (unsigned char)(l )&0xff, | 716 | (unsigned char)(l )&0xff, |
717 | port); | 717 | port); |
718 | end: | 718 | end: |
719 | return(ret); | 719 | return(ret); |
720 | } | 720 | } |
diff --git a/src/lib/libcrypto/bio/bio_cb.c b/src/lib/libcrypto/bio/bio_cb.c index 6f4254a114..ee9159ebd8 100644 --- a/src/lib/libcrypto/bio/bio_cb.c +++ b/src/lib/libcrypto/bio/bio_cb.c | |||
@@ -75,56 +75,56 @@ long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp, | |||
75 | if (BIO_CB_RETURN & cmd) | 75 | if (BIO_CB_RETURN & cmd) |
76 | r=ret; | 76 | r=ret; |
77 | 77 | ||
78 | BIO_snprintf(buf,sizeof buf,"BIO[%08lX]:",(unsigned long)bio); | 78 | snprintf(buf,sizeof buf,"BIO[%08lX]:",(unsigned long)bio); |
79 | p= &(buf[14]); | 79 | p= &(buf[14]); |
80 | p_maxlen = sizeof buf - 14; | 80 | p_maxlen = sizeof buf - 14; |
81 | switch (cmd) | 81 | switch (cmd) |
82 | { | 82 | { |
83 | case BIO_CB_FREE: | 83 | case BIO_CB_FREE: |
84 | BIO_snprintf(p,p_maxlen,"Free - %s\n",bio->method->name); | 84 | snprintf(p,p_maxlen,"Free - %s\n",bio->method->name); |
85 | break; | 85 | break; |
86 | case BIO_CB_READ: | 86 | case BIO_CB_READ: |
87 | if (bio->method->type & BIO_TYPE_DESCRIPTOR) | 87 | if (bio->method->type & BIO_TYPE_DESCRIPTOR) |
88 | BIO_snprintf(p,p_maxlen,"read(%d,%d) - %s fd=%d\n", | 88 | snprintf(p,p_maxlen,"read(%d,%d) - %s fd=%d\n", |
89 | bio->num,argi,bio->method->name,bio->num); | 89 | bio->num,argi,bio->method->name,bio->num); |
90 | else | 90 | else |
91 | BIO_snprintf(p,p_maxlen,"read(%d,%d) - %s\n", | 91 | snprintf(p,p_maxlen,"read(%d,%d) - %s\n", |
92 | bio->num,argi,bio->method->name); | 92 | bio->num,argi,bio->method->name); |
93 | break; | 93 | break; |
94 | case BIO_CB_WRITE: | 94 | case BIO_CB_WRITE: |
95 | if (bio->method->type & BIO_TYPE_DESCRIPTOR) | 95 | if (bio->method->type & BIO_TYPE_DESCRIPTOR) |
96 | BIO_snprintf(p,p_maxlen,"write(%d,%d) - %s fd=%d\n", | 96 | snprintf(p,p_maxlen,"write(%d,%d) - %s fd=%d\n", |
97 | bio->num,argi,bio->method->name,bio->num); | 97 | bio->num,argi,bio->method->name,bio->num); |
98 | else | 98 | else |
99 | BIO_snprintf(p,p_maxlen,"write(%d,%d) - %s\n", | 99 | snprintf(p,p_maxlen,"write(%d,%d) - %s\n", |
100 | bio->num,argi,bio->method->name); | 100 | bio->num,argi,bio->method->name); |
101 | break; | 101 | break; |
102 | case BIO_CB_PUTS: | 102 | case BIO_CB_PUTS: |
103 | BIO_snprintf(p,p_maxlen,"puts() - %s\n",bio->method->name); | 103 | snprintf(p,p_maxlen,"puts() - %s\n",bio->method->name); |
104 | break; | 104 | break; |
105 | case BIO_CB_GETS: | 105 | case BIO_CB_GETS: |
106 | BIO_snprintf(p,p_maxlen,"gets(%d) - %s\n",argi,bio->method->name); | 106 | snprintf(p,p_maxlen,"gets(%d) - %s\n",argi,bio->method->name); |
107 | break; | 107 | break; |
108 | case BIO_CB_CTRL: | 108 | case BIO_CB_CTRL: |
109 | BIO_snprintf(p,p_maxlen,"ctrl(%d) - %s\n",argi,bio->method->name); | 109 | snprintf(p,p_maxlen,"ctrl(%d) - %s\n",argi,bio->method->name); |
110 | break; | 110 | break; |
111 | case BIO_CB_RETURN|BIO_CB_READ: | 111 | case BIO_CB_RETURN|BIO_CB_READ: |
112 | BIO_snprintf(p,p_maxlen,"read return %ld\n",ret); | 112 | snprintf(p,p_maxlen,"read return %ld\n",ret); |
113 | break; | 113 | break; |
114 | case BIO_CB_RETURN|BIO_CB_WRITE: | 114 | case BIO_CB_RETURN|BIO_CB_WRITE: |
115 | BIO_snprintf(p,p_maxlen,"write return %ld\n",ret); | 115 | snprintf(p,p_maxlen,"write return %ld\n",ret); |
116 | break; | 116 | break; |
117 | case BIO_CB_RETURN|BIO_CB_GETS: | 117 | case BIO_CB_RETURN|BIO_CB_GETS: |
118 | BIO_snprintf(p,p_maxlen,"gets return %ld\n",ret); | 118 | snprintf(p,p_maxlen,"gets return %ld\n",ret); |
119 | break; | 119 | break; |
120 | case BIO_CB_RETURN|BIO_CB_PUTS: | 120 | case BIO_CB_RETURN|BIO_CB_PUTS: |
121 | BIO_snprintf(p,p_maxlen,"puts return %ld\n",ret); | 121 | snprintf(p,p_maxlen,"puts return %ld\n",ret); |
122 | break; | 122 | break; |
123 | case BIO_CB_RETURN|BIO_CB_CTRL: | 123 | case BIO_CB_RETURN|BIO_CB_CTRL: |
124 | BIO_snprintf(p,p_maxlen,"ctrl return %ld\n",ret); | 124 | snprintf(p,p_maxlen,"ctrl return %ld\n",ret); |
125 | break; | 125 | break; |
126 | default: | 126 | default: |
127 | BIO_snprintf(p,p_maxlen,"bio callback - unknown type (%d)\n",cmd); | 127 | snprintf(p,p_maxlen,"bio callback - unknown type (%d)\n",cmd); |
128 | break; | 128 | break; |
129 | } | 129 | } |
130 | 130 | ||
diff --git a/src/lib/libcrypto/bio/bss_conn.c b/src/lib/libcrypto/bio/bss_conn.c index f5d0e759e2..8c694140ed 100644 --- a/src/lib/libcrypto/bio/bss_conn.c +++ b/src/lib/libcrypto/bio/bss_conn.c | |||
@@ -521,8 +521,8 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
521 | char buf[16]; | 521 | char buf[16]; |
522 | unsigned char *p = ptr; | 522 | unsigned char *p = ptr; |
523 | 523 | ||
524 | BIO_snprintf(buf,sizeof buf,"%d.%d.%d.%d", | 524 | snprintf(buf,sizeof buf,"%d.%d.%d.%d", |
525 | p[0],p[1],p[2],p[3]); | 525 | p[0],p[1],p[2],p[3]); |
526 | if (data->param_hostname != NULL) | 526 | if (data->param_hostname != NULL) |
527 | OPENSSL_free(data->param_hostname); | 527 | OPENSSL_free(data->param_hostname); |
528 | data->param_hostname=BUF_strdup(buf); | 528 | data->param_hostname=BUF_strdup(buf); |
@@ -532,7 +532,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
532 | { | 532 | { |
533 | char buf[DECIMAL_SIZE(int)+1]; | 533 | char buf[DECIMAL_SIZE(int)+1]; |
534 | 534 | ||
535 | BIO_snprintf(buf,sizeof buf,"%d",*(int *)ptr); | 535 | snprintf(buf,sizeof buf,"%d",*(int *)ptr); |
536 | if (data->param_port != NULL) | 536 | if (data->param_port != NULL) |
537 | OPENSSL_free(data->param_port); | 537 | OPENSSL_free(data->param_port); |
538 | data->param_port=BUF_strdup(buf); | 538 | data->param_port=BUF_strdup(buf); |
diff --git a/src/lib/libcrypto/bio/bss_file.c b/src/lib/libcrypto/bio/bss_file.c index 9cdf159f82..0ca603ee0a 100644 --- a/src/lib/libcrypto/bio/bss_file.c +++ b/src/lib/libcrypto/bio/bss_file.c | |||
@@ -249,15 +249,15 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
249 | if (num & BIO_FP_APPEND) | 249 | if (num & BIO_FP_APPEND) |
250 | { | 250 | { |
251 | if (num & BIO_FP_READ) | 251 | if (num & BIO_FP_READ) |
252 | BUF_strlcpy(p,"a+",sizeof p); | 252 | strlcpy(p,"a+",sizeof p); |
253 | else BUF_strlcpy(p,"a",sizeof p); | 253 | else strlcpy(p,"a",sizeof p); |
254 | } | 254 | } |
255 | else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE)) | 255 | else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE)) |
256 | BUF_strlcpy(p,"r+",sizeof p); | 256 | strlcpy(p,"r+",sizeof p); |
257 | else if (num & BIO_FP_WRITE) | 257 | else if (num & BIO_FP_WRITE) |
258 | BUF_strlcpy(p,"w",sizeof p); | 258 | strlcpy(p,"w",sizeof p); |
259 | else if (num & BIO_FP_READ) | 259 | else if (num & BIO_FP_READ) |
260 | BUF_strlcpy(p,"r",sizeof p); | 260 | strlcpy(p,"r",sizeof p); |
261 | else | 261 | else |
262 | { | 262 | { |
263 | BIOerr(BIO_F_FILE_CTRL,BIO_R_BAD_FOPEN_MODE); | 263 | BIOerr(BIO_F_FILE_CTRL,BIO_R_BAD_FOPEN_MODE); |
diff --git a/src/lib/libcrypto/bio/bss_rtcp.c b/src/lib/libcrypto/bio/bss_rtcp.c new file mode 100644 index 0000000000..7dae485564 --- /dev/null +++ b/src/lib/libcrypto/bio/bss_rtcp.c | |||
@@ -0,0 +1,294 @@ | |||
1 | /* crypto/bio/bss_rtcp.c */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
38 | * the apps directory (application code) you must include an acknowledgement: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
53 | * The licence and distribution terms for any publically available version or | ||
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | /* Written by David L. Jones <jonesd@kcgl1.eng.ohio-state.edu> | ||
60 | * Date: 22-JUL-1996 | ||
61 | * Revised: 25-SEP-1997 Update for 0.8.1, BIO_CTRL_SET -> BIO_C_SET_FD | ||
62 | */ | ||
63 | /* VMS */ | ||
64 | #include <stdio.h> | ||
65 | #include <stdlib.h> | ||
66 | #include <string.h> | ||
67 | #include <errno.h> | ||
68 | #include "cryptlib.h" | ||
69 | #include <openssl/bio.h> | ||
70 | |||
71 | #include <iodef.h> /* VMS IO$_ definitions */ | ||
72 | #include <starlet.h> | ||
73 | |||
74 | typedef unsigned short io_channel; | ||
75 | /*************************************************************************/ | ||
76 | struct io_status { short status, count; long flags; }; | ||
77 | |||
78 | struct rpc_msg { /* Should have member alignment inhibited */ | ||
79 | char channel; /* 'A'-app data. 'R'-remote client 'G'-global */ | ||
80 | char function; /* 'G'-get, 'P'-put, 'C'-confirm, 'X'-close */ | ||
81 | unsigned short int length; /* Amount of data returned or max to return */ | ||
82 | char data[4092]; /* variable data */ | ||
83 | }; | ||
84 | #define RPC_HDR_SIZE (sizeof(struct rpc_msg) - 4092) | ||
85 | |||
86 | struct rpc_ctx { | ||
87 | int filled, pos; | ||
88 | struct rpc_msg msg; | ||
89 | }; | ||
90 | |||
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); | ||
98 | |||
99 | static BIO_METHOD rtcp_method= | ||
100 | { | ||
101 | BIO_TYPE_FD, | ||
102 | "RTCP", | ||
103 | rtcp_write, | ||
104 | rtcp_read, | ||
105 | rtcp_puts, | ||
106 | rtcp_gets, | ||
107 | rtcp_ctrl, | ||
108 | rtcp_new, | ||
109 | rtcp_free, | ||
110 | NULL, | ||
111 | }; | ||
112 | |||
113 | BIO_METHOD *BIO_s_rtcp(void) | ||
114 | { | ||
115 | return(&rtcp_method); | ||
116 | } | ||
117 | /*****************************************************************************/ | ||
118 | /* Decnet I/O routines. | ||
119 | */ | ||
120 | |||
121 | #ifdef __DECC | ||
122 | #pragma message save | ||
123 | #pragma message disable DOLLARID | ||
124 | #endif | ||
125 | |||
126 | static int get ( io_channel chan, char *buffer, int maxlen, int *length ) | ||
127 | { | ||
128 | int status; | ||
129 | struct io_status iosb; | ||
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; | ||
134 | return status; | ||
135 | } | ||
136 | |||
137 | static int put ( io_channel chan, char *buffer, int length ) | ||
138 | { | ||
139 | int status; | ||
140 | struct io_status iosb; | ||
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; | ||
144 | return status; | ||
145 | } | ||
146 | |||
147 | #ifdef __DECC | ||
148 | #pragma message restore | ||
149 | #endif | ||
150 | |||
151 | /***************************************************************************/ | ||
152 | |||
153 | static int rtcp_new(BIO *bi) | ||
154 | { | ||
155 | struct rpc_ctx *ctx; | ||
156 | bi->init=1; | ||
157 | bi->num=0; | ||
158 | bi->flags = 0; | ||
159 | bi->ptr=OPENSSL_malloc(sizeof(struct rpc_ctx)); | ||
160 | ctx = (struct rpc_ctx *) bi->ptr; | ||
161 | ctx->filled = 0; | ||
162 | ctx->pos = 0; | ||
163 | return(1); | ||
164 | } | ||
165 | |||
166 | static int rtcp_free(BIO *a) | ||
167 | { | ||
168 | if (a == NULL) return(0); | ||
169 | if ( a->ptr ) OPENSSL_free ( a->ptr ); | ||
170 | a->ptr = NULL; | ||
171 | return(1); | ||
172 | } | ||
173 | |||
174 | static int rtcp_read(BIO *b, char *out, int outl) | ||
175 | { | ||
176 | int status, length; | ||
177 | struct rpc_ctx *ctx; | ||
178 | /* | ||
179 | * read data, return existing. | ||
180 | */ | ||
181 | ctx = (struct rpc_ctx *) b->ptr; | ||
182 | if ( ctx->pos < ctx->filled ) { | ||
183 | length = ctx->filled - ctx->pos; | ||
184 | if ( length > outl ) length = outl; | ||
185 | memmove ( out, &ctx->msg.data[ctx->pos], length ); | ||
186 | ctx->pos += length; | ||
187 | return length; | ||
188 | } | ||
189 | /* | ||
190 | * Requst more data from R channel. | ||
191 | */ | ||
192 | ctx->msg.channel = 'R'; | ||
193 | ctx->msg.function = 'G'; | ||
194 | ctx->msg.length = sizeof(ctx->msg.data); | ||
195 | status = put ( b->num, (char *) &ctx->msg, RPC_HDR_SIZE ); | ||
196 | if ( (status&1) == 0 ) { | ||
197 | return -1; | ||
198 | } | ||
199 | /* | ||
200 | * Read. | ||
201 | */ | ||
202 | ctx->pos = ctx->filled = 0; | ||
203 | status = get ( b->num, (char *) &ctx->msg, sizeof(ctx->msg), &length ); | ||
204 | if ( (status&1) == 0 ) length = -1; | ||
205 | if ( ctx->msg.channel != 'R' || ctx->msg.function != 'C' ) { | ||
206 | length = -1; | ||
207 | } | ||
208 | ctx->filled = length - RPC_HDR_SIZE; | ||
209 | |||
210 | if ( ctx->pos < ctx->filled ) { | ||
211 | length = ctx->filled - ctx->pos; | ||
212 | if ( length > outl ) length = outl; | ||
213 | memmove ( out, ctx->msg.data, length ); | ||
214 | ctx->pos += length; | ||
215 | return length; | ||
216 | } | ||
217 | |||
218 | return length; | ||
219 | } | ||
220 | |||
221 | static int rtcp_write(BIO *b, const char *in, int inl) | ||
222 | { | ||
223 | int status, i, segment, length; | ||
224 | struct rpc_ctx *ctx; | ||
225 | /* | ||
226 | * Output data, send in chunks no larger that sizeof(ctx->msg.data). | ||
227 | */ | ||
228 | ctx = (struct rpc_ctx *) b->ptr; | ||
229 | for ( i = 0; i < inl; i += segment ) { | ||
230 | segment = inl - i; | ||
231 | if ( segment > sizeof(ctx->msg.data) ) segment = sizeof(ctx->msg.data); | ||
232 | ctx->msg.channel = 'R'; | ||
233 | ctx->msg.function = 'P'; | ||
234 | ctx->msg.length = segment; | ||
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; } | ||
238 | |||
239 | status = get ( b->num, (char *) &ctx->msg, sizeof(ctx->msg), &length ); | ||
240 | if ( ((status&1) == 0) || (length < RPC_HDR_SIZE) ) { i = -1; break; } | ||
241 | if ( (ctx->msg.channel != 'R') || (ctx->msg.function != 'C') ) { | ||
242 | printf("unexpected response when confirming put %c %c\n", | ||
243 | ctx->msg.channel, ctx->msg.function ); | ||
244 | |||
245 | } | ||
246 | } | ||
247 | return(i); | ||
248 | } | ||
249 | |||
250 | static long rtcp_ctrl(BIO *b, int cmd, long num, void *ptr) | ||
251 | { | ||
252 | long ret=1; | ||
253 | |||
254 | switch (cmd) | ||
255 | { | ||
256 | case BIO_CTRL_RESET: | ||
257 | case BIO_CTRL_EOF: | ||
258 | ret = 1; | ||
259 | break; | ||
260 | case BIO_C_SET_FD: | ||
261 | b->num = num; | ||
262 | ret = 1; | ||
263 | break; | ||
264 | case BIO_CTRL_SET_CLOSE: | ||
265 | case BIO_CTRL_FLUSH: | ||
266 | case BIO_CTRL_DUP: | ||
267 | ret=1; | ||
268 | break; | ||
269 | case BIO_CTRL_GET_CLOSE: | ||
270 | case BIO_CTRL_INFO: | ||
271 | case BIO_CTRL_GET: | ||
272 | case BIO_CTRL_PENDING: | ||
273 | case BIO_CTRL_WPENDING: | ||
274 | default: | ||
275 | ret=0; | ||
276 | break; | ||
277 | } | ||
278 | return(ret); | ||
279 | } | ||
280 | |||
281 | static int rtcp_gets(BIO *bp, char *buf, int size) | ||
282 | { | ||
283 | return(0); | ||
284 | } | ||
285 | |||
286 | static int rtcp_puts(BIO *bp, const char *str) | ||
287 | { | ||
288 | int length; | ||
289 | if (str == NULL) return(0); | ||
290 | length = strlen ( str ); | ||
291 | if ( length == 0 ) return (0); | ||
292 | return rtcp_write ( bp,str, length ); | ||
293 | } | ||
294 | |||