These are pretty skanky. It's not clear where they should live, or
even whether they should live at all, but they're handy for testing.
Signed-off-by: Steven Smith <steven.smith@xxxxxxxxxx>
---
drivers/xen/netchannel2/tools/destroy_bypass.c | 25 +++++++++++++++++
drivers/xen/netchannel2/tools/establish_bypass.c | 31 ++++++++++++++++++++++
2 files changed, 56 insertions(+), 0 deletions(-)
create mode 100644 drivers/xen/netchannel2/tools/destroy_bypass.c
create mode 100644 drivers/xen/netchannel2/tools/establish_bypass.c
diff --git a/drivers/xen/netchannel2/tools/destroy_bypass.c
b/drivers/xen/netchannel2/tools/destroy_bypass.c
new file mode 100644
index 0000000..93b82e0
--- /dev/null
+++ b/drivers/xen/netchannel2/tools/destroy_bypass.c
@@ -0,0 +1,25 @@
+#include <sys/ioctl.h>
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "../netchannel2_uspace.h"
+
+int
+main(int argc, char *argv[])
+{
+ int fd;
+ struct netchannel2_ioctl_destroy_bypass ioc;
+ int r;
+
+ fd = open("/dev/netback2", O_RDWR);
+ if (fd < 0)
+ err(1, "openning /dev/netback2");
+ ioc.handle = atoi(argv[1]);
+
+ r = ioctl(fd, NETCHANNEL2_IOCTL_DESTROY_BYPASS, &ioc);
+ if (r < 0)
+ err(1, "destroying bypass");
+ return 0;
+}
diff --git a/drivers/xen/netchannel2/tools/establish_bypass.c
b/drivers/xen/netchannel2/tools/establish_bypass.c
new file mode 100644
index 0000000..bdd326c
--- /dev/null
+++ b/drivers/xen/netchannel2/tools/establish_bypass.c
@@ -0,0 +1,31 @@
+#include <sys/ioctl.h>
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "../netchannel2_uspace.h"
+
+int
+main(int argc, char *argv[])
+{
+ int fd;
+ unsigned a;
+ unsigned b;
+ struct netchannel2_ioctl_establish_bypass ioc;
+ int r;
+
+ fd = open("/dev/netback2", O_RDWR);
+ if (fd < 0)
+ err(1, "openning /dev/netback2");
+ a = atoi(argv[1]);
+ b = atoi(argv[2]);
+ ioc.handle_a = a;
+ ioc.handle_b = b;
+
+ r = ioctl(fd, NETCHANNEL2_IOCTL_ESTABLISH_BYPASS, &ioc);
+ if (r < 0)
+ err(1, "establishing bypass");
+ printf("%d\n", r);
+ return 0;
+}
--
1.6.3.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|