convert test programs from socket_tcp[46] to socket_tcp[46]b

master
leitner 19 years ago
parent 83c1186870
commit f7e6432a2b

@ -66,11 +66,11 @@ usage:
goto usage; goto usage;
} }
if (byte_equal(ip,12,V4mappedprefix)) { if (byte_equal(ip,12,V4mappedprefix)) {
s=socket_tcp4(); s=socket_tcp4b();
if (s==-1) panic("client: error: socket() failed"); if (s==-1) panic("client: error: socket() failed");
if (socket_connect4(s,ip+12,port)==-1) panic("client: error: connect() failed"); if (socket_connect4(s,ip+12,port)==-1) panic("client: error: connect() failed");
} else { } else {
s=socket_tcp6(); s=socket_tcp6b();
if (s==-1) panic("client: error: socket() failed"); if (s==-1) panic("client: error: socket() failed");
if (socket_connect6(s,ip,port,scope_id)==-1) panic("client: error: connect() failed"); if (socket_connect6(s,ip,port,scope_id)==-1) panic("client: error: connect() failed");
} }

@ -8,7 +8,7 @@
#include "ndelay.h" #include "ndelay.h"
int main(int argc,char* argv[]) { int main(int argc,char* argv[]) {
int s=socket_tcp4(); int s=socket_tcp4b();
char line[1024]; char line[1024];
char buf[4096]; char buf[4096];
int l; int l;

@ -182,7 +182,7 @@ e404:
} }
int main() { int main() {
int s=socket_tcp6(); int s=socket_tcp6b();
uint32 scope_id; uint32 scope_id;
char ip[16]; char ip[16];
uint16 port; uint16 port;

@ -69,14 +69,14 @@ usage:
goto usage; goto usage;
} }
if (byte_equal(ip,12,V4mappedprefix)) { if (byte_equal(ip,12,V4mappedprefix)) {
s=socket_tcp4(); s=socket_tcp4b();
if (s==-1) panic("server: error: socket() failed"); if (s==-1) panic("server: error: socket() failed");
if (socket_bind4_reuse(s,ip+12,port)==-1) panic("server: error: bind() failed"); if (socket_bind4_reuse(s,ip+12,port)==-1) panic("server: error: bind() failed");
if (socket_listen(s,1)==-1) panic("server: error: listen() failed"); if (socket_listen(s,1)==-1) panic("server: error: listen() failed");
ndelay_off(s); ndelay_off(s);
if ((t=socket_accept4(s,0,0))==-1) panic("server: error: accept() failed"); if ((t=socket_accept4(s,0,0))==-1) panic("server: error: accept() failed");
} else { } else {
s=socket_tcp6(); s=socket_tcp6b();
if (s==-1) panic("server: error: socket() failed"); if (s==-1) panic("server: error: socket() failed");
if (socket_bind6_reuse(s,ip,port,scope_id)==-1) panic("server: error: bind() failed"); if (socket_bind6_reuse(s,ip,port,scope_id)==-1) panic("server: error: bind() failed");
if (socket_listen(s,1)==-1) panic("server: error: listen() failed"); if (socket_listen(s,1)==-1) panic("server: error: listen() failed");

@ -6,7 +6,7 @@
#include "ndelay.h" #include "ndelay.h"
int main(int argc,char* argv[]) { int main(int argc,char* argv[]) {
int s=socket_tcp4(); int s=socket_tcp4b();
char line[1024]; char line[1024];
char buf[4096]; char buf[4096];
int l; int l;

Loading…
Cancel
Save