diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-11-21 00:38:09 +0100 |
---|---|---|
committer | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-11-21 00:51:06 +0100 |
commit | ae6f3b8e1f55fc4bb7807c293850d3cb46cab1fd (patch) | |
tree | fcc8cc1f42a21e8d6da3051ccfcb161c90cd02c8 /hicn-light | |
parent | 275b80b81746cdf5fc9b8299e7441c9d0d8718de (diff) |
[HICN-379] Add face priority support in face manager
Change-Id: Iae19e016aae833b4bc95ff6d91d51b188f398e25
Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'hicn-light')
-rw-r--r-- | hicn-light/src/hicn/config/configuration.c | 4 | ||||
-rw-r--r-- | hicn-light/src/hicn/config/controlListConnections.c | 6 | ||||
-rw-r--r-- | hicn-light/src/hicn/core/connection.c | 4 | ||||
-rw-r--r-- | hicn-light/src/hicn/utils/commands.h | 4 |
4 files changed, 6 insertions, 12 deletions
diff --git a/hicn-light/src/hicn/config/configuration.c b/hicn-light/src/hicn/config/configuration.c index f135dcc5a..0466189cb 100644 --- a/hicn-light/src/hicn/config/configuration.c +++ b/hicn-light/src/hicn/config/configuration.c @@ -698,7 +698,7 @@ struct iovec *configuration_ProcessConnectionList(Configuration *config, listConnectionsCommand->state = connection_IsUp(original) ? IFACE_UP : IFACE_DOWN; - listConnectionsCommand->admin_state = + listConnectionsCommand->connectionData.admin_state = (connection_GetAdminState(original) == CONNECTION_STATE_UP) ? IFACE_UP : IFACE_DOWN; listConnectionsCommand->connectionData.connectionType = ioOperations_GetConnectionType(connection_GetIoOperations(original)); @@ -706,7 +706,7 @@ struct iovec *configuration_ProcessConnectionList(Configuration *config, listConnectionsCommand->connectionData.admin_state = connection_GetAdminState(original); #ifdef WITH_POLICY - listConnectionsCommand->priority = connection_GetPriority(original); + listConnectionsCommand->connectionData.priority = connection_GetPriority(original); listConnectionsCommand->connectionData.tags = connection_GetTags(original); #endif /* WITH_POLICY */ diff --git a/hicn-light/src/hicn/config/controlListConnections.c b/hicn-light/src/hicn/config/controlListConnections.c index 0613ac4f9..cbed8a79c 100644 --- a/hicn-light/src/hicn/config/controlListConnections.c +++ b/hicn-light/src/hicn/config/controlListConnections.c @@ -109,7 +109,7 @@ static CommandReturn _controlListConnections_Execute(CommandParser *parser, commandOutputMain = parcMemory_Allocate(sizeof(char *) * receivedHeader->length); for (size_t j = 0; j < receivedHeader->length; j++) { - commandOutputMain[j] = parcMemory_Allocate(sizeof(char) * 128); + commandOutputMain[j] = parcMemory_Allocate(sizeof(char) * 256); } } @@ -147,8 +147,8 @@ foreach_policy_tag *s = '\0'; parcBufferComposer_Format( - composer, "%5d %10s %12s %6s %40s %40s %5s [%d] [%s]", listConnectionsCommand->connid, listConnectionsCommand->connectionName, - stateString[listConnectionsCommand->admin_state], + composer, "%5d %10s %12s %6s %40s %40s %5s [%6d] [%s]", listConnectionsCommand->connid, listConnectionsCommand->connectionName, + stateString[listConnectionsCommand->connectionData.admin_state], stateString[listConnectionsCommand->state], sourceString, destinationString, connTypeString[listConnectionsCommand->connectionData.connectionType], diff --git a/hicn-light/src/hicn/core/connection.c b/hicn-light/src/hicn/core/connection.c index 8ec38f75f..c1d143f70 100644 --- a/hicn-light/src/hicn/core/connection.c +++ b/hicn-light/src/hicn/core/connection.c @@ -337,7 +337,7 @@ uint32_t connection_GetPriority(const Connection *conn) { parcAssertNotNull(conn, "Parameter conn must be non-null"); if (!conn->ops) - return CONNECTION_STATE_UNDEFINED; + return 0; return ioOperations_GetPriority(conn->ops); } @@ -346,8 +346,6 @@ void connection_SetPriority(Connection *conn, uint32_t priority) parcAssertNotNull(conn, "Parameter conn must be non-null"); if (!conn->ops) return; - if ((priority != CONNECTION_STATE_UP) && (priority != CONNECTION_STATE_DOWN)) - return; ioOperations_SetPriority(conn->ops, priority); } #endif /* WITH_POLICY */ diff --git a/hicn-light/src/hicn/utils/commands.h b/hicn-light/src/hicn/utils/commands.h index 520559ccf..c250216f0 100644 --- a/hicn-light/src/hicn/utils/commands.h +++ b/hicn-light/src/hicn/utils/commands.h @@ -167,10 +167,6 @@ typedef struct { add_connection_command connectionData; uint32_t connid; uint8_t state; - uint8_t admin_state; -#ifdef WITH_POLICY - uint32_t priority; -#endif /* WITH_POLICY */ char interfaceName[SYMBOLIC_NAME_LEN]; char connectionName[SYMBOLIC_NAME_LEN]; } list_connections_command; |