diff options
author | Sander Vrijders <[email protected]> | 2017-02-24 16:03:28 +0100 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2017-02-24 16:03:28 +0100 |
commit | cdab533860ba69423695e1d08acc25b074a0e065 (patch) | |
tree | 96779e5d2cdf964432506f774d5bf61d11b27d68 | |
parent | 75cf809a95b75f09ff805b3872dcb71b80fef586 (diff) | |
download | ouroboros-cdab533860ba69423695e1d08acc25b074a0e065.tar.gz ouroboros-cdab533860ba69423695e1d08acc25b074a0e065.zip |
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.
36 files changed, 61 insertions, 199 deletions
diff --git a/include/ouroboros/dev.h b/include/ouroboros/dev.h index 1d2a2533..c4d2cb16 100644 --- a/include/ouroboros/dev.h +++ b/include/ouroboros/dev.h @@ -27,16 +27,13 @@ #ifndef OUROBOROS_DEV_H #define OUROBOROS_DEV_H -#define UNKNOWN_AE "__UNKNOWN_AE__" - /* These calls should be removed once we write the ouroboros OS. */ int ap_init(const char * ap_name); void ap_fini(void); -/* Returns flow descriptor (> 0), client AE name and qos spec. */ -int flow_accept(char ** ae_name, - qosspec_t * spec); +/* Returns flow descriptor (> 0) and qos spec. */ +int flow_accept(qosspec_t * spec); int flow_alloc_resp(int fd, int response); @@ -46,7 +43,6 @@ int flow_alloc_resp(int fd, * On returning, spec will contain the actual supplied QoS. */ int flow_alloc(const char * dst_name, - const char * src_ae_name, qosspec_t * spec); int flow_alloc_res(int fd); diff --git a/include/ouroboros/ipcp-dev.h b/include/ouroboros/ipcp-dev.h index 81aca1d7..fc82f374 100644 --- a/include/ouroboros/ipcp-dev.h +++ b/include/ouroboros/ipcp-dev.h @@ -31,7 +31,6 @@ int ipcp_create_r(pid_t api, int ipcp_flow_req_arr(pid_t api, char * dst_name, - char * src_ae_name, qoscube_t cube); int ipcp_flow_alloc_reply(int fd, diff --git a/src/ipcpd/ipcp-ops.h b/src/ipcpd/ipcp-ops.h deleted file mode 100644 index 6a42ec5c..00000000 --- a/src/ipcpd/ipcp-ops.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - 2017 - * - * IPC process ops - * - * Dimitri Staessens <[email protected]> - * Sander Vrijders <[email protected]> - * - * 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 IPCPD_IPCP_OPS_H -#define IPCPD_IPCP_OPS_H - -#include <ouroboros/irm_config.h> -#include <ouroboros/shared.h> - -struct ipcp_ops { - int (* ipcp_bootstrap)(struct dif_config * conf); - - int (* ipcp_enroll)(char * dif_name); - - int (* ipcp_name_reg)(char * name); - - int (* ipcp_name_unreg)(char * name); - - int (* ipcp_name_query)(char * name); - - int (* ipcp_flow_alloc)(int fd, - char * dst_ap_name, - char * src_ae_name, - qoscube_t qos); - - int (* ipcp_flow_alloc_resp)(int fd, - int response); - - int (* ipcp_flow_dealloc)(int fd); -}; - -#endif /* IPCPD_IPCP_OPS_H */ diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 19b3a721..41b5bb48 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -191,7 +191,6 @@ static void * ipcp_main_loop(void * o) ret_msg.result = ipcpi.ops->ipcp_flow_alloc(fd, msg->dst_name, - msg->src_ae_name, msg->qoscube); break; case IPCP_MSG_CODE__IPCP_FLOW_ALLOC_RESP: diff --git a/src/ipcpd/ipcp.h b/src/ipcpd/ipcp.h index de7d72b0..d0b5e022 100644 --- a/src/ipcpd/ipcp.h +++ b/src/ipcpd/ipcp.h @@ -50,7 +50,6 @@ struct ipcp_ops { int (* ipcp_flow_alloc)(int fd, char * dst_ap_name, - char * src_ae_name, qoscube_t qos); int (* ipcp_flow_alloc_resp)(int fd, diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c index 8d770c94..2d995680 100644 --- a/src/ipcpd/local/main.c +++ b/src/ipcpd/local/main.c @@ -220,7 +220,6 @@ static int ipcp_local_name_query(char * name) static int ipcp_local_flow_alloc(int fd, char * dst_name, - char * src_ae_name, qoscube_t cube) { int out_fd = -1; @@ -228,7 +227,6 @@ static int ipcp_local_flow_alloc(int fd, log_dbg("Allocating flow to %s on fd %d.", dst_name, fd); assert(dst_name); - assert(src_ae_name); pthread_rwlock_rdlock(&ipcpi.state_lock); @@ -240,7 +238,7 @@ static int ipcp_local_flow_alloc(int fd, pthread_rwlock_wrlock(&local_data.lock); - out_fd = ipcp_flow_req_arr(getpid(), dst_name, src_ae_name, cube); + out_fd = ipcp_flow_req_arr(getpid(), dst_name, cube); local_data.in_out[fd] = out_fd; local_data.in_out[out_fd] = fd; diff --git a/src/ipcpd/normal/cdap_flow.c b/src/ipcpd/normal/cdap_flow.c index 71ebcc03..3d1b2b22 100644 --- a/src/ipcpd/normal/cdap_flow.c +++ b/src/ipcpd/normal/cdap_flow.c @@ -87,7 +87,6 @@ struct cdap_flow * cdap_flow_arr(int fd, } struct cdap_flow * cdap_flow_alloc(const char * dst_name, - const char * ae_name, qosspec_t * qs, enum pol_cacep pc, const struct conn_info * info) @@ -97,12 +96,12 @@ struct cdap_flow * cdap_flow_alloc(const char * dst_name, log_dbg("Allocating flow to %s.", dst_name); - if (dst_name == NULL || ae_name == NULL) { + if (dst_name == NULL) { log_err("Not enough info to establish flow."); return NULL; } - fd = flow_alloc(dst_name, ae_name, qs); + fd = flow_alloc(dst_name, qs); if (fd < 0) { log_err("Failed to allocate flow to %s.", dst_name); return NULL; diff --git a/src/ipcpd/normal/cdap_flow.h b/src/ipcpd/normal/cdap_flow.h index 14a04f02..8aa26dc0 100644 --- a/src/ipcpd/normal/cdap_flow.h +++ b/src/ipcpd/normal/cdap_flow.h @@ -39,7 +39,6 @@ struct cdap_flow * cdap_flow_arr(int fd, const struct conn_info * info); struct cdap_flow * cdap_flow_alloc(const char * dst_name, - const char * ae_name, qosspec_t * qs, enum pol_cacep pc, const struct conn_info * info); diff --git a/src/ipcpd/normal/enroll.c b/src/ipcpd/normal/enroll.c index 78bc4d51..b420533e 100644 --- a/src/ipcpd/normal/enroll.c +++ b/src/ipcpd/normal/enroll.c @@ -181,8 +181,7 @@ int enroll_boot(char * dst_name) info.proto.pref_version = 1; info.proto.pref_syntax = PROTO_GPB; - flow = cdap_flow_alloc(dst_name, ENROLL_AE, NULL, ANONYMOUS_AUTH, - &info); + flow = cdap_flow_alloc(dst_name, NULL, ANONYMOUS_AUTH, &info); if (flow == NULL) { log_err("Failed to allocate flow for enrollment request."); conn_info_fini(&info); diff --git a/src/ipcpd/normal/flow_alloc.proto b/src/ipcpd/normal/flow_alloc.proto index 16e8be2c..3b08f047 100644 --- a/src/ipcpd/normal/flow_alloc.proto +++ b/src/ipcpd/normal/flow_alloc.proto @@ -31,7 +31,6 @@ enum flow_alloc_code { message flow_alloc_msg { required flow_alloc_code code = 1; optional string dst_name = 2; - optional string src_ae_name = 3; - optional uint32 qoscube = 4; - optional sint32 response = 5; + optional uint32 qoscube = 3; + optional sint32 response = 4; }; diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c index 74bdda88..071a895f 100644 --- a/src/ipcpd/normal/fmgr.c +++ b/src/ipcpd/normal/fmgr.c @@ -301,7 +301,7 @@ int fmgr_init(void) /* FIXME: Implement cacep policies */ (void) pc; - fmgr.gam = gam_create(pg, DT_AE); + fmgr.gam = gam_create(pg); if (fmgr.gam == NULL) { log_err("Failed to create graph adjacency manager."); fmgr_destroy_flows(); @@ -360,7 +360,6 @@ void fmgr_fini() int fmgr_np1_alloc(int fd, char * dst_ap_name, - char * src_ae_name, qoscube_t cube) { cep_id_t cep_id; @@ -406,7 +405,6 @@ int fmgr_np1_alloc(int fd, msg.code = FLOW_ALLOC_CODE__FLOW_REQ; msg.dst_name = dst_ap_name; - msg.src_ae_name = src_ae_name; msg.has_qoscube = true; msg.qoscube = cube; @@ -546,7 +544,6 @@ int fmgr_np1_post_buf(cep_id_t cep_id, case FLOW_ALLOC_CODE__FLOW_REQ: fd = ipcp_flow_req_arr(getpid(), msg->dst_name, - msg->src_ae_name, msg->qoscube); if (fd < 0) { flow_alloc_msg__free_unpacked(msg, NULL); diff --git a/src/ipcpd/normal/fmgr.h b/src/ipcpd/normal/fmgr.h index 3c61f55a..e75417f3 100644 --- a/src/ipcpd/normal/fmgr.h +++ b/src/ipcpd/normal/fmgr.h @@ -34,7 +34,6 @@ void fmgr_fini(void); int fmgr_np1_alloc(int fd, char * dst_ap_name, - char * src_ae_name, qoscube_t qos); int fmgr_np1_alloc_resp(int fd, diff --git a/src/ipcpd/normal/gam.c b/src/ipcpd/normal/gam.c index 02df0be7..2479fa62 100644 --- a/src/ipcpd/normal/gam.c +++ b/src/ipcpd/normal/gam.c @@ -53,14 +53,11 @@ struct gam { pthread_mutex_t gas_lock; pthread_cond_t gas_cond; - char * ae_name; - struct pol_gam_ops * ops; void * ops_o; }; -struct gam * gam_create(enum pol_gam gam_type, - const char * ae_name) +struct gam * gam_create(enum pol_gam gam_type) { struct gam * tmp; @@ -80,21 +77,13 @@ struct gam * gam_create(enum pol_gam gam_type, list_head_init(&tmp->gas); - tmp->ae_name = strdup(ae_name); - if (tmp->ae_name == NULL) { - free(tmp); - return NULL; - } - if (pthread_mutex_init(&tmp->gas_lock, NULL)) { - free(tmp->ae_name); free(tmp); return NULL; } if (pthread_cond_init(&tmp->gas_cond, NULL)) { pthread_mutex_destroy(&tmp->gas_lock); - free(tmp->ae_name); free(tmp); return NULL; } @@ -103,7 +92,6 @@ struct gam * gam_create(enum pol_gam gam_type, if (tmp->ops_o == NULL) { pthread_cond_destroy(&tmp->gas_cond); pthread_mutex_destroy(&tmp->gas_lock); - free(tmp->ae_name); free(tmp); return NULL; } @@ -111,7 +99,6 @@ struct gam * gam_create(enum pol_gam gam_type, if (tmp->ops->start(tmp->ops_o)) { pthread_cond_destroy(&tmp->gas_cond); pthread_mutex_destroy(&tmp->gas_lock); - free(tmp->ae_name); free(tmp); return NULL; } @@ -143,7 +130,6 @@ void gam_destroy(struct gam * instance) pthread_mutex_destroy(&instance->gas_lock); pthread_cond_destroy(&instance->gas_cond); - free(instance->ae_name); instance->ops->destroy(instance->ops_o); free(instance); } @@ -170,7 +156,7 @@ static int add_ga(struct gam * instance, pthread_cond_signal(&instance->gas_cond); pthread_mutex_unlock(&instance->gas_lock); - log_info("Added %s flow to %s.", instance->ae_name, info->name); + log_info("Added flow to %s.", info->name); return 0; } @@ -241,7 +227,7 @@ int gam_flow_alloc(struct gam * instance, log_dbg("Allocating flow to %s.", dst_name); - fd = flow_alloc(dst_name, instance->ae_name, NULL); + fd = flow_alloc(dst_name, NULL); if (fd < 0) { log_err("Failed to allocate flow to %s.", dst_name); return -1; diff --git a/src/ipcpd/normal/gam.h b/src/ipcpd/normal/gam.h index e4832ca6..58b028b9 100644 --- a/src/ipcpd/normal/gam.h +++ b/src/ipcpd/normal/gam.h @@ -26,8 +26,7 @@ #include <ouroboros/cacep.h> #include <ouroboros/irm_config.h> -struct gam * gam_create(enum pol_gam gam_type, - const char * ae_name); +struct gam * gam_create(enum pol_gam gam_type); void gam_destroy(struct gam * instance); diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 522daa3b..939544c3 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -85,8 +85,9 @@ void ipcp_sig_handler(int sig, static void * flow_acceptor(void * o) { int fd; - char * ae_name; qosspec_t qs; + /* FIXME: Remove once correct AE is known. */ + char * ae_name = ENROLL_AE; (void) o; @@ -101,14 +102,14 @@ static void * flow_acceptor(void * o) pthread_rwlock_unlock(&ipcpi.state_lock); - fd = flow_accept(&ae_name, &qs); + fd = flow_accept(&qs); if (fd < 0) { if (fd != -EIRMD) log_warn("Flow accept failed: %d", fd); continue; } - log_dbg("New flow allocation request for AE %s.", ae_name); + /* FIXME: Perform CACEP at this point */ if (strcmp(ae_name, ENROLL_AE) == 0) { enroll_handle(fd); @@ -123,8 +124,6 @@ static void * flow_acceptor(void * o) log_warn("Failed to reply to flow allocation."); flow_dealloc(fd); } - - free(ae_name); } return (void *) 0; diff --git a/src/ipcpd/normal/pol-gam-ops.h b/src/ipcpd/normal/pol-gam-ops.h index 6983e3a0..264f252b 100644 --- a/src/ipcpd/normal/pol-gam-ops.h +++ b/src/ipcpd/normal/pol-gam-ops.h @@ -23,7 +23,7 @@ #ifndef OUROBOROS_IPCPD_NORMAL_POL_GAM_OPS_H #define OUROBOROS_IPCPD_NORMAL_POL_GAM_OPS_H -#include "conn.h" +#include <ouroboros/cacep.h> struct pol_gam_ops { void * (* create)(struct gam * instance); 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; diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c index cd913de4..01121fa3 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/shim-eth-llc/main.c @@ -334,7 +334,6 @@ static int eth_llc_ipcp_send_mgmt_frame(shim_eth_llc_msg_t * msg, static int eth_llc_ipcp_sap_alloc(uint8_t * dst_addr, uint8_t ssap, char * dst_name, - char * src_ae_name, qoscube_t cube) { shim_eth_llc_msg_t msg = SHIM_ETH_LLC_MSG__INIT; @@ -343,7 +342,6 @@ static int eth_llc_ipcp_sap_alloc(uint8_t * dst_addr, msg.has_ssap = true; msg.ssap = ssap; msg.dst_name = dst_name; - msg.src_ae_name = src_ae_name; msg.has_qoscube = true; msg.qoscube = cube; @@ -371,7 +369,6 @@ static int eth_llc_ipcp_sap_alloc_resp(uint8_t * dst_addr, static int eth_llc_ipcp_sap_req(uint8_t r_sap, uint8_t * r_addr, char * dst_name, - char * src_ae_name, qoscube_t cube) { int fd; @@ -380,7 +377,7 @@ static int eth_llc_ipcp_sap_req(uint8_t r_sap, pthread_rwlock_wrlock(ð_llc_data.flows_lock); /* reply to IRM */ - fd = ipcp_flow_req_arr(getpid(), dst_name, src_ae_name, cube); + fd = ipcp_flow_req_arr(getpid(), dst_name, cube); if (fd < 0) { pthread_rwlock_unlock(ð_llc_data.flows_lock); pthread_rwlock_unlock(&ipcpi.state_lock); @@ -491,7 +488,6 @@ static int eth_llc_ipcp_mgmt_frame(uint8_t * buf, eth_llc_ipcp_sap_req(msg->ssap, r_addr, msg->dst_name, - msg->src_ae_name, msg->qoscube); } break; @@ -989,7 +985,6 @@ static int eth_llc_ipcp_name_query(char * name) static int eth_llc_ipcp_flow_alloc(int fd, char * dst_name, - char * src_ae_name, qoscube_t cube) { uint8_t ssap = 0; @@ -998,7 +993,7 @@ static int eth_llc_ipcp_flow_alloc(int fd, log_dbg("Allocating flow to %s.", dst_name); - if (dst_name == NULL || src_ae_name == NULL) + if (dst_name == NULL) return -1; if (cube != QOS_CUBE_BE && cube != QOS_CUBE_FRC) { @@ -1038,11 +1033,7 @@ static int eth_llc_ipcp_flow_alloc(int fd, memcpy(r_addr, &addr, MAC_SIZE); - if (eth_llc_ipcp_sap_alloc(r_addr, - ssap, - dst_name, - src_ae_name, - cube) < 0) { + if (eth_llc_ipcp_sap_alloc(r_addr, ssap, dst_name, cube) < 0) { pthread_rwlock_rdlock(&ipcpi.state_lock); pthread_rwlock_wrlock(ð_llc_data.flows_lock); bmp_release(eth_llc_data.saps, eth_llc_data.fd_to_ef[fd].sap); diff --git a/src/ipcpd/shim-eth-llc/shim_eth_llc_messages.proto b/src/ipcpd/shim-eth-llc/shim_eth_llc_messages.proto index cedb0fd4..2d66428c 100644 --- a/src/ipcpd/shim-eth-llc/shim_eth_llc_messages.proto +++ b/src/ipcpd/shim-eth-llc/shim_eth_llc_messages.proto @@ -32,9 +32,8 @@ enum shim_eth_llc_msg_code { message shim_eth_llc_msg { required shim_eth_llc_msg_code code = 1; optional string dst_name = 2; - optional string src_ae_name = 3; - optional uint32 ssap = 4; - optional uint32 dsap = 5; - optional uint32 qoscube = 6; - optional sint32 response = 7; + optional uint32 ssap = 3; + optional uint32 dsap = 4; + optional uint32 qoscube = 5; + optional sint32 response = 6; }; diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c index 4d6fdc3b..a67a60ee 100644 --- a/src/ipcpd/shim-udp/main.c +++ b/src/ipcpd/shim-udp/main.c @@ -197,7 +197,6 @@ static int send_shim_udp_msg(shim_udp_msg_t * msg, static int ipcp_udp_port_alloc(uint32_t dst_ip_addr, uint16_t src_udp_port, char * dst_name, - char * src_ae_name, qoscube_t cube) { shim_udp_msg_t msg = SHIM_UDP_MSG__INIT; @@ -205,7 +204,6 @@ static int ipcp_udp_port_alloc(uint32_t dst_ip_addr, msg.code = SHIM_UDP_MSG_CODE__FLOW_REQ; msg.src_udp_port = src_udp_port; msg.dst_name = dst_name; - msg.src_ae_name = src_ae_name; msg.has_qoscube = true; msg.qoscube = cube; @@ -231,7 +229,6 @@ static int ipcp_udp_port_alloc_resp(uint32_t dst_ip_addr, static int ipcp_udp_port_req(struct sockaddr_in * c_saddr, char * dst_name, - char * src_ae_name, qoscube_t cube) { int skfd; @@ -275,7 +272,7 @@ static int ipcp_udp_port_req(struct sockaddr_in * c_saddr, pthread_rwlock_wrlock(&udp_data.flows_lock); /* reply to IRM */ - fd = ipcp_flow_req_arr(getpid(), dst_name, src_ae_name, cube); + fd = ipcp_flow_req_arr(getpid(), dst_name, cube); if (fd < 0) { pthread_rwlock_unlock(&udp_data.flows_lock); pthread_rwlock_unlock(&ipcpi.state_lock); @@ -397,7 +394,6 @@ static void * ipcp_udp_listener(void * o) c_saddr.sin_port = msg->src_udp_port; ipcp_udp_port_req(&c_saddr, msg->dst_name, - msg->src_ae_name, msg->qoscube); break; case SHIM_UDP_MSG_CODE__FLOW_REPLY: @@ -957,7 +953,6 @@ static int ipcp_udp_name_query(char * name) static int ipcp_udp_flow_alloc(int fd, char * dst_name, - char * src_ae_name, qoscube_t cube) { struct sockaddr_in r_saddr; /* server address */ @@ -969,10 +964,8 @@ static int ipcp_udp_flow_alloc(int fd, log_dbg("Allocating flow to %s.", dst_name); assert(dst_name); - assert(src_ae_name); - if (strlen(dst_name) > 255 - || strlen(src_ae_name) > 255) { + if (strlen(dst_name) > 255) { log_err("Name too long for this shim."); return -1; } @@ -1043,7 +1036,6 @@ static int ipcp_udp_flow_alloc(int fd, if (ipcp_udp_port_alloc(ip_addr, f_saddr.sin_port, dst_name, - src_ae_name, cube) < 0) { pthread_rwlock_rdlock(&ipcpi.state_lock); pthread_rwlock_wrlock(&udp_data.flows_lock); diff --git a/src/irmd/ipcp.c b/src/irmd/ipcp.c index dcf77eec..ae9ec957 100644 --- a/src/irmd/ipcp.c +++ b/src/irmd/ipcp.c @@ -328,14 +328,13 @@ int ipcp_flow_alloc(pid_t api, int port_id, pid_t n_api, char * dst_name, - char * src_ae_name, qoscube_t cube) { ipcp_msg_t msg = IPCP_MSG__INIT; ipcp_msg_t * recv_msg = NULL; int ret = -1; - if (dst_name == NULL || src_ae_name == NULL) + if (dst_name == NULL) return -EINVAL; msg.code = IPCP_MSG_CODE__IPCP_FLOW_ALLOC; @@ -343,7 +342,6 @@ int ipcp_flow_alloc(pid_t api, msg.port_id = port_id; msg.has_api = true; msg.api = n_api; - msg.src_ae_name = src_ae_name; msg.dst_name = dst_name; msg.has_qoscube = true; msg.qoscube = cube; diff --git a/src/irmd/ipcp.h b/src/irmd/ipcp.h index 658aa2ea..7ddfc3c4 100644 --- a/src/irmd/ipcp.h +++ b/src/irmd/ipcp.h @@ -52,7 +52,6 @@ int ipcp_flow_alloc(pid_t api, int port_id, pid_t n_api, char * dst_name, - char * src_ae_name, qoscube_t qos); int ipcp_flow_alloc_resp(pid_t api, diff --git a/src/irmd/main.c b/src/irmd/main.c index 9aceb27a..a0115f56 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -976,7 +976,6 @@ static int api_announce(pid_t api, } static struct irm_flow * flow_accept(pid_t api, - char ** dst_ae_name, qoscube_t * cube) { struct irm_flow * f = NULL; @@ -999,8 +998,10 @@ static struct irm_flow * flow_accept(pid_t api, log_err("Unknown instance %d calling accept.", api); return NULL; } + log_dbg("New instance (%d) of %s added.", api, e->apn); log_dbg("This instance accepts flows for:"); + list_for_each(p, &e->names) { struct str_el * s = list_entry(p, struct str_el, next); log_dbg(" %s", s->str); @@ -1064,9 +1065,6 @@ static struct irm_flow * flow_accept(pid_t api, *cube = re->qos; - if (dst_ae_name != NULL) - *dst_ae_name = re->req_ae_name; - log_info("Flow on port_id %d allocated.", f->port_id); pthread_rwlock_unlock(&irmd->flows_lock); @@ -1148,7 +1146,6 @@ static int flow_alloc_resp(pid_t n_api, static struct irm_flow * flow_alloc(pid_t api, char * dst_name, - char * src_ae_name, qoscube_t cube) { struct irm_flow * f; @@ -1197,7 +1194,7 @@ static struct irm_flow * flow_alloc(pid_t api, pthread_rwlock_unlock(&irmd->state_lock); if (ipcp_flow_alloc(ipcp, port_id, api, - dst_name, src_ae_name, cube) < 0) { + dst_name, cube) < 0) { pthread_rwlock_rdlock(&irmd->state_lock); pthread_rwlock_wrlock(&irmd->flows_lock); list_del(&f->next); @@ -1348,7 +1345,6 @@ static pid_t auto_execute(char ** argv) static struct irm_flow * flow_req_arr(pid_t api, char * dst_name, - char * ae_name, qoscube_t cube) { struct reg_entry * re = NULL; @@ -1363,8 +1359,7 @@ static struct irm_flow * flow_req_arr(pid_t api, struct timespec wt = {IRMD_REQ_ARR_TIMEOUT % 1000, (IRMD_REQ_ARR_TIMEOUT % 1000) * MILLION}; - log_dbg("Flow req arrived from IPCP %d for %s on AE %s.", - api, dst_name, ae_name); + log_dbg("Flow req arrived from IPCP %d for %s.", api, dst_name); pthread_rwlock_rdlock(&irmd->state_lock); pthread_rwlock_rdlock(&irmd->reg_lock); @@ -1469,7 +1464,6 @@ static struct irm_flow * flow_req_arr(pid_t api, pthread_rwlock_unlock(&irmd->flows_lock); pthread_rwlock_rdlock(&irmd->reg_lock); - re->req_ae_name = ae_name; re->qos = cube; reg_entry_set_state(re, REG_NAME_FLOW_ARRIVED); @@ -1926,7 +1920,6 @@ void * mainloop(void * o) case IRM_MSG_CODE__IRM_FLOW_ACCEPT: ret_msg.has_qoscube = true; e = flow_accept(msg->api, - &ret_msg.ae_name, (qoscube_t *) &ret_msg.qoscube); if (e == NULL) { ret_msg.has_result = true; @@ -1947,7 +1940,6 @@ void * mainloop(void * o) case IRM_MSG_CODE__IRM_FLOW_ALLOC: e = flow_alloc(msg->api, msg->dst_name, - msg->ae_name, msg->qoscube); if (e == NULL) { ret_msg.has_result = true; @@ -1970,7 +1962,6 @@ void * mainloop(void * o) case IRM_MSG_CODE__IPCP_FLOW_REQ_ARR: e = flow_req_arr(msg->api, msg->dst_name, - msg->ae_name, msg->qoscube); if (e == NULL) { ret_msg.has_result = true; diff --git a/src/irmd/registry.c b/src/irmd/registry.c index 985ecda0..f4579d08 100644 --- a/src/irmd/registry.c +++ b/src/irmd/registry.c @@ -52,7 +52,6 @@ static struct reg_entry * reg_entry_create(void) e->name = NULL; e->state = REG_NAME_NULL; - e->req_ae_name = NULL; e->response = -1; return e; diff --git a/src/irmd/registry.h b/src/irmd/registry.h index 67e4da40..76b32398 100644 --- a/src/irmd/registry.h +++ b/src/irmd/registry.h @@ -62,7 +62,6 @@ struct reg_entry { struct list_head reg_apis; enum reg_name_state state; - char * req_ae_name; qoscube_t qos; int response; pthread_cond_t state_cond; diff --git a/src/lib/dev.c b/src/lib/dev.c index 4d85a5d9..cb8044cf 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -382,8 +382,7 @@ void ap_fini() pthread_rwlock_destroy(&ai.data_lock); } -int flow_accept(char ** ae_name, - qosspec_t * spec) +int flow_accept(qosspec_t * spec) { irm_msg_t msg = IRM_MSG__INIT; irm_msg_t * recv_msg = NULL; @@ -451,18 +450,6 @@ int flow_accept(char ** ae_name, return -1; } - if (ae_name != NULL) { - *ae_name = strdup(recv_msg->ae_name); - if (*ae_name == NULL) { - reset_flow(fd); - bmp_release(ai.fds, fd); - pthread_rwlock_unlock(&ai.flows_lock); - pthread_rwlock_unlock(&ai.data_lock); - irm_msg__free_unpacked(recv_msg, NULL); - return -ENOMEM; - } - } - ai.flows[fd].port_id = recv_msg->port_id; ai.flows[fd].oflags = FLOW_O_DEFAULT; ai.flows[fd].api = recv_msg->api; @@ -531,7 +518,6 @@ int flow_alloc_resp(int fd, } int flow_alloc(const char * dst_name, - const char * src_ae_name, qosspec_t * spec) { irm_msg_t msg = IRM_MSG__INIT; @@ -541,12 +527,8 @@ int flow_alloc(const char * dst_name, if (dst_name == NULL) return -EINVAL; - if (src_ae_name == NULL) - src_ae_name = UNKNOWN_AE; - msg.code = IRM_MSG_CODE__IRM_FLOW_ALLOC; msg.dst_name = (char *) dst_name; - msg.ae_name = (char *) src_ae_name; msg.has_api = true; msg.has_qoscube = true; msg.qoscube = spec_to_cube(spec); @@ -1270,7 +1252,6 @@ int ipcp_create_r(pid_t api, int ipcp_flow_req_arr(pid_t api, char * dst_name, - char * src_ae_name, qoscube_t cube) { irm_msg_t msg = IRM_MSG__INIT; @@ -1278,14 +1259,13 @@ int ipcp_flow_req_arr(pid_t api, int port_id = -1; int fd = -1; - if (dst_name == NULL || src_ae_name == NULL) + if (dst_name == NULL) return -EINVAL; msg.code = IRM_MSG_CODE__IPCP_FLOW_REQ_ARR; msg.has_api = true; msg.api = api; msg.dst_name = dst_name; - msg.ae_name = src_ae_name; msg.has_qoscube = true; msg.qoscube = cube; diff --git a/src/lib/ipcpd_messages.proto b/src/lib/ipcpd_messages.proto index 827bd370..da817944 100644 --- a/src/lib/ipcpd_messages.proto +++ b/src/lib/ipcpd_messages.proto @@ -45,11 +45,10 @@ message ipcp_msg { optional string name = 5; optional sint32 port_id = 6; optional string dst_name = 7; - optional string src_ae_name = 8; - optional sint32 qoscube = 9; - optional dif_config_msg conf = 10; - optional sint32 fd = 11; - optional sint32 api = 12; - optional sint32 response = 13; - optional sint32 result = 14; + optional sint32 qoscube = 8; + optional dif_config_msg conf = 9; + optional sint32 fd = 10; + optional sint32 api = 11; + optional sint32 response = 12; + optional sint32 result = 13; }; diff --git a/src/lib/irmd_messages.proto b/src/lib/irmd_messages.proto index a0965f43..c25d2c18 100644 --- a/src/lib/irmd_messages.proto +++ b/src/lib/irmd_messages.proto @@ -52,17 +52,16 @@ enum irm_msg_code { message irm_msg { required irm_msg_code code = 1; optional string ap_name = 2; - optional string ae_name = 3; - optional sint32 api = 4; - optional uint32 ipcp_type = 5; - repeated string dif_name = 6; - repeated string args = 7; - optional sint32 response = 8; - optional string dst_name = 9; - optional sint32 port_id = 10; - optional sint32 qoscube = 11; - optional dif_config_msg conf = 12; - optional uint32 opts = 13; - repeated sint32 apis = 14; - optional sint32 result = 15; + optional sint32 api = 3; + optional uint32 ipcp_type = 4; + repeated string dif_name = 5; + repeated string args = 6; + optional sint32 response = 7; + optional string dst_name = 8; + optional sint32 port_id = 9; + optional sint32 qoscube = 10; + optional dif_config_msg conf = 11; + optional uint32 opts = 12; + repeated sint32 apis = 13; + optional sint32 result = 14; }; diff --git a/src/tools/cbr/cbr_client.c b/src/tools/cbr/cbr_client.c index 173dab24..48a18cd1 100644 --- a/src/tools/cbr/cbr_client.c +++ b/src/tools/cbr/cbr_client.c @@ -90,7 +90,7 @@ int client_main(char * server, printf("Client started, duration %d, rate %lu b/s, size %d B.\n", duration, rate, size); - fd = flow_alloc(server, NULL, NULL); + fd = flow_alloc(server, NULL); if (fd < 0) { printf("Failed to allocate flow.\n"); return -1; diff --git a/src/tools/cbr/cbr_server.c b/src/tools/cbr/cbr_server.c index 7105ff09..b0be9d7b 100644 --- a/src/tools/cbr/cbr_server.c +++ b/src/tools/cbr/cbr_server.c @@ -164,7 +164,7 @@ static void * listener(void * o) server_settings.interval, server_settings.timeout); while (true) { - client_fd = flow_accept(NULL, &qs); + client_fd = flow_accept(&qs); if (client_fd < 0) { printf("Failed to accept flow.\n"); break; diff --git a/src/tools/echo/echo_client.c b/src/tools/echo/echo_client.c index 783188d5..3036d338 100644 --- a/src/tools/echo/echo_client.c +++ b/src/tools/echo/echo_client.c @@ -30,7 +30,7 @@ int client_main(void) char * message = "Client says hi!"; ssize_t count = 0; - fd = flow_alloc("echo", NULL, NULL); + fd = flow_alloc("echo", NULL); if (fd < 0) { printf("Failed to allocate flow.\n"); return -1; diff --git a/src/tools/echo/echo_server.c b/src/tools/echo/echo_server.c index 8940a0b5..94c54eee 100644 --- a/src/tools/echo/echo_server.c +++ b/src/tools/echo/echo_server.c @@ -50,7 +50,7 @@ int server_main(void) } while (true) { - client_fd = flow_accept(NULL, &qs); + client_fd = flow_accept(&qs); if (client_fd < 0) { printf("Failed to accept flow.\n"); break; diff --git a/src/tools/operf/operf_client.c b/src/tools/operf/operf_client.c index 5b31e27b..0c943cf7 100644 --- a/src/tools/operf/operf_client.c +++ b/src/tools/operf/operf_client.c @@ -182,7 +182,7 @@ int client_main(void) client.sent = 0; client.rcvd = 0; - fd = flow_alloc(client.s_apn, NULL, NULL); + fd = flow_alloc(client.s_apn, NULL); if (fd < 0) { printf("Failed to allocate flow.\n"); return -1; diff --git a/src/tools/operf/operf_server.c b/src/tools/operf/operf_server.c index 3c3b9788..f23b52f3 100644 --- a/src/tools/operf/operf_server.c +++ b/src/tools/operf/operf_server.c @@ -108,7 +108,7 @@ void * accept_thread(void * o) printf("Ouroboros perf server started.\n"); while (true) { - fd = flow_accept(NULL, &qs); + fd = flow_accept(&qs); if (fd < 0) { printf("Failed to accept flow.\n"); break; diff --git a/src/tools/oping/oping_client.c b/src/tools/oping/oping_client.c index 99c11a68..253ea168 100644 --- a/src/tools/oping/oping_client.c +++ b/src/tools/oping/oping_client.c @@ -213,7 +213,7 @@ int client_main(void) return -1; } - fd = flow_alloc(client.s_apn, NULL, NULL); + fd = flow_alloc(client.s_apn, NULL); if (fd < 0) { printf("Failed to allocate flow.\n"); return -1; diff --git a/src/tools/oping/oping_server.c b/src/tools/oping/oping_server.c index 24cd9bf1..e0a6655b 100644 --- a/src/tools/oping/oping_server.c +++ b/src/tools/oping/oping_server.c @@ -119,7 +119,7 @@ void * accept_thread(void * o) printf("Ouroboros ping server started.\n"); while (true) { - fd = flow_accept(NULL, &qs); + fd = flow_accept(&qs); if (fd < 0) { printf("Failed to accept flow.\n"); break; |