Commit 92a687b9 authored by Sachin Goyal's avatar Sachin Goyal

Added 2 new programs:

1- elvindtest: a simple program to verify if a particular
    elvindserver is up or not

2- evproxy for planetlab nodes. It subscribes
   to the following events:
   host = node's ip addr
   objtype = EVPROXY
   objname = __$nodeid_proxy
   eventtype = UPDATE | CLEAR | RELOAD

   On UPDATE, it adds a new subscription to listen to an
   experiment conveyed by EXPT field of UPDATE message.

   On CLEAR, it removes the subscription for a experiment
   experiment conveyed by EXPT field of CLEAR message.

   On RELOAD, it removes all active experiment subscriptions.

   Also, while it comes up, it sends a RELAOD event to emulab's
   event-server to reload it with all existing experiments:

   host = node's ip addr
   objtype = EVPROXY
   objname = __$nodeid_proxy
   eventtype = RELOAD
parent e60d1d5d
......@@ -10,7 +10,7 @@ OBJDIR = ../..
SUBDIR = event/proxy
SYSTEM := $(shell uname -s)
PROGRAMS = evproxy proxytest
PROGRAMS = evproxy proxytest evproxyplab elvindtest
ifneq ($(SYSTEM),Linux)
PROGRAMS += evproxyclient evproxyserver
......@@ -46,6 +46,7 @@ PFLAGS += `$(ELVIN_CONFIG) --cflags vin4mt`
LDFLAGS += -L$(OBJDIR)/lib -L$(OBJDIR)/lib/libtb -L../lib
LIBS += -levent -ltb -lcrypto
LIBS += `$(ELVIN_CONFIG) --libs vin4c`
CPPC = g++
ifeq ($(host_cpu),arm)
......@@ -81,6 +82,16 @@ proxyserver.o: proxyserver.c
proxytest-debug: proxytest.o $(LIBTBDIR)/log.o
$(CC) $(LDFLAGS) -o $@ proxytest.o $(LIBS)
$(CPPC) $(CFLAGS) -c $<
evproxyplab: evproxyplab.o ../lib/libevent.a ../lib/event.h
$(CPPC) $(LDFLAGS) -o $@ evproxyplab.o $(LIBS)
elvindtest: elvindtest.o
$(CC) $(LDFLAGS) -o $@ elvindtest.o $(LIBS)
$(PROGRAMS): ../lib/libevent.a ../lib/event.h
client: evproxy
* Copyright (c) 2003, 2004 University of Utah and the Flux Group.
* All rights reserved.
#include <stdio.h>
#include <ctype.h>
#include <netdb.h>
#include <unistd.h>
#include <time.h>
#include <math.h>
#include <paths.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "config.h"
#include "event.h"
#include "tbdefs.h"
#include "log.h"
static event_handle_t bosshandle;
usage(char *progname)
fprintf(stderr, "Usage: %s -s server -p port\n", progname);
main(int argc, char **argv)
char *progname;
char *server = NULL;
char *port = NULL;
char buf[BUFSIZ];
int c;
progname = argv[0];
while ((c = getopt(argc, argv, "s:p:")) != -1) {
switch (c) {
case 's':
server = optarg;
case 'p':
port = optarg;
argc -= optind;
argv += optind;
if (argc)
if ((! server) || (!port))
fatal("Must provide server and port");
* Convert server/port to elvin thing.
snprintf(buf, sizeof(buf), "elvin://%s:%s",
server, port);
server = buf;
/* Register with the event system on boss */
bosshandle = event_register_withkeydata_withretry(server, 0, NULL, 0, 0);
if (bosshandle == NULL) {
fatal("could not register with remote event system");
/* Unregister with the remote event system: */
if (event_unregister(bosshandle) == 0) {
fatal("could not unregister with remote event system");
This diff is collapsed.
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