X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fdevtools.c;h=6d22516d145c16b04e095610977f57bf4c7d55a3;hb=6054182c9e208fd0b3f5c6c90f54cb5af75d3f5c;hp=3f2c0a4942797ff24d931ffccdec65fcdac6d043;hpb=305f26990ad31de1bc5edbf95e5d8b8d330ca5dc;p=meshlink diff --git a/src/devtools.c b/src/devtools.c index 3f2c0a49..6d22516d 100644 --- a/src/devtools.c +++ b/src/devtools.c @@ -279,3 +279,20 @@ void devtool_get_node_status(meshlink_handle_t *mesh, meshlink_node_t *node, dev pthread_mutex_unlock(&mesh->mesh_mutex); } + +meshlink_handle_t *devtool_open_in_netns(const char *confbase, const char *name, const char *appname, dev_class_t devclass, int netns) { + meshlink_open_params_t *params = meshlink_open_params_init(confbase, name, appname, devclass); + params->netns = dup(netns); + meshlink_handle_t *handle; + + if(params->netns == -1) { + handle = NULL; + meshlink_errno = MESHLINK_EINVAL; + } else { + handle = meshlink_open_ex(params); + } + + meshlink_open_params_free(params); + + return handle; +}