Skip to content
Snippets Groups Projects
Commit 35c790eb authored by Mike Hibler's avatar Mike Hibler
Browse files

First attempt to make it work with new pubsub system.

parent e5f9f7e1
No related branches found
No related tags found
No related merge requests found
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -11,6 +11,14 @@ SUBDIR = event/lib
include $(OBJDIR)/Makeconf
PUBSUBFLAGS = -I$(SRCDIR)/../../pubsub
PUBSUBMTFLAGS = -I$(SRCDIR)/../../pubsub
PUBSUBLIB = -L../../pubsub -lpubsub
#PUBSUBFLAGS = `$(ELVIN_CONFIG) --cflags vin4c`
#PUBSUBMTFLAGS = `$(ELVIN_CONFIG) --cflags vin4mt`
#PUBSUBLIB = `$(ELVIN_CONFIG) --libs vin4c`
SYSTEM := $(shell uname -s)
LIBS = libevent.a
SWIGLIBS =
......@@ -30,11 +38,10 @@ PERLVERS := $(shell $(SRCDIR)/perlvers.pl)
#CFLAGS += -DDEBUG
CFLAGS += -O2 -g -static -I. -Wall
SCFLAGS = $(CFLAGS) `$(ELVIN_CONFIG) --cflags vin4c`
TCFLAGS = $(CFLAGS) `$(ELVIN_CONFIG) --cflags vin4mt`
SCFLAGS = $(CFLAGS) $(PUBSUBFLAGS)
TCFLAGS = $(CFLAGS) $(PUBSUBMTFLAGS)
# Special CFLAGS w/o warnings, for SWIG-generated code
CFLAGS_NOWARN += -O2 -g -static -I.
CFLAGS_NOWARN += `$(ELVIN_CONFIG) --cflags vin4c`
CFLAGS_NOWARN += -O2 -g -static -I. $(PUBSUBFLAGS)
ifeq ($(SYSTEM),Linux)
PCORE = -I/usr/lib/perl5/5.6.1/i386-linux/CORE
PCORE += -I/usr/lib/perl5/5.8.3/i386-linux-thread-multi/CORE
......@@ -113,10 +120,10 @@ event_wrap_py.o: $(SRCDIR)/event_wrap_py.c event.h
$(CC) -c $(CFLAGS_NOWARN) $(PYCORE) $<
event.so: event.o event_wrap.o util.o
ld -shared $^ `$(ELVIN_CONFIG) --libs vin4c` -lcrypto -o event.so
ld -shared $^ $(PUBSUBLIB) -lcrypto -o event.so
_tbevent.so: event.o event_wrap_py.o util.o
ld -shared $^ `$(ELVIN_CONFIG) --libs vin4c` -lcrypto -o $@
ld -shared $^ $(PUBSUBLIB) -lcrypto -o $@
LIB_STUFF = event.pm event.so tbevent.py _tbevent.so
......
This diff is collapsed.
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2006 University of Utah and the Flux Group.
* Copyright (c) 2000-2007 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -16,7 +16,8 @@
#include <stdio.h>
#include <stdarg.h>
#include <elvin/elvin.h>
#include <stdlib.h>
#include <pubsub.h>
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
......@@ -28,40 +29,38 @@ extern "C" {
/* Handle to the event server: */
struct event_handle {
elvin_handle_t server;
elvin_error_t status;
pubsub_handle_t *server;
pubsub_error_t status;
unsigned char *keydata;
int keylen;
int do_loop;
/* API function pointers: */
elvin_error_t (*init)(void);
int (*connect)(elvin_handle_t handle, elvin_error_t error);
int (*disconnect)(elvin_handle_t handle, elvin_error_t error);
int (*cleanup)(int force, elvin_error_t error);
int (*mainloop)(int *do_loop, elvin_error_t error);
int (*notify)(elvin_handle_t handle, elvin_notification_t notification,
int deliver_insecure, elvin_keys_t keys,
elvin_error_t error);
elvin_subscription_t (*subscribe)(elvin_handle_t handle, char *sub_exp,
elvin_keys_t keys, int accept_insecure,
elvin_notify_cb_t callback, void *rock,
elvin_error_t error);
int (*unsubscribe)(elvin_handle_t handle,
elvin_subscription_t subscription,
elvin_error_t error);
int (*connect)(char *server, int portnum, pubsub_handle_t **);
int (*disconnect)(pubsub_handle_t *handle);
int (*mainloop)(pubsub_handle_t *handle, int *go, pubsub_error_t *error);
int (*notify)(pubsub_handle_t *handle, pubsub_notification_t *notification,
pubsub_error_t *error);
pubsub_subscription_t *(*subscribe)(pubsub_handle_t *handle,
char *expression,
pubsub_notify_callback_t notify_cb,
void *notify_arg,
pubsub_error_t *error);
int (*unsubscribe)(pubsub_handle_t *handle,
pubsub_subscription_t *subscription,
pubsub_error_t *error);
};
typedef struct event_handle * event_handle_t;
/* Event notification: */
struct event_notification {
elvin_notification_t elvin_notification;
pubsub_notification_t *pubsub_notification;
int has_hmac;
};
typedef struct event_notification *event_notification_t;
/* Event subscription: */
typedef elvin_subscription_t event_subscription_t;
typedef pubsub_subscription_t *event_subscription_t;
/*
* A tuple defines the target of the event, or if you are a subscriber,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment