34 #define DEF_TUPLE "NET,HOST,FULL" 35 #define DEF_TIMES "0,1000,0,1000" 47 #define CONF_INITIALIZER {"/tmp/ze-grey-bench", 10000, DEF_TIMES, DEF_TUPLE} 49 static char *
workdir =
"/var/ze-greyd";
51 static char *ntuple = NULL;
53 static char *tconst = NULL;
55 static int do_test(
conf_T * cargs);
57 static void usage(
char *);
77 const char *args =
"ht:dvw:n:l:c:";
80 while ((c = getopt(argc, argv, args)) != -1) {
112 cargs.
count = atoi(optarg);
128 printf(
"Error ... \n");
146 printf(
"* Connect \n");
150 printf(
"* Receive \n");
151 memset(buf, 0,
sizeof (buf));
155 strlcpy(buf,
"download pending\r\n",
sizeof (buf));
158 printf(
"* Receive \n");
159 strlcpy(fname,
"pending.XXXXXX",
sizeof (fname));
162 memset(buf, 0,
sizeof (buf));
166 write(fd, buf, strlen(buf));
171 strlcpy(buf,
"download valid\r\n",
sizeof (buf));
174 printf(
"* Receive \n");
175 strlcpy(fname,
"valid.XXXXXX",
sizeof (fname));
178 memset(buf, 0,
sizeof (buf));
183 write(fd, buf, strlen(buf));
189 write(fd, buf, strlen(buf));
195 strlcpy(buf,
"download white\r\n",
sizeof (buf));
198 printf(
"* Receive \n");
199 strlcpy(fname,
"white.XXXXXX",
sizeof (fname));
202 memset(buf, 0,
sizeof (buf));
206 write(fd, buf, strlen(buf));
211 strlcpy(buf,
"quit\r\n",
sizeof (buf));
237 from =
"nobody@foss.jose-marcio.org";
238 hostname =
"nowhere.foss.jose-marcio.org";
239 to =
"grey@foss.jose-marcio.org";
242 for (n = 0; n < cargs->
count; n++) {
246 bool can_validate =
TRUE;
248 snprintf(buf,
sizeof (buf),
"grey-%d@foss.jose-marcio.org", n);
285 printf(
"Usage : %s options\n" 286 " %s\n" " Compiled on %s\n", arg,
PACKAGE, __DATE__
" " __TIME__);
#define CLIENT_INITIALIZER
int remote_grey_check(char *ip, char *from, char *to, char *hostname)
bool client_send(client_T *client, char *buf, size_t size)
void zeLog_SetOutput(bool, bool)
int main(int argc, char **argv)
#define ZE_MessageInfo(level,...)
bool client_disconnect(client_T *client, bool incerr)
int configure(char *, char *, bool)
int client_connect(client_T *client, char *spec, int to)
bool client_recv(client_T *client, char *buf, size_t size)
bool client_readln(client_T *client, char *buf, size_t size)