1 /* Tool for testing the FTP parser */
14 #include "osdep/stat.h"
15 #include "protocol/ftp/parse.h"
18 void die(const char *msg
, ...)
24 vfprintf(stderr
, msg
, args
);
33 main(int argc
, char *argv
[])
35 struct ftp_file_info ftp_info
= INIT_FTP_FILE_INFO
;
36 unsigned char *response
= "";
40 for (i
= 1; i
< argc
; i
++) {
43 if (strncmp(arg
, "--", 2))
48 if (!strncmp(arg
, "response", 8)) {
56 die("--response expects a string");
59 responselen
= strlen(response
);
62 die("Unknown argument '%s'", arg
- 2);
67 die("Usage: %s --response \"string\"", argv
[0]);
69 if (parse_ftp_file_info(&ftp_info
, response
, responselen
))