Commit 83ba64ac authored by Leigh B Stoller's avatar Leigh B Stoller

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 11b64785 03d4aa39
......@@ -544,7 +544,7 @@ bool populate_links(DOMElement *root, tb_pgraph &pg, tb_sgraph &sg,
int bandwidth = characteristics.bandwidth;
int latency = characteristics.latency;
int packetLoss = characteristics.packetLoss;
double packetLoss = characteristics.packetLoss;
/*
* Find the nodes in the existing data structures
......
......@@ -18,7 +18,14 @@ ifneq ($(SYSTEM),CYGWIN_NT-5.1)
SUBDIRS += trafgen
endif
ifeq ($(SYSTEM),FreeBSD)
SUBDIRS += sched delay-agent stated
FBSDREL := $(shell uname -r | sed -e 's/\([^-][^-]*\)-.*/\1/')
FBSDMAJ := $(basename $(FBSDREL))
SUBDIRS += sched stated
ifneq ($(FBSDMAJ),8)
# doesn't build right now due to API changes
SUBDIRS += delay-agent
endif
endif
all: etc-subdir trafgen-fetch all-subdirs
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -23,7 +23,7 @@ endif
SYSTEM := $(shell uname -s)
LIBS = libevent.a
SWIGLIBS =
# Re-entrant, multi-threaded version on FreeBSD, not on Linux or Windows clients.
# Re-entrant, multi-threaded version on FreeBSD and Linux, not on Windows.
ifneq ($(SYSTEM),CYGWIN_NT-5.1)
LIBS += libevent_r.a
SWIGLIBS += event.so _tbevent.so
......
......@@ -151,7 +151,9 @@ event_register_withkeydata_withretry(char *name, int threaded,
unsigned char *keydata, int keylen,
int retrycount)
{
#ifndef __CYGWIN__
extern int pubsub_is_threaded[] __attribute__ ((weak));
#endif
event_handle_t handle;
pubsub_handle_t *server;
......@@ -218,11 +220,15 @@ event_register_withkeydata_withretry(char *name, int threaded,
handle->disconnect = pubsub_disconnect;
#ifdef THREADED
assert(threaded == 1);
#ifndef __CYGWIN__
assert(pubsub_is_threaded != NULL);
#endif
handle->mainloop = NULL; /* no mainloop for mt programs */
#else
assert(threaded == 0);
#ifndef __CYGWIN__
assert(pubsub_is_threaded == NULL);
#endif
handle->mainloop = pubsub_mainloop;
#endif
handle->notify = pubsub_notify;
......@@ -1415,7 +1421,7 @@ notify_callback(pubsub_handle_t *server,
handle->keydata &&
event_notification_check_hmac(handle, &notification)) {
ERROR("bad hmac\n");
return;
return;
}
if (0) {
......@@ -1423,7 +1429,8 @@ notify_callback(pubsub_handle_t *server,
gettimeofday(&now, NULL);
INFO("note arrived at %ld:%ld\n", now.tv_sec, now.tv_usec);
INFO("note arrived at %ld:%ld\n",
(long)now.tv_sec, (long)now.tv_usec);
}
callback = arg->callback;
......@@ -1568,13 +1575,27 @@ hmac_fill_hash(void *rock, char *name,
}
#endif
static void
hmac_dump(char *msg, unsigned char *mac, int len)
{
unsigned char *up;
int i;
fprintf(stderr, "%s: ", msg);
up = (unsigned char *)mac;
for (i = 0; i < len; i++, up++) {
fprintf(stderr, "%02hhx", *up);
}
fprintf(stderr, "\n");
}
int
event_notification_insert_hmac(event_handle_t handle,
event_notification_t notification)
{
HMAC_CTX ctx;
unsigned char mac[EVP_MAX_MD_SIZE];
int i, len = EVP_MAX_MD_SIZE;
unsigned int len = EVP_MAX_MD_SIZE;
if (0)
INFO("event_notification_insert_hmac (key): %s\n",
......@@ -1609,21 +1630,15 @@ event_notification_insert_hmac(event_handle_t handle,
HMAC_cleanup(&ctx);
if (0) {
unsigned char *up;
INFO("event_notification_insert_hmac: ");
up = (unsigned char *) mac;
for (i = 0; i < len; i++, up++) {
fprintf(stderr, "%02hhx", *up);
}
fprintf(stderr, "\n");
hmac_dump("event_notification_insert_hmac", mac, len);
}
/*
* Okay, now insert the MAC into the notification as an opaque field.
*/
if (pubsub_notification_add_opaque(notification->pubsub_notification,
"__hmac__", mac, len, &handle->status) != 0) {
"__hmac__", (char *)mac, (int)len,
&handle->status) != 0) {
ERROR("pubsub_notification_add_opaque failed: ");
pubsub_error_fprintf(stderr, &handle->status);
return 1;
......@@ -1713,8 +1728,8 @@ event_notification_check_hmac(event_handle_t handle,
HMAC_CTX ctx;
unsigned char srcmac[EVP_MAX_MD_SIZE], mac[EVP_MAX_MD_SIZE];
char *pmac;
int i, srclen, len = EVP_MAX_MD_SIZE;
int tmp, elvin, elvin_ordered;
unsigned int srclen, len = EVP_MAX_MD_SIZE;
int tmp, elvin, elvincompat, elvin_ordered;
pubsub_notification_t *pubsub_notification;
#ifdef ELVIN_COMPAT
struct elvin_hashtable *hashtable;
......@@ -1729,7 +1744,8 @@ event_notification_check_hmac(event_handle_t handle,
* Pull out the MAC from the notification so we can compare it.
*/
if (pubsub_notification_get_opaque(pubsub_notification,
"__hmac__", &pmac, &srclen, &handle->status) != 0) {
"__hmac__", &pmac, (int *)&srclen,
&handle->status) != 0) {
ERROR("MAC not present!\n");
notification->has_hmac = 0;
return -1;
......@@ -1738,14 +1754,8 @@ event_notification_check_hmac(event_handle_t handle,
memcpy(srcmac, pmac, srclen);
if (0) {
unsigned char *up;
INFO("event_notification_check_hmac __hmac__: ");
up = (unsigned char *) srcmac;
for (i = 0; i < srclen; i++, up++) {
fprintf(stderr, "%02hhx", *up);
}
fprintf(stderr, "\n");
hmac_dump("event_notification_check_hmac (__hmac__)",
srcmac, srclen);
}
/*
......@@ -1753,7 +1763,10 @@ event_notification_check_hmac(event_handle_t handle,
* client. These would always be a version 0 version of this
* code since we do not generate the elvin HMACs anymore.
*/
elvin = elvin_ordered = 0;
elvin = elvincompat = elvin_ordered = 0;
#ifdef ELVIN_COMPAT
elvincompat = 1;
#endif
if (! pubsub_notification_get_int32(pubsub_notification,
"___PUBSUB___",
......@@ -1814,14 +1827,8 @@ event_notification_check_hmac(event_handle_t handle,
HMAC_cleanup(&ctx);
if (0) {
unsigned char *up;
INFO("event_notification_check_hmac (elvin): ");
up = (unsigned char *) mac;
for (i = 0; i < len; i++, up++) {
fprintf(stderr, "%02hhx", *up);
}
fprintf(stderr, "\n");
hmac_dump("event_notification_check_hmac (elvin)",
mac, len);
}
goto docmp;
}
......@@ -1848,21 +1855,37 @@ event_notification_check_hmac(event_handle_t handle,
HMAC_cleanup(&ctx);
if (0) {
unsigned char *up;
INFO("event_notification_check_hmac plain: ");
up = (unsigned char *) mac;
for (i = 0; i < len; i++, up++) {
fprintf(stderr, "%02hhx", *up);
}
fprintf(stderr, "\n");
hmac_dump("event_notification_check_hmac (plain)", mac, len);
}
#ifdef ELVIN_COMPAT
docmp:
#endif
if (srclen == len && memcmp(srcmac, mac, len) == 0) {
notification->has_hmac = 1;
return 0;
}
ERROR("MAC mismatch! elvin=%d, ordered=%d\n", elvin, elvin_ordered);
ERROR("MAC mismatch! myelvincompat=%d, elvin=%d, ordered=%d\n",
elvincompat, elvin, elvin_ordered);
if (1) {
char _obj[128];
char _evt[128];
char _args[1024];
if (!event_notification_get_objname(handle, notification,
_obj, sizeof(_obj)))
strncpy(_obj, "<UNKNOWN>", sizeof(_obj));
if (!event_notification_get_eventtype(handle, notification,
_evt, sizeof(_evt)))
strncpy(_evt, "<UNKNOWN>", sizeof(_evt));
event_notification_get_arguments(handle, notification,
_args, sizeof(_args));
fprintf(stderr,
" object=%s, event=%s, args=%s\n", _obj, _evt, _args);
if (0) {
hmac_dump(" inmsg", srcmac, srclen);
hmac_dump(" computed", mac, len);
}
}
return 1;
}
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -117,8 +117,8 @@ control-install: binaries $(SCRIPT_RUN) $(SCRIPT_PROXY)
$(INSTALL_PROGRAM) $(SCRIPT_PROXY) $(INSTALL_BINDIR)
client: all
$(MAKE) -C iperf client
$(MAKE) -C rude client
cd iperf && $(MAKE) client
cd rude && $(MAKE) client
client-install: client
@if test ! -x '$(CLIENT_BINDIR)/emulab-rude$(EXE)' -o \
......
......@@ -100,7 +100,7 @@ control-install: $(INSTALL_SBINDIR)/version0_gateway
install: $(INSTALL_DIR)/opsdir/sbin/version0_gateway
client: evproxy$(EXE) evproxyplab$(EXE)
client: evproxy evproxyplab
client-install: client
$(INSTALL_PROGRAM) evproxy$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/evproxy$(EXE)
$(INSTALL_PROGRAM) evproxyplab$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/evproxy_shared$(EXE)
......
......@@ -29,7 +29,7 @@ TIP_SCRIPTS =
ifeq ($(SYSTEM),FreeBSD)
FBSDVERSION := $(shell uname -v | sed -e 's/FreeBSD \([0-9]\).*/FreeBSD\1/')
ifeq ($(FBSDVERSION),FreeBSD6)
ifneq ($(FBSDVERSION),FreeBSD4)
ifeq ($(WINSUPPORT),1)
OPS_SCRIPTS += silly.sh
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment