1 /* Utility functions for the test apps */
9 #include "sys/socket.h"
10 #include "netinet/in.h"
11 #include "arpa/inet.h"
12 #include "sys/select.h"
16 void err(int error
, char *msg
)
18 printf("Error: %s\n", msg
);
19 printf("Code: %d\n", error
);
20 printf("Desc: %s\n", strerror(error
));
24 void test_banner(char *msg
)
27 char *buf
= (char*)malloc(sl
+ 5);
29 memset(buf
, '=', sl
+ 4);
31 buf
[1] = buf
[sl
+ 2] = ' ';
32 memcpy(&buf
[2], msg
, sl
);
34 memset(buf
, '=', sl
+ 4);