|
|
|
@@ -166,28 +166,30 @@ struct main_list_y_ptr_STRING * split_str_to_main_list_y_ptr_STRING(char *str_or
|
|
|
|
|
|
|
|
|
|
void usage_cmdl(){
|
|
|
|
|
printf("usage:\n"
|
|
|
|
|
"help: to print this menu.\n"
|
|
|
|
|
"kill: to gracefuly kill local socket server.\n"
|
|
|
|
|
"sendto [addr] { \"cmd\" : \"[command]\" }\n"
|
|
|
|
|
"addr: ipv4 address or ipv6 address \n"
|
|
|
|
|
"\tor all to send cmd to all nodes already in the list.\n"
|
|
|
|
|
"\tor other to send cmd to all nodes excluding local address in the list.\n"
|
|
|
|
|
"command: \n"
|
|
|
|
|
"\tupdate kill: to gracefully shutdown socket server.\n"
|
|
|
|
|
"\tupdate cleanup: to free m_headers lists.\n"
|
|
|
|
|
"\tupdate standby: to suspend all workers, but can receive all task but in queu tasks.\n"
|
|
|
|
|
"\tupdate wakeup: to wakeup all workers, and then execute all tasks in queu.\n"
|
|
|
|
|
"\tpipe: to pipe string after header to destination:\n"
|
|
|
|
|
"\t\teg: sendto 192.168.1.142 { \"cmd\" : \"pipe\" }sendto 192.168.1.250 { \"cmd\" : \"get file SOME_FILE_LOCAL\" }\n"
|
|
|
|
|
"\t\tIt is equivalent to type: sendto 192.168.1.250 { \"cmd\" : \"get file SOME_FILE_LOCAL\" }\n\t\tin node 192.168.1.142.\n"
|
|
|
|
|
"\tupdate remove node [addr]: to remove [addr] in the list.\n"
|
|
|
|
|
"\tupdate add node [addr]: to add [addr] in the list.\n"
|
|
|
|
|
"\tget file [filename]: to ask server to send file named [filename].\n"
|
|
|
|
|
"\t\tfilename can be absolute path or relative working directory path\n"
|
|
|
|
|
"\t\teg: sendto 192.168.1.142 { \"cmd\" : \"get file FILENAME\" }\n"
|
|
|
|
|
"\t\twe can specify destination directory eg: sendto 192.168.1.142 { \"cmd\" : \"get file FILENAME\" , \"dst_dir\" : \"DIRECTORY_NEW_OR_ALREADY_EXISTS\" }\n"
|
|
|
|
|
"\tpost file [filename] : to send file [filename] after header.\n"
|
|
|
|
|
"\t\tNeed to add \"seq\" and \"tm\" keys to have good handling, the payload is after the header {}\n"
|
|
|
|
|
"\t\tSee y_socket_send_file_for_node function.\n"
|
|
|
|
|
"\tpost ok [filenameid]: to acknowledge receipt [filename].\n"
|
|
|
|
|
"\t\t[filenameid] is to precise witch [filename] (file name from whom and when)\n"
|
|
|
|
|
"\taddr: server cible address: ipv4 address or ipv6 address \n"
|
|
|
|
|
"\t\tor all to send cmd to all nodes already in the list.\n"
|
|
|
|
|
"\t\tor other to send cmd to all nodes excluding local address in the list.\n"
|
|
|
|
|
"\tcommand: \n"
|
|
|
|
|
"\t\tupdate kill: to gracefully shutdown socket server.\n"
|
|
|
|
|
"\t\tupdate cleanup: to free m_headers lists.\n"
|
|
|
|
|
"\t\tupdate standby: to suspend all workers, but can receive all task but in queu tasks.\n"
|
|
|
|
|
"\t\tupdate wakeup: to wakeup all workers, and then execute all tasks in queu.\n"
|
|
|
|
|
"\t\tpipe: to pipe string after header to destination:\n"
|
|
|
|
|
"\t\t\teg: sendto 192.168.1.142 { \"cmd\" : \"pipe\" }sendto 192.168.1.250 { \"cmd\" : \"get file SOME_FILE_LOCAL\" }\n"
|
|
|
|
|
"\t\t\tIt is equivalent to type: sendto 192.168.1.250 { \"cmd\" : \"get file SOME_FILE_LOCAL\" }\n\t\tin node 192.168.1.142.\n"
|
|
|
|
|
"\t\tupdate remove node [addr]: to remove [addr] in the list.\n"
|
|
|
|
|
"\t\tupdate add node [addr]: to add [addr] in the list.\n"
|
|
|
|
|
"\t\tget file [filename]: to ask server to send file named [filename].\n"
|
|
|
|
|
"\t\t\tfilename can be absolute path or relative working directory path\n"
|
|
|
|
|
"\t\t\teg: sendto 192.168.1.142 { \"cmd\" : \"get file FILENAME\" }\n"
|
|
|
|
|
"\t\t\twe can specify destination directory eg: sendto 192.168.1.142 { \"cmd\" : \"get file FILENAME\" , \"dst_dir\" : \"DIRECTORY_NEW_OR_ALREADY_EXISTS\" }\n"
|
|
|
|
|
"\t\tpost file [filename] : to send file [filename] after header.\n"
|
|
|
|
|
"\t\t\tNeed to add \"seq\" and \"tm\" keys to have good handling, the payload is after the header {}\n"
|
|
|
|
|
"\t\t\tSee y_socket_send_file_for_node function.\n"
|
|
|
|
|
"\t\tpost ok [filenameid]: to acknowledge receipt [filename].\n"
|
|
|
|
|
"\t\t\t[filenameid] is to precise witch [filename] (file name from whom and when)\n"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|