All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit e44fc90d authored by Leigh B Stoller's avatar Leigh B Stoller

Lots of changes for SSL enabled pubsub:

Pubsub libraries are now SSL enabled by default, so that we can talk SSL
from a perl client. To do this we need another entry point from SWIG
into the event code, event_register_withssl. At the same time there is a
new entry point called event_set_sockbufsizes that calls a new pubsub
entry point pubsub_set_sockbufsizes.

The problem is that current swig generates code that does not compile,
and since I don't know nothing about swig, I just hand crafted the two
new routines that needed in event_wrap.c and the few extra lines that go
into event.pm.

Also change all the link lines to include the ssl/crypto libraries when
linking.
parent 0a5d5f33
#
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
# Copyright (c) 2000-2015, 2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -40,8 +40,8 @@ CFLAGS += -I$(TESTBED_LIBSRCDIR)/event -I$(TESTBED_LIBSRCDIR)/libtb
CFLAGS += -I/usr/local/include
LDFLAGS += -L${TESTBED_LIBOBJDIR}/event -L${TESTBED_LIBOBJDIR}/libtb
LIBS += -levent -ltb -lcrypto
LIBS += -L/usr/local/lib -lpubsub -lm
LIBS += -levent -ltb
LIBS += -L/usr/local/lib -lpubsub -lm -lssl -lcrypto -lcrypt
LDFLAGS += $(LDSTATIC)
# Deal with the presence/absence of kerberos in the linux ssl library
......
#
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
# Copyright (c) 2000-2016, 2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -40,8 +40,8 @@ CFLAGS += -DCLIENT_BINDIR='"$(CLIENT_BINDIR)"'
LDFLAGS += $(LDSTATIC)
LDFLAGS += -L${TESTBED_LIBOBJDIR}/libtb -L${TESTBED_LIBOBJDIR}/event
LIBS += -levent -ltb -lcrypto
LIBS += -L/usr/local/lib -lpubsub -lm
LIBS += -levent -ltb
LIBS += -L/usr/local/lib -lpubsub -lm -lssl -lcrypto -lcrypt
OBJS = main.o callback.o
......
#
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2011, 2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -40,8 +40,8 @@ CFLAGS += -I$(TESTBED_LIBSRCDIR)/event -I$(TESTBED_LIBSRCDIR)/libtb
CFLAGS += -I/usr/local/include
LDFLAGS += -L${TESTBED_LIBOBJDIR}/event -L${TESTBED_LIBOBJDIR}/libtb
LIBS += -levent -ltb -lcrypto
LIBS += -L/usr/local/lib -lpubsub -lm
LIBS += -levent -ltb
LIBS += -L/usr/local/lib -lpubsub -lm -lssl -lcrypto -lcrypt
LDFLAGS += $(LDSTATIC)
# Deal with the presence/absence of kerberos in the linux ssl library
......
#
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2011, 2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -43,8 +43,8 @@ CFLAGS += -DHAVE_PUBSUB
CFLAGS += -DCLIENT_BINDIR='"$(CLIENT_BINDIR)"'
LDFLAGS += -g -L${TESTBED_LIBOBJDIR}/event -L${TESTBED_LIBOBJDIR}/libtb
LIBS += -levent -ltb -lcrypto
LIBS += -L/usr/local/lib -lpubsub
LIBS += -levent -ltb
LIBS += -L/usr/local/lib -lpubsub -lssl -lcrypto -lcrypt
LDFLAGS += $(LDSTATIC)
# Deal with the presence/absence of kerberos in the linux ssl library
......
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2014, 2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -61,14 +61,14 @@ PFLAGS += -L/usr/local/lib -lpubsub_r -ltb -lm
PLDFLAGS += -L$(TESTBED_LIBOBJDIR)
PLDFLAGS += -L$(TESTBED_LIBOBJDIR)/libtb -L$(TESTBED_LIBOBJDIR)/event
PLIBS = -levent_r -ltb -lcrypto
PLIBS += -L/usr/local/lib -lpubsub_r -ltb -lm
PLIBS = -levent_r -ltb
PLIBS += -L/usr/local/lib -lpubsub_r -ltb -lm -lssl -lcrypto -lcrypt
PLDFLAGS += $(LDSTATIC)
LDFLAGS += -L$(TESTBED_LIBOBJDIR)
LDFLAGS += -L$(TESTBED_LIBOBJDIR)/libtb -L$(TESTBED_LIBOBJDIR)/event
LIBS = -levent -ltb -lcrypto
LIBS += -L/usr/local/lib -lpubsub -ltb -lm
LIBS = -levent -ltb
LIBS += -L/usr/local/lib -lpubsub -ltb -lm -lssl -lcrypto -lcrypt
LDFLAGS += $(LDSTATIC)
# Deal with the presence/absence of kerberos in the linux ssl library
......
#
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2011, 2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -53,8 +53,8 @@ CFLAGS += -I/usr/local/include
LDFLAGS += -L$(TESTBED_LIBOBJDIR)
LDFLAGS += -L$(TESTBED_LIBOBJDIR)/libtb -L$(TESTBED_LIBOBJDIR)/event
LIBS += -levent -lcrypto
LIBS += -lm -L/usr/local/lib -lpubsub
LIBS += -levent
LIBS += -lm -L/usr/local/lib -lpubsub -lssl -lcrypto -lcrypt
LDFLAGS += $(LDSTATIC)
# Deal with the presence/absence of kerberos in the linux ssl library
......
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2012, 2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -65,9 +65,9 @@ CFLAGS += -I/usr/local/include
CFLAGS += -DUSEEVENTS
LDFLAGS += -L${TESTBED_LIBOBJDIR}/event -L${TESTBED_LIBOBJDIR}/libtb
LIBS += -levent -ltb -lcrypto
LIBS += -levent -ltb
# Expand the elvin-config list now so it can be filtered below.
LIBS += -L/usr/local/lib -lpubsub -lm
LIBS += -L/usr/local/lib -lpubsub -lm -lssl -lcrypto -lcrypt
LDFLAGS += $(LDSTATIC)
SYSTEM := $(shell uname -s)
......
#
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
# Copyright (c) 2000-2016, 2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -29,7 +29,23 @@ include $(OBJDIR)/Makeconf
PUBSUBFLAGS = -I/usr/local/include
PUBSUBMTFLAGS = -I/usr/local/include
PUBSUBLIB = -L/usr/local/lib -lpubsub
PUBSUBLIB = /usr/local/lib/libpubsub.a
#PUBSUBLIB = /home/stoller/pubsub/libpubsub.a
SSLTEST := $(shell nm $(PUBSUBLIB) | grep -q ps_client_sslinit; echo $$?)
ifeq ($(SSLTEST),0)
PUBSUBLIBS = -L/usr/local/lib -lpubsub
PUBSUBLIBS_R = -L/usr/local/lib -lpubsub_r
#PUBSUBLIBS = -rpath /home/stoller/pubsub/.libs/ \
# /home/stoller/pubsub/.libs/libpubsub.so
#PUBSUBLIBS_R = -rpath /home/stoller/pubsub/.libs/ \
# /home/stoller/pubsub/.libs/libpubsub_r.so
PUBSUBLIBS += -lssl -lcrypto -lcrypt
PUBSUBLIBS_R += -lssl -lcrypto -lcrypt
CFLAGS += -DWITHSSL
else
PUBSUBLIBS += -L/usr/local/lib -lpubsub -lcrypt
PUBSUBLIBS_R += -L/usr/local/lib -lpubsub_r -lcrypt
endif
ifeq ($(ELVIN_COMPAT),1)
PUBSUBFLAGS += -DELVIN_COMPAT
......
/*
* Copyright (c) 2000-2016 University of Utah and the Flux Group.
* Copyright (c) 2000-2016, 2018 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -113,11 +113,27 @@ static int handles_in_use = 0;
* the Elvin server.
*/
event_handle_t
event_register_internal(char const *name, int threaded,
unsigned char *keydata, int keylen,
int retrycount,
const char *certfile, const char *keyfile);
event_handle_t
event_register(char const *name, int threaded)
{
return event_register_withkeydata(name, threaded, NULL, 0);
}
#ifdef WITHSSL
event_handle_t
event_register_withssl(char const *name, int threaded,
char const *certfile, char const *keyfile)
{
return event_register_internal(name, threaded, NULL,
0, INT_MAX, certfile, keyfile);
}
#endif
event_handle_t
event_register_withkeyfile(char const *name, int threaded, char *keyfile) {
return event_register_withkeyfile_withretry(name,
......@@ -149,25 +165,35 @@ event_register_withkeyfile_withretry(char const *name, int threaded,
return 0;
}
fclose(fp);
return event_register_withkeydata_withretry(name, threaded,
buf, cc, retrycount);
return event_register_internal(name, threaded,
buf, cc, retrycount,
NULL, NULL);
}
return event_register_withkeydata_withretry(name, threaded, NULL,
0, retrycount);
return event_register_internal(name, threaded, NULL,
0, retrycount, NULL, NULL);
}
event_handle_t
event_register_withkeydata(char const *name, int threaded,
unsigned char *keydata, int keylen){
return event_register_withkeydata_withretry(name, threaded, keydata,
keylen, INT_MAX);
return event_register_internal(name, threaded, keydata,
keylen, INT_MAX, NULL, NULL);
}
event_handle_t
event_register_withkeydata_withretry(char const *name, int threaded,
unsigned char *keydata, int keylen,
int retrycount)
unsigned char *keydata, int keylen,
int retrycount)
{
return event_register_internal(name, threaded, keydata,
keylen, INT_MAX, NULL, NULL);
}
event_handle_t
event_register_internal(char const *name, int threaded,
unsigned char *keydata, int keylen,
int retrycount,
const char *certfile, const char *keyfile)
{
#ifndef __CYGWIN__
extern int pubsub_is_threaded[] __attribute__ ((weak));
......@@ -253,9 +279,35 @@ event_register_withkeydata_withretry(char const *name, int threaded,
memcpy(handle->keydata, keydata, keylen);
handle->keydata[keylen] = (unsigned char)0;
}
/* Watch for SSL option */
if (certfile && keyfile) {
#ifndef WITHSSL
ERROR("could not get IP from local file %s either!\n", IPADDRFILE);
return 0;
#else
int ps_client_sslinit(const char *certfile, const char *keyfile);
handle->dossl = 1;
handle->certfile = strdup(certfile);
handle->keyfile = strdup(keyfile);
if (ps_client_sslinit(handle->certfile, handle->keyfile)) {
ERROR("ps_client_sslinit() failed!\n");
return 0;
}
#endif
}
/* Set up the interface pointers: */
handle->connect = pubsub_connect;
if (handle->dossl) {
#ifdef WITHSSL
handle->connect = pubsub_sslconnect;
#endif
}
else {
handle->connect = pubsub_connect;
}
handle->disconnect = pubsub_disconnect;
#ifdef THREADED
assert(threaded == 1);
......@@ -2425,3 +2477,17 @@ int event_set_failover(event_handle_t handle, int dofail) {
}
return retval;
}
/*
* Dig into pubsub to change the socket buffer sizes. Note that this
* function went in with SSL changes, so if libpubsub does not have
* SSL symbols, it will not have this one either.
*/
int event_set_sockbufsizes(int sendsockbufsize, int recvsockbufsize)
{
#ifdef WITHSSL
return pubsub_set_sockbufsizes(sendsockbufsize, recvsockbufsize);
#else
return 0;
#endif
}
/*
* Copyright (c) 2000-2016 University of Utah and the Flux Group.
* Copyright (c) 2000-2016, 2018 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -54,6 +54,9 @@ struct event_handle {
unsigned char *keydata;
int keylen;
int do_loop;
int dossl;
char *certfile;
char *keyfile;
/* API function pointers: */
int (*connect)(char *server, int portnum, pubsub_handle_t **);
int (*disconnect)(pubsub_handle_t *handle);
......@@ -203,6 +206,8 @@ typedef void (*event_subscription_callback_t)(event_handle_t handle,
/* event.c */
event_handle_t event_register(char const *name, int threaded);
event_handle_t event_register_withssl(char const *name, int threaded,
char const *certfile, char const *keyfile);
event_handle_t event_register_withkeyfile(char const *name, int threaded,
char *keyfile);
event_handle_t event_register_withkeydata(char const *name, int threaded,
......@@ -291,6 +296,7 @@ int event_notification_unpack(event_handle_t handle,
#endif
int event_set_idle_period(event_handle_t handle, int seconds) ;
int event_set_failover(event_handle_t handle, int dofail) ;
int event_set_sockbufsizes(int, int);
int event_arg_get(char *args, char const *key, char **value);
int event_arg_dup(char *args, char const *key, char **value);
......
......@@ -10,7 +10,7 @@ use base qw(DynaLoader);
package eventc;
bootstrap event;
package event;
@EXPORT = qw($EVENT_LIBRARY_VERSION $MAXHOSTNAMELEN event_handle_server_set event_handle_server_get event_handle_status_set event_handle_status_get event_handle_keydata_set event_handle_keydata_get event_handle_keylen_set event_handle_keylen_get event_handle_do_loop_set event_handle_do_loop_get event_handle_connect_set event_handle_connect_get event_handle_disconnect_set event_handle_disconnect_get event_handle_mainloop_set event_handle_mainloop_get event_handle_notify_set event_handle_notify_get event_handle_subscribe_set event_handle_subscribe_get event_handle_unsubscribe_set event_handle_unsubscribe_get new_event_handle delete_event_handle event_notification_pubsub_notification_set event_notification_pubsub_notification_get event_notification_has_hmac_set event_notification_has_hmac_get new_event_notification delete_event_notification address_tuple_site_set address_tuple_site_get address_tuple_expt_set address_tuple_expt_get address_tuple_group_set address_tuple_group_get address_tuple_host_set address_tuple_host_get address_tuple_objtype_set address_tuple_objtype_get address_tuple_objname_set address_tuple_objname_get address_tuple_eventtype_set address_tuple_eventtype_get address_tuple_scheduler_set address_tuple_scheduler_get address_tuple_timeline_set address_tuple_timeline_get new_address_tuple delete_address_tuple $ADDRESSTUPLE_ALL $OBJECTTYPE_TESTBED $OBJECTTYPE_TRAFGEN address_tuple_alloc address_tuple_free $EVENT_HOST_ANY $EVENT_NULL $EVENT_TEST $EVENT_SCHEDULE $EVENT_TRAFGEN_START $EVENT_TRAFGEN_STOP event_register event_register_withkeyfile event_register_withkeydata event_register_withkeyfile_withretry event_register_withkeydata_withretry event_unregister c_event_poll c_event_poll_blocking dont_use_this_function_because_it_does_not_work event_stop_main event_notify event_schedule event_notification_alloc event_notification_free event_notification_clone event_notification_get_double event_notification_get_int32 event_notification_get_int64 event_notification_get_opaque_length event_notification_get_string_length event_notification_get_opaque c_event_notification_get_string event_notification_put_double event_notification_put_int32 event_notification_put_int64 event_notification_put_opaque event_notification_put_string event_notification_remove c_event_subscribe event_subscribe_auth event_async_subscribe event_unsubscribe event_async_unsubscribe event_notification_insert_hmac event_set_idle_period event_set_failover event_arg_get event_arg_dup $EA_TAG_DONE $EA_Site $EA_Experiment $EA_Group $EA_Host $EA_Type $EA_Name $EA_Event $EA_Arguments $EA_ArgInteger $EA_ArgFloat $EA_ArgString $EA_When event_notification_create_v event_notification_create event_do_v event_do xmalloc xrealloc make_timestamp timeval_tv_sec_set timeval_tv_sec_get timeval_tv_usec_set timeval_tv_usec_get new_timeval delete_timeval callback_data_callback_notification_set callback_data_callback_notification_get callback_data_next_set callback_data_next_get new_callback_data delete_callback_data $callback_data_list allocate_callback_data free_callback_data dequeue_callback_data enqueue_callback_data perl_stub_callback stub_event_subscribe $event_string_buffer event_notification_get_string event_notification_get_site event_notification_get_expt event_notification_get_group event_notification_get_host event_notification_get_objtype event_notification_get_objname event_notification_get_eventtype event_notification_get_arguments event_notification_set_arguments event_notification_get_sender event_notification_set_sender );
@EXPORT = qw($EVENT_LIBRARY_VERSION $MAXHOSTNAMELEN event_handle_server_set event_handle_server_get event_handle_status_set event_handle_status_get event_handle_keydata_set event_handle_keydata_get event_handle_keylen_set event_handle_keylen_get event_handle_do_loop_set event_handle_do_loop_get event_handle_connect_set event_handle_connect_get event_handle_disconnect_set event_handle_disconnect_get event_handle_mainloop_set event_handle_mainloop_get event_handle_notify_set event_handle_notify_get event_handle_subscribe_set event_handle_subscribe_get event_handle_unsubscribe_set event_handle_unsubscribe_get new_event_handle delete_event_handle event_notification_pubsub_notification_set event_notification_pubsub_notification_get event_notification_has_hmac_set event_notification_has_hmac_get new_event_notification delete_event_notification address_tuple_site_set address_tuple_site_get address_tuple_expt_set address_tuple_expt_get address_tuple_group_set address_tuple_group_get address_tuple_host_set address_tuple_host_get address_tuple_objtype_set address_tuple_objtype_get address_tuple_objname_set address_tuple_objname_get address_tuple_eventtype_set address_tuple_eventtype_get address_tuple_scheduler_set address_tuple_scheduler_get address_tuple_timeline_set address_tuple_timeline_get new_address_tuple delete_address_tuple $ADDRESSTUPLE_ALL $OBJECTTYPE_TESTBED $OBJECTTYPE_TRAFGEN address_tuple_alloc address_tuple_free $EVENT_HOST_ANY $EVENT_NULL $EVENT_TEST $EVENT_SCHEDULE $EVENT_TRAFGEN_START $EVENT_TRAFGEN_STOP event_register event_register_withssl event_register_withkeyfile event_register_withkeyfile event_register_withkeydata event_register_withkeyfile_withretry event_register_withkeydata_withretry event_unregister c_event_poll c_event_poll_blocking dont_use_this_function_because_it_does_not_work event_stop_main event_notify event_schedule event_notification_alloc event_notification_free event_notification_clone event_notification_get_double event_notification_get_int32 event_notification_get_int64 event_notification_get_opaque_length event_notification_get_string_length event_notification_get_opaque c_event_notification_get_string event_notification_put_double event_notification_put_int32 event_notification_put_int64 event_notification_put_opaque event_notification_put_string event_notification_remove c_event_subscribe event_subscribe_auth event_async_subscribe event_unsubscribe event_async_unsubscribe event_notification_insert_hmac event_set_idle_period event_set_failover event_set_sockbufsizes event_arg_get event_arg_dup $EA_TAG_DONE $EA_Site $EA_Experiment $EA_Group $EA_Host $EA_Type $EA_Name $EA_Event $EA_Arguments $EA_ArgInteger $EA_ArgFloat $EA_ArgString $EA_When event_notification_create_v event_notification_create event_do_v event_do xmalloc xrealloc make_timestamp timeval_tv_sec_set timeval_tv_sec_get timeval_tv_usec_set timeval_tv_usec_get new_timeval delete_timeval callback_data_callback_notification_set callback_data_callback_notification_get callback_data_next_set callback_data_next_get new_callback_data delete_callback_data $callback_data_list allocate_callback_data free_callback_data dequeue_callback_data enqueue_callback_data perl_stub_callback stub_event_subscribe $event_string_buffer event_notification_get_string event_notification_get_site event_notification_get_expt event_notification_get_group event_notification_get_host event_notification_get_objtype event_notification_get_objname event_notification_get_eventtype event_notification_get_arguments event_notification_set_arguments event_notification_get_sender event_notification_set_sender );
# ---------- BASE METHODS -------------
......@@ -52,6 +52,7 @@ package event;
*address_tuple_alloc = *eventc::address_tuple_alloc;
*address_tuple_free = *eventc::address_tuple_free;
*event_register = *eventc::event_register;
*event_register_withssl = *eventc::event_register_withssl;
*event_register_withkeyfile = *eventc::event_register_withkeyfile;
*event_register_withkeydata = *eventc::event_register_withkeydata;
*event_register_withkeyfile_withretry = *eventc::event_register_withkeyfile_withretry;
......@@ -87,6 +88,7 @@ package event;
*event_notification_insert_hmac = *eventc::event_notification_insert_hmac;
*event_set_idle_period = *eventc::event_set_idle_period;
*event_set_failover = *eventc::event_set_failover;
*event_set_sockbufsizes = *eventc::event_set_sockbufsizes;
*event_arg_get = *eventc::event_arg_get;
*event_arg_dup = *eventc::event_arg_dup;
*event_notification_create_v = *eventc::event_notification_create_v;
......@@ -591,6 +593,37 @@ sub EventRegister(;$$) {
return 1;
}
#
# SSL variant.
#
sub EventRegisterWithSSL($$$$) {
my ($host, $port, $certfile, $keyfile) = @_;
if ($event::EventSendHandle) {
if (event_unregister($event::EventSendHandle) == 0) {
warn "Could not unregister with event system";
}
$event::EventSendHandle = undef;
}
$host = TB_EVENTSERVER()
if (!defined($host));
my $URL = "elvin://$host";
$URL .= ":$port"
if (defined($port));
$event::EventSendHandle = event_register_withssl($URL, 0,
$certfile, $keyfile);
if (!$event::EventSendHandle) {
$EventErrorString = "Unable to register with the event system";
return undef;
}
return 1;
}
sub EventSend(@) {
my %tuple_values = @_;
......@@ -658,6 +691,7 @@ END {
}
push @EXPORT, qw(event_subscribe event_poll event_poll_blocking EventSend
EventSendFatal EventSendWarn EventFork EventRegister);
EventSendFatal EventSendWarn EventFork EventRegister
EventRegisterWithSSL);
1;
......@@ -202,6 +202,37 @@ sub EventRegister(;$$) {
return 1;
}
#
# SSL variant.
#
sub EventRegisterWithSSL($$;$$) {
my ($certfile,$keyfile,$host, $port) = @_;
if ($event::EventSendHandle) {
if (event_unregister($event::EventSendHandle) == 0) {
warn "Could not unregister with event system";
}
$event::EventSendHandle = undef;
}
$host = TB_EVENTSERVER()
if (!defined($host));
my $URL = "elvin://$host";
$URL .= ":$port"
if (defined($port));
$event::EventSendHandle = event_register_withssl($URL, 0,
$certfile, $keyfile);
if (!$event::EventSendHandle) {
$EventErrorString = "Unable to register with the event system";
return undef;
}
return 1;
}
sub EventSend(@) {
my %tuple_values = @_;
......@@ -269,6 +300,7 @@ END {
}
push @EXPORT, qw(event_subscribe event_poll event_poll_blocking EventSend
EventSendFatal EventSendWarn EventFork EventRegister);
EventSendFatal EventSendWarn EventFork EventRegister
EventRegisterWithSSL);
1;
......@@ -3803,6 +3803,69 @@ XS(_wrap_event_register) {
}
XS(_wrap_event_register_withssl) {
{
char *arg1 = (char *) 0 ;
int arg2 ;
char *arg3 = (char *) 0 ;
char *arg4 = (char *) 0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
int res3 ;
char *buf3 = 0 ;
int alloc3 = 0 ;
int res4 ;
char *buf4 = 0 ;
int alloc4 = 0 ;
int val2 ;
int ecode2 = 0 ;
int argvi = 0;
event_handle_t result;
dXSARGS;
if ((items < 4) || (items > 4)) {
SWIG_croak("Usage: event_register_withssl(name,threaded,cert,key);");
}
res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "event_register_withssl" "', argument " "1"" of type '" "char *""'");
}
arg1 = (char *)(buf1);
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "event_register_withssl" "', argument " "2"" of type '" "int""'");
}
arg2 = (int)(val2);
res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "event_register_withssl" "', argument " "3"" of type '" "char *""'");
}
arg3 = (char *)(buf3);
res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
if (!SWIG_IsOK(res4)) {
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "event_register_withssl" "', argument " "4"" of type '" "char *""'");
}
arg4 = (char *)(buf4);
result = (event_handle_t)event_register_withssl(arg1,arg2,arg3,arg4);
ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_event_handle, 0 | SWIG_SHADOW); argvi++ ;
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
XSRETURN(argvi);
fail:
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
SWIG_croak_null();
}
}
XS(_wrap_event_register_withkeyfile) {
{
char *arg1 = (char *) 0 ;
......@@ -5551,6 +5614,43 @@ XS(_wrap_event_set_failover) {
}
}
XS(_wrap_event_set_sockbufsizes) {
{
int arg1 ;
int val1 ;
int ecode1 = 0 ;
int arg2 ;
int val2 ;
int ecode2 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: event_set_idle_period(handle,seconds);");
}
ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "event_set_sockbufsizes" "', argument " "1"" of type '" "int""'");
}
arg1 = (int)(val1);
ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "event_set_sockbufsizes" "', argument " "2"" of type '" "int""'");
}
arg2 = (int)(val2);
result = (int)event_set_sockbufsizes(arg1,arg2);
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_event_arg_get) {
{
......@@ -7159,6 +7259,7 @@ static swig_command_info swig_commands[] = {
{"eventc::address_tuple_alloc", _wrap_address_tuple_alloc},
{"eventc::address_tuple_free", _wrap_address_tuple_free},
{"eventc::event_register", _wrap_event_register},
{"eventc::event_register_withssl", _wrap_event_register_withssl},
{"eventc::event_register_withkeyfile", _wrap_event_register_withkeyfile},
{"eventc::event_register_withkeydata", _wrap_event_register_withkeydata},
{"eventc::event_register_withkeyfile_withretry", _wrap_event_register_withkeyfile_withretry},
......@@ -7193,6 +7294,7 @@ static swig_command_info swig_commands[] = {
{"eventc::event_async_unsubscribe", _wrap_event_async_unsubscribe},
{"eventc::event_notification_insert_hmac", _wrap_event_notification_insert_hmac},
{"eventc::event_set_idle_period", _wrap_event_set_idle_period},
{"eventc::event_set_sockbufsizes", _wrap_event_set_sockbufsizes},
{"eventc::event_set_failover", _wrap_event_set_failover},
{"eventc::event_arg_get", _wrap_event_arg_get},
{"eventc::event_arg_dup", _wrap_event_arg_dup},
......
#
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
# Copyright (c) 2000-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -251,7 +251,7 @@ endif
ifeq ($(WITH_EVENTS),1)
CFLAGS += -DEMULAB_EVENTS -DBOSSNODE='"$(BOSSNODE)"'
SERVEROBJS += event.o $(TESTBED_LIBOBJDIR)/event/event.o $(TESTBED_LIBOBJDIR)/event/util.o
SERVERLIBS += -L/usr/local/lib -lpubsub -lcrypto
SERVERLIBS += -L/usr/local/lib -lpubsub -lssl -lcrypto -lcrypt
EVENTFLAGS = $(CFLAGS) -I/usr/local/include -I$(TESTBED_LIBSRCDIR)
endif
......
#
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
# Copyright (c) 2000-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -62,7 +62,7 @@ ELVINLIBS = -L/usr/local/lib -lpubsub -lm
EVENTFLAGS = -DEVENTSYS -I$(TESTBED_LIBSRCDIR)/event $(ELVINFLAGS)
EVENTOBJS = $(TESTBED_LIBOBJDIR)/event/event.o \
$(TESTBED_LIBOBJDIR)/event/util.o
EVENTLIBS = $(ELVINLIBS) -lcrypto
EVENTLIBS = $(ELVINLIBS) -lssl -lcrypto -lcrypt
else
EVENTFLAGS =
EVENTOBJS =
......
#
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2011, 2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -64,13 +64,13 @@ PFLAGS += -L/usr/local/lib -lpubsub_r -ltb -lm
PLDFLAGS += -L$(TESTBED_LIBOBJDIR)
PLDFLAGS += -L$(TESTBED_LIBOBJDIR)/libtb -L$(TESTBED_LIBOBJDIR)/event
PLIBS = -levent_r -ltb -lcrypto
PLIBS = -levent_r -ltb -lssl -lcrypto -lcrypt
PLIBS += -L/usr/local/lib -lpubsub_r -ltb -lm
PLDFLAGS += $(LDSTATIC)
LDFLAGS += -L$(TESTBED_LIBOBJDIR)
LDFLAGS += -L$(TESTBED_LIBOBJDIR)/libtb -L$(TESTBED_LIBOBJDIR)/event
LIBS = -levent -ltb -lcrypto
LIBS = -levent -ltb -lssl -lcrypto -lcrypt
LIBS += -L/usr/local/lib -lpubsub -ltb -lm
LDFLAGS += $(LDSTATIC)
......@@ -99,7 +99,7 @@ endif
version0_gateway: version0_gateway.c
$(CC) $(CFLAGS) $(PLDFLAGS) -pthread -o $@ $< -L/usr/local/lib \
-lpubsub_r -ltb -lm
-lpubsub_r -ltb -lm -lssl -lcrypto -lcrypt
eventping-debug: eventping.o
$(CC) $(LDFLAGS) -o $@ eventping.o -pthread $(LIBS)
......
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