diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-04-22 17:39:30 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-04-22 17:39:30 +0200 |
commit | f4f67651db3891652f4dd08dec990aa0560bb35c (patch) | |
tree | 38d9d3f171389a85fc9b6ab7dcb640029ac0d743 /src/lib/ipcp.c | |
parent | cd428b2b63230fce191ff3a90d5f6928aa50df46 (diff) | |
download | ouroboros-f4f67651db3891652f4dd08dec990aa0560bb35c.tar.gz ouroboros-f4f67651db3891652f4dd08dec990aa0560bb35c.zip |
irmd: reg/unreg whatevercast names
Unregistering ap's now works. An AP now registers/unregisters its AP-I
by sending its AP name and its pid to the IRMd. The IPCPs register
whatevercast names. An AP name is currently mapped on a whatevercast
name represented by the same string literal. The IRMd allows
registration of only one AP-I per AP. A Name Space Management system
is needed in the processing system so we can resolve this completely.
Changing the stack to register whatevercast names required some changes
all over the ipcpd implemented and in the library.
Diffstat (limited to 'src/lib/ipcp.c')
-rw-r--r-- | src/lib/ipcp.c | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/src/lib/ipcp.c b/src/lib/ipcp.c index 338d8683..b93f5488 100644 --- a/src/lib/ipcp.c +++ b/src/lib/ipcp.c @@ -326,21 +326,18 @@ int ipcp_enroll(pid_t pid, return ret; } -int ipcp_ap_reg(pid_t pid, - uint32_t reg_ap_id, - char * ap_name) +int ipcp_name_reg(pid_t pid, + char * name) { ipcp_msg_t msg = IPCP_MSG__INIT; ipcp_msg_t * recv_msg = NULL; int ret = -1; - if (ap_name == NULL) + if (name == NULL) return -1; - msg.code = IPCP_MSG_CODE__IPCP_AP_REG; - msg.ap_name = ap_name; - msg.has_reg_ap_id = true; - msg.reg_ap_id = reg_ap_id; + msg.code = IPCP_MSG_CODE__IPCP_NAME_REG; + msg.name = name; recv_msg = send_recv_ipcp_msg(pid, &msg); if (recv_msg == NULL) @@ -357,16 +354,15 @@ int ipcp_ap_reg(pid_t pid, return ret; } -int ipcp_ap_unreg(pid_t pid, - uint32_t reg_ap_id) +int ipcp_name_unreg(pid_t pid, + char * name) { ipcp_msg_t msg = IPCP_MSG__INIT; ipcp_msg_t * recv_msg = NULL; int ret = -1; - msg.code = IPCP_MSG_CODE__IPCP_AP_UNREG; - msg.has_reg_ap_id = true; - msg.reg_ap_id = reg_ap_id; + msg.code = IPCP_MSG_CODE__IPCP_NAME_UNREG; + msg.name = name; recv_msg = send_recv_ipcp_msg(pid, &msg); if (recv_msg == NULL) @@ -385,7 +381,7 @@ int ipcp_ap_unreg(pid_t pid, int ipcp_flow_alloc(pid_t pid, uint32_t port_id, - char * dst_ap_name, + char * dst_name, char * src_ap_name, char * src_ae_name, struct qos_spec * qos) @@ -394,13 +390,13 @@ int ipcp_flow_alloc(pid_t pid, ipcp_msg_t * recv_msg = NULL; int ret = -1; - if (dst_ap_name == NULL || src_ap_name == NULL || src_ae_name == NULL) + if (dst_name == NULL || src_ap_name == NULL || src_ae_name == NULL) return -EINVAL; msg.code = IPCP_MSG_CODE__IPCP_FLOW_ALLOC; - msg.ap_name = src_ap_name; - msg.ae_name = src_ae_name; - msg.dst_ap_name = dst_ap_name; + msg.src_ap_name = src_ap_name; + msg.src_ae_name = src_ae_name; + msg.dst_name = dst_name; msg.port_id = port_id; msg.has_port_id = true; @@ -449,22 +445,21 @@ int ipcp_flow_alloc_resp(pid_t pid, } int ipcp_flow_req_arr(pid_t pid, - uint32_t reg_ap_id, - char * ap_name, - char * ae_name) + char * dst_name, + char * src_ap_name, + char * src_ae_name) { irm_msg_t msg = IRM_MSG__INIT; irm_msg_t * recv_msg = NULL; int fd = -1; - if (ap_name == NULL || ae_name == NULL) + if (src_ap_name == NULL || src_ae_name == NULL) return -EINVAL; msg.code = IRM_MSG_CODE__IPCP_FLOW_REQ_ARR; - msg.ap_name = ap_name; - msg.ae_name = ae_name; - msg.reg_ap_id = reg_ap_id; - msg.has_reg_ap_id = true; + msg.dst_name = dst_name; + msg.ap_name = src_ap_name; + msg.ae_name = src_ae_name; msg.pid = pid; msg.has_pid = true; @@ -485,17 +480,17 @@ int ipcp_flow_req_arr(pid_t pid, int ipcp_flow_alloc_reply(pid_t pid, uint32_t port_id, - int result) + int response) { irm_msg_t msg = IRM_MSG__INIT; irm_msg_t * recv_msg = NULL; int ret = -1; - msg.code = IRM_MSG_CODE__IPCP_FLOW_ALLOC_REPLY; - msg.port_id = port_id; - msg.has_port_id = true; - msg.result = result; - msg.has_result = true; + msg.code = IRM_MSG_CODE__IPCP_FLOW_ALLOC_REPLY; + msg.port_id = port_id; + msg.has_port_id = true; + msg.response = response; + msg.has_response = true; recv_msg = send_recv_irm_msg(&msg); if (recv_msg == NULL) @@ -521,9 +516,9 @@ int ipcp_flow_dealloc(pid_t pid, ipcp_msg_t * recv_msg = NULL; int ret = -1; - msg.code = IPCP_MSG_CODE__IPCP_FLOW_DEALLOC; + msg.code = IPCP_MSG_CODE__IPCP_FLOW_DEALLOC; msg.has_port_id = true; - msg.port_id = port_id; + msg.port_id = port_id; recv_msg = send_recv_ipcp_msg(pid, &msg); if (recv_msg == NULL) @@ -543,9 +538,9 @@ int ipcp_flow_dealloc(pid_t pid, irm_msg_t * recv_msg = NULL; int ret = -1; - msg.code = IRM_MSG_CODE__IPCP_FLOW_DEALLOC; + msg.code = IRM_MSG_CODE__IPCP_FLOW_DEALLOC; msg.has_port_id = true; - msg.port_id = port_id; + msg.port_id = port_id; recv_msg = send_recv_irm_msg(&msg); if (recv_msg == NULL) |