summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-04-12 12:22:11 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-04-12 12:22:11 +0200
commit5b5839ab88fd7b621f2fe64f838666d428b20538 (patch)
treea60890fcca5d4fb3930f8b61eb42f7989273d36c
parent842c229601af0d0a5cfbe11f1155d332094b580f (diff)
sync dde stuff
-rw-r--r--devnode/Makefile6
-rw-r--r--devnode/devnode.c22
-rw-r--r--eth-filter/Makefile1
-rw-r--r--eth-filter/filter.c34
-rw-r--r--eth-multiplexer/Makefile1
-rw-r--r--eth-multiplexer/multiplexer.c22
-rw-r--r--libmachdev/ds_routines.c14
-rw-r--r--libmachdev/trivfs_server.c17
8 files changed, 71 insertions, 46 deletions
diff --git a/devnode/Makefile b/devnode/Makefile
index 2c8af58d..d9a9c23c 100644
--- a/devnode/Makefile
+++ b/devnode/Makefile
@@ -20,14 +20,10 @@ makemode := server
SRCS = devnode.c
LCLHDRS = util.h
-DIST_FILES = ourdevice.defs notify.defs
HURDLIBS = ports trivfs fshelp shouldbeinlibc
target = devnode
-MIGSTUBS = ourdeviceServer.o notifyServer.o
+MIGSTUBS = deviceServer.o notifyServer.o
MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
include ../Makeconf
-
-ourdevice.defs: device.defs
- $(CPP) $(CPPFLAGS) -x c $< | sed -e '/out[ ]*device[ ]*:[ ]*device_t/s/device_t/mach_port_send_t/' > $@
diff --git a/devnode/devnode.c b/devnode/devnode.c
index 61fc5099..789bf513 100644
--- a/devnode/devnode.c
+++ b/devnode/devnode.c
@@ -35,8 +35,9 @@
#include <device/device.h>
#include <hurd/trivfs.h>
#include <hurd/ports.h>
+#include <version.h>
-#include "ourdevice_S.h"
+#include "device_S.h"
#include "notify_S.h"
#include "util.h"
@@ -48,8 +49,8 @@ static char *master_file;
/* The master device port for opening the interface. */
static mach_port_t master_device;
-const char *argp_program_version = "devnode 0.1";
-const char *argp_program_bug_address = "<bug-hurd@gnu.org>";
+const char *argp_program_version = STANDARD_HURD_VERSION (devnode);
+
static const char args_doc[] = "device";
static const char doc[] = "Hurd devnode translator.";
static const struct argp_option options[] =
@@ -81,10 +82,17 @@ static int
devnode_demuxer (mach_msg_header_t *inp,
mach_msg_header_t *outp)
{
- extern int device_server (mach_msg_header_t *, mach_msg_header_t *);
- extern int notify_server (mach_msg_header_t *, mach_msg_header_t *);
- return device_server (inp, outp) || notify_server (inp, outp)
- || trivfs_demuxer (inp, outp);
+ mig_routine_t routine;
+ if ((routine = device_server_routine (inp)) ||
+ (routine = notify_server_routine (inp)) ||
+ (routine = NULL, trivfs_demuxer (inp, outp)))
+ {
+ if (routine)
+ (*routine) (inp, outp);
+ return TRUE;
+ }
+ else
+ return FALSE;
}
/* Implementation of notify interface */
diff --git a/eth-filter/Makefile b/eth-filter/Makefile
index deee1e57..ed3286ce 100644
--- a/eth-filter/Makefile
+++ b/eth-filter/Makefile
@@ -20,7 +20,6 @@ makemode := server
SRCS = bpf_impl.c filter.c queue.c pcap_filter.c
LCLHDRS = bpf_impl.h queue.h util.h
-DIST_FILES = device.defs notify.defs
HURDLIBS = ports trivfs fshelp ihash shouldbeinlibc
target = eth-filter
MIGSTUBS = deviceServer.o notifyServer.o
diff --git a/eth-filter/filter.c b/eth-filter/filter.c
index 8c76c7b1..482b0800 100644
--- a/eth-filter/filter.c
+++ b/eth-filter/filter.c
@@ -39,6 +39,7 @@
#include <hurd/ports.h>
#include <hurd/ihash.h>
#include <hurd/fshelp.h>
+#include <version.h>
#include "device_S.h"
#include "notify_S.h"
@@ -73,8 +74,8 @@ static struct hurd_ihash proxy_deliverport_ht
/* The name of the network interface that the filter translator sits on. */
static char *device_file;
-const char *argp_program_version = "eth-filter 0.1";
-const char *argp_program_bug_address = "<bug-hurd@gnu.org>";
+const char *argp_program_version = STANDARD_HURD_VERSION (eth-filter);
+
static const char doc[] = "Hurd filter translator.";
static const struct argp_option options[] =
{
@@ -193,17 +194,6 @@ clean_proxy_device (void *p)
device->proxy->device = NULL;
}
-static int
-filter_demuxer (mach_msg_header_t *inp,
- mach_msg_header_t *outp)
-{
- extern int device_server (mach_msg_header_t *, mach_msg_header_t *);
- extern int notify_server (mach_msg_header_t *, mach_msg_header_t *);
- extern int ethernet_demuxer (mach_msg_header_t *, mach_msg_header_t *);
- return device_server (inp, outp) || notify_server (inp, outp)
- || ethernet_demuxer (inp, outp) || trivfs_demuxer (inp, outp);
-}
-
int
ethernet_demuxer (mach_msg_header_t *inp,
mach_msg_header_t *outp)
@@ -232,6 +222,24 @@ ethernet_demuxer (mach_msg_header_t *inp,
return 1;
}
+static int
+filter_demuxer (mach_msg_header_t *inp,
+ mach_msg_header_t *outp)
+{
+ mig_routine_t routine;
+ if ((routine = NULL, ethernet_demuxer (inp, outp)) ||
+ (routine = device_server_routine (inp)) ||
+ (routine = notify_server_routine (inp)) ||
+ (routine = NULL, trivfs_demuxer (inp, outp)))
+ {
+ if (routine)
+ (*routine) (inp, outp);
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
/* Implementation of notify interface */
kern_return_t
do_mach_notify_port_deleted (struct port_info *pi,
diff --git a/eth-multiplexer/Makefile b/eth-multiplexer/Makefile
index 882c3d03..fbee1ca1 100644
--- a/eth-multiplexer/Makefile
+++ b/eth-multiplexer/Makefile
@@ -25,7 +25,6 @@ MIGSTUBS = deviceServer.o notifyServer.o
MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
LCLHDRS = ethernet.h util.h vdev.h netfs_impl.h
-DIST_FILES = device.defs notify.defs
HURDLIBS=ports fshelp shouldbeinlibc netfs bpf
OTHERLIBS = -lpthread
diff --git a/eth-multiplexer/multiplexer.c b/eth-multiplexer/multiplexer.c
index c36ab787..cc0024ef 100644
--- a/eth-multiplexer/multiplexer.c
+++ b/eth-multiplexer/multiplexer.c
@@ -39,6 +39,7 @@
#include <device/device.h>
#include <hurd/ports.h>
#include <hurd/netfs.h>
+#include <version.h>
#include "ethernet.h"
#include "vdev.h"
@@ -51,8 +52,8 @@
/* The device which the multiplexer connects to */
static char *device_file;
-const char *argp_program_version = "eth-multiplexer 0.1";
-const char *argp_program_bug_address = "<bug-hurd@gnu.org>";
+const char *argp_program_version = STANDARD_HURD_VERSION (eth-multiplexer);
+
static const char doc[] = "Hurd multiplexer server.";
static const struct argp_option options[] =
{
@@ -78,12 +79,17 @@ static int
multiplexer_demuxer (mach_msg_header_t *inp,
mach_msg_header_t *outp)
{
- int device_server (mach_msg_header_t *, mach_msg_header_t *);
- int notify_server (mach_msg_header_t *, mach_msg_header_t *);
-
- return (device_server (inp, outp)
- || notify_server (inp, outp)
- || ethernet_demuxer (inp, outp));
+ mig_routine_t routine;
+ if ((routine = NULL, ethernet_demuxer (inp, outp)) ||
+ (routine = device_server_routine (inp)) ||
+ (routine = notify_server_routine (inp)))
+ {
+ if (routine)
+ (*routine) (inp, outp);
+ return TRUE;
+ }
+ else
+ return FALSE;
}
static void *
diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c
index bbf54880..0e431a33 100644
--- a/libmachdev/ds_routines.c
+++ b/libmachdev/ds_routines.c
@@ -360,11 +360,15 @@ void mach_device_init()
static int
demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
{
- int ret;
- extern int device_server (mach_msg_header_t *, mach_msg_header_t *);
- extern int notify_server (mach_msg_header_t *, mach_msg_header_t *);
- ret = device_server (inp, outp) || notify_server (inp, outp);
- return ret;
+ mig_routine_t routine;
+ if ((routine = device_server_routine (inp)) ||
+ (routine = notify_server_routine (inp)))
+ {
+ (*routine) (inp, outp);
+ return TRUE;
+ }
+ else
+ return FALSE;
}
void reg_dev_emul (struct device_emulation_ops *ops)
diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c
index 6d5b3ad5..0d7fe24e 100644
--- a/libmachdev/trivfs_server.c
+++ b/libmachdev/trivfs_server.c
@@ -125,12 +125,17 @@ trivfs_goaway (struct trivfs_control *fsys, int flags)
static int
demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
{
- int ret;
- extern int device_server (mach_msg_header_t *, mach_msg_header_t *);
- extern int notify_server (mach_msg_header_t *, mach_msg_header_t *);
- ret = device_server (inp, outp) || notify_server (inp, outp)
- || trivfs_demuxer (inp, outp);
- return ret;
+ mig_routine_t routine;
+ if ((routine = device_server_routine (inp)) ||
+ (routine = notify_server_routine (inp)) ||
+ (routine = NULL, trivfs_demuxer (inp, outp)))
+ {
+ if (routine)
+ (*routine) (inp, outp);
+ return TRUE;
+ }
+ else
+ return FALSE;
}
void