From cdab533860ba69423695e1d08acc25b074a0e065 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Fri, 24 Feb 2017 16:03:28 +0100 Subject: lib: Remove application entity name The AE name should not be passed over the layer boundaries. If an application has more than one AE it should exchange this in CACEP. --- src/ipcpd/normal/ribmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ipcpd/normal/ribmgr.c') diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c index f254bd50..1436a7d4 100644 --- a/src/ipcpd/normal/ribmgr.c +++ b/src/ipcpd/normal/ribmgr.c @@ -71,7 +71,7 @@ int ribmgr_init(void) /* FIXME: Implement cacep policies */ (void) pc; - ribmgr.gam = gam_create(pg, MGMT_AE); + ribmgr.gam = gam_create(pg); if (ribmgr.gam == NULL) { log_err("Failed to create gam."); return -1; -- cgit v1.2.3 From d06cb62e111be1ac3f09398ae559f99e4833b4bf Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Mon, 27 Feb 2017 17:04:40 +0100 Subject: lib: Split authentication from CACEP By removing authentication as part of CACEP, all policies disappear. CACEP becomes a policy-free connection establishment protocol between Application Entities. Authentication can later be added cleanly as a pure policy function when needed. --- include/ouroboros/cacep.h | 37 +++--- include/ouroboros/irm_config.h | 5 - src/ipcpd/normal/cdap_flow.c | 25 ++-- src/ipcpd/normal/cdap_flow.h | 8 +- src/ipcpd/normal/enroll.c | 42 +++---- src/ipcpd/normal/fmgr.c | 11 -- src/ipcpd/normal/gam.c | 87 ++++++-------- src/ipcpd/normal/main.c | 11 -- src/ipcpd/normal/pol/complete.c | 6 +- src/ipcpd/normal/ribmgr.c | 10 -- src/lib/CMakeLists.txt | 14 +-- src/lib/cacep.c | 152 ++++++++++++++---------- src/lib/cacep.proto | 33 ++++++ src/lib/pol/cacep_anonymous_auth.c | 209 --------------------------------- src/lib/pol/cacep_anonymous_auth.h | 35 ------ src/lib/pol/cacep_anonymous_auth.proto | 30 ----- src/lib/pol/cacep_proto.c | 52 -------- src/lib/pol/cacep_proto.h | 36 ------ src/lib/pol/cacep_proto.proto | 38 ------ src/lib/pol/cacep_simple_auth.c | 190 ------------------------------ src/lib/pol/cacep_simple_auth.h | 35 ------ src/lib/pol/cacep_simple_auth.proto | 32 ----- 22 files changed, 210 insertions(+), 888 deletions(-) create mode 100644 src/lib/cacep.proto delete mode 100644 src/lib/pol/cacep_anonymous_auth.c delete mode 100644 src/lib/pol/cacep_anonymous_auth.h delete mode 100644 src/lib/pol/cacep_anonymous_auth.proto delete mode 100644 src/lib/pol/cacep_proto.c delete mode 100644 src/lib/pol/cacep_proto.h delete mode 100644 src/lib/pol/cacep_proto.proto delete mode 100644 src/lib/pol/cacep_simple_auth.c delete mode 100644 src/lib/pol/cacep_simple_auth.h delete mode 100644 src/lib/pol/cacep_simple_auth.proto (limited to 'src/ipcpd/normal/ribmgr.c') diff --git a/include/ouroboros/cacep.h b/include/ouroboros/cacep.h index f155023e..5ef66433 100644 --- a/include/ouroboros/cacep.h +++ b/include/ouroboros/cacep.h @@ -1,7 +1,7 @@ /* * Ouroboros - Copyright (C) 2016 - 2017 * - * The Common Application Connection Establishment Phase + * The Common Application Connection Establishment Protocol * * Sander Vrijders * Dimitri Staessens @@ -24,7 +24,7 @@ #ifndef OUROBOROS_CACEP_H #define OUROBOROS_CACEP_H -#include +#include enum proto_concrete_syntax { PROTO_GPB = 0, @@ -33,27 +33,22 @@ enum proto_concrete_syntax { }; struct conn_info{ - struct { - char * protocol; - uint32_t pref_version; - enum proto_concrete_syntax pref_syntax; - } proto; - char * name; - uint64_t addr; + char ae_name[64]; + char protocol[64]; + uint32_t pref_version; + enum proto_concrete_syntax pref_syntax; + union { + char name[64]; + uint64_t addr; + } ae; }; -int conn_info_init(struct conn_info * info); +int cacep_connect(int fd, + const struct conn_info * in, + struct conn_info * out); -void conn_info_fini(struct conn_info * info); - -struct conn_info * cacep_auth(int fd, - enum pol_cacep pc, - const struct conn_info * info, - const void * auth); - -struct conn_info * cacep_auth_wait(int fd, - enum pol_cacep pc, - const struct conn_info * info, - const void * auth); +int cacep_listen(int fd, + const struct conn_info * in, + struct conn_info * out); #endif /* OUROBOROS_CACEP_H */ diff --git a/include/ouroboros/irm_config.h b/include/ouroboros/irm_config.h index 9a05a434..5e3c84b4 100644 --- a/include/ouroboros/irm_config.h +++ b/include/ouroboros/irm_config.h @@ -47,11 +47,6 @@ enum pol_gam { COMPLETE = 0 }; -enum pol_cacep { - ANONYMOUS_AUTH = 0, - SIMPLE_AUTH -}; - struct dif_config { char * dif_name; enum ipcp_type type; diff --git a/src/ipcpd/normal/cdap_flow.c b/src/ipcpd/normal/cdap_flow.c index 3d1b2b22..d3d98884 100644 --- a/src/ipcpd/normal/cdap_flow.c +++ b/src/ipcpd/normal/cdap_flow.c @@ -29,6 +29,7 @@ #include "cdap_flow.h" #include +#include #include static void cdap_flow_destroy(struct cdap_flow * flow) @@ -37,20 +38,15 @@ static void cdap_flow_destroy(struct cdap_flow * flow) if (flow->ci != NULL) cdap_destroy(flow->ci); - if (flow->info != NULL) { - conn_info_fini(flow->info); - free(flow->info); - } free(flow); } -struct cdap_flow * cdap_flow_arr(int fd, +struct cdap_flow * cdap_flow_arr(int fd, int resp, - enum pol_cacep pc, const struct conn_info * info) { - struct cdap_flow * flow; + struct cdap_flow * flow; if (flow_alloc_resp(fd, resp) < 0) { log_err("Could not respond to new flow."); @@ -66,12 +62,13 @@ struct cdap_flow * cdap_flow_arr(int fd, return NULL; } + memset(&flow->info, 0, sizeof(flow->info)); + flow->fd = fd; flow->ci = NULL; - flow->info = cacep_auth_wait(fd, pc, info, NULL); - if (flow->info == NULL) { - log_err("Other side failed to authenticate."); + if (cacep_listen(fd, info, &flow->info)) { + log_err("Error establishing application connection."); cdap_flow_destroy(flow); return NULL; } @@ -88,7 +85,6 @@ struct cdap_flow * cdap_flow_arr(int fd, struct cdap_flow * cdap_flow_alloc(const char * dst_name, qosspec_t * qs, - enum pol_cacep pc, const struct conn_info * info) { struct cdap_flow * flow; @@ -119,12 +115,13 @@ struct cdap_flow * cdap_flow_alloc(const char * dst_name, return NULL; } + memset(&flow->info, 0, sizeof(flow->info)); + flow->fd = fd; flow->ci = NULL; - flow->info = cacep_auth(fd, pc, info, NULL); - if (flow->info == NULL) { - log_err("Failed to authenticate."); + if (cacep_connect(fd, info, &flow->info)) { + log_err("Failed to connect to application."); cdap_flow_dealloc(flow); return NULL; } diff --git a/src/ipcpd/normal/cdap_flow.h b/src/ipcpd/normal/cdap_flow.h index 8aa26dc0..761f3463 100644 --- a/src/ipcpd/normal/cdap_flow.h +++ b/src/ipcpd/normal/cdap_flow.h @@ -28,19 +28,17 @@ #include struct cdap_flow { - int fd; - struct cdap * ci; - struct conn_info * info; + int fd; + struct cdap * ci; + struct conn_info info; }; struct cdap_flow * cdap_flow_arr(int fd, int resp, - enum pol_cacep pc, const struct conn_info * info); struct cdap_flow * cdap_flow_alloc(const char * dst_name, qosspec_t * qs, - enum pol_cacep pc, const struct conn_info * info); void cdap_flow_dealloc(struct cdap_flow * flow); diff --git a/src/ipcpd/normal/enroll.c b/src/ipcpd/normal/enroll.c index b420533e..5c7ebd7e 100644 --- a/src/ipcpd/normal/enroll.c +++ b/src/ipcpd/normal/enroll.c @@ -44,7 +44,7 @@ int enroll_handle(int fd) { struct cdap_flow * flow; - struct conn_info info; + struct conn_info info; cdap_key_t key; enum cdap_opcode oc; char * name; @@ -61,27 +61,20 @@ int enroll_handle(int fd) char * members_ro = MEMBERS_PATH; char * dif_ro = DIF_PATH; - conn_info_init(&info); + memset(&info, 0, sizeof(info)); - info.proto.protocol = strdup(CDAP_PROTO); - if (info.proto.protocol == NULL) { - conn_info_fini(&info); - return -ENOMEM; - } - - info.proto.pref_version = 1; - info.proto.pref_syntax = PROTO_GPB; + strcpy(info.ae_name, ENROLL_AE); + strcpy(info.protocol, CDAP_PROTO); + info.pref_version = 1; + info.pref_syntax = PROTO_GPB; - flow = cdap_flow_arr(fd, 0, ANONYMOUS_AUTH, &info); + flow = cdap_flow_arr(fd, 0, &info); if (flow == NULL) { log_err("Failed to auth enrollment request."); - conn_info_fini(&info); flow_dealloc(fd); return -1; } - conn_info_fini(&info); - while (!(boot_r && members_r && dif_name_r)) { key = cdap_request_wait(flow->ci, &oc, &name, &data, (size_t *) &len , &flags); @@ -156,7 +149,7 @@ int enroll_handle(int fd) int enroll_boot(char * dst_name) { struct cdap_flow * flow; - struct conn_info info; + struct conn_info info; cdap_key_t key; uint8_t * data; size_t len; @@ -170,26 +163,19 @@ int enroll_boot(char * dst_name) char * members_ro = MEMBERS_PATH; char * dif_ro = DIF_PATH; - conn_info_init(&info); + memset(&info, 0, sizeof(info)); - info.proto.protocol = strdup(CDAP_PROTO); - if (info.proto.protocol == NULL) { - conn_info_fini(&info); - return -ENOMEM; - } - - info.proto.pref_version = 1; - info.proto.pref_syntax = PROTO_GPB; + strcpy(info.ae_name, ENROLL_AE); + strcpy(info.protocol, CDAP_PROTO); + info.pref_version = 1; + info.pref_syntax = PROTO_GPB; - flow = cdap_flow_alloc(dst_name, NULL, ANONYMOUS_AUTH, &info); + flow = cdap_flow_alloc(dst_name, NULL, &info); if (flow == NULL) { log_err("Failed to allocate flow for enrollment request."); - conn_info_fini(&info); return -1; } - conn_info_fini(&info); - log_dbg("Getting boot information from %s.", dst_name); clock_gettime(CLOCK_REALTIME, &t0); diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c index 071a895f..0c927fc7 100644 --- a/src/ipcpd/normal/fmgr.c +++ b/src/ipcpd/normal/fmgr.c @@ -249,7 +249,6 @@ static void fmgr_destroy_flows(void) int fmgr_init(void) { - enum pol_cacep pc; enum pol_gam pg; int i; @@ -292,15 +291,6 @@ int fmgr_init(void) return -1; } - if (rib_read(BOOT_PATH "/dt/gam/cacep", &pc, sizeof(pc)) - != sizeof(pc)) { - log_err("Failed to read CACEP policy for ribmgr gam."); - return -1; - } - - /* FIXME: Implement cacep policies */ - (void) pc; - fmgr.gam = gam_create(pg); if (fmgr.gam == NULL) { log_err("Failed to create graph adjacency manager."); @@ -345,7 +335,6 @@ void fmgr_fini() flow_dealloc(flow->fd); ipcp_flow_get_qoscube(flow->fd, &cube); flow_set_del(fmgr.nm1_set[cube], flow->fd); - free(flow->info->name); free(flow->info); free(flow); } diff --git a/src/ipcpd/normal/gam.c b/src/ipcpd/normal/gam.c index 2479fa62..bdfc8cb9 100644 --- a/src/ipcpd/normal/gam.c +++ b/src/ipcpd/normal/gam.c @@ -120,7 +120,6 @@ void gam_destroy(struct gam * instance) list_for_each_safe(p, n, &instance->gas) { struct ga * e = list_entry(p, struct ga, next); list_del(&e->next); - free(e->info->name); free(e->info); free(e); } @@ -156,7 +155,7 @@ static int add_ga(struct gam * instance, pthread_cond_signal(&instance->gas_cond); pthread_mutex_unlock(&instance->gas_lock); - log_info("Added flow to %s.", info->name); + log_info("Added flow."); return 0; } @@ -166,7 +165,7 @@ int gam_flow_arr(struct gam * instance, qosspec_t qs) { struct conn_info * rcv_info; - struct conn_info snd_info; + struct conn_info snd_info; if (flow_alloc_resp(fd, instance->ops->accept_new_flow(instance->ops_o)) < 0) { @@ -174,34 +173,29 @@ int gam_flow_arr(struct gam * instance, return -1; } - conn_info_init(&snd_info); - snd_info.proto.protocol = strdup(CDAP_PROTO); - if (snd_info.proto.protocol == NULL) { - conn_info_fini(&snd_info); + rcv_info = malloc(sizeof(*rcv_info)); + if (rcv_info == NULL) return -ENOMEM; - } - snd_info.proto.pref_version = 1; - snd_info.proto.pref_syntax = PROTO_GPB; - snd_info.addr = ipcpi.address; - snd_info.name = strdup(ipcpi.name); - if (snd_info.name == NULL) { - conn_info_fini(&snd_info); - return -ENOMEM; - } + memset(&snd_info, 0, sizeof(snd_info)); + memset(rcv_info, 0, sizeof(*rcv_info)); + + /* FIXME: send correct AE */ + strcpy(snd_info.ae_name, "FIXME:CORRECT_AE"); + strcpy(snd_info.protocol, CDAP_PROTO); + snd_info.pref_version = 1; + snd_info.pref_syntax = PROTO_GPB; + snd_info.ae.addr = ipcpi.address; - rcv_info = cacep_auth_wait(fd, SIMPLE_AUTH, &snd_info, NULL); - if (rcv_info == NULL) { - log_err("Other side failed to authenticate."); - conn_info_fini(&snd_info); + if (cacep_listen(fd, &snd_info, rcv_info)) { + log_err("Failed to create application connection."); + flow_dealloc(fd); + free(rcv_info); return -1; } - conn_info_fini(&snd_info); - if (instance->ops->accept_flow(instance->ops_o, qs, rcv_info)) { flow_dealloc(fd); - conn_info_fini(rcv_info); free(rcv_info); return 0; } @@ -209,7 +203,6 @@ int gam_flow_arr(struct gam * instance, if (add_ga(instance, fd, qs, rcv_info)) { log_err("Failed to add ga to graph adjacency manager list."); flow_dealloc(fd); - conn_info_fini(rcv_info); free(rcv_info); return -1; } @@ -222,11 +215,15 @@ int gam_flow_alloc(struct gam * instance, qosspec_t qs) { struct conn_info * rcv_info; - struct conn_info snd_info; + struct conn_info snd_info; int fd; log_dbg("Allocating flow to %s.", dst_name); + rcv_info = malloc(sizeof(*rcv_info)); + if (rcv_info == NULL) + return -ENOMEM; + fd = flow_alloc(dst_name, NULL); if (fd < 0) { log_err("Failed to allocate flow to %s.", dst_name); @@ -239,34 +236,25 @@ int gam_flow_alloc(struct gam * instance, return -1; } - conn_info_init(&snd_info); - snd_info.proto.protocol = strdup(CDAP_PROTO); - if (snd_info.proto.protocol == NULL) { - conn_info_fini(&snd_info); - return -ENOMEM; - } + memset(&snd_info, 0, sizeof(snd_info)); + memset(rcv_info, 0, sizeof(*rcv_info)); - snd_info.proto.pref_version = 1; - snd_info.proto.pref_syntax = PROTO_GPB; - snd_info.addr = ipcpi.address; - snd_info.name = strdup(ipcpi.name); - if (snd_info.name == NULL) { - conn_info_fini(&snd_info); - return -ENOMEM; - } + /* FIXME: send correct AE */ + strcpy(snd_info.ae_name, "FIXME:CORRECT_AE"); + strcpy(snd_info.protocol, CDAP_PROTO); + snd_info.pref_version = 1; + snd_info.pref_syntax = PROTO_GPB; + snd_info.ae.addr = ipcpi.address; - rcv_info = cacep_auth(fd, SIMPLE_AUTH, &snd_info, NULL); - if (rcv_info == NULL) { - log_err("Other side failed to authenticate."); - conn_info_fini(&snd_info); + if (cacep_connect(fd, &snd_info, rcv_info)) { + log_err("Failed to create application connection."); + flow_dealloc(fd); + free(rcv_info); return -1; } - conn_info_fini(&snd_info); - if (instance->ops->accept_flow(instance->ops_o, qs, rcv_info)) { flow_dealloc(fd); - conn_info_fini(rcv_info); free(rcv_info); return 0; } @@ -274,7 +262,6 @@ int gam_flow_alloc(struct gam * instance, if (add_ga(instance, fd, qs, rcv_info)) { log_err("Failed to add GA to graph adjacency manager list."); flow_dealloc(fd); - conn_info_fini(rcv_info); free(rcv_info); return -1; } @@ -282,10 +269,10 @@ int gam_flow_alloc(struct gam * instance, return 0; } -int gam_flow_wait(struct gam * instance, - int * fd, +int gam_flow_wait(struct gam * instance, + int * fd, struct conn_info ** info, - qosspec_t * qs) + qosspec_t * qs) { struct ga * ga; diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 939544c3..c75a74d6 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -336,11 +336,6 @@ int normal_rib_init(void) static int normal_ipcp_bootstrap(struct dif_config * conf) { - /* FIXME: get CACEP policies from conf */ - enum pol_cacep pol = SIMPLE_AUTH; - - (void) pol; - assert(conf); assert(conf->type == THIS_TYPE); @@ -388,12 +383,6 @@ static int normal_ipcp_bootstrap(struct dif_config * conf) rib_write(BOOT_PATH "/rm/gam/type", &conf->rm_gam_type, sizeof(conf->rm_gam_type)) || - rib_write(BOOT_PATH "/rm/gam/cacep", - &pol, - sizeof(pol)) || - rib_write(BOOT_PATH "/dt/gam/cacep", - &pol, - sizeof(pol)) || rib_write(BOOT_PATH "/addr_auth/type", &conf->addr_auth_type, sizeof(conf->addr_auth_type))) { diff --git a/src/ipcpd/normal/pol/complete.c b/src/ipcpd/normal/pol/complete.c index 1d4811d2..68f43e81 100644 --- a/src/ipcpd/normal/pol/complete.c +++ b/src/ipcpd/normal/pol/complete.c @@ -167,7 +167,8 @@ int complete_accept_flow(void * o, list_for_each(pos, &complete->neighbors) { struct neighbor * e = list_entry(pos, struct neighbor, next); - if (strcmp(e->neighbor, info->name) == 0) { + /* FIXME: figure out union type and check name or address */ + if (strcmp(e->neighbor, info->ae.name) == 0) { pthread_mutex_unlock(&complete->neighbors_lock); return -1; } @@ -185,7 +186,8 @@ int complete_accept_flow(void * o, list_head_init(&n->next); - n->neighbor = strdup(info->name); + /* FIXME: figure out union type and check name or address */ + n->neighbor = strdup(info->ae.name); if (n->neighbor == NULL) { pthread_mutex_unlock(&complete->neighbors_lock); free(n); diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c index 1436a7d4..25f1687e 100644 --- a/src/ipcpd/normal/ribmgr.c +++ b/src/ipcpd/normal/ribmgr.c @@ -53,7 +53,6 @@ struct { int ribmgr_init(void) { - enum pol_cacep pc; enum pol_gam pg; if (rib_read(BOOT_PATH "/rm/gam/type", &pg, sizeof(pg)) @@ -62,15 +61,6 @@ int ribmgr_init(void) return -1; } - if (rib_read(BOOT_PATH "/rm/gam/cacep", &pc, sizeof(pc)) - != sizeof(pc)) { - log_err("Failed to read CACEP policy for ribmgr gam."); - return -1; - } - - /* FIXME: Implement cacep policies */ - (void) pc; - ribmgr.gam = gam_create(pg); if (ribmgr.gam == NULL) { log_err("Failed to create gam."); diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index fcea0fb2..03452705 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -10,12 +10,7 @@ protobuf_generate_c(DIF_CONFIG_PROTO_SRCS DIF_CONFIG_PROTO_HDRS dif_config.proto) protobuf_generate_c(CDAP_PROTO_SRCS CDAP_PROTO_HDRS cdap.proto) protobuf_generate_c(RO_PROTO_SRCS RO_PROTO_HDRS ro.proto) -protobuf_generate_c(CACEP_PROTO_PROTO_SRCS CACEP_CDAP_PROTO_HDRS - pol/cacep_proto.proto) -protobuf_generate_c(CACEP_ANONYMOUS_AUTH_PROTO_SRCS - CACEP_ANONYMOUS_AUTH_PROTO_HDRS pol/cacep_anonymous_auth.proto) -protobuf_generate_c(CACEP_SIMPLE_AUTH_PROTO_SRCS CACEP_SIMPLE_AUTH_PROTO_HDRS - pol/cacep_simple_auth.proto) +protobuf_generate_c(CACEP_PROTO_SRCS CACEP_PROTO_HDRS cacep.proto) if(NOT APPLE) find_library(LIBRT_LIBRARIES rt) @@ -54,16 +49,11 @@ set(SOURCE_FILES sockets.c time_utils.c utils.c - # Add policies last - pol/cacep_proto.c - pol/cacep_anonymous_auth.c - pol/cacep_simple_auth.c ) add_library(ouroboros SHARED ${SOURCE_FILES} ${IRM_PROTO_SRCS} ${IPCP_PROTO_SRCS} ${DIF_CONFIG_PROTO_SRCS} ${CDAP_PROTO_SRCS} - ${CACEP_PROTO_PROTO_SRCS} ${CACEP_ANONYMOUS_AUTH_PROTO_SRCS} - ${CACEP_SIMPLE_AUTH_PROTO_SRCS} ${RO_PROTO_SRCS}) + ${CACEP_PROTO_SRCS} ${RO_PROTO_SRCS}) target_link_libraries(ouroboros ${LIBRT_LIBRARIES} ${LIBPTHREAD_LIBRARIES} ${PROTOBUF_C_LIBRARY}) diff --git a/src/lib/cacep.c b/src/lib/cacep.c index 89bd05e7..badeccc0 100644 --- a/src/lib/cacep.c +++ b/src/lib/cacep.c @@ -1,9 +1,10 @@ /* * Ouroboros - Copyright (C) 2016 - 2017 * - * The Common Application Connection Establishment Phase + * The Common Application Connection Establishment Protocol * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -20,91 +21,118 @@ * 02110-1301 USA */ -#define OUROBOROS_PREFIX "cacep" - #include #include #include #include -#include - -#include "pol/cacep_anonymous_auth.h" -#include "pol/cacep_simple_auth.h" #include #include -#define BUF_SIZE 2048 +#include "cacep.pb-c.h" +typedef CacepMsg cacep_msg_t; -int conn_info_init(struct conn_info * info) +#define BUF_SIZE 64 + +int read_msg(int fd, + struct conn_info * info) { - if (info == NULL) - return -EINVAL; + uint8_t buf[BUF_SIZE]; + cacep_msg_t * msg; + ssize_t len; + + len = flow_read(fd, buf, BUF_SIZE); + if (len < 0) + return -1; + + msg = cacep_msg__unpack(NULL, len, buf); + if (msg == NULL) + return -1; + + strcpy(info->protocol, msg->protocol); + + info->pref_version = msg->pref_version; + info->pref_syntax = msg->pref_syntax; - info->proto.protocol = NULL; - info->name = NULL; + cacep_msg__free_unpacked(msg, NULL); return 0; } -void conn_info_fini(struct conn_info * info) +static int send_msg(int fd, + const struct conn_info * info) { - if (info == NULL) - return; + cacep_msg_t msg = CACEP_MSG__INIT; + uint8_t * data = NULL; + size_t len = 0; - if (info->proto.protocol != NULL) { - free(info->proto.protocol); - info->proto.protocol = NULL; - } + msg.ae_name = (char *) info->ae_name; + msg.protocol = (char *) info->protocol; + msg.pref_version = info->pref_version; + msg.pref_syntax = info->pref_syntax; + if (msg.pref_syntax < 0) + return -1; + + len = cacep_msg__get_packed_size(&msg); + if (len == 0) + return -1; + + data = malloc(len); + if (data == NULL) + return -ENOMEM; + + cacep_msg__pack(&msg, data); - if (info->name != NULL) { - free(info->name); - info->name = NULL; + if (flow_write(fd, data, len) < 0) { + free(data); + return -1; } + + free(data); + + return 0; } -struct conn_info * cacep_auth(int fd, - enum pol_cacep pc, - const struct conn_info * info, - const void * auth) +int cacep_connect(int fd, + const struct conn_info * in, + struct conn_info * out) { - if (info == NULL) { - log_err("No info provided."); - return NULL; - } + if (in == NULL || out == NULL) + return -EINVAL; - switch (pc) { - case ANONYMOUS_AUTH: - return cacep_anonymous_auth(fd, info, auth); - case SIMPLE_AUTH: - if (info == NULL) - return NULL; - return cacep_simple_auth_auth(fd, info, auth); - default: - log_err("Unsupported CACEP policy."); - return NULL; - } + if (send_msg(fd, in)) + return -1; + + if (read_msg(fd, out)) + return -1; + + if (strcmp(in->ae_name, out->ae_name) || + strcmp(in->protocol, out->protocol) || + in->pref_version != out->pref_version || + in->pref_syntax != out->pref_syntax) + return -EPROTO; + + return 0; } -struct conn_info * cacep_auth_wait(int fd, - enum pol_cacep pc, - const struct conn_info * info, - const void * auth) +int cacep_listen(int fd, + const struct conn_info * in, + struct conn_info * out) { - if (info == NULL) { - log_err("No info provided."); - return NULL; - } + if (in == NULL || out == NULL) + return -EINVAL; - switch (pc) { - case ANONYMOUS_AUTH: - return cacep_anonymous_auth_wait(fd, info, auth); - case SIMPLE_AUTH: - if (info == NULL) - return NULL; - return cacep_simple_auth_auth_wait(fd, info, auth); - default: - log_err("Unsupported CACEP policy."); - return NULL; - } + if (send_msg(fd, in)) + return -1; + + if (read_msg(fd, out)) + return -1; + + if (strcmp(in->ae_name, out->ae_name) || + strcmp(in->protocol, out->protocol) || + in->pref_version != out->pref_version || + in->pref_syntax != out->pref_syntax) + return -EPROTO; + + return 0; } diff --git a/src/lib/cacep.proto b/src/lib/cacep.proto new file mode 100644 index 00000000..3e1291f6 --- /dev/null +++ b/src/lib/cacep.proto @@ -0,0 +1,33 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2017 + * + * Message for Connection Information in CACEP + * + * Dimitri Staessens + * Sander Vrijders + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +syntax = "proto2"; + +message cacep_msg { + required string ae_name = 1; + required string protocol = 2; + required int32 pref_version = 3; + repeated int32 supp_version = 4; + required int32 pref_syntax = 5; + repeated int32 supp_syntax = 6; +} \ No newline at end of file diff --git a/src/lib/pol/cacep_anonymous_auth.c b/src/lib/pol/cacep_anonymous_auth.c deleted file mode 100644 index 44c7bd17..00000000 --- a/src/lib/pol/cacep_anonymous_auth.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * Anonymous policy for CACEP - * - * Dimitri Staessens - * Sander Vrijders - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -#include -#include -#include -#include -#include - -#include "cacep_proto.h" -#include "cacep_anonymous_auth.h" - -#include -#include -#include -#include - -#include "cacep_anonymous_auth.pb-c.h" -typedef CacepAnonymousAuthMsg cacep_anonymous_auth_msg_t; -typedef CacepProtoMsg cacep_proto_msg_t; - -#define BUF_SIZE 2048 -#define NAME_LEN 8 - -/* this policy generates a hex string */ -static struct conn_info * anonymous_info(void) -{ - struct conn_info * info; - struct timespec t; - - info = malloc(sizeof(*info)); - if (info == NULL) - return NULL; - - conn_info_init(info); - - info->name = malloc(NAME_LEN + 1); - if (info->name == NULL) { - free(info); - return NULL; - } - - clock_gettime(CLOCK_REALTIME, &t); - srand(t.tv_nsec); - - sprintf(info->name, "%8x", - (uint32_t)((rand() % RAND_MAX) & 0xFFFFFFFF)); - - info->addr = 0; - - return info; -} - -static struct conn_info * read_msg(int fd) -{ - struct conn_info * tmp; - uint8_t buf[BUF_SIZE]; - cacep_anonymous_auth_msg_t * msg; - ssize_t len; - - len = flow_read(fd, buf, BUF_SIZE); - if (len < 0) - return NULL; - - msg = cacep_anonymous_auth_msg__unpack(NULL, len, buf); - if (msg == NULL) - return NULL; - - tmp = anonymous_info(); - if (tmp == NULL) { - cacep_anonymous_auth_msg__free_unpacked(msg, NULL); - return NULL; - } - - tmp->proto.protocol = strdup(msg->proto->protocol); - if (tmp->proto.protocol == NULL) { - free(tmp); - cacep_anonymous_auth_msg__free_unpacked(msg, NULL); - return NULL; - } - - tmp->proto.pref_version = msg->proto->pref_version; - tmp->proto.pref_syntax = code_to_syntax(msg->proto->pref_syntax); - if (tmp->proto.pref_syntax < 0) { - free(tmp->proto.protocol); - free(tmp); - cacep_anonymous_auth_msg__free_unpacked(msg, NULL); - return NULL; - } - - cacep_anonymous_auth_msg__free_unpacked(msg, NULL); - - return tmp; -} - -static int send_msg(int fd, - const struct conn_info * info) -{ - cacep_anonymous_auth_msg_t msg = CACEP_ANONYMOUS_AUTH_MSG__INIT; - cacep_proto_msg_t cmsg = CACEP_PROTO_MSG__INIT; - int ret = 0; - uint8_t * data = NULL; - size_t len = 0; - - cmsg.protocol = info->proto.protocol; - cmsg.pref_version = info->proto.pref_version; - cmsg.pref_syntax = syntax_to_code(info->proto.pref_syntax); - if (cmsg.pref_syntax < 0) - return -1; - - msg.proto = &cmsg; - - len = cacep_anonymous_auth_msg__get_packed_size(&msg); - if (len == 0) - return -1; - - data = malloc(len); - if (data == NULL) - return -ENOMEM; - - cacep_anonymous_auth_msg__pack(&msg, data); - - if (flow_write(fd, data, len) < 0) - ret = -1; - - free(data); - - return ret; -} - -struct conn_info * cacep_anonymous_auth(int fd, - const struct conn_info * info, - const void * auth) -{ - struct conn_info * tmp; - - assert(info); - - (void) auth; - - if (send_msg(fd, info)) - return NULL; - - tmp = read_msg(fd); - if (tmp == NULL) - return NULL; - - if (strcmp(info->proto.protocol, tmp->proto.protocol) || - info->proto.pref_version != tmp->proto.pref_version || - info->proto.pref_syntax != tmp->proto.pref_syntax) { - conn_info_fini(tmp); - free(tmp); - return NULL; - } - - return tmp; -} - - -struct conn_info * cacep_anonymous_auth_wait(int fd, - const struct conn_info * info, - const void * auth) -{ - struct conn_info * tmp; - - assert(info); - - (void) auth; - - tmp = read_msg(fd); - if (tmp == NULL) - return NULL; - - if (send_msg(fd, info)) { - conn_info_fini(tmp); - free(tmp); - return NULL; - } - - if (strcmp(info->proto.protocol, tmp->proto.protocol) || - info->proto.pref_version != tmp->proto.pref_version || - info->proto.pref_syntax != tmp->proto.pref_syntax) { - conn_info_fini(tmp); - free(tmp); - return NULL; - } - - return tmp; -} diff --git a/src/lib/pol/cacep_anonymous_auth.h b/src/lib/pol/cacep_anonymous_auth.h deleted file mode 100644 index ca47b1b8..00000000 --- a/src/lib/pol/cacep_anonymous_auth.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * Anonymous policy for CACEP - * - * Dimitri Staessens - * Sander Vrijders - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -#ifndef OUROBOROS_LIB_CACEP_ANONYMOUS_AUTH_H -#define OUROBOROS_LIB_CACEP_ANONYMOUS_AUTH_H - -struct conn_info * cacep_anonymous_auth(int fd, - const struct conn_info * info, - const void * auth); - -struct conn_info * cacep_anonymous_auth_wait(int fd, - const struct conn_info * info, - const void * auth); - -#endif /* OUROBOROS_LIB_CACEP_ANONYMOUS_AUTH_H */ diff --git a/src/lib/pol/cacep_anonymous_auth.proto b/src/lib/pol/cacep_anonymous_auth.proto deleted file mode 100644 index 79734e28..00000000 --- a/src/lib/pol/cacep_anonymous_auth.proto +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * Message for no authentication CACEP policy - * - * Dimitri Staessens - * Sander Vrijders - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -syntax = "proto2"; - -import "cacep_proto.proto"; - -message cacep_anonymous_auth_msg { - required cacep_proto_msg proto = 1; -} \ No newline at end of file diff --git a/src/lib/pol/cacep_proto.c b/src/lib/pol/cacep_proto.c deleted file mode 100644 index 9990a05a..00000000 --- a/src/lib/pol/cacep_proto.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * CACEP - Read/Write Protocol info - * - * Sander Vrijders - * Dimitri Staessens - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -#include "cacep_proto.h" - -enum proto_concrete_syntax code_to_syntax(int code) -{ - switch(code) { - case PROTO_CONCRETE_SYNTAX_CODE__GPB: - return PROTO_GPB; - case PROTO_CONCRETE_SYNTAX_CODE__ASN_1: - return PROTO_ASN_1; - case PROTO_CONCRETE_SYNTAX_CODE__FIXED: - return PROTO_FIXED; - default: - return -1; - } -} - -int syntax_to_code(enum proto_concrete_syntax stx) -{ - switch(stx) { - case PROTO_GPB: - return PROTO_CONCRETE_SYNTAX_CODE__GPB; - case PROTO_ASN_1: - return PROTO_CONCRETE_SYNTAX_CODE__ASN_1; - case PROTO_FIXED: - return PROTO_CONCRETE_SYNTAX_CODE__FIXED; - default: - return -1; - } -} diff --git a/src/lib/pol/cacep_proto.h b/src/lib/pol/cacep_proto.h deleted file mode 100644 index bfb1b247..00000000 --- a/src/lib/pol/cacep_proto.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * CACEP - Convert syntax to msg code and back - * - * Sander Vrijders - * Dimitri Staessens - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -#ifndef OUROBOROS_LIB_CACEP_CDAP_H -#define OUROBOROS_LIB_CACEP_CDAP_H - -#include -#include - -#include "cacep_proto.pb-c.h" - -enum proto_concrete_syntax code_to_syntax(int code); - -int syntax_to_code(enum proto_concrete_syntax stx); - -#endif /* OUROBOROS_LIB_CACEP_CDAP_H */ diff --git a/src/lib/pol/cacep_proto.proto b/src/lib/pol/cacep_proto.proto deleted file mode 100644 index f313bfc1..00000000 --- a/src/lib/pol/cacep_proto.proto +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * Message for setting Protocol information in CACEP - * - * Dimitri Staessens - * Sander Vrijders - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -syntax = "proto2"; - -enum proto_concrete_syntax_code { - GPB = 1; - ASN_1 = 2; - FIXED = 3; -} - -message cacep_proto_msg { - required string protocol = 1; - required int32 pref_version = 2; - repeated int32 supp_version = 3; - required proto_concrete_syntax_code pref_syntax = 4; - repeated proto_concrete_syntax_code supp_syntax = 5; -} diff --git a/src/lib/pol/cacep_simple_auth.c b/src/lib/pol/cacep_simple_auth.c deleted file mode 100644 index 69189114..00000000 --- a/src/lib/pol/cacep_simple_auth.c +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * Simple authentication policy for CACEP - * - * Dimitri Staessens - * Sander Vrijders - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -#include -#include -#include -#include - -#include "cacep_proto.h" -#include "cacep_simple_auth.h" - -#include -#include - -#include "cacep_simple_auth.pb-c.h" -typedef CacepSimpleAuthMsg cacep_simple_auth_msg_t; -typedef CacepProtoMsg cacep_proto_msg_t; - -#define BUF_SIZE 2048 - -static struct conn_info * read_msg(int fd) -{ - struct conn_info * tmp; - uint8_t buf[BUF_SIZE]; - cacep_simple_auth_msg_t * msg; - ssize_t len; - - len = flow_read(fd, buf, BUF_SIZE); - if (len < 0) - return NULL; - - msg = cacep_simple_auth_msg__unpack(NULL, len, buf); - if (msg == NULL) - return NULL; - - tmp = malloc(sizeof(*tmp)); - if (tmp == NULL) { - cacep_simple_auth_msg__free_unpacked(msg, NULL); - return NULL; - } - - conn_info_init(tmp); - - tmp->addr = msg->addr; - tmp->name = strdup(msg->name); - if (tmp->name == NULL) { - free(tmp); - cacep_simple_auth_msg__free_unpacked(msg, NULL); - return NULL; - } - - tmp->proto.protocol = strdup(msg->proto->protocol); - if (tmp->proto.protocol == NULL) { - conn_info_fini(tmp); - free(tmp); - cacep_simple_auth_msg__free_unpacked(msg, NULL); - return NULL; - } - - tmp->proto.pref_version = msg->proto->pref_version; - tmp->proto.pref_syntax = code_to_syntax(msg->proto->pref_syntax); - if (tmp->proto.pref_syntax < 0) { - conn_info_fini(tmp); - free(tmp); - cacep_simple_auth_msg__free_unpacked(msg, NULL); - return NULL; - } - - cacep_simple_auth_msg__free_unpacked(msg, NULL); - - return tmp; -} - -static int send_msg(int fd, - const struct conn_info * info) -{ - cacep_simple_auth_msg_t msg = CACEP_SIMPLE_AUTH_MSG__INIT; - cacep_proto_msg_t cmsg = CACEP_PROTO_MSG__INIT; - int ret = 0; - uint8_t * data = NULL; - size_t len = 0; - - cmsg.protocol = info->proto.protocol; - cmsg.pref_version = info->proto.pref_version; - cmsg.pref_syntax = syntax_to_code(info->proto.pref_syntax); - if (cmsg.pref_syntax < 0) - return -1; - - msg.proto = &cmsg; - msg.name = info->name; - msg.addr = info->addr; - - len = cacep_simple_auth_msg__get_packed_size(&msg); - if (len == 0) - return -1; - - data = malloc(len); - if (data == NULL) - return -ENOMEM; - - cacep_simple_auth_msg__pack(&msg, data); - - if (flow_write(fd, data, len) < 0) - ret = -1; - - free(data); - - return ret; -} - -struct conn_info * cacep_simple_auth_auth(int fd, - const struct conn_info * info, - const void * auth) -{ - struct conn_info * tmp; - - assert(info); - - /* This policy does not need info to authenticate */ - (void) auth; - - if (send_msg(fd, info)) - return NULL; - - tmp = read_msg(fd); - if (tmp == NULL) - return NULL; - - if (strcmp(info->proto.protocol, tmp->proto.protocol) || - info->proto.pref_version != tmp->proto.pref_version || - info->proto.pref_syntax != tmp->proto.pref_syntax) { - conn_info_fini(tmp); - free(tmp); - return NULL; - } - - return tmp; -} - - -struct conn_info * cacep_simple_auth_auth_wait(int fd, - const struct conn_info * info, - const void * auth) -{ - struct conn_info * tmp; - - assert(info); - - (void) auth; - - tmp = read_msg(fd); - if (tmp == NULL) - return NULL; - - if (send_msg(fd, info)) { - conn_info_fini(tmp); - free(tmp); - return NULL; - } - - if (strcmp(info->proto.protocol, tmp->proto.protocol) || - info->proto.pref_version != tmp->proto.pref_version || - info->proto.pref_syntax != tmp->proto.pref_syntax) { - conn_info_fini(tmp); - free(tmp); - return NULL; - } - - return tmp; -} diff --git a/src/lib/pol/cacep_simple_auth.h b/src/lib/pol/cacep_simple_auth.h deleted file mode 100644 index 31398a68..00000000 --- a/src/lib/pol/cacep_simple_auth.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * Simple authentication policy for CACEP - * - * Dimitri Staessens - * Sander Vrijders - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -#ifndef OUROBOROS_LIB_CACEP_SIMPLE_AUTH_H -#define OUROBOROS_LIB_CACEP_SIMPLE_AUTH_H - -struct conn_info * cacep_simple_auth_auth(int fd, - const struct conn_info * info, - const void * auth); - -struct conn_info * cacep_simple_auth_auth_wait(int fd, - const struct conn_info * info, - const void * auth); - -#endif /* OUROBOROS_LIB_CACEP_SIMPLE_AUTH_H */ diff --git a/src/lib/pol/cacep_simple_auth.proto b/src/lib/pol/cacep_simple_auth.proto deleted file mode 100644 index 1a1e7ea8..00000000 --- a/src/lib/pol/cacep_simple_auth.proto +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * Message for no authentication CACEP policy - * - * Dimitri Staessens - * Sander Vrijders - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ - -syntax = "proto2"; - -import "cacep_proto.proto"; - -message cacep_simple_auth_msg { - required cacep_proto_msg proto = 1; - required string name = 2; - required uint64 addr = 3; -} -- cgit v1.2.3 From a409fd81dfc6d22f9a287f15394b86490dea5273 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 23 Feb 2017 14:31:31 +0100 Subject: ipcpd: normal: Refactor application entities and add neighbors struct This refactors the different Application Entities of the normal IPCP. They all listen to and use the connection manager to establish new application connections. This commit also adds a neighbors struct to the normal IPCP. It contains neighbor structs that contain application connection. Notifiers can be registered in case a neighbor changes (added, removed, QoS changed). The flow manager has an instance of this neighbors struct and listens to these events to update its flow set. The routing component also listens to these events so that it can update the FSDB if needed. The flow manager now also creates the PFF instances and the routing instances per QoS cube. The RIB manager also uses this an instance of the neighbors struct and listens to neighbor events as well. --- src/ipcpd/normal/CMakeLists.txt | 2 + src/ipcpd/normal/connmgr.c | 8 +- src/ipcpd/normal/connmgr.h | 2 +- src/ipcpd/normal/enroll.c | 292 +++++++++++++++++++++++---------------- src/ipcpd/normal/enroll.h | 10 +- src/ipcpd/normal/fmgr.c | 283 +++++++++++++++++++++++--------------- src/ipcpd/normal/fmgr.h | 4 - src/ipcpd/normal/frct.c | 16 +-- src/ipcpd/normal/frct.h | 2 + src/ipcpd/normal/gam.c | 296 +++------------------------------------- src/ipcpd/normal/gam.h | 21 +-- src/ipcpd/normal/main.c | 54 ++++++-- src/ipcpd/normal/neighbors.c | 213 +++++++++++++++++++++++++++++ src/ipcpd/normal/neighbors.h | 81 +++++++++++ src/ipcpd/normal/pff.c | 7 +- src/ipcpd/normal/pff.h | 4 +- src/ipcpd/normal/pol-gam-ops.h | 14 +- src/ipcpd/normal/pol/complete.c | 189 ++++++++++--------------- src/ipcpd/normal/pol/complete.h | 29 ++-- src/ipcpd/normal/ribconfig.h | 2 + src/ipcpd/normal/ribmgr.c | 84 +++++++++--- src/ipcpd/normal/ribmgr.h | 3 - src/ipcpd/normal/routing.c | 132 ++++++++++++++++++ src/ipcpd/normal/routing.h | 42 ++++++ 24 files changed, 1065 insertions(+), 725 deletions(-) create mode 100644 src/ipcpd/normal/neighbors.c create mode 100644 src/ipcpd/normal/neighbors.h create mode 100644 src/ipcpd/normal/routing.c create mode 100644 src/ipcpd/normal/routing.h (limited to 'src/ipcpd/normal/ribmgr.c') diff --git a/src/ipcpd/normal/CMakeLists.txt b/src/ipcpd/normal/CMakeLists.txt index 70742336..772d5212 100644 --- a/src/ipcpd/normal/CMakeLists.txt +++ b/src/ipcpd/normal/CMakeLists.txt @@ -27,8 +27,10 @@ set(SOURCE_FILES frct.c gam.c main.c + neighbors.c pff.c ribmgr.c + routing.c shm_pci.c # Add policies last pol/complete.c diff --git a/src/ipcpd/normal/connmgr.c b/src/ipcpd/normal/connmgr.c index 387c38fd..0c908cd1 100644 --- a/src/ipcpd/normal/connmgr.c +++ b/src/ipcpd/normal/connmgr.c @@ -42,8 +42,6 @@ #include #include -#define FRCT_PROTO "frct" - struct ae_conn { struct list_head next; struct conn conn; @@ -272,7 +270,7 @@ void connmgr_ae_destroy(struct ae * ae) int connmgr_alloc(struct ae * ae, char * dst_name, - qosspec_t qs, + qosspec_t * qs, struct conn * conn) { assert(ae); @@ -281,13 +279,13 @@ int connmgr_alloc(struct ae * ae, memset(&conn->conn_info, 0, sizeof(conn->conn_info)); - conn->flow_info.fd = flow_alloc(dst_name, &qs); + conn->flow_info.fd = flow_alloc(dst_name, qs); if (conn->flow_info.fd < 0) { log_err("Failed to allocate flow to %s.", dst_name); return -1; } - conn->flow_info.qs = qs; + conn->flow_info.qs = *qs; if (flow_alloc_res(conn->flow_info.fd)) { log_err("Flow allocation to %s failed.", dst_name); diff --git a/src/ipcpd/normal/connmgr.h b/src/ipcpd/normal/connmgr.h index bfb3d762..5dbf2bcc 100644 --- a/src/ipcpd/normal/connmgr.h +++ b/src/ipcpd/normal/connmgr.h @@ -48,7 +48,7 @@ void connmgr_ae_destroy(struct ae * ae); int connmgr_alloc(struct ae * ae, char * dst_name, - qosspec_t qs, + qosspec_t * qs, struct conn * conn); int connmgr_wait(struct ae * ae, diff --git a/src/ipcpd/normal/enroll.c b/src/ipcpd/normal/enroll.c index 9c3b9973..25460161 100644 --- a/src/ipcpd/normal/enroll.c +++ b/src/ipcpd/normal/enroll.c @@ -22,6 +22,8 @@ #include #include +#include +#include #include #include #include @@ -29,29 +31,35 @@ #include #include "ae.h" -#include "cdap_flow.h" +#include "connmgr.h" #include "ribconfig.h" #include #include #include +#include /* Symbolic, will return current time */ #define TIME_NAME "localtime" #define TIME_PATH DLR TIME_NAME #define ENROLL_WARN_TIME_OFFSET 20 -int enroll_handle(int fd) +struct { + struct ae * ae; + pthread_t listener; +} enroll; + +static void * enroll_handle(void * o) { - struct cdap_flow * flow; - struct conn_info info; - cdap_key_t key; - enum cdap_opcode oc; - char * name; - uint8_t * buf; - uint8_t * data; - ssize_t len; - uint32_t flags; + struct cdap * cdap; + struct conn conn; + cdap_key_t key; + enum cdap_opcode oc; + char * name; + uint8_t * buf; + uint8_t * data; + ssize_t len; + uint32_t flags; bool boot_r = false; bool members_r = false; @@ -61,98 +69,107 @@ int enroll_handle(int fd) char * members_ro = MEMBERS_PATH; char * dif_ro = DIF_PATH; - memset(&info, 0, sizeof(info)); - - strcpy(info.ae_name, ENROLL_AE); - strcpy(info.protocol, CDAP_PROTO); - info.pref_version = 1; - info.pref_syntax = PROTO_GPB; + (void) o; - flow = cdap_flow_arr(fd, 0, &info); - if (flow == NULL) { - log_err("Failed to auth enrollment request."); - flow_dealloc(fd); - return -1; - } - - while (!(boot_r && members_r && dif_name_r)) { - key = cdap_request_wait(flow->ci, &oc, &name, &data, - (size_t *) &len , &flags); - assert(key >= 0); - assert(name); - - if (data != NULL) { - free(data); - log_warn("Received data with enrollment request."); - } - - if (oc != CDAP_READ) { - log_warn("Invalid request."); - cdap_reply_send(flow->ci, key, -1, NULL, 0); - cdap_flow_dealloc(flow); - free(name); - return -1; + while (true) { + if (connmgr_wait(enroll.ae, &conn)) { + log_err("Failed to get next connection."); + continue; } - if (strcmp(name, boot_ro) == 0) { - boot_r = true; - } else if (strcmp(name, members_ro) == 0) { - members_r = true; - } else if (strcmp(name, dif_ro) == 0) { - dif_name_r = true; - } else if (strcmp(name, TIME_PATH) == 0) { - struct timespec t; - uint64_t buf[2]; - clock_gettime(CLOCK_REALTIME, &t); - buf[0] = hton64(t.tv_sec); - buf[1] = hton64(t.tv_nsec); - cdap_reply_send(flow->ci, key, 0, buf, sizeof(buf)); - free(name); + cdap = cdap_create(conn.flow_info.fd); + if (cdap == NULL) { + log_err("Failed to instantiate CDAP."); + flow_dealloc(conn.flow_info.fd); continue; - } else { - log_warn("Illegal read: %s.", name); - cdap_reply_send(flow->ci, key, -1, NULL, 0); - cdap_flow_dealloc(flow); - free(name); - return -1; } - len = rib_pack(name, &buf, PACK_HASH_ROOT); - if (len < 0) { - log_err("Failed to pack %s.", name); - cdap_reply_send(flow->ci, key, -1, NULL, 0); - cdap_flow_dealloc(flow); - free(name); - return -1; - } + while (!(boot_r && members_r && dif_name_r)) { + key = cdap_request_wait(cdap, &oc, &name, &data, + (size_t *) &len , &flags); + assert(key >= 0); + assert(name); + + if (data != NULL) { + free(data); + log_warn("Received data with enroll request."); + } + + if (oc != CDAP_READ) { + log_warn("Invalid request."); + cdap_reply_send(cdap, key, -1, NULL, 0); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); + free(name); + continue; + } + + if (strcmp(name, boot_ro) == 0) { + boot_r = true; + } else if (strcmp(name, members_ro) == 0) { + members_r = true; + } else if (strcmp(name, dif_ro) == 0) { + dif_name_r = true; + } else if (strcmp(name, TIME_PATH) == 0) { + struct timespec t; + uint64_t buf[2]; + clock_gettime(CLOCK_REALTIME, &t); + buf[0] = hton64(t.tv_sec); + buf[1] = hton64(t.tv_nsec); + cdap_reply_send(cdap, key, 0, buf, sizeof(buf)); + free(name); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); + continue; + } else { + log_warn("Illegal read: %s.", name); + cdap_reply_send(cdap, key, -1, NULL, 0); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); + free(name); + continue; + } + + len = rib_pack(name, &buf, PACK_HASH_ROOT); + if (len < 0) { + log_err("Failed to pack %s.", name); + cdap_reply_send(cdap, key, -1, NULL, 0); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); + free(name); + continue; + } + + log_dbg("Packed %s (%zu bytes).", name, len); - log_dbg("Packed %s (%zu bytes).", name, len); + free(name); - free(name); + if (cdap_reply_send(cdap, key, 0, buf, len)) { + log_err("Failed to send CDAP reply."); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); + continue; + } - if (cdap_reply_send(flow->ci, key, 0, buf, len)) { - log_err("Failed to send CDAP reply."); - cdap_flow_dealloc(flow); - return -1; + free(buf); } - free(buf); - } - - log_dbg("Sent boot info to new member."); + log_dbg("Sent boot info to new member."); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); + } return 0; } int enroll_boot(char * dst_name) { - struct cdap_flow * flow; - struct conn_info info; - cdap_key_t key; - uint8_t * data; - size_t len; + struct cdap * cdap; + cdap_key_t key; + uint8_t * data; + size_t len; + struct conn conn; struct timespec t0; struct timespec rtt; @@ -163,16 +180,14 @@ int enroll_boot(char * dst_name) char * members_ro = MEMBERS_PATH; char * dif_ro = DIF_PATH; - memset(&info, 0, sizeof(info)); - - strcpy(info.ae_name, ENROLL_AE); - strcpy(info.protocol, CDAP_PROTO); - info.pref_version = 1; - info.pref_syntax = PROTO_GPB; + if (connmgr_alloc(enroll.ae, dst_name, NULL, &conn)) { + log_err("Failed to get connection."); + return -1; + } - flow = cdap_flow_alloc(dst_name, NULL, &info); - if (flow == NULL) { - log_err("Failed to allocate flow for enrollment request."); + cdap = cdap_create(conn.flow_info.fd); + if (cdap == NULL) { + log_err("Failed to instantiate CDAP."); return -1; } @@ -180,16 +195,18 @@ int enroll_boot(char * dst_name) clock_gettime(CLOCK_REALTIME, &t0); - key = cdap_request_send(flow->ci, CDAP_READ, TIME_PATH, NULL, 0, 0); + key = cdap_request_send(cdap, CDAP_READ, TIME_PATH, NULL, 0, 0); if (key < 0) { log_err("Failed to send CDAP request."); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } - if (cdap_reply_wait(flow->ci, key, &data, &len)) { + if (cdap_reply_wait(cdap, key, &data, &len)) { log_err("Failed to get CDAP reply."); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } @@ -207,16 +224,18 @@ int enroll_boot(char * dst_name) free(data); - key = cdap_request_send(flow->ci, CDAP_READ, boot_ro, NULL, 0, 0); + key = cdap_request_send(cdap, CDAP_READ, boot_ro, NULL, 0, 0); if (key < 0) { log_err("Failed to send CDAP request."); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } - if (cdap_reply_wait(flow->ci, key, &data, &len)) { + if (cdap_reply_wait(cdap, key, &data, &len)) { log_err("Failed to get CDAP reply."); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } @@ -226,22 +245,25 @@ int enroll_boot(char * dst_name) log_warn("Error unpacking RIB data."); rib_del(boot_ro); free(data); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } log_dbg("Packed information inserted into RIB."); - key = cdap_request_send(flow->ci, CDAP_READ, members_ro, NULL, 0, 0); + key = cdap_request_send(cdap, CDAP_READ, members_ro, NULL, 0, 0); if (key < 0) { log_err("Failed to send CDAP request."); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } - if (cdap_reply_wait(flow->ci, key, &data, &len)) { + if (cdap_reply_wait(cdap, key, &data, &len)) { log_err("Failed to get CDAP reply."); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } @@ -251,22 +273,25 @@ int enroll_boot(char * dst_name) log_warn("Error unpacking RIB data."); rib_del(boot_ro); free(data); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } log_dbg("Packed information inserted into RIB."); - key = cdap_request_send(flow->ci, CDAP_READ, dif_ro, NULL, 0, 0); + key = cdap_request_send(cdap, CDAP_READ, dif_ro, NULL, 0, 0); if (key < 0) { log_err("Failed to send CDAP request."); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } - if (cdap_reply_wait(flow->ci, key, &data, &len)) { + if (cdap_reply_wait(cdap, key, &data, &len)) { log_err("Failed to get CDAP reply."); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } @@ -276,13 +301,52 @@ int enroll_boot(char * dst_name) log_warn("Error unpacking RIB data."); rib_del(boot_ro); free(data); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); return -1; } log_dbg("Packed information inserted into RIB."); - cdap_flow_dealloc(flow); + cdap_destroy(cdap); + flow_dealloc(conn.flow_info.fd); + + return 0; +} + +int enroll_init(void) +{ + struct conn_info info; + + memset(&info, 0, sizeof(info)); + + strcpy(info.ae_name, ENROLL_AE); + strcpy(info.protocol, CDAP_PROTO); + info.pref_version = 1; + info.pref_syntax = PROTO_GPB; + + enroll.ae = connmgr_ae_create(info); + if (enroll.ae == NULL) + return -1; + + return 0; +} + +void enroll_fini(void) +{ + connmgr_ae_destroy(enroll.ae); +} + +int enroll_start(void) +{ + if (pthread_create(&enroll.listener, NULL, enroll_handle, NULL)) + return -1; return 0; } + +void enroll_stop(void) +{ + pthread_cancel(enroll.listener); + pthread_join(enroll.listener, NULL); +} diff --git a/src/ipcpd/normal/enroll.h b/src/ipcpd/normal/enroll.h index 2980c380..3c81ae25 100644 --- a/src/ipcpd/normal/enroll.h +++ b/src/ipcpd/normal/enroll.h @@ -22,8 +22,14 @@ #ifndef OUROBOROS_IPCPD_NORMAL_ENROLL_H #define OUROBOROS_IPCPD_NORMAL_ENROLL_H -int enroll_handle(int fd); +int enroll_init(void); -int enroll_boot(char * dst_name); +void enroll_fini(void); + +int enroll_start(void); + +void enroll_stop(void); + +int enroll_boot(char * dst_name); #endif /* OUROBOROS_IPCPD_NORMAL_ENROLL_H */ diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c index 34724ddd..b7a99f6c 100644 --- a/src/ipcpd/normal/fmgr.c +++ b/src/ipcpd/normal/fmgr.c @@ -31,12 +31,16 @@ #include #include +#include "connmgr.h" #include "fmgr.h" #include "frct.h" #include "ipcp.h" #include "shm_pci.h" -#include "gam.h" #include "ribconfig.h" +#include "pff.h" +#include "neighbors.h" +#include "gam.h" +#include "routing.h" #include #include @@ -48,19 +52,7 @@ typedef FlowAllocMsg flow_alloc_msg_t; #define FD_UPDATE_TIMEOUT 100000 /* nanoseconds */ -struct nm1_flow { - struct list_head next; - int fd; - qosspec_t qs; - struct conn_info * info; -}; - struct { - flow_set_t * nm1_set[QOS_CUBE_MAX]; - fqueue_t * nm1_fqs[QOS_CUBE_MAX]; - struct list_head nm1_flows; - pthread_rwlock_t nm1_flows_lock; - flow_set_t * np1_set[QOS_CUBE_MAX]; fqueue_t * np1_fqs[QOS_CUBE_MAX]; pthread_rwlock_t np1_flows_lock; @@ -69,15 +61,43 @@ struct { int np1_cep_id_to_fd[IPCPD_MAX_CONNS]; pthread_t np1_sdu_reader; + + flow_set_t * nm1_set[QOS_CUBE_MAX]; + fqueue_t * nm1_fqs[QOS_CUBE_MAX]; pthread_t nm1_sdu_reader; - pthread_t nm1_flow_wait; - /* FIXME: Replace with PFF */ - int fd; + struct pff * pff[QOS_CUBE_MAX]; + struct routing * routing[QOS_CUBE_MAX]; struct gam * gam; + struct nbs * nbs; + struct ae * ae; + + struct nb_notifier nb_notifier; } fmgr; +static int fmgr_neighbor_event(enum nb_event event, + struct conn conn) +{ + qoscube_t cube; + + /* We are only interested in neighbors being added and removed. */ + switch (event) { + case NEIGHBOR_ADDED: + ipcp_flow_get_qoscube(conn.flow_info.fd, &cube); + flow_set_add(fmgr.nm1_set[cube], conn.flow_info.fd); + break; + case NEIGHBOR_REMOVED: + ipcp_flow_get_qoscube(conn.flow_info.fd, &cube); + flow_set_del(fmgr.nm1_set[cube], conn.flow_info.fd); + break; + default: + break; + } + + return 0; +} + static void * fmgr_np1_sdu_reader(void * o) { struct shm_du_buff * sdb; @@ -171,12 +191,20 @@ void * fmgr_nm1_sdu_reader(void * o) continue; } - /* - * FIXME: Dropping for now, since - * we don't have a PFF yet - */ - ipcp_flow_del(sdb); - continue; + fd = pff_nhop(fmgr.pff[i], pci.dst_addr); + if (fd < 0) { + log_err("No next hop for %lu", + pci.dst_addr); + ipcp_flow_del(sdb); + continue; + } + + if (ipcp_flow_write(fd, sdb)) { + log_err("Failed to write SDU to fd %d.", + fd); + ipcp_flow_del(sdb); + continue; + } } shm_pci_shrink(sdb); @@ -192,49 +220,6 @@ void * fmgr_nm1_sdu_reader(void * o) return (void *) 0; } -static void * fmgr_nm1_flow_wait(void * o) -{ - qoscube_t cube; - struct conn_info * info; - int fd; - qosspec_t qs; - struct nm1_flow * flow; - - (void) o; - - while (true) { - if (gam_flow_wait(fmgr.gam, &fd, &info, &qs)) { - log_err("Failed to get next flow descriptor."); - continue; - } - - ipcp_flow_get_qoscube(fd, &cube); - flow_set_add(fmgr.nm1_set[cube], fd); - - /* FIXME: Temporary, until we have a PFF */ - fmgr.fd = fd; - - pthread_rwlock_wrlock(&fmgr.nm1_flows_lock); - flow = malloc(sizeof(*flow)); - if (flow == NULL) { - free(info); - pthread_rwlock_unlock(&fmgr.nm1_flows_lock); - continue; - } - - flow->info = info; - flow->fd = fd; - flow->qs = qs; - - list_head_init(&flow->next); - list_add(&flow->next, &fmgr.nm1_flows); - - pthread_rwlock_unlock(&fmgr.nm1_flows_lock); - } - - return (void *) 0; -} - static void fmgr_destroy_flows(void) { int i; @@ -247,12 +232,29 @@ static void fmgr_destroy_flows(void) } } -int fmgr_init(void) +static void fmgr_destroy_routing(void) { - enum pol_gam pg; + int i; + + for (i = 0; i < QOS_CUBE_MAX; ++i) + routing_destroy(fmgr.routing[i]); +} +static void fmgr_destroy_pff(void) +{ int i; + for (i = 0; i < QOS_CUBE_MAX; ++i) + pff_destroy(fmgr.pff[i]); +} + +int fmgr_init(void) +{ + enum pol_gam pg; + int i; + int j; + struct conn_info info; + for (i = 0; i < AP_MAX_FLOWS; ++i) fmgr.np1_fd_to_cep_id[i] = INVALID_CEP_ID; @@ -288,63 +290,116 @@ int fmgr_init(void) if (rib_read(BOOT_PATH "/dt/gam/type", &pg, sizeof(pg)) != sizeof(pg)) { log_err("Failed to read policy for ribmgr gam."); + fmgr_destroy_flows(); return -1; } - fmgr.gam = gam_create(pg); - if (fmgr.gam == NULL) { - log_err("Failed to create graph adjacency manager."); + strcpy(info.ae_name, DT_AE); + strcpy(info.protocol, FRCT_PROTO); + info.pref_version = 1; + info.pref_syntax = PROTO_FIXED; + info.addr = ipcpi.dt_addr; + + fmgr.ae = connmgr_ae_create(info); + if (fmgr.ae == NULL) { + log_err("Failed to create AE struct."); fmgr_destroy_flows(); return -1; } - list_head_init(&fmgr.nm1_flows); + fmgr.nbs = nbs_create(); + if (fmgr.nbs == NULL) { + log_err("Failed to create neighbors struct."); + fmgr_destroy_flows(); + connmgr_ae_destroy(fmgr.ae); + return -1; + } - pthread_rwlock_init(&fmgr.nm1_flows_lock, NULL); - pthread_rwlock_init(&fmgr.np1_flows_lock, NULL); + fmgr.nb_notifier.notify_call = fmgr_neighbor_event; + if (nbs_reg_notifier(fmgr.nbs, &fmgr.nb_notifier)) { + log_err("Failed to register notifier."); + nbs_destroy(fmgr.nbs); + fmgr_destroy_flows(); + connmgr_ae_destroy(fmgr.ae); + return -1; + } + + if (pthread_rwlock_init(&fmgr.np1_flows_lock, NULL)) { + gam_destroy(fmgr.gam); + nbs_unreg_notifier(fmgr.nbs, &fmgr.nb_notifier); + nbs_destroy(fmgr.nbs); + fmgr_destroy_flows(); + connmgr_ae_destroy(fmgr.ae); + return -1; + } + + for (i = 0; i < QOS_CUBE_MAX; ++i) { + fmgr.pff[i] = pff_create(); + if (fmgr.pff[i] == NULL) { + for (j = 0; j < i; ++j) + pff_destroy(fmgr.pff[j]); + pthread_rwlock_destroy(&fmgr.np1_flows_lock); + nbs_unreg_notifier(fmgr.nbs, &fmgr.nb_notifier); + nbs_destroy(fmgr.nbs); + fmgr_destroy_flows(); + connmgr_ae_destroy(fmgr.ae); + return -1; + } + + fmgr.routing[i] = routing_create(fmgr.pff[i], fmgr.nbs); + if (fmgr.routing[i] == NULL) { + for (j = 0; j < i; ++j) + routing_destroy(fmgr.routing[j]); + fmgr_destroy_pff(); + pthread_rwlock_destroy(&fmgr.np1_flows_lock); + nbs_unreg_notifier(fmgr.nbs, &fmgr.nb_notifier); + nbs_destroy(fmgr.nbs); + fmgr_destroy_flows(); + connmgr_ae_destroy(fmgr.ae); + return -1; + } + } + + fmgr.gam = gam_create(pg, fmgr.nbs, fmgr.ae); + if (fmgr.gam == NULL) { + log_err("Failed to init dt graph adjacency manager."); + fmgr_destroy_routing(); + fmgr_destroy_pff(); + pthread_rwlock_destroy(&fmgr.np1_flows_lock); + nbs_unreg_notifier(fmgr.nbs, &fmgr.nb_notifier); + nbs_destroy(fmgr.nbs); + fmgr_destroy_flows(); + connmgr_ae_destroy(fmgr.ae); + return -1; + } pthread_create(&fmgr.np1_sdu_reader, NULL, fmgr_np1_sdu_reader, NULL); pthread_create(&fmgr.nm1_sdu_reader, NULL, fmgr_nm1_sdu_reader, NULL); - pthread_create(&fmgr.nm1_flow_wait, NULL, fmgr_nm1_flow_wait, NULL); return 0; } void fmgr_fini() { - struct list_head * pos = NULL; - struct list_head * n = NULL; - qoscube_t cube; - pthread_cancel(fmgr.np1_sdu_reader); pthread_cancel(fmgr.nm1_sdu_reader); - pthread_cancel(fmgr.nm1_flow_wait); pthread_join(fmgr.np1_sdu_reader, NULL); pthread_join(fmgr.nm1_sdu_reader, NULL); - pthread_join(fmgr.nm1_flow_wait, NULL); - gam_destroy(fmgr.gam); + nbs_unreg_notifier(fmgr.nbs, &fmgr.nb_notifier); - pthread_rwlock_wrlock(&fmgr.nm1_flows_lock); - - list_for_each_safe(pos, n, &fmgr.nm1_flows) { - struct nm1_flow * flow = - list_entry(pos, struct nm1_flow, next); - list_del(&flow->next); - flow_dealloc(flow->fd); - ipcp_flow_get_qoscube(flow->fd, &cube); - flow_set_del(fmgr.nm1_set[cube], flow->fd); - free(flow->info); - free(flow); - } + gam_destroy(fmgr.gam); - pthread_rwlock_unlock(&fmgr.nm1_flows_lock); + fmgr_destroy_routing(); - pthread_rwlock_destroy(&fmgr.nm1_flows_lock); - pthread_rwlock_destroy(&fmgr.np1_flows_lock); + fmgr_destroy_pff(); fmgr_destroy_flows(); + + connmgr_ae_destroy(fmgr.ae); + + nbs_destroy(fmgr.nbs); } int fmgr_np1_alloc(int fd, @@ -601,24 +656,20 @@ int fmgr_np1_post_sdu(cep_id_t cep_id, return 0; } -int fmgr_nm1_flow_arr(int fd, - qosspec_t qs) -{ - assert(fmgr.gam); - - if (gam_flow_arr(fmgr.gam, fd, qs)) { - log_err("Failed to hand to graph adjacency manager."); - return -1; - } - - return 0; -} - int fmgr_nm1_write_sdu(struct pci * pci, struct shm_du_buff * sdb) { + int fd; + if (pci == NULL || sdb == NULL) + return -EINVAL; + + fd = pff_nhop(fmgr.pff[pci->qos_id], pci->dst_addr); + if (fd < 0) { + log_err("Could not get nhop for address %lu", pci->dst_addr); + ipcp_flow_del(sdb); return -1; + } if (shm_pci_ser(sdb, pci)) { log_err("Failed to serialize PDU."); @@ -626,8 +677,8 @@ int fmgr_nm1_write_sdu(struct pci * pci, return -1; } - if (ipcp_flow_write(fmgr.fd, sdb)) { - log_err("Failed to write SDU to fd %d.", fmgr.fd); + if (ipcp_flow_write(fd, sdb)) { + log_err("Failed to write SDU to fd %d.", fd); ipcp_flow_del(sdb); return -1; } @@ -639,9 +690,17 @@ int fmgr_nm1_write_buf(struct pci * pci, buffer_t * buf) { buffer_t * buffer; + int fd; if (pci == NULL || buf == NULL || buf->data == NULL) + return -EINVAL; + + fd = pff_nhop(fmgr.pff[pci->qos_id], pci->dst_addr); + if (fd < 0) { + log_err("Could not get nhop for address %lu", pci->dst_addr); + free(buf->data); return -1; + } buffer = shm_pci_ser_buf(buf, pci); if (buffer == NULL) { @@ -650,7 +709,7 @@ int fmgr_nm1_write_buf(struct pci * pci, return -1; } - if (flow_write(fmgr.fd, buffer->data, buffer->len) == -1) { + if (flow_write(fd, buffer->data, buffer->len) == -1) { log_err("Failed to write buffer to fd."); free(buffer); return -1; diff --git a/src/ipcpd/normal/fmgr.h b/src/ipcpd/normal/fmgr.h index e75417f3..06eab0a1 100644 --- a/src/ipcpd/normal/fmgr.h +++ b/src/ipcpd/normal/fmgr.h @@ -53,8 +53,4 @@ int fmgr_nm1_write_sdu(struct pci * pci, int fmgr_nm1_write_buf(struct pci * pci, buffer_t * buf); -int fmgr_nm1_flow_arr(int fd, - qosspec_t qs); - - #endif /* OUROBOROS_IPCPD_NORMAL_FMGR_H */ diff --git a/src/ipcpd/normal/frct.c b/src/ipcpd/normal/frct.c index c9b23060..b5a42db4 100644 --- a/src/ipcpd/normal/frct.c +++ b/src/ipcpd/normal/frct.c @@ -198,12 +198,12 @@ int frct_fini() return 0; } -int frct_nm1_post_sdu(struct pci * pci, +int frct_nm1_post_sdu(struct pci * pci, struct shm_du_buff * sdb) { struct frct_i * instance; - buffer_t buf; - cep_id_t id; + buffer_t buf; + cep_id_t id; if (pci == NULL || sdb == NULL) return -1; @@ -267,8 +267,8 @@ cep_id_t frct_i_create(uint64_t address, qoscube_t cube) { struct frct_i * instance; - struct pci pci; - cep_id_t id; + struct pci pci; + cep_id_t id; if (buf == NULL || buf->data == NULL) return INVALID_CEP_ID; @@ -304,7 +304,7 @@ int frct_i_accept(cep_id_t id, buffer_t * buf, qoscube_t cube) { - struct pci pci; + struct pci pci; struct frct_i * instance; if (buf == NULL || buf->data == NULL) @@ -347,7 +347,7 @@ int frct_i_accept(cep_id_t id, int frct_i_destroy(cep_id_t id, buffer_t * buf) { - struct pci pci; + struct pci pci; struct frct_i * instance; pthread_mutex_lock(&frct.instances_lock); @@ -390,7 +390,7 @@ int frct_i_destroy(cep_id_t id, int frct_i_write_sdu(cep_id_t id, struct shm_du_buff * sdb) { - struct pci pci; + struct pci pci; struct frct_i * instance; if (sdb == NULL) diff --git a/src/ipcpd/normal/frct.h b/src/ipcpd/normal/frct.h index 462b8cc3..d85d11f5 100644 --- a/src/ipcpd/normal/frct.h +++ b/src/ipcpd/normal/frct.h @@ -27,6 +27,8 @@ #include "shm_pci.h" +#define FRCT_PROTO "FRCT" + struct frct_i; int frct_init(void); diff --git a/src/ipcpd/normal/gam.c b/src/ipcpd/normal/gam.c index 212cfd83..cb4e662f 100644 --- a/src/ipcpd/normal/gam.c +++ b/src/ipcpd/normal/gam.c @@ -1,7 +1,7 @@ /* * Ouroboros - Copyright (C) 2016 - 2017 * - * Graph adjacency manager for IPC Process components + * Data transfer graph adjacency manager * * Dimitri Staessens * Sander Vrijders @@ -20,7 +20,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define OUROBOROS_PREFIX "graph-adjacency-manager" +#define OUROBOROS_PREFIX "dt-gam" #include #include @@ -40,305 +40,43 @@ #include #include -struct ga { - struct list_head next; - - qosspec_t qs; - int fd; - struct conn_info * info; -}; - struct gam { - struct list_head gas; - pthread_mutex_t gas_lock; - pthread_cond_t gas_cond; - struct pol_gam_ops * ops; void * ops_o; }; -struct gam * gam_create(enum pol_gam gam_type) +struct gam * gam_create(enum pol_gam gam_type, + struct nbs * nbs, + struct ae * ae) { - struct gam * tmp; + struct gam * gam; - tmp = malloc(sizeof(*tmp)); - if (tmp == NULL) + gam = malloc(sizeof(*gam)); + if (gam == NULL) return NULL; switch (gam_type) { case COMPLETE: - tmp->ops = &complete_ops; + gam->ops = &complete_ops; break; default: log_err("Unknown gam policy: %d.", gam_type); - free(tmp); - return NULL; - } - - list_head_init(&tmp->gas); - - if (pthread_mutex_init(&tmp->gas_lock, NULL)) { - free(tmp); - return NULL; - } - - if (pthread_cond_init(&tmp->gas_cond, NULL)) { - pthread_mutex_destroy(&tmp->gas_lock); - free(tmp); return NULL; } - tmp->ops_o = tmp->ops->create(tmp); - if (tmp->ops_o == NULL) { - pthread_cond_destroy(&tmp->gas_cond); - pthread_mutex_destroy(&tmp->gas_lock); - free(tmp); + gam->ops_o = gam->ops->create(nbs, ae); + if (gam->ops_o == NULL) { + free(gam); return NULL; } - if (tmp->ops->start(tmp->ops_o)) { - pthread_cond_destroy(&tmp->gas_cond); - pthread_mutex_destroy(&tmp->gas_lock); - free(tmp); - return NULL; - } - - return tmp; -} - -void gam_destroy(struct gam * instance) -{ - struct list_head * p = NULL; - struct list_head * n = NULL; - - assert(instance); - - instance->ops->stop(instance->ops_o); - - pthread_mutex_lock(&instance->gas_lock); - - list_for_each_safe(p, n, &instance->gas) { - struct ga * e = list_entry(p, struct ga, next); - list_del(&e->next); - free(e->info); - free(e); - } - - pthread_mutex_unlock(&instance->gas_lock); - - pthread_mutex_destroy(&instance->gas_lock); - pthread_cond_destroy(&instance->gas_cond); - - instance->ops->destroy(instance->ops_o); - free(instance); -} - -static int add_ga(struct gam * instance, - int fd, - qosspec_t qs, - struct conn_info * info) -{ - struct ga * ga; - - ga = malloc(sizeof(*ga)); - if (ga == NULL) - return -ENOMEM; - - ga->fd = fd; - ga->info = info; - ga->qs = qs; - - list_head_init(&ga->next); - - pthread_mutex_lock(&instance->gas_lock); - list_add(&ga->next, &instance->gas); - pthread_cond_signal(&instance->gas_cond); - pthread_mutex_unlock(&instance->gas_lock); - - log_info("Added flow."); - - return 0; -} - -int gam_flow_arr(struct gam * instance, - int fd, - qosspec_t qs) -{ - struct conn_info * rcv_info; - struct conn_info snd_info; - - if (flow_alloc_resp(fd, instance->ops->accept_new_flow(instance->ops_o)) - < 0) { - log_err("Could not respond to new flow."); - return -1; - } - - rcv_info = malloc(sizeof(*rcv_info)); - if (rcv_info == NULL) - return -ENOMEM; - - memset(&snd_info, 0, sizeof(snd_info)); - memset(rcv_info, 0, sizeof(*rcv_info)); - - /* FIXME: send correct AE */ - strcpy(snd_info.ae_name, "FIXME:CORRECT_AE"); - strcpy(snd_info.protocol, CDAP_PROTO); - snd_info.pref_version = 1; - snd_info.pref_syntax = PROTO_GPB; - snd_info.addr = ipcpi.dt_addr; - - if (cacep_rcv(fd, rcv_info)) { - log_err("Error establishing application connection."); - flow_dealloc(fd); - free(rcv_info); - return -1; - } - - if (cacep_snd(fd, &snd_info)) { - log_err("Failed to respond to application connection request."); - flow_dealloc(fd); - free(rcv_info); - return -1; - } - - if (strcmp(snd_info.ae_name, rcv_info->ae_name)) { - log_err("Received connection for wrong AE."); - flow_dealloc(fd); - free(rcv_info); - return -1; - } - - if (strcmp(snd_info.protocol, rcv_info->protocol) || - snd_info.pref_version != rcv_info->pref_version || - snd_info.pref_syntax != rcv_info->pref_syntax) { - flow_dealloc(fd); - free(rcv_info); - return -1; - } - - if (instance->ops->accept_flow(instance->ops_o, qs, rcv_info)) { - flow_dealloc(fd); - free(rcv_info); - return 0; - } - - if (add_ga(instance, fd, qs, rcv_info)) { - log_err("Failed to add ga to graph adjacency manager list."); - flow_dealloc(fd); - free(rcv_info); - return -1; - } - - return 0; + return gam; } -int gam_flow_alloc(struct gam * instance, - char * dst_name, - qosspec_t qs) +void gam_destroy(struct gam * gam) { - struct conn_info * rcv_info; - struct conn_info snd_info; - int fd; - - log_dbg("Allocating flow to %s.", dst_name); - - rcv_info = malloc(sizeof(*rcv_info)); - if (rcv_info == NULL) - return -ENOMEM; - - fd = flow_alloc(dst_name, NULL); - if (fd < 0) { - log_err("Failed to allocate flow to %s.", dst_name); - return -1; - } - - if (flow_alloc_res(fd)) { - log_err("Flow allocation to %s failed.", dst_name); - flow_dealloc(fd); - return -1; - } - - memset(&snd_info, 0, sizeof(snd_info)); - memset(rcv_info, 0, sizeof(*rcv_info)); - - /* FIXME: send correct AE */ - strcpy(snd_info.ae_name, "FIXME:CORRECT_AE"); - strcpy(snd_info.protocol, CDAP_PROTO); - snd_info.pref_version = 1; - snd_info.pref_syntax = PROTO_GPB; - snd_info.addr = ipcpi.dt_addr; - - if (cacep_snd(fd, &snd_info)) { - log_err("Failed to create application connection."); - flow_dealloc(fd); - free(rcv_info); - return -1; - } - - if (cacep_rcv(fd, rcv_info)) { - log_err("Failed to connect to application."); - flow_dealloc(fd); - free(rcv_info); - return -1; - } - - if (strcmp(snd_info.protocol, rcv_info->protocol) || - snd_info.pref_version != rcv_info->pref_version || - snd_info.pref_syntax != rcv_info->pref_syntax) { - flow_dealloc(fd); - free(rcv_info); - return -1; - } - - if (instance->ops->accept_flow(instance->ops_o, qs, rcv_info)) { - flow_dealloc(fd); - free(rcv_info); - return 0; - } - - if (add_ga(instance, fd, qs, rcv_info)) { - log_err("Failed to add GA to graph adjacency manager list."); - flow_dealloc(fd); - free(rcv_info); - return -1; - } - - return 0; -} - -int gam_flow_wait(struct gam * instance, - int * fd, - struct conn_info ** info, - qosspec_t * qs) -{ - struct ga * ga; - - assert(fd); - assert(info); - assert(qs); - - pthread_mutex_lock(&instance->gas_lock); - - pthread_cleanup_push((void(*)(void *))pthread_mutex_unlock, - (void *) &instance->gas_lock); - - while (list_is_empty(&instance->gas)) - pthread_cond_wait(&instance->gas_cond, &instance->gas_lock); - - ga = list_first_entry((&instance->gas), struct ga, next); - if (ga == NULL) { - pthread_mutex_unlock(&instance->gas_lock); - return -1; - } - - *fd = ga->fd; - *info = ga->info; - *qs = ga->qs; - - list_del(&ga->next); - free(ga); - - pthread_cleanup_pop(true); + assert(gam); - return 0; + gam->ops->destroy(gam->ops_o); + free(gam); } diff --git a/src/ipcpd/normal/gam.h b/src/ipcpd/normal/gam.h index 58b028b9..01a6e40e 100644 --- a/src/ipcpd/normal/gam.h +++ b/src/ipcpd/normal/gam.h @@ -1,7 +1,7 @@ /* * Ouroboros - Copyright (C) 2016 - 2017 * - * Graph adjacency manager for IPC Process components + * Data transfer graph adjacency manager * * Dimitri Staessens * Sander Vrijders @@ -26,21 +26,12 @@ #include #include -struct gam * gam_create(enum pol_gam gam_type); +#include "neighbors.h" -void gam_destroy(struct gam * instance); +struct gam * gam_create(enum pol_gam gam_type, + struct nbs * nbs, + struct ae * ae); -int gam_flow_arr(struct gam * instance, - int fd, - qosspec_t qs); - -int gam_flow_alloc(struct gam * instance, - char * dst_name, - qosspec_t qs); - -int gam_flow_wait(struct gam * instance, - int * fd, - struct conn_info ** info, - qosspec_t * qs); +void gam_destroy(struct gam * gam); #endif /* OUROBOROS_IPCPD_NORMAL_GAM_H */ diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 3e5907a8..8b9a7c09 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -105,11 +105,6 @@ static int boot_components(void) log_dbg("Starting components."); - if (connmgr_init()) { - log_err("Failed to init ap connection manager"); - return -1; - } - if (rib_read(BOOT_PATH "/addr_auth/type", &pa, sizeof(pa)) != sizeof(pa)) { log_err("Failed to read policy for address authority."); @@ -126,7 +121,6 @@ static int boot_components(void) if (ipcpi.dt_addr == 0) { log_err("Failed to get a valid address."); addr_auth_fini(); - connmgr_fini(); return -1; } @@ -137,7 +131,6 @@ static int boot_components(void) if (ribmgr_init()) { log_err("Failed to initialize RIB manager."); addr_auth_fini(); - connmgr_fini(); return -1; } @@ -145,7 +138,6 @@ static int boot_components(void) log_err("Failed to initialize directory."); ribmgr_fini(); addr_auth_fini(); - connmgr_fini(); return -1; } @@ -155,7 +147,6 @@ static int boot_components(void) dir_fini(); ribmgr_fini(); addr_auth_fini(); - connmgr_fini(); log_err("Failed to start flow manager."); return -1; } @@ -165,20 +156,29 @@ static int boot_components(void) dir_fini(); ribmgr_fini(); addr_auth_fini(); - connmgr_fini(); log_err("Failed to initialize FRCT."); return -1; } + if (enroll_start()) { + fmgr_fini(); + dir_fini(); + ribmgr_fini(); + addr_auth_fini(); + log_err("Failed to start enroll."); + return -1; + } + ipcp_set_state(IPCP_OPERATIONAL); if (connmgr_start()) { ipcp_set_state(IPCP_INIT); + enroll_stop(); + frct_fini(); fmgr_fini(); dir_fini(); ribmgr_fini(); addr_auth_fini(); - connmgr_fini(); log_err("Failed to start AP connection manager."); return -1; } @@ -190,6 +190,8 @@ void shutdown_components(void) { connmgr_stop(); + enroll_stop(); + frct_fini(); fmgr_fini(); @@ -199,8 +201,6 @@ void shutdown_components(void) ribmgr_fini(); addr_auth_fini(); - - connmgr_fini(); } static int normal_ipcp_enroll(char * dst_name) @@ -418,11 +418,33 @@ int main(int argc, exit(EXIT_FAILURE); } + + if (connmgr_init()) { + log_err("Failed to initialize connection manager."); + ipcp_create_r(getpid(), -1); + rib_fini(); + irm_unbind_api(getpid(), ipcpi.name); + ipcp_fini(); + exit(EXIT_FAILURE); + } + + if (enroll_init()) { + log_err("Failed to initialize enroll component."); + ipcp_create_r(getpid(), -1); + connmgr_fini(); + rib_fini(); + irm_unbind_api(getpid(), ipcpi.name); + ipcp_fini(); + exit(EXIT_FAILURE); + } + pthread_sigmask(SIG_BLOCK, &sigset, NULL); if (ipcp_boot() < 0) { log_err("Failed to boot IPCP."); ipcp_create_r(getpid(), -1); + enroll_fini(); + connmgr_fini(); rib_fini(); irm_unbind_api(getpid(), ipcpi.name); ipcp_fini(); @@ -435,6 +457,8 @@ int main(int argc, log_err("Failed to notify IRMd we are initialized."); ipcp_set_state(IPCP_NULL); ipcp_shutdown(); + enroll_fini(); + connmgr_fini(); rib_fini(); irm_unbind_api(getpid(), ipcpi.name); ipcp_fini(); @@ -448,6 +472,10 @@ int main(int argc, rib_fini(); + connmgr_fini(); + + enroll_fini(); + irm_unbind_api(getpid(), ipcpi.name); ipcp_fini(); diff --git a/src/ipcpd/normal/neighbors.c b/src/ipcpd/normal/neighbors.c new file mode 100644 index 00000000..40ef0d73 --- /dev/null +++ b/src/ipcpd/normal/neighbors.c @@ -0,0 +1,213 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2017 + * + * Data transfer neighbors + * + * Dimitri Staessens + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#define OUROBOROS_PREFIX "neighbors" + +#include +#include +#include +#include +#include + +#include "neighbors.h" + +#include +#include +#include + +static void notify_listeners(enum nb_event event, + struct nb * nb, + struct nbs * nbs) +{ + struct list_head * p = NULL; + + list_for_each(p, &nbs->notifiers) { + struct nb_notifier * e = + list_entry(p, struct nb_notifier, next); + if (e->notify_call(event, nb->conn)) + log_err("Listener reported an error."); + } +} + +struct nbs * nbs_create(void) +{ + struct nbs * nbs; + + nbs = malloc(sizeof(*nbs)); + if (nbs == NULL) + return NULL; + + list_head_init(&nbs->list); + list_head_init(&nbs->notifiers); + + if (pthread_mutex_init(&nbs->list_lock, NULL)) + return NULL; + + if (pthread_mutex_init(&nbs->notifiers_lock, NULL)) { + pthread_mutex_destroy(&nbs->list_lock); + return NULL; + } + + return nbs; +} + +void nbs_destroy(struct nbs * nbs) +{ + struct list_head * p = NULL; + struct list_head * n = NULL; + + assert(nbs); + + pthread_mutex_lock(&nbs->list_lock); + + list_for_each_safe(p, n, &nbs->list) { + struct nb * e = list_entry(p, struct nb, next); + list_del(&e->next); + free(e); + } + + pthread_mutex_unlock(&nbs->list_lock); + + pthread_mutex_destroy(&nbs->list_lock); + pthread_mutex_destroy(&nbs->notifiers_lock); +} + +int nbs_add(struct nbs * nbs, + struct conn conn) +{ + struct nb * nb; + + assert(nbs); + + nb = malloc(sizeof(*nb)); + if (nb == NULL) + return -ENOMEM; + + nb->conn = conn; + + list_head_init(&nb->next); + + pthread_mutex_lock(&nbs->list_lock); + + list_add(&nb->next, &nbs->list); + + notify_listeners(NEIGHBOR_ADDED, nb, nbs); + + pthread_mutex_unlock(&nbs->list_lock); + + log_info("Added neighbor with address %" PRIu64 " to list.", + conn.conn_info.addr); + + return 0; +} + +int nbs_update_qos(struct nbs * nbs, + int fd, + qosspec_t qs) +{ + struct list_head * p = NULL; + + assert(nbs); + + pthread_mutex_lock(&nbs->list_lock); + + list_for_each(p, &nbs->list) { + struct nb * e = list_entry(p, struct nb, next); + if (e->conn.flow_info.fd == fd) { + e->conn.flow_info.qs = qs; + + notify_listeners(NEIGHBOR_QOS_CHANGE, e, nbs); + + pthread_mutex_unlock(&nbs->list_lock); + return 0; + } + } + + pthread_mutex_unlock(&nbs->list_lock); + + return -1; +} + +int nbs_del(struct nbs * nbs, + int fd) +{ + struct list_head * p = NULL; + struct list_head * n = NULL; + + assert(nbs); + + pthread_mutex_lock(&nbs->list_lock); + + list_for_each_safe(p, n, &nbs->list) { + struct nb * e = list_entry(p, struct nb, next); + if (e->conn.flow_info.fd == fd) { + notify_listeners(NEIGHBOR_REMOVED, e, nbs); + list_del(&e->next); + free(e); + pthread_mutex_unlock(&nbs->list_lock); + return 0; + } + } + + pthread_mutex_unlock(&nbs->list_lock); + + return -1; +} + +int nbs_reg_notifier(struct nbs * nbs, + struct nb_notifier * notify) +{ + assert(nbs); + assert(notify); + + pthread_mutex_lock(&nbs->notifiers_lock); + + list_head_init(¬ify->next); + list_add(¬ify->next, &nbs->notifiers); + + pthread_mutex_unlock(&nbs->notifiers_lock); + + return 0; +} + +int nbs_unreg_notifier(struct nbs * nbs, + struct nb_notifier * notify) +{ + struct list_head * p = NULL; + struct list_head * n = NULL; + + pthread_mutex_lock(&nbs->notifiers_lock); + + list_for_each_safe(p, n, &nbs->notifiers) { + struct nb_notifier * e = + list_entry(p, struct nb_notifier, next); + if (e == notify) { + list_del(&e->next); + pthread_mutex_unlock(&nbs->notifiers_lock); + return 0; + } + } + + pthread_mutex_unlock(&nbs->notifiers_lock); + + return -1; +} diff --git a/src/ipcpd/normal/neighbors.h b/src/ipcpd/normal/neighbors.h new file mode 100644 index 00000000..743bc7b8 --- /dev/null +++ b/src/ipcpd/normal/neighbors.h @@ -0,0 +1,81 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2017 + * + * Data transfer neighbors + * + * Dimitri Staessens + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef OUROBOROS_IPCPD_NORMAL_NEIGHBORS_H +#define OUROBOROS_IPCPD_NORMAL_NEIGHBORS_H + +#include +#include +#include +#include +#include + +#include "connmgr.h" + +enum nb_event { + NEIGHBOR_ADDED, + NEIGHBOR_REMOVED, + NEIGHBOR_QOS_CHANGE +}; + +typedef int (* nb_notify_t)(enum nb_event event, + struct conn conn); + +struct nb_notifier { + struct list_head next; + nb_notify_t notify_call; +}; + +struct nb { + struct list_head next; + struct conn conn; +}; + +struct nbs { + struct list_head notifiers; + pthread_mutex_t notifiers_lock; + + struct list_head list; + pthread_mutex_t list_lock; +}; + +struct nbs * nbs_create(void); + +void nbs_destroy(struct nbs * nbs); + +int nbs_add(struct nbs * nbs, + struct conn conn); + +int nbs_update_qos(struct nbs * nbs, + int fd, + qosspec_t qs); + +int nbs_del(struct nbs * nbs, + int fd); + +int nbs_reg_notifier(struct nbs * nbs, + struct nb_notifier * notify); + +int nbs_unreg_notifier(struct nbs * nbs, + struct nb_notifier * notify); + +#endif diff --git a/src/ipcpd/normal/pff.c b/src/ipcpd/normal/pff.c index 2f7d554b..b44f79bf 100644 --- a/src/ipcpd/normal/pff.c +++ b/src/ipcpd/normal/pff.c @@ -55,15 +55,16 @@ struct pff * pff_create(void) return tmp; } -int pff_destroy(struct pff * instance) +void pff_destroy(struct pff * instance) { assert(instance); + pthread_mutex_lock(&instance->lock); htable_destroy(instance->table); + pthread_mutex_unlock(&instance->lock); + pthread_mutex_destroy(&instance->lock); free(instance); - - return 0; } int pff_add(struct pff * instance, uint64_t addr, int fd) diff --git a/src/ipcpd/normal/pff.h b/src/ipcpd/normal/pff.h index b4a1400b..d4edb90c 100644 --- a/src/ipcpd/normal/pff.h +++ b/src/ipcpd/normal/pff.h @@ -25,8 +25,6 @@ #include -struct pff; - /* * PFF will take a type in the future, * to allow different policies. @@ -34,7 +32,7 @@ struct pff; */ struct pff * pff_create(void); -int pff_destroy(struct pff * instance); +void pff_destroy(struct pff * instance); int pff_add(struct pff * instance, uint64_t addr, diff --git a/src/ipcpd/normal/pol-gam-ops.h b/src/ipcpd/normal/pol-gam-ops.h index 264f252b..a7753b8b 100644 --- a/src/ipcpd/normal/pol-gam-ops.h +++ b/src/ipcpd/normal/pol-gam-ops.h @@ -24,21 +24,13 @@ #define OUROBOROS_IPCPD_NORMAL_POL_GAM_OPS_H #include +#include struct pol_gam_ops { - void * (* create)(struct gam * instance); + void * (* create)(struct nbs * nbs, + struct ae * ae); void (* destroy)(void * o); - - int (* start)(void * o); - - int (* stop)(void * o); - - int (* accept_new_flow)(void * o); - - int (* accept_flow)(void * o, - qosspec_t qs, - const struct conn_info * info); }; #endif /* OUROBOROS_IPCPD_NORMAL_POL_GAM_OPS_H */ diff --git a/src/ipcpd/normal/pol/complete.c b/src/ipcpd/normal/pol/complete.c index daf8c9bf..f84c3a23 100644 --- a/src/ipcpd/normal/pol/complete.c +++ b/src/ipcpd/normal/pol/complete.c @@ -1,7 +1,7 @@ /* * Ouroboros - Copyright (C) 2016 - 2017 * - * Graph adjacency manager for IPC Process components + * Sets up a complete graph * * Dimitri Staessens * Sander Vrijders @@ -20,35 +20,54 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define OUROBOROS_PREFIX "complete-graph-adjacency-manager" +#define OUROBOROS_PREFIX "complete" #include -#include -#include -#include +#include #include +#include +#include +#include +#include -#include "ipcp.h" -#include "gam.h" +#include "neighbors.h" +#include "frct.h" #include "ribconfig.h" +#include "ipcp.h" +#include "ae.h" #include #include #include -struct neighbor { - struct list_head next; - uint64_t neighbor; +struct complete { + struct nbs * nbs; + struct ae * ae; + pthread_t allocator; + pthread_t listener; }; -struct complete { - struct list_head neighbors; - pthread_mutex_t neighbors_lock; +static void * listener(void * o) +{ + struct complete * complete; + struct conn conn; - pthread_t allocator; + complete = (struct complete *) o; - struct gam * gam; -}; + while (true) { + if (connmgr_wait(complete->ae, &conn)) { + log_err("Error while getting next connection."); + continue; + } + + if (nbs_add(complete->nbs, conn)) { + log_err("Failed to add neighbor."); + continue; + } + } + + return (void *) 0; +} static void * allocator(void * o) { @@ -56,10 +75,10 @@ static void * allocator(void * o) ssize_t len; char ** children; ssize_t i; - struct complete * complete = (struct complete *) o; + struct complete * complete; + struct conn conn; - assert(complete); - assert(complete->gam); + complete = (struct complete *) o; qs.delay = 0; qs.jitter = 0; @@ -67,8 +86,23 @@ static void * allocator(void * o) /* FIXME: subscribe to members to keep the graph complete. */ len = rib_children("/" MEMBERS_NAME, &children); for (i = 0; i < len; ++i) { - if (strcmp(children[i], ipcpi.name) < 0) - gam_flow_alloc(complete->gam, children[i], qs); + if (strcmp(children[i], ipcpi.name) < 0) { + if (connmgr_alloc(complete->ae, + children[i], + &qs, + &conn)) { + log_warn("Failed to get a conn to neighbor."); + free(children[i]); + continue; + } + + if (nbs_add(complete->nbs, conn)) { + log_err("Failed to add neighbor."); + free(children[i]); + continue; + } + + } free(children[i]); } @@ -78,118 +112,41 @@ static void * allocator(void * o) return (void *) 0; } -void * complete_create(struct gam * gam) +void * complete_create(struct nbs * nbs, + struct ae * ae) { struct complete * complete; - assert(gam); - complete = malloc(sizeof(*complete)); if (complete == NULL) return NULL; - list_head_init(&complete->neighbors); - complete->gam = gam; - - if (pthread_mutex_init(&complete->neighbors_lock, NULL)) { - free(complete); - return NULL; - } - - return (void *) complete; -} - -int complete_start(void * o) -{ - struct complete * complete = (struct complete *) o; - - assert(complete); - assert(complete->gam); + complete->nbs = nbs; + complete->ae = ae; if (pthread_create(&complete->allocator, NULL, - allocator, (void *) complete)) { - pthread_mutex_destroy(&complete->neighbors_lock); - free(complete); - return -1; - } + allocator, (void *) complete)) + return NULL; - /* FIXME: Handle flooding of the flow allocator before detaching.*/ - pthread_join(complete->allocator, NULL); + if (pthread_create(&complete->listener, NULL, + listener, (void *) complete)) + return NULL; - return 0; + return complete; } -int complete_stop(void * o) +void complete_destroy(void * ops_o) { - (void) o; + struct complete * complete; - return 0; -} + assert(ops_o); -void complete_destroy(void * o) -{ - struct list_head * p = NULL; - struct list_head * n = NULL; - struct complete * complete = (struct complete *) o; - - list_for_each_safe(p, n, &complete->neighbors) { - struct neighbor * e = list_entry(p, struct neighbor, next); - list_del(&e->next); - free(e); - } + complete = (struct complete *) ops_o; - pthread_mutex_destroy(&complete->neighbors_lock); + pthread_cancel(complete->allocator); + pthread_cancel(complete->listener); + pthread_join(complete->allocator, NULL); + pthread_join(complete->listener, NULL); free(complete); } - -int complete_accept_new_flow(void * o) -{ - (void) o; - - return 0; -} - -int complete_accept_flow(void * o, - qosspec_t qs, - const struct conn_info * info) -{ - struct list_head * pos = NULL; - struct neighbor * n; - struct complete * complete = (struct complete *) o; - - (void) qs; - - assert(complete); - - pthread_mutex_lock(&complete->neighbors_lock); - - list_for_each(pos, &complete->neighbors) { - struct neighbor * e = list_entry(pos, struct neighbor, next); - /* FIXME: figure out union type and check name or address */ - if (e->neighbor == info->addr) { - pthread_mutex_unlock(&complete->neighbors_lock); - return -1; - } - - assert(complete); - assert(&complete->neighbors_lock); - assert(pos->nxt); - } - - n = malloc(sizeof(*n)); - if (n == NULL) { - pthread_mutex_unlock(&complete->neighbors_lock); - return -1; - } - - list_head_init(&n->next); - - n->neighbor = info->addr; - - list_add(&n->next, &complete->neighbors); - - pthread_mutex_unlock(&complete->neighbors_lock); - - return 0; -} diff --git a/src/ipcpd/normal/pol/complete.h b/src/ipcpd/normal/pol/complete.h index 8fe1437f..40aca69d 100644 --- a/src/ipcpd/normal/pol/complete.h +++ b/src/ipcpd/normal/pol/complete.h @@ -1,7 +1,7 @@ /* * Ouroboros - Copyright (C) 2016 - 2017 * - * Graph adjacency manager for IPC Process components + * Sets up a complete graph * * Dimitri Staessens * Sander Vrijders @@ -23,30 +23,19 @@ #ifndef OUROBOROS_IPCPD_NORMAL_POL_COMPLETE_H #define OUROBOROS_IPCPD_NORMAL_POL_COMPLETE_H -#include "gam.h" -#include "pol-gam-ops.h" - -void * complete_create(struct gam * instance); - -void complete_destroy(void * o); +#include +#include -int complete_start(void * o); - -int complete_stop(void * o); +#include "pol-gam-ops.h" -int complete_accept_new_flow(void * o); +void * complete_create(struct nbs * nbs, + struct ae * ae); -int complete_accept_flow(void * o, - qosspec_t qs, - const struct conn_info * info); +void complete_destroy(void * ops_o); struct pol_gam_ops complete_ops = { - .create = complete_create, - .destroy = complete_destroy, - .start = complete_start, - .stop = complete_stop, - .accept_new_flow = complete_accept_new_flow, - .accept_flow = complete_accept_flow + .create = complete_create, + .destroy = complete_destroy }; #endif /* OUROBOROS_IPCPD_NORMAL_POL_COMPLETE_H */ diff --git a/src/ipcpd/normal/ribconfig.h b/src/ipcpd/normal/ribconfig.h index 15b65ce2..5ecdaab3 100644 --- a/src/ipcpd/normal/ribconfig.h +++ b/src/ipcpd/normal/ribconfig.h @@ -31,9 +31,11 @@ #define MEMBERS_NAME "members" #define DIF_NAME "dif_name" #define DIR_NAME "directory" +#define ROUTING_NAME "fsdb" #define DIF_PATH DLR DIF_NAME #define DIR_PATH DLR DIR_NAME #define BOOT_PATH DLR BOOT_NAME #define MEMBERS_PATH DLR MEMBERS_NAME +#define ROUTING_PATH DLR ROUTING_NAME #endif /* OUROBOROS_IPCPD_NORMAL_RIB_CONFIG_H */ diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c index 25f1687e..e8fa77a4 100644 --- a/src/ipcpd/normal/ribmgr.c +++ b/src/ipcpd/normal/ribmgr.c @@ -45,25 +45,70 @@ #include struct { - flow_set_t * fs; - fqueue_t * fq; - struct gam * gam; + flow_set_t * fs; + fqueue_t * fq; + + struct gam * gam; + struct nbs * nbs; + struct ae * ae; + + struct nb_notifier nb_notifier; } ribmgr; +static int ribmgr_neighbor_event(enum nb_event event, + struct conn conn) +{ + /* We are only interested in neighbors being added and removed. */ + switch (event) { + case NEIGHBOR_ADDED: + flow_set_add(ribmgr.fs, conn.flow_info.fd); + break; + case NEIGHBOR_REMOVED: + flow_set_del(ribmgr.fs, conn.flow_info.fd); + break; + default: + break; + } + + return 0; +} int ribmgr_init(void) { - enum pol_gam pg; + enum pol_gam pg; + struct conn_info info; + + strcpy(info.ae_name, MGMT_AE); + strcpy(info.protocol, CDAP_PROTO); + info.pref_version = 1; + info.pref_syntax = PROTO_GPB; + + ribmgr.nbs = nbs_create(); + if (ribmgr.nbs == NULL) { + log_err("Failed to create neighbors."); + return -1; + } + + ribmgr.ae = connmgr_ae_create(info); + if (ribmgr.ae == NULL) { + log_err("Failed to create AE struct."); + nbs_destroy(ribmgr.nbs); + return -1; + } if (rib_read(BOOT_PATH "/rm/gam/type", &pg, sizeof(pg)) != sizeof(pg)) { log_err("Failed to read policy for ribmgr gam."); + connmgr_ae_destroy(ribmgr.ae); + nbs_destroy(ribmgr.nbs); return -1; } - ribmgr.gam = gam_create(pg); + ribmgr.gam = gam_create(pg, ribmgr.nbs, ribmgr.ae); if (ribmgr.gam == NULL) { log_err("Failed to create gam."); + connmgr_ae_destroy(ribmgr.ae); + nbs_destroy(ribmgr.nbs); return -1; } @@ -71,6 +116,8 @@ int ribmgr_init(void) if (ribmgr.fs == NULL) { log_err("Failed to create flow set."); gam_destroy(ribmgr.gam); + connmgr_ae_destroy(ribmgr.ae); + nbs_destroy(ribmgr.nbs); return -1; } @@ -79,6 +126,19 @@ int ribmgr_init(void) log_err("Failed to create fq."); flow_set_destroy(ribmgr.fs); gam_destroy(ribmgr.gam); + connmgr_ae_destroy(ribmgr.ae); + nbs_destroy(ribmgr.nbs); + return -1; + } + + ribmgr.nb_notifier.notify_call = ribmgr_neighbor_event; + if (nbs_reg_notifier(ribmgr.nbs, &ribmgr.nb_notifier)) { + log_err("Failed to register notifier."); + fqueue_destroy(ribmgr.fq); + flow_set_destroy(ribmgr.fs); + gam_destroy(ribmgr.gam); + connmgr_ae_destroy(ribmgr.ae); + nbs_destroy(ribmgr.nbs); return -1; } @@ -87,20 +147,12 @@ int ribmgr_init(void) void ribmgr_fini(void) { + nbs_unreg_notifier(ribmgr.nbs, &ribmgr.nb_notifier); flow_set_destroy(ribmgr.fs); fqueue_destroy(ribmgr.fq); gam_destroy(ribmgr.gam); -} - -int ribmgr_flow_arr(int fd, - qosspec_t qs) -{ - assert(ribmgr.gam); - - if (gam_flow_arr(ribmgr.gam, fd, qs)) - return -1; - - return 0; + connmgr_ae_destroy(ribmgr.ae); + nbs_destroy(ribmgr.nbs); } int ribmgr_disseminate(char * path, diff --git a/src/ipcpd/normal/ribmgr.h b/src/ipcpd/normal/ribmgr.h index 12f407ab..f3f4cc24 100644 --- a/src/ipcpd/normal/ribmgr.h +++ b/src/ipcpd/normal/ribmgr.h @@ -41,9 +41,6 @@ int ribmgr_init(void); void ribmgr_fini(void); -int ribmgr_flow_arr(int fd, - qosspec_t qs); - int ribmgr_disseminate(char * path, enum diss_target target, enum diss_freq freq, diff --git a/src/ipcpd/normal/routing.c b/src/ipcpd/normal/routing.c new file mode 100644 index 00000000..48c2c16d --- /dev/null +++ b/src/ipcpd/normal/routing.c @@ -0,0 +1,132 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2017 + * + * Routing component of the IPCP + * + * Sander Vrijders + * Dimitri Staessens + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#define OUROBOROS_PREFIX "routing" + +#include +#include +#include +#include + +#include "routing.h" +#include "ribmgr.h" + +#include +#include +#include + +struct edge { + struct vertex * ep; + qosspec_t qs; +}; + +struct vertex { + struct list_head next; + + uint64_t addr; + + struct list_head edges; +}; + +struct routing { + struct pff * pff; + struct nbs * nbs; + + struct nb_notifier nb_notifier; + + struct list_head vertices; +}; + +static int routing_neighbor_event(enum nb_event event, + struct conn conn) +{ + (void) conn; + + /* FIXME: React to events here */ + switch (event) { + case NEIGHBOR_ADDED: + break; + case NEIGHBOR_REMOVED: + break; + case NEIGHBOR_QOS_CHANGE: + break; + default: + break; + } + + return 0; +} + +#if 0 +/* FIXME: If zeroed since it is not used currently */ +static int add_vertex(struct routing * instance, + uint64_t addr) +{ + struct vertex * vertex; + + vertex = malloc(sizeof(*vertex)); + if (vertex == NULL) + return -1; + + list_head_init(&vertex->next); + list_head_init(&vertex->edges); + vertex->addr = addr; + + list_add(&vertex->next, &instance->vertices); + + return 0; +} +#endif + +struct routing * routing_create(struct pff * pff, + struct nbs * nbs) +{ + struct routing * tmp; + + assert(pff); + + tmp = malloc(sizeof(*tmp)); + if (tmp == NULL) + return NULL; + + tmp->pff = pff; + tmp->nbs = nbs; + + list_head_init(&tmp->vertices); + + tmp->nb_notifier.notify_call = routing_neighbor_event; + if (nbs_reg_notifier(tmp->nbs, &tmp->nb_notifier)) { + free(tmp); + return NULL; + } + + return tmp; +} + +void routing_destroy(struct routing * instance) +{ + assert(instance); + + nbs_unreg_notifier(instance->nbs, &instance->nb_notifier); + + free(instance); +} diff --git a/src/ipcpd/normal/routing.h b/src/ipcpd/normal/routing.h new file mode 100644 index 00000000..624763ec --- /dev/null +++ b/src/ipcpd/normal/routing.h @@ -0,0 +1,42 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2017 + * + * Routing component of the IPCP + * + * Sander Vrijders + * Dimitri Staessens + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef OUROBOROS_IPCPD_NORMAL_ROUTING_H +#define OUROBOROS_IPCPD_NORMAL_ROUTING_H + +#include + +#include "pff.h" +#include "neighbors.h" + +#include + +/* + * Routing will take a type in the future, + * to allow different policies. + */ +struct routing * routing_create(struct pff * pff, + struct nbs * nbs); + +void routing_destroy(struct routing * instance); + +#endif /* OUROBOROS_IPCPD_NORMAL_ROUTING_H */ -- cgit v1.2.3 From c9fb31c7ebadc076b7c3bfd9dbe1c492c6ef7172 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Fri, 3 Mar 2017 15:31:42 +0100 Subject: Change email addresses to ugent.be Our mailserver was migrated from intec.ugent.be to the central ugent.be emailserver. This PR updates the header files to reflect this change as well. Some header files were also homogenized if the parameters within the functions were badly aligned. --- include/ouroboros/bitmap.h | 4 +- include/ouroboros/cacep.h | 4 +- include/ouroboros/cdap.h | 4 +- include/ouroboros/crc32.h | 3 +- include/ouroboros/dev.h | 3 +- include/ouroboros/endian.h | 4 +- include/ouroboros/errno.h | 3 +- include/ouroboros/fcntl.h | 3 +- include/ouroboros/fqueue.h | 4 +- include/ouroboros/hashtable.h | 3 +- include/ouroboros/ipcp-dev.h | 4 +- include/ouroboros/irm.h | 3 +- include/ouroboros/irm_config.h | 3 +- include/ouroboros/list.h | 4 +- include/ouroboros/local-dev.h | 3 +- include/ouroboros/lockfile.h | 6 ++- include/ouroboros/logs.h | 5 +-- include/ouroboros/np1_flow.h | 3 +- include/ouroboros/nsm.h | 3 +- include/ouroboros/qos.h | 3 +- include/ouroboros/rib.h | 4 +- include/ouroboros/rqueue.h | 4 +- include/ouroboros/shared.h | 3 +- include/ouroboros/shm_flow_set.h | 3 +- include/ouroboros/shm_rbuff.h | 9 +++-- include/ouroboros/shm_rdrbuff.h | 4 +- include/ouroboros/sockets.h | 3 +- include/ouroboros/time_utils.h | 6 ++- include/ouroboros/utils.h | 6 +-- src/ipcpd/ipcp.c | 3 +- src/ipcpd/ipcp.h | 3 +- src/ipcpd/local/main.c | 3 +- src/ipcpd/normal/addr_auth.c | 4 +- src/ipcpd/normal/addr_auth.h | 4 +- src/ipcpd/normal/ae.h | 4 +- src/ipcpd/normal/connmgr.c | 2 +- src/ipcpd/normal/connmgr.h | 2 +- src/ipcpd/normal/dir.c | 4 +- src/ipcpd/normal/dir.h | 3 +- src/ipcpd/normal/dt_const.h | 4 +- src/ipcpd/normal/enroll.c | 3 +- src/ipcpd/normal/enroll.h | 3 +- src/ipcpd/normal/fmgr.c | 3 +- src/ipcpd/normal/fmgr.h | 3 +- src/ipcpd/normal/frct.c | 3 +- src/ipcpd/normal/frct.h | 3 +- src/ipcpd/normal/gam.c | 4 +- src/ipcpd/normal/gam.h | 4 +- src/ipcpd/normal/main.c | 4 +- src/ipcpd/normal/neighbors.c | 4 +- src/ipcpd/normal/neighbors.h | 4 +- src/ipcpd/normal/pff.c | 3 +- src/ipcpd/normal/pff.h | 4 +- src/ipcpd/normal/pol-addr-auth-ops.h | 4 +- src/ipcpd/normal/pol-gam-ops.h | 4 +- src/ipcpd/normal/pol/complete.c | 4 +- src/ipcpd/normal/pol/complete.h | 4 +- src/ipcpd/normal/pol/flat.c | 4 +- src/ipcpd/normal/pol/flat.h | 3 +- src/ipcpd/normal/ribmgr.c | 4 +- src/ipcpd/normal/ribmgr.h | 3 +- src/ipcpd/normal/routing.c | 4 +- src/ipcpd/normal/routing.h | 4 +- src/ipcpd/normal/shm_pci.c | 4 +- src/ipcpd/normal/shm_pci.h | 4 +- src/ipcpd/shim-data.c | 4 +- src/ipcpd/shim-data.h | 4 +- src/ipcpd/shim-eth-llc/main.c | 3 +- src/ipcpd/shim-udp/main.c | 3 +- src/ipcpd/shim-udp/tests/shim_udp_test.c | 3 +- src/ipcpd/tests/timerwheel_test.c | 3 +- src/ipcpd/timerwheel.c | 3 +- src/ipcpd/timerwheel.h | 9 +++-- src/irmd/api_table.c | 3 +- src/irmd/api_table.h | 3 +- src/irmd/apn_table.c | 3 +- src/irmd/apn_table.h | 3 +- src/irmd/ipcp.c | 3 +- src/irmd/ipcp.h | 3 +- src/irmd/irm_flow.c | 3 +- src/irmd/irm_flow.h | 3 +- src/irmd/main.c | 4 +- src/irmd/registry.c | 3 +- src/irmd/registry.h | 3 +- src/irmd/utils.c | 4 +- src/irmd/utils.h | 4 +- src/lib/bitmap.c | 4 +- src/lib/btree.c | 4 +- src/lib/btree.h | 3 +- src/lib/cdap.c | 3 +- src/lib/cdap_req.c | 4 +- src/lib/cdap_req.h | 4 +- src/lib/crc32.c | 3 +- src/lib/dev.c | 4 +- src/lib/hashtable.c | 3 +- src/lib/irm.c | 3 +- src/lib/list.c | 4 +- src/lib/lockfile.c | 3 +- src/lib/logs.c | 4 +- src/lib/nsm.c | 3 +- src/lib/rib.c | 4 +- src/lib/sha3.c | 3 ++ src/lib/sha3.h | 3 +- src/lib/shm_flow_set.c | 3 +- src/lib/shm_rbuff.c | 3 +- src/lib/shm_rdrbuff.c | 4 +- src/lib/sockets.c | 3 +- src/lib/tests/bitmap_test.c | 3 +- src/lib/tests/btree_test.c | 3 +- src/lib/tests/crc32_test.c | 3 +- src/lib/tests/hashtable_test.c | 3 +- src/lib/tests/rib_test.c | 3 +- src/lib/tests/sha3_test.c | 3 +- src/lib/time_utils.c | 3 +- src/lib/utils.c | 3 +- src/nsmd/main.c | 26 ++++++++++++- src/tools/cbr/cbr.c | 4 +- src/tools/cbr/cbr_client.c | 4 +- src/tools/cbr/cbr_server.c | 4 +- src/tools/echo/echo.c | 3 +- src/tools/echo/echo_client.c | 3 +- src/tools/echo/echo_server.c | 3 +- src/tools/irm/irm.c | 3 +- src/tools/irm/irm_bind.c | 4 +- src/tools/irm/irm_bind_ap.c | 4 +- src/tools/irm/irm_bind_api.c | 4 +- src/tools/irm/irm_bind_ipcp.c | 4 +- src/tools/irm/irm_ipcp.c | 3 +- src/tools/irm/irm_ipcp_bootstrap.c | 3 +- src/tools/irm/irm_ipcp_create.c | 3 +- src/tools/irm/irm_ipcp_destroy.c | 3 +- src/tools/irm/irm_ipcp_enroll.c | 3 +- src/tools/irm/irm_ops.h | 63 +++++++++++++++++++++++--------- src/tools/irm/irm_register.c | 4 +- src/tools/irm/irm_unbind.c | 4 +- src/tools/irm/irm_unbind_ap.c | 4 +- src/tools/irm/irm_unbind_api.c | 4 +- src/tools/irm/irm_unbind_ipcp.c | 4 +- src/tools/irm/irm_unregister.c | 4 +- src/tools/irm/irm_utils.c | 3 +- src/tools/irm/irm_utils.h | 6 ++- src/tools/operf/operf.c | 4 +- src/tools/operf/operf_client.c | 4 +- src/tools/operf/operf_server.c | 4 +- src/tools/oping/oping.c | 4 +- src/tools/oping/oping_client.c | 4 +- src/tools/oping/oping_server.c | 4 +- 147 files changed, 374 insertions(+), 238 deletions(-) (limited to 'src/ipcpd/normal/ribmgr.c') diff --git a/include/ouroboros/bitmap.h b/include/ouroboros/bitmap.h index d6ce623a..cb62312a 100644 --- a/include/ouroboros/bitmap.h +++ b/include/ouroboros/bitmap.h @@ -3,8 +3,8 @@ * * Bitmap implementation * - * Sander Vrijders - * Francesco Salvestrini + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/cacep.h b/include/ouroboros/cacep.h index b6fb8625..950f3cf7 100644 --- a/include/ouroboros/cacep.h +++ b/include/ouroboros/cacep.h @@ -3,8 +3,8 @@ * * The Common Application Connection Establishment Protocol * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/cdap.h b/include/ouroboros/cdap.h index cc04cf27..19ab39a8 100644 --- a/include/ouroboros/cdap.h +++ b/include/ouroboros/cdap.h @@ -3,8 +3,8 @@ * * The Common Distributed Application Protocol * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/crc32.h b/include/ouroboros/crc32.h index 3c7721de..dccdf7cb 100644 --- a/include/ouroboros/crc32.h +++ b/include/ouroboros/crc32.h @@ -3,7 +3,8 @@ * * 32-bit Cyclic Redundancy Check * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/dev.h b/include/ouroboros/dev.h index c4d2cb16..e92cdd1c 100644 --- a/include/ouroboros/dev.h +++ b/include/ouroboros/dev.h @@ -3,7 +3,8 @@ * * API for applications * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/endian.h b/include/ouroboros/endian.h index 46f384ec..d712b1b3 100644 --- a/include/ouroboros/endian.h +++ b/include/ouroboros/endian.h @@ -3,8 +3,8 @@ * * Endianness * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/errno.h b/include/ouroboros/errno.h index 600f016f..d2117992 100644 --- a/include/ouroboros/errno.h +++ b/include/ouroboros/errno.h @@ -3,7 +3,8 @@ * * Ouroboros specific error numbers * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/fcntl.h b/include/ouroboros/fcntl.h index 7ee4229e..c07b7bf0 100644 --- a/include/ouroboros/fcntl.h +++ b/include/ouroboros/fcntl.h @@ -3,7 +3,8 @@ * * Flows * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/fqueue.h b/include/ouroboros/fqueue.h index fdd2cbfb..fc7dc303 100644 --- a/include/ouroboros/fqueue.h +++ b/include/ouroboros/fqueue.h @@ -3,8 +3,8 @@ * * Flow queues * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/hashtable.h b/include/ouroboros/hashtable.h index 4cb6000d..81fbcc1a 100644 --- a/include/ouroboros/hashtable.h +++ b/include/ouroboros/hashtable.h @@ -3,7 +3,8 @@ * * Hash table with integer keys with separate chaining on collisions * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/ipcp-dev.h b/include/ouroboros/ipcp-dev.h index fc82f374..6cad9a87 100644 --- a/include/ouroboros/ipcp-dev.h +++ b/include/ouroboros/ipcp-dev.h @@ -3,8 +3,8 @@ * * Additional API for IPCPs * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/irm.h b/include/ouroboros/irm.h index 07052727..9bd0c93b 100644 --- a/include/ouroboros/irm.h +++ b/include/ouroboros/irm.h @@ -3,7 +3,8 @@ * * The API to instruct the IPC Resource Manager * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/irm_config.h b/include/ouroboros/irm_config.h index 5e3c84b4..3dd55823 100644 --- a/include/ouroboros/irm_config.h +++ b/include/ouroboros/irm_config.h @@ -3,7 +3,8 @@ * * Configuration information for the IPC Resource Manager * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/list.h b/include/ouroboros/list.h index 5f246775..5da93b9a 100644 --- a/include/ouroboros/list.h +++ b/include/ouroboros/list.h @@ -3,8 +3,8 @@ * * Simple doubly linked list implementation. * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/local-dev.h b/include/ouroboros/local-dev.h index 3c95e589..228a2a98 100644 --- a/include/ouroboros/local-dev.h +++ b/include/ouroboros/local-dev.h @@ -3,7 +3,8 @@ * * Optimized calls for the local IPCPs * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/lockfile.h b/include/ouroboros/lockfile.h index 561e31ab..1b988092 100644 --- a/include/ouroboros/lockfile.h +++ b/include/ouroboros/lockfile.h @@ -3,7 +3,8 @@ * * Lockfile for Ouroboros * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -28,8 +29,11 @@ struct lockfile; struct lockfile * lockfile_create(void); + struct lockfile * lockfile_open(void); + void lockfile_close(struct lockfile * lf); + void lockfile_destroy(struct lockfile * lf); pid_t lockfile_owner(struct lockfile * lf); diff --git a/include/ouroboros/logs.h b/include/ouroboros/logs.h index 9b83abd2..38b50053 100644 --- a/include/ouroboros/logs.h +++ b/include/ouroboros/logs.h @@ -3,9 +3,8 @@ * * Logging facilities * - * Sander Vrijders - * Francesco Salvestrini - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/np1_flow.h b/include/ouroboros/np1_flow.h index 6144ec06..a4e94b89 100644 --- a/include/ouroboros/np1_flow.h +++ b/include/ouroboros/np1_flow.h @@ -3,7 +3,8 @@ * * Adapter functions for N + 1 flow descriptors * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/nsm.h b/include/ouroboros/nsm.h index 0bcc028a..22a2a593 100644 --- a/include/ouroboros/nsm.h +++ b/include/ouroboros/nsm.h @@ -3,7 +3,8 @@ * * The API to instruct the global Namespace Manager * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/qos.h b/include/ouroboros/qos.h index 57d0ab0e..b12fed60 100644 --- a/include/ouroboros/qos.h +++ b/include/ouroboros/qos.h @@ -3,7 +3,8 @@ * * Quality of Service specification * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/rib.h b/include/ouroboros/rib.h index 50747498..320ef860 100644 --- a/include/ouroboros/rib.h +++ b/include/ouroboros/rib.h @@ -3,8 +3,8 @@ * * Resource Information Base * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/rqueue.h b/include/ouroboros/rqueue.h index 7bfbfa8f..b0ec4a60 100644 --- a/include/ouroboros/rqueue.h +++ b/include/ouroboros/rqueue.h @@ -3,8 +3,8 @@ * * RIB event queues * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/shared.h b/include/ouroboros/shared.h index 1f309d27..07d4be5e 100644 --- a/include/ouroboros/shared.h +++ b/include/ouroboros/shared.h @@ -3,7 +3,8 @@ * * Shared definitions between IRMd and IPCPs * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/shm_flow_set.h b/include/ouroboros/shm_flow_set.h index 95b1718e..947fe897 100644 --- a/include/ouroboros/shm_flow_set.h +++ b/include/ouroboros/shm_flow_set.h @@ -3,7 +3,8 @@ * * Management of flow_sets for fqueue * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/shm_rbuff.h b/include/ouroboros/shm_rbuff.h index 14cfb79a..f31dab63 100644 --- a/include/ouroboros/shm_rbuff.h +++ b/include/ouroboros/shm_rbuff.h @@ -3,7 +3,8 @@ * * Ring buffer for incoming SDUs * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -28,9 +29,11 @@ struct shm_rbuff; -struct shm_rbuff * shm_rbuff_create(pid_t api, int port_id); +struct shm_rbuff * shm_rbuff_create(pid_t api, + int port_id); -struct shm_rbuff * shm_rbuff_open(pid_t api, int port_id); +struct shm_rbuff * shm_rbuff_open(pid_t api, + int port_id); void shm_rbuff_close(struct shm_rbuff * rb); diff --git a/include/ouroboros/shm_rdrbuff.h b/include/ouroboros/shm_rdrbuff.h index 73d6bfbc..92173388 100644 --- a/include/ouroboros/shm_rdrbuff.h +++ b/include/ouroboros/shm_rdrbuff.h @@ -3,8 +3,8 @@ * * Random Deletion Ring Buffer for Data Units * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/sockets.h b/include/ouroboros/sockets.h index efd4a08f..bcc60e17 100644 --- a/include/ouroboros/sockets.h +++ b/include/ouroboros/sockets.h @@ -3,7 +3,8 @@ * * The sockets layer to communicate between daemons * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/include/ouroboros/time_utils.h b/include/ouroboros/time_utils.h index f45df27f..35f2dcbb 100644 --- a/include/ouroboros/time_utils.h +++ b/include/ouroboros/time_utils.h @@ -3,7 +3,8 @@ * * Time utilities * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -97,7 +98,8 @@ int ts_to_tv(const struct timespec * src, #define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC) #define CLOCKS_MONO CLOCK_MONOTONIC -int clock_gettime(int clock, struct timespec * t); +int clock_gettime(int clock, + struct timespec * t); #endif #endif /* OUROBOROS_TIME_UTILS_H */ diff --git a/include/ouroboros/utils.h b/include/ouroboros/utils.h index 29fb4367..19a29097 100644 --- a/include/ouroboros/utils.h +++ b/include/ouroboros/utils.h @@ -3,7 +3,8 @@ * * Handy utilities * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -40,9 +41,6 @@ typedef struct { */ int n_digits(unsigned i); -/* Returns a copy of the source string */ -char * strdup(const char * src); - /* gets the application name */ char * path_strip(char * src); diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 41b5bb48..8646121a 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -3,7 +3,8 @@ * * IPC process main loop * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/ipcp.h b/src/ipcpd/ipcp.h index 07c72791..a64ab65c 100644 --- a/src/ipcpd/ipcp.h +++ b/src/ipcpd/ipcp.h @@ -3,7 +3,8 @@ * * IPC process structure * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c index 2d995680..f025afa2 100644 --- a/src/ipcpd/local/main.c +++ b/src/ipcpd/local/main.c @@ -3,7 +3,8 @@ * * Local IPC process * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/addr_auth.c b/src/ipcpd/normal/addr_auth.c index 8469e95e..5b3c6170 100644 --- a/src/ipcpd/normal/addr_auth.c +++ b/src/ipcpd/normal/addr_auth.c @@ -3,8 +3,8 @@ * * Address authority * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/addr_auth.h b/src/ipcpd/normal/addr_auth.h index b389fa90..fbe7d790 100644 --- a/src/ipcpd/normal/addr_auth.h +++ b/src/ipcpd/normal/addr_auth.h @@ -3,8 +3,8 @@ * * Address authority * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/ae.h b/src/ipcpd/normal/ae.h index 882625dd..aafef625 100644 --- a/src/ipcpd/normal/ae.h +++ b/src/ipcpd/normal/ae.h @@ -3,8 +3,8 @@ * * Application Entities for the normal IPC process * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/connmgr.c b/src/ipcpd/normal/connmgr.c index 0c908cd1..87daeddb 100644 --- a/src/ipcpd/normal/connmgr.c +++ b/src/ipcpd/normal/connmgr.c @@ -3,8 +3,8 @@ * * Handles the different AP connections * - * Sander Vrijders * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/connmgr.h b/src/ipcpd/normal/connmgr.h index 5dbf2bcc..c0356f6d 100644 --- a/src/ipcpd/normal/connmgr.h +++ b/src/ipcpd/normal/connmgr.h @@ -3,8 +3,8 @@ * * Handles the different AP connections * - * Sander Vrijders * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/dir.c b/src/ipcpd/normal/dir.c index 55d6e3f6..ae9793c6 100644 --- a/src/ipcpd/normal/dir.c +++ b/src/ipcpd/normal/dir.c @@ -3,8 +3,8 @@ * * DIF directory * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/dir.h b/src/ipcpd/normal/dir.h index 925fc823..04e722f3 100644 --- a/src/ipcpd/normal/dir.h +++ b/src/ipcpd/normal/dir.h @@ -3,7 +3,8 @@ * * DIF directory * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/dt_const.h b/src/ipcpd/normal/dt_const.h index c94e9395..327f51b8 100644 --- a/src/ipcpd/normal/dt_const.h +++ b/src/ipcpd/normal/dt_const.h @@ -3,8 +3,8 @@ * * Data Transfer Constants for the IPCP * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/enroll.c b/src/ipcpd/normal/enroll.c index 25460161..680cfbba 100644 --- a/src/ipcpd/normal/enroll.c +++ b/src/ipcpd/normal/enroll.c @@ -3,7 +3,8 @@ * * Enrollment Task * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/enroll.h b/src/ipcpd/normal/enroll.h index 3c81ae25..05f950ba 100644 --- a/src/ipcpd/normal/enroll.h +++ b/src/ipcpd/normal/enroll.h @@ -3,7 +3,8 @@ * * Enrollment Task * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c index b7a99f6c..2593e8fd 100644 --- a/src/ipcpd/normal/fmgr.c +++ b/src/ipcpd/normal/fmgr.c @@ -3,7 +3,8 @@ * * Flow manager of the IPC Process * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/fmgr.h b/src/ipcpd/normal/fmgr.h index 06eab0a1..f5076eab 100644 --- a/src/ipcpd/normal/fmgr.h +++ b/src/ipcpd/normal/fmgr.h @@ -3,7 +3,8 @@ * * Flow manager of the IPC Process * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/frct.c b/src/ipcpd/normal/frct.c index b5a42db4..62cbf9f7 100644 --- a/src/ipcpd/normal/frct.c +++ b/src/ipcpd/normal/frct.c @@ -3,7 +3,8 @@ * * The Flow and Retransmission control component * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/frct.h b/src/ipcpd/normal/frct.h index d85d11f5..a1dcb151 100644 --- a/src/ipcpd/normal/frct.h +++ b/src/ipcpd/normal/frct.h @@ -3,7 +3,8 @@ * * The Flow and Retransmission control component * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/gam.c b/src/ipcpd/normal/gam.c index cb4e662f..643d83b0 100644 --- a/src/ipcpd/normal/gam.c +++ b/src/ipcpd/normal/gam.c @@ -3,8 +3,8 @@ * * Data transfer graph adjacency manager * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/gam.h b/src/ipcpd/normal/gam.h index 01a6e40e..4ae0b1b3 100644 --- a/src/ipcpd/normal/gam.h +++ b/src/ipcpd/normal/gam.h @@ -3,8 +3,8 @@ * * Data transfer graph adjacency manager * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 8b9a7c09..814a0c0b 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -3,8 +3,8 @@ * * Normal IPC Process * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/neighbors.c b/src/ipcpd/normal/neighbors.c index 40ef0d73..1c399145 100644 --- a/src/ipcpd/normal/neighbors.c +++ b/src/ipcpd/normal/neighbors.c @@ -3,8 +3,8 @@ * * Data transfer neighbors * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/neighbors.h b/src/ipcpd/normal/neighbors.h index 743bc7b8..8714a9aa 100644 --- a/src/ipcpd/normal/neighbors.h +++ b/src/ipcpd/normal/neighbors.h @@ -3,8 +3,8 @@ * * Data transfer neighbors * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/pff.c b/src/ipcpd/normal/pff.c index b44f79bf..8cab7936 100644 --- a/src/ipcpd/normal/pff.c +++ b/src/ipcpd/normal/pff.c @@ -3,7 +3,8 @@ * * PDU Forwarding Function * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/pff.h b/src/ipcpd/normal/pff.h index d4edb90c..667c341e 100644 --- a/src/ipcpd/normal/pff.h +++ b/src/ipcpd/normal/pff.h @@ -3,8 +3,8 @@ * * PDU Forwarding Function * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/pol-addr-auth-ops.h b/src/ipcpd/normal/pol-addr-auth-ops.h index 25952636..f0f473ef 100644 --- a/src/ipcpd/normal/pol-addr-auth-ops.h +++ b/src/ipcpd/normal/pol-addr-auth-ops.h @@ -3,8 +3,8 @@ * * Address authority policy ops * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/pol-gam-ops.h b/src/ipcpd/normal/pol-gam-ops.h index a7753b8b..cfe9cbc3 100644 --- a/src/ipcpd/normal/pol-gam-ops.h +++ b/src/ipcpd/normal/pol-gam-ops.h @@ -3,8 +3,8 @@ * * Graph adjacency manager policy ops * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/pol/complete.c b/src/ipcpd/normal/pol/complete.c index f84c3a23..3a9dd548 100644 --- a/src/ipcpd/normal/pol/complete.c +++ b/src/ipcpd/normal/pol/complete.c @@ -3,8 +3,8 @@ * * Sets up a complete graph * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/pol/complete.h b/src/ipcpd/normal/pol/complete.h index 40aca69d..46a535c2 100644 --- a/src/ipcpd/normal/pol/complete.h +++ b/src/ipcpd/normal/pol/complete.h @@ -3,8 +3,8 @@ * * Sets up a complete graph * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/pol/flat.c b/src/ipcpd/normal/pol/flat.c index aa0f6c7c..e709da7c 100644 --- a/src/ipcpd/normal/pol/flat.c +++ b/src/ipcpd/normal/pol/flat.c @@ -3,8 +3,8 @@ * * Policy for flat addresses in a distributed way * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/pol/flat.h b/src/ipcpd/normal/pol/flat.h index 85fe9281..d45a89cd 100644 --- a/src/ipcpd/normal/pol/flat.h +++ b/src/ipcpd/normal/pol/flat.h @@ -3,7 +3,8 @@ * * Policy for flat addresses in a distributed way * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c index e8fa77a4..ec465c6b 100644 --- a/src/ipcpd/normal/ribmgr.c +++ b/src/ipcpd/normal/ribmgr.c @@ -3,8 +3,8 @@ * * RIB manager of the IPC Process * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/ribmgr.h b/src/ipcpd/normal/ribmgr.h index f3f4cc24..8922688a 100644 --- a/src/ipcpd/normal/ribmgr.h +++ b/src/ipcpd/normal/ribmgr.h @@ -3,7 +3,8 @@ * * RIB manager of the IPC Process * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/routing.c b/src/ipcpd/normal/routing.c index 48c2c16d..449c9379 100644 --- a/src/ipcpd/normal/routing.c +++ b/src/ipcpd/normal/routing.c @@ -3,8 +3,8 @@ * * Routing component of the IPCP * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/routing.h b/src/ipcpd/normal/routing.h index 624763ec..81208ffa 100644 --- a/src/ipcpd/normal/routing.h +++ b/src/ipcpd/normal/routing.h @@ -3,8 +3,8 @@ * * Routing component of the IPCP * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/shm_pci.c b/src/ipcpd/normal/shm_pci.c index 0807a24f..1170adff 100644 --- a/src/ipcpd/normal/shm_pci.c +++ b/src/ipcpd/normal/shm_pci.c @@ -3,8 +3,8 @@ * * Protocol Control Information in Shared Memory Map * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/normal/shm_pci.h b/src/ipcpd/normal/shm_pci.h index 17ce5cdd..0c54c883 100644 --- a/src/ipcpd/normal/shm_pci.h +++ b/src/ipcpd/normal/shm_pci.h @@ -3,8 +3,8 @@ * * Protocol Control Information in Shared Memory Map * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/shim-data.c b/src/ipcpd/shim-data.c index 933f3a64..6f5832a1 100644 --- a/src/ipcpd/shim-data.c +++ b/src/ipcpd/shim-data.c @@ -3,8 +3,8 @@ * * IPC process utilities * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/shim-data.h b/src/ipcpd/shim-data.h index 28087901..ac670b43 100644 --- a/src/ipcpd/shim-data.h +++ b/src/ipcpd/shim-data.h @@ -3,8 +3,8 @@ * * Utitilies for building IPC processes * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c index 01121fa3..8015d64a 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/shim-eth-llc/main.c @@ -3,7 +3,8 @@ * * Shim IPC process over Ethernet with LLC * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c index a67a60ee..3bbce79d 100644 --- a/src/ipcpd/shim-udp/main.c +++ b/src/ipcpd/shim-udp/main.c @@ -3,7 +3,8 @@ * * Shim IPC process over UDP * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/shim-udp/tests/shim_udp_test.c b/src/ipcpd/shim-udp/tests/shim_udp_test.c index d4a5d8ed..d7bd0bb7 100644 --- a/src/ipcpd/shim-udp/tests/shim_udp_test.c +++ b/src/ipcpd/shim-udp/tests/shim_udp_test.c @@ -3,7 +3,8 @@ * * Test of the Shim UDP IPCP Daemon * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/tests/timerwheel_test.c b/src/ipcpd/tests/timerwheel_test.c index 23de403a..cf5b0333 100644 --- a/src/ipcpd/tests/timerwheel_test.c +++ b/src/ipcpd/tests/timerwheel_test.c @@ -3,7 +3,8 @@ * * Test of the timer wheel * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/timerwheel.c b/src/ipcpd/timerwheel.c index ef79bc14..d309bbf9 100644 --- a/src/ipcpd/timerwheel.c +++ b/src/ipcpd/timerwheel.c @@ -3,7 +3,8 @@ * * Timerwheel * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/ipcpd/timerwheel.h b/src/ipcpd/timerwheel.h index 8ef9437c..aa71c73d 100644 --- a/src/ipcpd/timerwheel.h +++ b/src/ipcpd/timerwheel.h @@ -3,7 +3,8 @@ * * Ring buffer for incoming SDUs * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -31,8 +32,8 @@ void timerwheel_destroy(struct timerwheel * tw); int timerwheel_add(struct timerwheel * tw, void (* func)(void *), - void * arg, - size_t arg_len, - unsigned int delay); /* ms */ + void * arg, + size_t arg_len, + unsigned int delay); /* ms */ #endif /* OUROBOROS_IPCPD_TIMERWHEEL_H */ diff --git a/src/irmd/api_table.c b/src/irmd/api_table.c index df300cea..9ba0f551 100644 --- a/src/irmd/api_table.c +++ b/src/irmd/api_table.c @@ -3,7 +3,8 @@ * * The IPC Resource Manager - Application Instance Table * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/api_table.h b/src/irmd/api_table.h index df788bbc..c7998c7f 100644 --- a/src/irmd/api_table.h +++ b/src/irmd/api_table.h @@ -3,7 +3,8 @@ * * The IPC Resource Manager - Application Instance Table * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/apn_table.c b/src/irmd/apn_table.c index 955618d8..d265e2f0 100644 --- a/src/irmd/apn_table.c +++ b/src/irmd/apn_table.c @@ -3,7 +3,8 @@ * * The IPC Resource Manager - Application Process Table * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/apn_table.h b/src/irmd/apn_table.h index 550012bf..311c0f3d 100644 --- a/src/irmd/apn_table.h +++ b/src/irmd/apn_table.h @@ -3,7 +3,8 @@ * * The IPC Resource Manager - Application Process Names Table * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/ipcp.c b/src/irmd/ipcp.c index ae9ec957..06b66d3b 100644 --- a/src/irmd/ipcp.c +++ b/src/irmd/ipcp.c @@ -3,7 +3,8 @@ * * The API to instruct IPCPs * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/ipcp.h b/src/irmd/ipcp.h index 7ddfc3c4..bb868191 100644 --- a/src/irmd/ipcp.h +++ b/src/irmd/ipcp.h @@ -3,7 +3,8 @@ * * The API for the IRM to instruct IPCPs * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/irm_flow.c b/src/irmd/irm_flow.c index d2482391..20d2511c 100644 --- a/src/irmd/irm_flow.c +++ b/src/irmd/irm_flow.c @@ -3,7 +3,8 @@ * * The IPC Resource Manager - Flows * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/irm_flow.h b/src/irmd/irm_flow.h index dc60d139..9a439204 100644 --- a/src/irmd/irm_flow.h +++ b/src/irmd/irm_flow.h @@ -3,7 +3,8 @@ * * The IPC Resource Manager - Flows * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/main.c b/src/irmd/main.c index a0115f56..08e41f8d 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -3,8 +3,8 @@ * * The IPC Resource Manager * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/registry.c b/src/irmd/registry.c index f4579d08..a488d80a 100644 --- a/src/irmd/registry.c +++ b/src/irmd/registry.c @@ -3,7 +3,8 @@ * * The IPC Resource Manager - Registry * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/registry.h b/src/irmd/registry.h index 76b32398..cf4ea432 100644 --- a/src/irmd/registry.h +++ b/src/irmd/registry.h @@ -3,7 +3,8 @@ * * The IPC Resource Manager - Registry * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/utils.c b/src/irmd/utils.c index 7d63f020..97193b53 100644 --- a/src/irmd/utils.c +++ b/src/irmd/utils.c @@ -3,8 +3,8 @@ * * The IPC Resource Manager - Utilities * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/irmd/utils.h b/src/irmd/utils.h index 03296259..36ec3d8e 100644 --- a/src/irmd/utils.h +++ b/src/irmd/utils.h @@ -3,7 +3,8 @@ * * Utils of the IPC Resource Manager * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -44,6 +45,7 @@ int wildcard_match(const char * pattern, /* functions for copying and destroying arguments list */ char ** argvdup(char ** argv); + void argvfree(char ** argv); #endif /* OUROBOROS_IRM_UTILS_H */ diff --git a/src/lib/bitmap.c b/src/lib/bitmap.c index 255f2b4d..93ffda77 100644 --- a/src/lib/bitmap.c +++ b/src/lib/bitmap.c @@ -3,8 +3,8 @@ * * Bitmap implementation * - * Sander Vrijders - * Francesco Salvestrini + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/btree.c b/src/lib/btree.c index 38302dae..10a900d6 100644 --- a/src/lib/btree.c +++ b/src/lib/btree.c @@ -3,8 +3,8 @@ * * B-trees * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/btree.h b/src/lib/btree.h index 79467099..f7c293c5 100644 --- a/src/lib/btree.h +++ b/src/lib/btree.h @@ -3,7 +3,8 @@ * * B-trees * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/cdap.c b/src/lib/cdap.c index 6c46775c..ba4a2a21 100644 --- a/src/lib/cdap.c +++ b/src/lib/cdap.c @@ -3,7 +3,8 @@ * * The Common Distributed Application Protocol * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/cdap_req.c b/src/lib/cdap_req.c index 810ec9bf..a0348a14 100644 --- a/src/lib/cdap_req.c +++ b/src/lib/cdap_req.c @@ -3,8 +3,8 @@ * * CDAP - CDAP request management * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/cdap_req.h b/src/lib/cdap_req.h index 2d69526b..9023357d 100644 --- a/src/lib/cdap_req.h +++ b/src/lib/cdap_req.h @@ -3,8 +3,8 @@ * * CDAP - CDAP request management * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/crc32.c b/src/lib/crc32.c index 8cafe5b5..549938b8 100644 --- a/src/lib/crc32.c +++ b/src/lib/crc32.c @@ -3,7 +3,8 @@ * * 32-bit Cyclic Redundancy Check * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/dev.c b/src/lib/dev.c index cb8044cf..9ddc5b84 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -3,8 +3,8 @@ * * API for applications * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/hashtable.c b/src/lib/hashtable.c index f17accaf..0a534da7 100644 --- a/src/lib/hashtable.c +++ b/src/lib/hashtable.c @@ -3,7 +3,8 @@ * * Hash table with separate chaining on collisions * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/irm.c b/src/lib/irm.c index b610a59e..0e4bfc40 100644 --- a/src/lib/irm.c +++ b/src/lib/irm.c @@ -3,7 +3,8 @@ * * The API to instruct the IRM * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/list.c b/src/lib/list.c index 01fdf6e3..b6b4bbd2 100644 --- a/src/lib/list.c +++ b/src/lib/list.c @@ -3,8 +3,8 @@ * * Simple doubly linked list implementation. * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/lockfile.c b/src/lib/lockfile.c index 2868cb71..e84c6692 100644 --- a/src/lib/lockfile.c +++ b/src/lib/lockfile.c @@ -3,7 +3,8 @@ * * Lockfile for Ouroboros * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/logs.c b/src/lib/logs.c index 3184773f..e38f2a8b 100644 --- a/src/lib/logs.c +++ b/src/lib/logs.c @@ -3,8 +3,8 @@ * * Logging facilities * - * Sander Vrijders - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/nsm.c b/src/lib/nsm.c index 3fc98021..979f711e 100644 --- a/src/lib/nsm.c +++ b/src/lib/nsm.c @@ -3,7 +3,8 @@ * * The API to instruct the global Namespace Manager * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/rib.c b/src/lib/rib.c index af4abccf..8468e88c 100644 --- a/src/lib/rib.c +++ b/src/lib/rib.c @@ -3,8 +3,8 @@ * * Resource Information Base * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/sha3.c b/src/lib/sha3.c index 212f645a..750038f2 100644 --- a/src/lib/sha3.c +++ b/src/lib/sha3.c @@ -3,6 +3,9 @@ * * SHA3 algorithm * + * Dimitri Staessens + * Sander Vrijders + * * This implementation is adapted and redistributed from the RHASH * project * diff --git a/src/lib/sha3.h b/src/lib/sha3.h index 413228a2..6ce67482 100644 --- a/src/lib/sha3.h +++ b/src/lib/sha3.h @@ -3,7 +3,8 @@ * * SHA3 algorithm * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This implementation is adapted and redistributed from the RHASH * project implementation of the sha3 algorithm diff --git a/src/lib/shm_flow_set.c b/src/lib/shm_flow_set.c index 161e070c..a8e3fc79 100644 --- a/src/lib/shm_flow_set.c +++ b/src/lib/shm_flow_set.c @@ -3,7 +3,8 @@ * * Management of flow_sets for fqueue * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/shm_rbuff.c b/src/lib/shm_rbuff.c index 0d0795aa..a206a019 100644 --- a/src/lib/shm_rbuff.c +++ b/src/lib/shm_rbuff.c @@ -3,7 +3,8 @@ * * Ring buffer for incoming SDUs * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/shm_rdrbuff.c b/src/lib/shm_rdrbuff.c index eb51a278..0976c4bd 100644 --- a/src/lib/shm_rdrbuff.c +++ b/src/lib/shm_rdrbuff.c @@ -3,8 +3,8 @@ * * Random Deletion Ring Buffer for Data Units * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/sockets.c b/src/lib/sockets.c index e57cd748..3a26a2cf 100644 --- a/src/lib/sockets.c +++ b/src/lib/sockets.c @@ -3,7 +3,8 @@ * * The sockets layer to communicate between daemons * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/tests/bitmap_test.c b/src/lib/tests/bitmap_test.c index b1684f72..7480600e 100644 --- a/src/lib/tests/bitmap_test.c +++ b/src/lib/tests/bitmap_test.c @@ -3,7 +3,8 @@ * * Test of the bitmap * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/lib/tests/btree_test.c b/src/lib/tests/btree_test.c index 257a7e37..6981f63a 100644 --- a/src/lib/tests/btree_test.c +++ b/src/lib/tests/btree_test.c @@ -3,7 +3,8 @@ * * Test of the B-tree implementation * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/lib/tests/crc32_test.c b/src/lib/tests/crc32_test.c index 563d23b0..6a8ee9c3 100644 --- a/src/lib/tests/crc32_test.c +++ b/src/lib/tests/crc32_test.c @@ -3,7 +3,8 @@ * * Test of the CRC32 function * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/lib/tests/hashtable_test.c b/src/lib/tests/hashtable_test.c index fb7f1156..a5b0e469 100644 --- a/src/lib/tests/hashtable_test.c +++ b/src/lib/tests/hashtable_test.c @@ -3,7 +3,8 @@ * * Test of the hash table * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/lib/tests/rib_test.c b/src/lib/tests/rib_test.c index 8996c379..54926e10 100644 --- a/src/lib/tests/rib_test.c +++ b/src/lib/tests/rib_test.c @@ -3,7 +3,8 @@ * * Test of the RIB * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/lib/tests/sha3_test.c b/src/lib/tests/sha3_test.c index 30334f49..212452ef 100644 --- a/src/lib/tests/sha3_test.c +++ b/src/lib/tests/sha3_test.c @@ -3,7 +3,8 @@ * * Test of the SHA3 function * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/lib/time_utils.c b/src/lib/time_utils.c index 3b791157..97e97b09 100644 --- a/src/lib/time_utils.c +++ b/src/lib/time_utils.c @@ -3,7 +3,8 @@ * * Time utilities * - * Dimitri Staessens + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/lib/utils.c b/src/lib/utils.c index 40d1c285..e97dddb0 100644 --- a/src/lib/utils.c +++ b/src/lib/utils.c @@ -3,7 +3,8 @@ * * Handy utilities * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/src/nsmd/main.c b/src/nsmd/main.c index f3b87330..b85b39a9 100644 --- a/src/nsmd/main.c +++ b/src/nsmd/main.c @@ -1,10 +1,32 @@ -#define OUROBOROS_PREFIX "da" +/* + * Ouroboros - Copyright (C) 2016 - 2017 + * + * Normal IPC Process + * + * Dimitri Staessens + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#define OUROBOROS_PREFIX "nsmd" #include int main(void) { - log_dbg("Test of the DA"); + log_dbg("Test of the NSMd"); return 0; } diff --git a/src/tools/cbr/cbr.c b/src/tools/cbr/cbr.c index ef8a58ba..cd29c9ad 100644 --- a/src/tools/cbr/cbr.c +++ b/src/tools/cbr/cbr.c @@ -3,8 +3,8 @@ * * CBR traffic generator * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/cbr/cbr_client.c b/src/tools/cbr/cbr_client.c index 48a18cd1..16ade13d 100644 --- a/src/tools/cbr/cbr_client.c +++ b/src/tools/cbr/cbr_client.c @@ -3,8 +3,8 @@ * * A simple CBR generator * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/cbr/cbr_server.c b/src/tools/cbr/cbr_server.c index b0be9d7b..9198858c 100644 --- a/src/tools/cbr/cbr_server.c +++ b/src/tools/cbr/cbr_server.c @@ -3,8 +3,8 @@ * * A simple CBR generator * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/echo/echo.c b/src/tools/echo/echo.c index 3dd7527b..051a16c3 100644 --- a/src/tools/echo/echo.c +++ b/src/tools/echo/echo.c @@ -3,7 +3,8 @@ * * A simple echo application * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/echo/echo_client.c b/src/tools/echo/echo_client.c index 3036d338..f84de73a 100644 --- a/src/tools/echo/echo_client.c +++ b/src/tools/echo/echo_client.c @@ -3,7 +3,8 @@ * * A simple echo application * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/echo/echo_server.c b/src/tools/echo/echo_server.c index 94c54eee..aa136485 100644 --- a/src/tools/echo/echo_server.c +++ b/src/tools/echo/echo_server.c @@ -3,7 +3,8 @@ * * A simple echo application * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm.c b/src/tools/irm/irm.c index 85d03245..0e77e22a 100644 --- a/src/tools/irm/irm.c +++ b/src/tools/irm/irm.c @@ -3,7 +3,8 @@ * * A tool to instruct the IRM daemon * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_bind.c b/src/tools/irm/irm_bind.c index bb19d13c..bbe370db 100644 --- a/src/tools/irm/irm_bind.c +++ b/src/tools/irm/irm_bind.c @@ -3,8 +3,8 @@ * * Bind names in the processing system * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_bind_ap.c b/src/tools/irm/irm_bind_ap.c index dc66e399..d23f7035 100644 --- a/src/tools/irm/irm_bind_ap.c +++ b/src/tools/irm/irm_bind_ap.c @@ -3,8 +3,8 @@ * * Bind AP to a name * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_bind_api.c b/src/tools/irm/irm_bind_api.c index dd405347..6e171099 100644 --- a/src/tools/irm/irm_bind_api.c +++ b/src/tools/irm/irm_bind_api.c @@ -3,8 +3,8 @@ * * Bind AP-I to a name * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_bind_ipcp.c b/src/tools/irm/irm_bind_ipcp.c index 404207c0..81347080 100644 --- a/src/tools/irm/irm_bind_ipcp.c +++ b/src/tools/irm/irm_bind_ipcp.c @@ -3,8 +3,8 @@ * * Bind IPCP Instance to a name * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_ipcp.c b/src/tools/irm/irm_ipcp.c index 59869a12..fef803d9 100644 --- a/src/tools/irm/irm_ipcp.c +++ b/src/tools/irm/irm_ipcp.c @@ -3,7 +3,8 @@ * * A tool to instruct the IRM daemon * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_ipcp_bootstrap.c b/src/tools/irm/irm_ipcp_bootstrap.c index 10c89060..ac52c6c1 100644 --- a/src/tools/irm/irm_ipcp_bootstrap.c +++ b/src/tools/irm/irm_ipcp_bootstrap.c @@ -3,7 +3,8 @@ * * Bootstrap IPC Processes * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_ipcp_create.c b/src/tools/irm/irm_ipcp_create.c index e8ed1186..494f01f5 100644 --- a/src/tools/irm/irm_ipcp_create.c +++ b/src/tools/irm/irm_ipcp_create.c @@ -3,7 +3,8 @@ * * Create IPC Processes * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_ipcp_destroy.c b/src/tools/irm/irm_ipcp_destroy.c index 96808850..1c81c9ce 100644 --- a/src/tools/irm/irm_ipcp_destroy.c +++ b/src/tools/irm/irm_ipcp_destroy.c @@ -3,7 +3,8 @@ * * Destroy IPC Processes * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_ipcp_enroll.c b/src/tools/irm/irm_ipcp_enroll.c index 3731fa81..05b3f6b6 100644 --- a/src/tools/irm/irm_ipcp_enroll.c +++ b/src/tools/irm/irm_ipcp_enroll.c @@ -3,7 +3,8 @@ * * Enroll IPC Processes * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_ops.h b/src/tools/irm/irm_ops.h index 514570f5..8f0e790e 100644 --- a/src/tools/irm/irm_ops.h +++ b/src/tools/irm/irm_ops.h @@ -3,7 +3,8 @@ * * Functions of the IRM tool that are one level deep * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -19,19 +20,47 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -int ipcp_cmd(int argc, char ** argv); -int do_create_ipcp(int argc, char ** argv); -int do_destroy_ipcp(int argc, char ** argv); -int do_bootstrap_ipcp(int argc, char ** argv); -int do_enroll_ipcp(int argc, char ** argv); - -int bind_cmd(int argc, char ** argv); -int do_bind_ap(int argc, char ** argv); -int do_bind_api(int argc, char ** argv); -int do_bind_ipcp(int argc, char ** argv); -int unbind_cmd(int argc, char ** argv); -int do_unbind_ap(int argc, char ** argv); -int do_unbind_api(int argc, char ** argv); -int do_unbind_ipcp(int argc, char ** argv); -int do_register(int argc, char ** argv); -int do_unregister(int argc, char ** argv); +int ipcp_cmd(int argc, + char ** argv); + +int do_create_ipcp(int argc, + char ** argv); + +int do_destroy_ipcp(int argc, + char ** argv); + +int do_bootstrap_ipcp(int argc, + char ** argv); + +int do_enroll_ipcp(int argc, + char ** argv); + +int bind_cmd(int argc, + char ** argv); + +int do_bind_ap(int argc, + char ** argv); + +int do_bind_api(int argc, + char ** argv); + +int do_bind_ipcp(int argc, + char ** argv); + +int unbind_cmd(int argc, + char ** argv); + +int do_unbind_ap(int argc, + char ** argv); + +int do_unbind_api(int argc, + char ** argv); + +int do_unbind_ipcp(int argc, + char ** argv); + +int do_register(int argc, + char ** argv); + +int do_unregister(int argc, + char ** argv); diff --git a/src/tools/irm/irm_register.c b/src/tools/irm/irm_register.c index cdb4b888..094268c0 100644 --- a/src/tools/irm/irm_register.c +++ b/src/tools/irm/irm_register.c @@ -3,8 +3,8 @@ * * Register names in IPCPs * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_unbind.c b/src/tools/irm/irm_unbind.c index 2a570547..e21f7993 100644 --- a/src/tools/irm/irm_unbind.c +++ b/src/tools/irm/irm_unbind.c @@ -3,8 +3,8 @@ * * Unbind names in the processing system * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_unbind_ap.c b/src/tools/irm/irm_unbind_ap.c index 779506bd..a1b07d36 100644 --- a/src/tools/irm/irm_unbind_ap.c +++ b/src/tools/irm/irm_unbind_ap.c @@ -3,8 +3,8 @@ * * Unbind AP names * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_unbind_api.c b/src/tools/irm/irm_unbind_api.c index 29e4a9c1..6200c21f 100644 --- a/src/tools/irm/irm_unbind_api.c +++ b/src/tools/irm/irm_unbind_api.c @@ -3,8 +3,8 @@ * * Unbind AP-I names * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_unbind_ipcp.c b/src/tools/irm/irm_unbind_ipcp.c index be7e995f..34af66e0 100644 --- a/src/tools/irm/irm_unbind_ipcp.c +++ b/src/tools/irm/irm_unbind_ipcp.c @@ -3,8 +3,8 @@ * * Unbind name from IPCP Instance * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_unregister.c b/src/tools/irm/irm_unregister.c index d8cadc33..18314e96 100644 --- a/src/tools/irm/irm_unregister.c +++ b/src/tools/irm/irm_unregister.c @@ -3,8 +3,8 @@ * * Unregister names from IPCPs * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_utils.c b/src/tools/irm/irm_utils.c index 25f8dc3a..24841b99 100644 --- a/src/tools/irm/irm_utils.c +++ b/src/tools/irm/irm_utils.c @@ -3,7 +3,8 @@ * * Handy helper functions for the IRM tool * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/irm/irm_utils.h b/src/tools/irm/irm_utils.h index b5a6f56f..d6d2232c 100644 --- a/src/tools/irm/irm_utils.h +++ b/src/tools/irm/irm_utils.h @@ -3,7 +3,8 @@ * * Handy helper functions for the IRM tool * - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -19,4 +20,5 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -int matches(const char * cmd, const char * pattern); +int matches(const char * cmd, + const char * pattern); diff --git a/src/tools/operf/operf.c b/src/tools/operf/operf.c index 1d91ff42..7935d12c 100644 --- a/src/tools/operf/operf.c +++ b/src/tools/operf/operf.c @@ -3,8 +3,8 @@ * * Ouroboros perf application * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/operf/operf_client.c b/src/tools/operf/operf_client.c index 0c943cf7..d2f08ef4 100644 --- a/src/tools/operf/operf_client.c +++ b/src/tools/operf/operf_client.c @@ -3,8 +3,8 @@ * * Ouroboros ping application * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/operf/operf_server.c b/src/tools/operf/operf_server.c index f23b52f3..3665d4cc 100644 --- a/src/tools/operf/operf_server.c +++ b/src/tools/operf/operf_server.c @@ -3,8 +3,8 @@ * * Ouroboros perf application * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/oping/oping.c b/src/tools/oping/oping.c index 64cb7dd8..7c9c108c 100644 --- a/src/tools/oping/oping.c +++ b/src/tools/oping/oping.c @@ -3,8 +3,8 @@ * * Ouroboros ping application * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c index 253ea168..a91a126c 100644 --- a/src/tools/oping/oping_client.c +++ b/src/tools/oping/oping_client.c @@ -3,8 +3,8 @@ * * Ouroboros ping application * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/src/tools/oping/oping_server.c b/src/tools/oping/oping_server.c index e0a6655b..e20e236d 100644 --- a/src/tools/oping/oping_server.c +++ b/src/tools/oping/oping_server.c @@ -3,8 +3,8 @@ * * Ouroboros ping application * - * Dimitri Staessens - * Sander Vrijders + * Dimitri Staessens + * Sander Vrijders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as -- cgit v1.2.3