51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "meshlink_internal.h"
+#include "meshlink.h"
typedef struct submesh_t {
char *name; /* name of this Sub-Mesh */
}
char *execute_invite(char *invitee) {
- char *invite_url = meshlink_invite_ex(mesh_handle, invitee, MESHLINK_INVITE_LOCAL | MESHLINK_INVITE_NUMERIC);
+ char *invite_url = meshlink_invite_ex(mesh_handle, NULL, invitee, MESHLINK_INVITE_LOCAL | MESHLINK_INVITE_NUMERIC);
PRINT_TEST_CASE_MSG("meshlink_invite status: %s\n", meshlink_strerror(meshlink_errno));
assert(invite_url);
assert(mesh_handle);
meshlink_set_log_cb(mesh_handle, TEST_MESHLINK_LOG_LEVEL, meshlink_callback_logger);
- char *invitation = meshlink_invite(mesh_handle, "new");
+ char *invitation = meshlink_invite(mesh_handle, NULL, "new");
assert_int_equal(invitation, NULL);
free(invitation);
*/
static bool test_invite_02(void) {
// Trying to generate INVITATION by passing NULL as mesh link handle
- char *invitation = meshlink_invite(NULL, "nut");
+ char *invitation = meshlink_invite(NULL, NULL, "nut");
assert_int_equal(invitation, NULL);
return true;
meshlink_set_log_cb(mesh_handle, TEST_MESHLINK_LOG_LEVEL, meshlink_callback_logger);
// Trying to generate INVITATION by passing NULL as mesh link handle
- char *invitation = meshlink_invite(mesh_handle, NULL);
+ char *invitation = meshlink_invite(mesh_handle, NULL, NULL);
assert_int_equal(invitation, NULL);
meshlink_close(mesh_handle);
char *hostname1 = "127.1.1.1";
bool ret = meshlink_add_address(mesh_handle, hostname1);
- char *invitation = meshlink_invite(mesh_handle, "foo");
+ char *invitation = meshlink_invite(mesh_handle, NULL, "foo");
assert_int_not_equal(strstr(invitation, hostname1), NULL);
char *hostname2 = "127.1.2.3";
ret = meshlink_add_address(mesh_handle, hostname2);
- invitation = meshlink_invite(mesh_handle, "bar");
+ invitation = meshlink_invite(mesh_handle, NULL, "bar");
// Verify we have both the added addresses
assert_int_not_equal(strstr(invitation, hostname1), NULL);
// Inviting nut
meshlink_start(mesh2);
- char *invitation = meshlink_invite(mesh2, "nut");
+ char *invitation = meshlink_invite(mesh2, NULL, "nut");
assert(invitation);
// Joining Node-Under-Test with relay
assert(mesh1 != NULL);
meshlink_set_log_cb(mesh1, TEST_MESHLINK_LOG_LEVEL, meshlink_callback_logger);
- char *invitation = meshlink_invite(mesh1, "nodex");
+ char *invitation = meshlink_invite(mesh1, NULL, "nodex");
/* meshlink_join called with NULL as mesh handle and with valid invitation */
bool ret = meshlink_join(NULL, invitation);
meshlink_set_log_cb(mesh, MESHLINK_DEBUG, logger_cb);
meshlink_enable_discovery(mesh, false);
assert(meshlink_start(mesh));
- invite = meshlink_invite_ex(mesh, argv[2], MESHLINK_INVITE_LOCAL | MESHLINK_INVITE_NUMERIC);
+ invite = meshlink_invite_ex(mesh, NULL, argv[2], MESHLINK_INVITE_LOCAL | MESHLINK_INVITE_NUMERIC);
printf("%s\n", invite);
meshlink_close(mesh);
}
meshlink_add_address(mesh1, "localhost");
- char *baz_url = meshlink_invite(mesh1, "baz");
+ char *baz_url = meshlink_invite(mesh1, NULL, "baz");
if(!baz_url) {
fprintf(stderr, "Foo could not generate an invitation for baz\n");
return 1;
}
- char *quux_url = meshlink_invite(mesh1, "quux");
+ char *quux_url = meshlink_invite(mesh1, NULL, "quux");
if(!quux_url) {
fprintf(stderr, "Foo could not generate an invitation for quux\n");