Index: examples/arping/main.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/examples/arping/main.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- examples/arping/main.c 15 Mar 2006 15:15:36 -0000 1.22 +++ examples/arping/main.c 30 Jun 2006 14:22:21 -0000 1.23 @@ -28,6 +28,7 @@ /* configuration */ static int arping_verbose = 0; // verbose static int recv_broadcast = 0; // recv broadcast packets +static char *ore_name = NULL; //static int send_dsi = 0; // send through dsi //static int recv_dsi = 0; // receive through dsi @@ -188,12 +189,14 @@ LOG("Hello from the ORe arping shared memory client"); if (parse_cmdline(&argc, &argv, + 'b', "broadcast", "receive broadcast packets", + PARSE_CMD_SWITCH, 1, &recv_broadcast, 'e', "exit", "exit after some pings", PARSE_CMD_SWITCH, 1, &exit_somewhen, + 'o', "orename", "name of ORe instance to connect to", + PARSE_CMD_STRING, "ORe", &ore_name, 'v', "verbose", "verbose output", PARSE_CMD_SWITCH, 1, &arping_verbose, - 'b', "broadcast", "receive broadcast packets", - PARSE_CMD_SWITCH, 1, &recv_broadcast, // 's', "senddsi", "send packets via dsi", // PARSE_CMD_SWITCH, 1, &send_dsi, // 'r', "recvdsi", "receive packets via dsi", @@ -201,6 +204,14 @@ 0,0)) return 1; + if (ore_name) + { + LOG("connecting to '%s'", ore_name); + strcpy(ore_conf.ro_orename, ore_name); + } + else + LOG("connecting to 'ORe'"); + if (recv_broadcast) ore_conf.rw_broadcast = 1; #if 0 @@ -233,7 +244,7 @@ #endif LOG("sending with string ipc"); - + handle = l4ore_open("eth0", mac, &ore_conf); LOG("opened eth0: %d for %02X:%02X:%02X:%02X:%02X:%02X", handle, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); Index: examples/debug/main.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/examples/debug/main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- examples/debug/main.c 25 Sep 2005 20:38:30 -0000 1.1 +++ examples/debug/main.c 30 Jun 2006 14:22:21 -0000 1.2 @@ -16,6 +16,8 @@ int main(int argc, char **argv) { + l4ore_config c = L4ORE_DEFAULT_CONFIG; + strncpy(c.ro_orename, "ORe", 3); if (argc > 1) { @@ -25,7 +27,7 @@ printf("Setting debug level to %d\n", debug); - l4ore_debug(debug); + l4ore_debug(&c, debug); return 0; } Index: examples/log_ore/server.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/examples/log_ore/server.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- examples/log_ore/server.c 7 Apr 2006 08:21:00 -0000 1.2 +++ examples/log_ore/server.c 30 Jun 2006 08:28:55 -0000 1.3 @@ -232,7 +232,8 @@ strcpy(conf.ip, ip_addr); conf.port_nr = port_nr; - ret = l4thread_create(uip_ore_thread, &conf, L4THREAD_CREATE_SYNC); + uip_ore_initialize(&conf); + ret = l4thread_create(uip_ore_thread, NULL, L4THREAD_CREATE_SYNC); outstring("log_ore initialized\n"); Index: idl/Makefile =================================================================== RCS file: /home/cvs/l4/pkg/ore/idl/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- idl/Makefile 15 Mar 2006 15:15:46 -0000 1.5 +++ idl/Makefile 13 Jul 2006 07:19:41 -0000 @@ -13,18 +13,18 @@ # the default idl type is DCE/dice. Uncomment the next line to change this. # IDL_TYPE= -LIBDIR = $(L4DIR)/lib/x86_586 \ - $(L4DIR)/lib +LIBDIR = $(O)/lib/x86_586 \ + $(O)/lib TRACELIB = $(call findfile,libdice_trace.s.so,$(LIBDIR)) IDL_FLAGS = -t #-ftrace-lib=$(TRACELIB) -ftrace-server ifneq ($(SENSOR),) -LIBDIR = $(L4DIR)/lib/x86_586 \ - $(L4DIR)/lib +LIBDIR = $(O)/lib/x86_586 \ + $(O)/lib TRACELIB = $(call findfile,libdice_trace.s.so,$(LIBDIR)) IDL_FLAGS += -ftrace-lib=$(TRACELIB) --eventname=ORE \ -ftrace-server -ftrace-client \ - --sensorname=DICE --cflow --maxpar=10#--benchmark + --sensorname=FERRET_DICE --cflow endif include $(L4DIR)/mk/idl.mk Index: include/ore-types.h =================================================================== RCS file: /home/cvs/l4/pkg/ore/include/ore-types.h,v retrieving revision 1.10 retrieving revision 1.12 diff -u -r1.10 -r1.12 --- include/ore-types.h 27 Apr 2006 13:17:41 -0000 1.10 +++ include/ore-types.h 5 Jul 2006 07:55:13 -0000 1.12 @@ -33,6 +33,7 @@ l4dm_dataspace_t ro_recv_ctl_ds; //!< receive control area (DSI) dsi_socket_ref_t ro_recv_client_socketref; //!< the client's socket for receiving packets dsi_socket_ref_t ro_recv_ore_socketref; //!< ORe's socket for incoming packets + char ro_orename[16]; //!< name of the ORe instance we connect to } l4ore_config; #define LOG_CONFIG(conf) { \ @@ -50,6 +51,7 @@ LOG("conf->send_ore_socket = %d", (conf).ro_send_ore_socketref.socket); \ LOG("conf->recv_client_socket = %d", (conf).ro_recv_client_socketref.socket); \ LOG("conf->recv_ore_socket = %d", (conf).ro_recv_ore_socketref.socket); \ + LOG("conf->orename = %s", (conf).ro_orename); \ } #define LOG_SOCKETREF(s) \ @@ -79,7 +81,8 @@ {-1, L4_INVALID_ID, L4_INVALID_ID, L4_INVALID_ID}, \ L4DM_INVALID_DATASPACE, L4DM_INVALID_DATASPACE, \ {-1, L4_INVALID_ID, L4_INVALID_ID, L4_INVALID_ID}, \ - {-1, L4_INVALID_ID, L4_INVALID_ID, L4_INVALID_ID} \ + {-1, L4_INVALID_ID, L4_INVALID_ID, L4_INVALID_ID}, \ + {'O', 'R', 'e', 0, 0, 0, 0, 0, 0, 0}, \ } #define L4ORE_INVALID_INITIALIZER { -1,-1,-1,-1,-1,-1, \ @@ -88,7 +91,8 @@ {-1, L4_INVALID_ID, L4_INVALID_ID, L4_INVALID_ID}, \ L4DM_INVALID_DATASPACE, L4DM_INVALID_DATASPACE, \ {-1, L4_INVALID_ID, L4_INVALID_ID, L4_INVALID_ID}, \ - {-1, L4_INVALID_ID, L4_INVALID_ID, L4_INVALID_ID} \ + {-1, L4_INVALID_ID, L4_INVALID_ID, L4_INVALID_ID}, \ + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \ } #define L4ORE_DEFAULT_CONFIG ((l4ore_config)L4ORE_DEFAULT_INITIALIZER) Index: include/ore.h =================================================================== RCS file: /home/cvs/l4/pkg/ore/include/ore.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- include/ore.h 27 Apr 2006 12:58:41 -0000 1.15 +++ include/ore.h 30 Jun 2006 14:22:23 -0000 1.16 @@ -89,9 +89,10 @@ /*!\brief Set/unset debugging. * \ingroup debug * + * \param conf config data * \param flag Debugging flag. */ -void l4ore_debug(int flag); +void l4ore_debug(l4ore_config *conf, int flag); /*!\brief Get address of the send dataspace. * \ingroup sharedmem Index: lib/client/close.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/lib/client/close.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- lib/client/close.c 9 Mar 2006 20:56:03 -0000 1.5 +++ lib/client/close.c 5 Jul 2006 15:33:07 -0000 1.6 @@ -11,7 +11,8 @@ _dice_corba_env.free = (dice_free_func)free; l4ore_handle_t channel = descriptor_table[handle].remote_worker_thread; - ore_manager_close_call(&ore_server, &channel, &_dice_corba_env); + ore_manager_close_call(&descriptor_table[handle].remote_manager_thread, + &channel, &_dice_corba_env); // TODO: dispose dataspaces ? } Index: lib/client/debug.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/lib/client/debug.c,v retrieving revision 1.6 retrieving revision 1.8 diff -u -r1.6 -r1.8 --- lib/client/debug.c 9 Mar 2006 20:56:03 -0000 1.6 +++ lib/client/debug.c 5 Jul 2006 15:33:07 -0000 1.8 @@ -1,20 +1,31 @@ #include "local.h" +#include // evil: call configure() with invalid channel number. this // will only change the debug state -void l4ore_debug(int flag) +void l4ore_debug(l4ore_config *c, int flag) { DICE_DECLARE_ENV(env); l4ore_handle_t handle = L4_INVALID_ID; l4ore_config conf; + l4_threadid_t server_id; + env.malloc = (dice_malloc_func)malloc; env.free = (dice_free_func)free; conf.rw_debug = flag; - if (ore_lookup_server()) - return; + if (strlen(c->ro_orename) == 0) + strcpy(conf.ro_orename, c->ro_orename); + else + strcpy(conf.ro_orename, "ORe"); + + if (ore_lookup_server(c->ro_orename, &server_id)) + { + LOG("could not lookup server %s\n", c->ro_orename); + return; + } - ore_manager_configure_call(&ore_server, &handle, &conf, &conf, &env); + ore_manager_configure_call(&server_id, &handle, &conf, &conf, &env); } l4ore_config l4ore_get_config(int channel) @@ -23,12 +34,12 @@ l4ore_config conf; l4ore_config inval = L4ORE_INVALID_CONFIG; l4ore_handle_t handle = descriptor_table[channel].remote_worker_thread; + l4_threadid_t ore_server = descriptor_table[channel].remote_manager_thread; env.malloc = (dice_malloc_func)malloc; env.free = (dice_free_func)free; - if (l4_thread_equal(ore_server, L4_INVALID_ID)) + if (l4_is_invalid_id(handle)) return L4ORE_INVALID_CONFIG; - ore_manager_configure_call(&ore_server, &handle, &inval, &conf, &env); @@ -40,6 +51,7 @@ DICE_DECLARE_ENV(env); l4ore_config old; l4ore_handle_t handle = descriptor_table[channel].remote_worker_thread; + l4_threadid_t ore_server = descriptor_table[channel].remote_manager_thread; env.malloc = (dice_malloc_func)malloc; env.free = (dice_free_func)free; Index: lib/client/dsi.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/lib/client/dsi.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- lib/client/dsi.c 12 Dec 2005 08:14:11 -0000 1.6 +++ lib/client/dsi.c 5 Jul 2006 15:33:07 -0000 1.7 @@ -49,7 +49,7 @@ } /* create DSI connection for sending data */ -int __l4ore_init_send_socket(l4ore_config *conf, dsi_socket_t **sock, void **addr) +int __l4ore_init_send_socket(l4ore_handle_t server, l4ore_config *conf, dsi_socket_t **sock, void **addr) { dsi_jcp_stream_t jcp; dsi_stream_cfg_t cfg; @@ -102,8 +102,9 @@ LOG_SOCKETREF(&conf->ro_send_client_socketref); + // XXX: broken - need to locally lookup the ORe server here // share dataspaces and socket with ORe - ret = dsi_socket_share_ds(*sock, ore_server); + ret = dsi_socket_share_ds(*sock, server); LOG("socket_share_ds: %d", ret); if (ret) { @@ -111,7 +112,7 @@ return ret; } - ret = l4dm_share(&conf->ro_send_ctl_ds, ore_server, L4DM_RW); + ret = l4dm_share(&conf->ro_send_ctl_ds, server, L4DM_RW); LOG("share ctl_ds: %d", ret); if (ret) { @@ -120,7 +121,7 @@ return ret; } - ret = l4dm_share(&conf->ro_send_ds, ore_server, L4DM_RW); + ret = l4dm_share(&conf->ro_send_ds, server, L4DM_RW); LOG("share send_ds: %d", ret); if (ret) { @@ -132,7 +133,7 @@ return 0; } -int __l4ore_init_recv_socket(l4ore_config *conf, dsi_socket_t **sock, void **addr) +int __l4ore_init_recv_socket(l4ore_handle_t server, l4ore_config *conf, dsi_socket_t **sock, void **addr) { dsi_jcp_stream_t jcp; dsi_stream_cfg_t cfg; @@ -186,7 +187,7 @@ LOG_SOCKETREF(&conf->ro_recv_client_socketref); // share dataspaces and socket with ORe - ret = dsi_socket_share_ds(*sock, ore_server); + ret = dsi_socket_share_ds(*sock, server); LOG("socket_share_ds: %d", ret); if (ret) { @@ -194,7 +195,7 @@ return ret; } - ret = l4dm_share(&conf->ro_recv_ctl_ds, ore_server, L4DM_RW); + ret = l4dm_share(&conf->ro_recv_ctl_ds, server, L4DM_RW); LOG("share ctl_ds: %d", ret); if (ret) { @@ -203,7 +204,7 @@ return ret; } - ret = l4dm_share(&conf->ro_recv_ds, ore_server, L4DM_RW); + ret = l4dm_share(&conf->ro_recv_ds, server, L4DM_RW); LOG("share send_ds: %d", ret); if (ret) { Index: lib/client/dummy_dsi.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/lib/client/dummy_dsi.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- lib/client/dummy_dsi.c 15 Mar 2006 15:15:49 -0000 1.1 +++ lib/client/dummy_dsi.c 5 Jul 2006 15:33:07 -0000 1.2 @@ -10,12 +10,12 @@ } /* create DSI connection for sending data */ -int __l4ore_init_send_socket(l4ore_config *conf, dsi_socket_t **sock, void **addr) +int __l4ore_init_send_socket(l4ore_handle_t server, l4ore_config *conf, dsi_socket_t **sock, void **addr) { return -1; } -int __l4ore_init_recv_socket(l4ore_config *conf, dsi_socket_t **sock, void **addr) +int __l4ore_init_recv_socket(l4ore_handle_t server, l4ore_config *conf, dsi_socket_t **sock, void **addr) { return -1; } Index: lib/client/lib.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/lib/client/lib.c,v retrieving revision 1.16 retrieving revision 1.20 diff -u -r1.16 -r1.20 --- lib/client/lib.c 15 Mar 2006 15:15:49 -0000 1.16 +++ lib/client/lib.c 5 Jul 2006 15:33:07 -0000 1.20 @@ -8,7 +8,7 @@ static int get_free_descriptor(void); static void release_descriptor(int idx); -static void ore_initialize(void); +static int ore_initialize(void); // find the first free connection static int get_free_descriptor(void) @@ -16,8 +16,7 @@ int i=0; do { - if (l4_thread_equal(descriptor_table[i].remote_worker_thread, - L4_INVALID_ID)) + if (l4_is_invalid_id(descriptor_table[i].remote_worker_thread)) return i; } while (++i < CONN_MAX); @@ -32,7 +31,7 @@ } // initialize library -static void ore_initialize(void) +static int ore_initialize(void) { int i=0; @@ -46,9 +45,8 @@ LOG("dsi_init: %d", dsi_init()); #endif - ore_lookup_server(); - ore_initialized = 1; + return 0; } int l4ore_recv_blocking(int handle, char **buf, l4_size_t *size, l4_timeout_t timeout) @@ -73,7 +71,7 @@ { l4ore_handle_t ret; - int desc; + int desc, err = 0; #ifdef ORE_DSI dsi_socket_t *send = NULL; dsi_socket_t *receive = NULL; @@ -81,9 +79,17 @@ LOG_Enter(); + if (!conf) + { + LOG_Error("invalid connection configuration"); + return -L4_EINVAL; + } + // singleton: initialize library if (!ore_initialized) - ore_initialize(); + err = ore_initialize(); + if (err) + return -L4_EINVAL; desc = get_free_descriptor(); LOG("descriptor: %d", desc); @@ -95,6 +101,15 @@ return -L4_ENOMEM; } + // make sure, we have a name for ORe, fallback is always "ORe" + if (strlen(conf->ro_orename) == 0) + strncpy(conf->ro_orename, "ORe", sizeof(conf->ro_orename)-1); + if (ore_lookup_server(conf->ro_orename, &descriptor_table[desc].remote_manager_thread)) + { + release_descriptor(desc); + return -1; + } + #ifdef ORE_DSI // sending via string IPC if (l4dm_is_invalid_ds(conf->ro_send_ds)) @@ -107,7 +122,8 @@ { LOG("sending via dataspace"); descriptor_table[desc].send_func = ore_send_dsi; - __l4ore_init_send_socket(conf, &send, &descriptor_table[desc].send_addr); + __l4ore_init_send_socket(descriptor_table[desc].remote_manager_thread, + conf, &send, &descriptor_table[desc].send_addr); } // receiving via string IPC @@ -123,7 +139,8 @@ LOG("receiving via dataspace"); descriptor_table[desc].rx_func_blocking = ore_recv_dsi_blocking; descriptor_table[desc].rx_func_nonblocking = ore_recv_dsi_nonblocking; - __l4ore_init_recv_socket(conf, &receive, &descriptor_table[desc].recv_addr); + __l4ore_init_recv_socket(descriptor_table[desc].remote_manager_thread, + conf, &receive, &descriptor_table[desc].recv_addr); } descriptor_table[desc].local_send_socket = send; @@ -134,15 +151,16 @@ descriptor_table[desc].send_func = ore_send_string; #endif - ret = ore_do_open(device, mac, conf); + ret = ore_do_open(desc, device, mac, conf); // return reason of failed open() - if (l4_thread_equal(ret, L4_INVALID_ID)) + if (l4_is_invalid_id(ret)) { #ifdef ORE_DSI if (l4dm_is_invalid_ds(conf->ro_send_ds) || l4dm_is_invalid_ds(conf->ro_recv_ds)) { LOG_Error("ore_open() returned INVALID_ID"); + release_descriptor(desc); return -1; } else @@ -188,18 +206,15 @@ ore_do_close(handle); } -int ore_lookup_server(void) +int ore_lookup_server(char *orename, l4ore_handle_t *manager) { - // lookup ORe if necessary - if (l4_is_invalid_id(ore_server)) + if (!names_waitfor_name(orename, manager, 10000)) { - if (!names_waitfor_name("ORe", &ore_server, 10000)) - { - LOG("Could not find ORe server, aborting."); - return -1; - } - LOG("ORe = "l4util_idfmt, l4util_idstr(ore_server)); + LOG("Could not find ORe server '%s', aborting.", orename); + return -1; } + LOG("ORe server %s = "l4util_idfmt, orename, l4util_idstr(*manager)); + return 0; } Index: lib/client/local.h =================================================================== RCS file: /home/cvs/l4/pkg/ore/lib/client/local.h,v retrieving revision 1.13 retrieving revision 1.15 diff -u -r1.13 -r1.15 --- lib/client/local.h 22 Mar 2006 13:52:57 -0000 1.13 +++ lib/client/local.h 5 Jul 2006 15:33:07 -0000 1.15 @@ -13,13 +13,11 @@ #include "ore_rxtx-client.h" #include "ore_manager-client.h" -// someone needs to store who ORe is -extern l4_threadid_t ore_server; - // maximum no. of connections one client may have #define CONN_MAX 8 typedef struct ore_client_conn_desc{ + l4ore_handle_t remote_manager_thread; // manager of the remote ORe instance l4ore_handle_t remote_worker_thread; // ORe worker dsi_socket_t *local_send_socket; // DSI send socket dsi_socket_t *local_recv_socket; // DSI rx socket @@ -33,8 +31,9 @@ extern ore_client_conn_desc descriptor_table[CONN_MAX]; extern int ore_initialized; -int ore_lookup_server(void); -l4ore_handle_t ore_do_open(const char *dev, unsigned char mac[6], l4ore_config *flags); +int ore_lookup_server(char *orename, l4ore_handle_t *manager); +l4ore_handle_t ore_do_open(int handle, const char *dev, + unsigned char mac[6], l4ore_config *flags); // string ipc functions int ore_send_string(l4ore_handle_t channel, int handle, char *data, l4_size_t size); @@ -46,8 +45,8 @@ int ore_recv_dsi_blocking(l4ore_handle_t channel, int handle, char **data, l4_size_t *size, l4_timeout_t); int ore_recv_dsi_nonblocking(l4ore_handle_t channel, int handle, char **data, l4_size_t *size); -int __l4ore_init_send_socket(l4ore_config *conf, dsi_socket_t **, void **); -int __l4ore_init_recv_socket(l4ore_config *conf, dsi_socket_t **, void **); +int __l4ore_init_send_socket(l4ore_handle_t, l4ore_config *conf, dsi_socket_t **, void **); +int __l4ore_init_recv_socket(l4ore_handle_t, l4ore_config *conf, dsi_socket_t **, void **); void __l4ore_remember_packet(dsi_socket_t *, dsi_packet_t *, void *, l4_size_t); void ore_do_close(int handle); Index: lib/client/open.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/lib/client/open.c,v retrieving revision 1.10 retrieving revision 1.12 diff -u -r1.10 -r1.12 --- lib/client/open.c 9 Mar 2006 20:56:03 -0000 1.10 +++ lib/client/open.c 5 Jul 2006 15:33:07 -0000 1.12 @@ -2,10 +2,10 @@ #include #include "local.h" -l4_threadid_t ore_server = L4_INVALID_ID; - -// perform open actions -l4ore_handle_t ore_do_open(const char *dev, unsigned char mac[6], +// perform open +l4ore_handle_t ore_do_open(int handle, + const char *dev, + unsigned char mac[6], l4ore_config *conf) { DICE_DECLARE_ENV(_dice_corba_env); @@ -32,12 +32,9 @@ else _conf = *conf; - if (ore_lookup_server()) - return L4_INVALID_ID; - // open() - ret = ore_manager_open_call(&ore_server, dev, mac, &_conf, - &_dice_corba_env); + ret = ore_manager_open_call(&descriptor_table[handle].remote_manager_thread, + dev, mac, &_conf, &_dice_corba_env); LOG("opened. worker = "l4util_idfmt, l4util_idstr(ret)); Index: server/idl/Makefile =================================================================== RCS file: /home/cvs/l4/pkg/ore/server/idl/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- server/idl/Makefile 15 Mar 2006 15:15:54 -0000 1.4 +++ server/idl/Makefile 13 Jul 2006 07:19:41 -0000 @@ -14,12 +14,12 @@ IDL_FLAGS = -t ifneq ($(SENSOR),) -LIBDIR = $(L4DIR)/lib/x86_586 \ - $(L4DIR)/lib +LIBDIR = $(O)/lib/x86_586 \ + $(O)/lib TRACELIB = $(call findfile,libdice_trace.s.so,$(LIBDIR)) IDL_FLAGS += -ftrace-lib=$(TRACELIB) --eventname=ORE_WORKER \ -ftrace-server -ftrace-client \ - --sensorname=DICE --cflow --maxpar=10 #--benchmark + --sensorname=FERRET_DICE --cflow endif include $(L4DIR)/mk/idl.mk Index: server/lib/linuxemul/emul.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/server/lib/linuxemul/emul.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- server/lib/linuxemul/emul.c 13 Oct 2005 16:25:39 -0000 1.9 +++ server/lib/linuxemul/emul.c 5 Jul 2006 15:33:07 -0000 1.10 @@ -9,6 +9,7 @@ #include extern int net_dev_init(void); +extern int loopback_only; int init_emulation(long memsize) { @@ -83,7 +84,8 @@ net_dev_init(); - l4dde_do_initcalls(); + if (!loopback_only) + l4dde_do_initcalls(); return 0; } Index: server/src/main.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/server/src/main.c,v retrieving revision 1.21 diff -u -r1.21 main.c --- server/src/main.c 15 Mar 2006 15:16:07 -0000 1.21 +++ server/src/main.c 13 Jul 2006 07:19:41 -0000 @@ -22,12 +22,13 @@ #include "ore-local.h" -static const char *_oreName = "ORe"; +static char *_oreName = "ORe"; /* MAC addresses are by default 04:EA:xx:xx:xx:xx; where xx is a checksum * over real MAC and ORe handle * FIXME no global vars, please */ unsigned char global_mac_address_head[4] = { 0x00, 0x00, 0x00, 0x00}; static int use_events; +int loopback_only = 0; ore_connection_t ore_connection_table[ORE_CONFIG_MAX_CONNECTIONS]; l4_threadid_t ore_main_server = L4_INVALID_ID; @@ -89,6 +90,11 @@ global_mac_address_head[2] = (unsigned char)(tmp >> 8 & 0xff); global_mac_address_head[1] = (unsigned char)(tmp >> 16 & 0xff); global_mac_address_head[0] = (unsigned char)(tmp >> 24 & 0xff); + + LOG("global address head: %X:%X:%X:%X", global_mac_address_head[0], + global_mac_address_head[1], + global_mac_address_head[2], + global_mac_address_head[3]); } /* Basic initialization. */ @@ -105,12 +111,16 @@ // (1) it is shorter and better to read than getopt_long() // (2) it provides a help screen if the binary is called with --help if (parse_cmdline(&argc, &argv, - 'm', "mac", "mac address", - PARSE_CMD_FN_ARG, 0, ©_mac, - 'e', "events", "use events to detect broken connections", - PARSE_CMD_SWITCH, 1, &use_events, 'd', "debug", "debug on", PARSE_CMD_SWITCH, 1, &ore_debug, + 'e', "events", "use events to detect broken connections", + PARSE_CMD_SWITCH, 1, &use_events, + 'l', "loopback-only", "use only a loopback device", + PARSE_CMD_SWITCH, 1, &loopback_only, + 'm', "mac", "mac address", + PARSE_CMD_FN_ARG, 0, ©_mac, + 'n', "name", "configure server name", + PARSE_CMD_STRING, "ORe", &_oreName, 0, 0)) return 1; @@ -125,6 +135,7 @@ ret = init_emulation(ORE_LINUXEMUL_MEMSIZE); LOGd(ORE_DEBUG_INIT, "init_emulation: %d (%s)", ret, l4env_strerror(-ret)); + LOG("loopback: %d", loopback_only); // initialize network devices ret = open_network_devices(); LOG("Initialized %d network devices.", ret); @@ -135,7 +146,7 @@ init_connection_table(); // register - LOG("Registering at names..."); + LOG("Registering '%s' at names...", _oreName); ret = names_register(_oreName); if (!ret) LOG_Error("Could not register at names."); Index: server/src/ore-local.h =================================================================== RCS file: /home/cvs/l4/pkg/ore/server/src/ore-local.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- server/src/ore-local.h 9 Mar 2006 20:56:40 -0000 1.21 +++ server/src/ore-local.h 5 Jul 2006 15:33:07 -0000 1.22 @@ -105,6 +105,8 @@ extern l4_threadid_t ore_main_server; /* local storage key for a worker thread's channel id */ extern int __l4ore_tls_id_key; +/* set to 1 if we only want to use the loopback device */ +extern int loopback_only; /* Connection handling */ void init_connection_table(void); // initialize conn table Index: server/src/rxtx_string.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/server/src/rxtx_string.c,v retrieving revision 1.35 diff -u -r1.35 rxtx_string.c --- server/src/rxtx_string.c 12 Jun 2006 09:58:20 -0000 1.35 +++ server/src/rxtx_string.c 13 Jul 2006 07:19:41 -0000 @@ -202,7 +202,7 @@ ent->in_dataspace = 0; LOGd(ORE_DEBUG_PACKET, "skb = %p", skb); - LOG_MAC_s(ORE_DEBUG_PACKET_SEND, "packet for:", skb->data); + LOG_MAC_s(ORE_DEBUG_PACKET_SEND, "packet for:", buf); // fill the skb with all data necessary for sending, memcpy(skb->data, buf, size); Index: server/src/send.c =================================================================== RCS file: /home/cvs/l4/pkg/ore/server/src/send.c,v retrieving revision 1.14 diff -u -r1.14 send.c --- server/src/send.c 18 Nov 2005 15:19:12 -0000 1.14 +++ server/src/send.c 13 Jul 2006 07:19:41 -0000 @@ -25,6 +25,7 @@ int channel = *(int *)l4thread_data_get_current(__l4ore_tls_id_key); LOGd(ORE_DEBUG_COMPONENTS, "send on channel %d", channel); + LOG_MAC(ORE_DEBUG_COMPONENTS, buf); ret = sanity_check_rxtx(channel, *_dice_corba_obj); if (ret < 0)