add "start_program" support

This allows the controlling instance (ttcn3 test case) to start
a process (shell command) within the namespace of a given tunnel
/ tun device.

The controlling instance is informed of the success/failure
of starting the process, as well as the exit code at time of
termination.

Change-Id: I94db625de9f5968e53bf67ce2f941673d9a15fbc
Depends: libosmocore.git If1431f930f72a8d6c1d102426874a11b7a2debd9
Depends: libosmocore.git If8d89dd1f6989e1cd9b9367fad954d65f91ada30
diff --git a/daemon/tun_device.c b/daemon/tun_device.c
index f6553ca..e20607d 100644
--- a/daemon/tun_device.c
+++ b/daemon/tun_device.c
@@ -337,6 +337,23 @@
 	return NULL;
 }
 
+/* find the first tun device within given named netns */
+struct tun_device *
+tun_device_find_netns(struct gtp_daemon *d, const char *netns_name)
+{
+	struct tun_device *tun;
+
+	pthread_rwlock_rdlock(&d->rwlock);
+	llist_for_each_entry(tun, &d->tun_devices, list) {
+		if (!strcmp(tun->netns_name, netns_name)) {
+			pthread_rwlock_unlock(&d->rwlock);
+			return tun;
+		}
+	}
+	pthread_rwlock_unlock(&d->rwlock);
+	return NULL;
+}
+
 struct tun_device *
 tun_device_find_or_create(struct gtp_daemon *d, const char *devname, const char *netns_name)
 {