From 151adbc851c9b2a218f2be9409199c1baa62bd8d Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 31 Mar 2016 18:32:28 +0200 Subject: lib: Implementation of flow related ops This adds the messages that are sent to the IPCPs related to flows. Some messages are also sent to the IRMd (e.g. when a new flow arrives). --- src/irmd/main.c | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'src/irmd/main.c') diff --git a/src/irmd/main.c b/src/irmd/main.c index af0f85e2..0256248b 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -165,8 +165,7 @@ static int enroll_ipcp(instance_name_t * api, n_1_difs_size = da_resolve_dap(member, n_1_difs); if (n_1_difs_size != 0) - if (ipcp_enroll(pid, dif_name, member, - n_1_difs, n_1_difs_size)) { + if (ipcp_enroll(pid, member, n_1_difs[0])) { LOG_ERR("Could not enroll IPCP"); return -1; } @@ -268,6 +267,24 @@ static int flow_cntl(int fd, return -1; } +static int flow_req_arr(uint32_t reg_api_id, + char * ap_name, + char * ae_name) +{ + return -1; +} + +static int flow_alloc_reply(uint32_t port_id, + int result) +{ + return -1; +} + +static int flow_dealloc_ipcp(uint32_t port_id) +{ + return -1; +} + /* FIXME: Close sockfd on closing and release irm */ int main() { @@ -391,6 +408,21 @@ int main() ret_msg.result = flow_cntl(msg->fd, msg->oflags); break; + case IRM_MSG_CODE__IPCP_FLOW_REQ_ARR: + ret_msg.has_fd = true; + ret_msg.fd = flow_req_arr(msg->port_id, + msg->ap_name, + msg->ae_name); + break; + case IRM_MSG_CODE__IPCP_FLOW_ALLOC_REPLY: + ret_msg.has_result = true; + ret_msg.result = flow_alloc_reply(msg->port_id, + msg->result); + break; + case IRM_MSG_CODE__IPCP_FLOW_DEALLOC: + ret_msg.has_result = true; + ret_msg.result = flow_dealloc_ipcp(msg->port_id); + break; default: LOG_ERR("Don't know that message code"); break; -- cgit v1.2.3