summaryrefslogtreecommitdiffstats
path: root/hicn-light/src/config/configuration.c
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-02-11 10:44:29 +0100
committerMauro Sardara <msardara@cisco.com>2019-02-18 10:48:38 +0000
commit79e0d4f89c4d532189aae06cc5dfbc14e3269703 (patch)
treeadc83eccb824c019c3c43cc48bcd4de6656eea8d /hicn-light/src/config/configuration.c
parent7d2b217bd01a8da1a2ac57aaad59b3179c7af916 (diff)
[HICN-50] Added udp application connector.
Change-Id: I0c5afad4b404ec485f50b1342b81e70ef85a5163 Signed-off-by: Mauro Sardara <msardara@cisco.com> Signed-off-by: michele papalini <micpapal@cisco.com>
Diffstat (limited to 'hicn-light/src/config/configuration.c')
-rw-r--r--hicn-light/src/config/configuration.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/hicn-light/src/config/configuration.c b/hicn-light/src/config/configuration.c
index 1a41a9642..865dbca4d 100644
--- a/hicn-light/src/config/configuration.c
+++ b/hicn-light/src/config/configuration.c
@@ -115,7 +115,7 @@ struct iovec *configuration_ProcessRegisterHicnPrefix(Configuration *config,
const char *symbolicOrConnid = control->symbolicOrConnid;
- if (strcmp(symbolicOrConnid, "SELF_ROUTE") == 0) {
+ if (strcmp(symbolicOrConnid, "SELF") == 0) {
success = forwarder_AddOrUpdateRoute(config->forwarder, control, ingressId);
} else if (utils_IsNumber(symbolicOrConnid)) {
// case for connid as input
@@ -304,11 +304,14 @@ static void configuration_SendResponse(Configuration *config, struct iovec *msg,
ConnectionTable *connectionTable =
forwarder_GetConnectionTable(config->forwarder);
const Connection *conn = connectionTable_FindById(connectionTable, egressId);
- parcAssertNotNull(conn,
- "Got null connection for control message we just received");
- IoOperations *ops = connection_GetIoOperations(conn);
- streamState_SendCommandResponse(ops, msg);
+ if (conn == NULL) {
+ return;
+ }
+
+ connection_SendCommandResponse(conn, msg);
+ //IoOperations *ops = connection_GetIoOperations(conn);
+ //streamState_SendCommandResponse(ops, msg);
}
struct iovec *configuration_ProcessCreateTunnel(Configuration *config,
@@ -425,7 +428,8 @@ struct iovec *configuration_ProcessCreateTunnel(Configuration *config,
*/
struct iovec *configuration_ProcessRemoveTunnel(Configuration *config,
- struct iovec *request) {
+ struct iovec *request,
+ unsigned ingressId) {
header_control_message *header = request[0].iov_base;
remove_connection_command *control = request[1].iov_base;
@@ -434,7 +438,11 @@ struct iovec *configuration_ProcessRemoveTunnel(Configuration *config,
const char *symbolicOrConnid = control->symbolicOrConnid;
ConnectionTable *table = forwarder_GetConnectionTable(config->forwarder);
- if (utils_IsNumber(symbolicOrConnid)) {
+ if (strcmp(symbolicOrConnid, "SELF") == 0) {
+ forwarder_RemoveConnectionIdFromRoutes(config->forwarder, ingressId);
+ connectionTable_RemoveById(table, ingressId);
+ success = true;
+ } else if (utils_IsNumber(symbolicOrConnid)) {
// case for connid as input
unsigned connid = (unsigned)strtold(symbolicOrConnid, NULL);
@@ -997,7 +1005,7 @@ struct iovec *configuration_DispatchCommand(Configuration *config,
break;
case REMOVE_CONNECTION:
- response = configuration_ProcessRemoveTunnel(config, control);
+ response = configuration_ProcessRemoveTunnel(config, control, ingressId);
break;
case REMOVE_ROUTE: