summaryrefslogtreecommitdiff
path: root/src/irmd/main.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-03-01 15:43:41 +0100
committerSander Vrijders <[email protected]>2016-03-01 15:43:41 +0100
commit52a5113760802e16b07d9d954237871d52cff70a (patch)
tree07b806048cc9a792b5127bd5decb81b7ca907197 /src/irmd/main.c
parente5bfc52e93654a8be7893cf5573c9c04e9c96c55 (diff)
parent45ad14035a06e4947b1cc1d908bb665646c1f2a0 (diff)
downloadouroboros-52a5113760802e16b07d9d954237871d52cff70a.tar.gz
ouroboros-52a5113760802e16b07d9d954237871d52cff70a.zip
Merged in sandervrijders/ouroboros/be (pull request #17)
lib, irmd, tools: Provide more IRM messages
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r--src/irmd/main.c62
1 files changed, 55 insertions, 7 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 137b2b61..73533ef0 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -31,9 +31,6 @@
#include <stdlib.h>
#include <errno.h>
-#define BUF_SIZE 256
-
-
static void create_ipcp(rina_name_t * name,
char * ipcp_type)
{
@@ -47,6 +44,37 @@ static void create_ipcp(rina_name_t * name,
LOG_MISSING;
}
+static void destroy_ipcp(rina_name_t * name)
+{
+ LOG_MISSING;
+}
+
+static void bootstrap_ipcp(rina_name_t * name,
+ struct dif_info * info)
+{
+ LOG_MISSING;
+}
+
+static void enroll_ipcp(rina_name_t * name,
+ char * dif_name)
+{
+ LOG_MISSING;
+}
+
+static void reg_ipcp(rina_name_t * name,
+ char ** difs,
+ size_t difs_size)
+{
+ LOG_MISSING;
+}
+
+static void unreg_ipcp(rina_name_t * name,
+ char ** difs,
+ size_t difs_size)
+{
+ LOG_MISSING;
+}
+
int main()
{
int sockfd;
@@ -56,7 +84,7 @@ int main()
if (sockfd < 0)
return -1;
- buf = malloc(sizeof(*buf) * BUF_SIZE);
+ buf = malloc(sizeof(*buf) * IRM_MSG_BUF_SIZE);
if (buf == NULL) {
LOG_ERR("Cannot allocate memory");
return -ENOMEM;
@@ -74,7 +102,7 @@ int main()
continue;
}
- count = read(cli_sockfd, buf, BUF_SIZE);
+ count = read(cli_sockfd, buf, IRM_MSG_BUF_SIZE);
if (count) {
buffer.size = count;
buffer.data = buf;
@@ -85,8 +113,28 @@ int main()
LOG_DBG("Got message code %d", msg->code);
switch (msg->code) {
case IRM_CREATE_IPCP:
- create_ipcp(msg->msgs.create_ipcp.name,
- msg->msgs.create_ipcp.ipcp_type);
+ create_ipcp(msg->name, msg->ipcp_type);
+ break;
+ case IRM_DESTROY_IPCP:
+ destroy_ipcp(msg->name);
+ break;
+ case IRM_BOOTSTRAP_IPCP:
+ bootstrap_ipcp(msg->name,
+ msg->info);
+ break;
+ case IRM_ENROLL_IPCP:
+ enroll_ipcp(msg->name,
+ msg->dif_name);
+ break;
+ case IRM_REG_IPCP:
+ reg_ipcp(msg->name,
+ msg->difs,
+ msg->difs_size);
+ break;
+ case IRM_UNREG_IPCP:
+ unreg_ipcp(msg->name,
+ msg->difs,
+ msg->difs_size);
break;
default:
LOG_ERR("Don't know that message code");