summaryrefslogtreecommitdiff
path: root/src/irmd
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-03-31 18:32:28 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-03-31 18:34:50 +0200
commit151adbc851c9b2a218f2be9409199c1baa62bd8d (patch)
tree5d13c9aa547018f70adfa054076fc4af8099b04b /src/irmd
parentb0dfdd839e0704af4f4bf4d4271688af9294e8c9 (diff)
downloadouroboros-151adbc851c9b2a218f2be9409199c1baa62bd8d.tar.gz
ouroboros-151adbc851c9b2a218f2be9409199c1baa62bd8d.zip
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).
Diffstat (limited to 'src/irmd')
-rw-r--r--src/irmd/main.c36
1 files changed, 34 insertions, 2 deletions
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;