From 5b5839ab88fd7b621f2fe64f838666d428b20538 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sat, 12 Apr 2014 12:22:11 +0200 Subject: sync dde stuff --- eth-filter/Makefile | 1 - eth-filter/filter.c | 34 +++++++++++++++++++++------------- 2 files changed, 21 insertions(+), 14 deletions(-) (limited to 'eth-filter') 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 #include #include +#include #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 = ""; +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, -- cgit v1.2.3