From: Saverio Proto Date: Thu, 28 Aug 2014 13:18:00 +0000 (+0200) Subject: manynodes: add few backbone nodes and many portable nodes to make tests X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=a1ca2b23296707172f0e315a1edc186eaccf5551;p=meshlink manynodes: add few backbone nodes and many portable nodes to make tests --- diff --git a/examples/manynodes.c b/examples/manynodes.c index 16d25ddc..d158e5b9 100644 --- a/examples/manynodes.c +++ b/examples/manynodes.c @@ -374,7 +374,12 @@ int main(int argc, char *argv[]) { snprintf(nodename, sizeof nodename, "%snode%d", namesprefix,i); snprintf(filename, sizeof filename, "%s/%s", basebase, nodename); bool itsnew = access(filename, R_OK); - mesh[i] = meshlink_open(filename, nodename, "manynodes", i%_DEV_CLASS_MAX); + if (n/(i+1) > n/4) { + mesh[i] = meshlink_open(filename, nodename, "manynodes", DEV_CLASS_BACKBONE); + } + else { + mesh[i] = meshlink_open(filename, nodename, "manynodes", DEV_CLASS_PORTABLE); + } meshlink_set_log_cb(mesh[i], MESHLINK_WARNING, log_message); if(!mesh[i]) { fprintf(stderr, "errno is: %d\n", meshlink_errno);