X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Fblackbox%2Futil%2Fgen_invite.c;h=beb7401f64af698b46fea14e7a7fc1ba4e2e3a73;hb=4108810af455f463dfbcdac0e2e0b2ba0312bf26;hp=83c3f4f80a06325c5779f985fcb640b9ddb6e13b;hpb=dc68da94af8fca91748579c84ef5ed798db7efab;p=meshlink diff --git a/test/blackbox/util/gen_invite.c b/test/blackbox/util/gen_invite.c index 83c3f4f8..beb7401f 100644 --- a/test/blackbox/util/gen_invite.c +++ b/test/blackbox/util/gen_invite.c @@ -17,22 +17,30 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include +#include #include #include "../../../src/meshlink.h" #include "../common/test_step.h" #define CMD_LINE_ARG_NODENAME 1 #define CMD_LINE_ARG_INVITEE 2 +#define CMD_LINE_ARG_SUBMESH 3 int main(int argc, char *argv[]) { char *invite = NULL; + meshlink_submesh_t *s = NULL; /* Start mesh, generate an invite and print out the invite */ - execute_open(argv[CMD_LINE_ARG_NODENAME], "1"); + meshlink_handle_t *mesh = execute_open(argv[CMD_LINE_ARG_NODENAME], "1"); execute_start(); - invite = execute_invite(argv[CMD_LINE_ARG_INVITEE]); + + if(argc > CMD_LINE_ARG_SUBMESH) { + s = meshlink_submesh_open(mesh, argv[CMD_LINE_ARG_SUBMESH]); + } + + invite = execute_invite(argv[CMD_LINE_ARG_INVITEE], s); printf("%s\n", invite); - //execute_close(); + execute_close(); return EXIT_SUCCESS; }