5a175172cc118923c4e40d9df2c807c63d2a41e4
[tpg/acess2.git] / Tools / NetTest / mode_cmdline.c
1 /*
2  */
3 #include <nettest.h>
4 #include <stdio.h>
5 #include <string.h>
6
7 // === CODE ===
8 void NetTest_Suite_Cmdline(void)
9 {
10         char line[BUFSIZ];
11         while( fgets(line, sizeof(line)-1, stdin) )
12         {
13                 const char *cmd = strtok(line, " ");
14                 if(!cmd)
15                         continue;
16                 if( strcmp(cmd, "exit") == 0 ) {
17                         return ;
18                 }
19                 else if( strcmp(cmd, "request") == 0 ) {
20                         //const char *addr = strtok(NULL, " ");
21                         
22                 }
23                 else {
24                         fprintf(stderr, "ERROR: Unknown command '%s'\n", cmd);
25                 }
26         }
27 }

UCC git Repository :: git.ucc.asn.au