Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emmanuel Cecchet
emulab-devel
Commits
35c790eb
Commit
35c790eb
authored
17 years ago
by
Mike Hibler
Browse files
Options
Downloads
Patches
Plain Diff
First attempt to make it work with new pubsub system.
parent
e5f9f7e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
event/lib/GNUmakefile.in
+14
-7
14 additions, 7 deletions
event/lib/GNUmakefile.in
event/lib/event.c
+206
-325
206 additions, 325 deletions
event/lib/event.c
event/lib/event.h
+20
-21
20 additions, 21 deletions
event/lib/event.h
with
240 additions
and
353 deletions
event/lib/GNUmakefile.in
+
14
−
7
View file @
35c790eb
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-200
6
University of Utah and the Flux Group.
# Copyright (c) 2000-200
7
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.
Click to expand it.
event/lib/event.c
+
206
−
325
View file @
35c790eb
This diff is collapsed.
Click to expand it.
event/lib/event.h
+
20
−
21
View file @
35c790eb
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-200
6
University of Utah and the Flux Group.
* Copyright (c) 2000-200
7
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,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment