diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-11-17 00:07:12 +0100 |
---|---|---|
committer | Jordan Augé <jordan.auge+fdio@cisco.com> | 2019-11-17 11:03:31 +0100 |
commit | 2ada8954ecd3601d115a22696c4c3ab90858cec3 (patch) | |
tree | 6db983388333e8776eecaf9c07c5b7bd6f2f10be /hicn-light/src/hicn/core | |
parent | 2dcc25795fab0100ce33852f08d77a5fd90d8f14 (diff) |
[HICN-379] Add face priority support in face manager
Change-Id: If4f75d44fc66414a4a70135de7827f5082b97112
Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'hicn-light/src/hicn/core')
-rw-r--r-- | hicn-light/src/hicn/core/connection.c | 20 | ||||
-rw-r--r-- | hicn-light/src/hicn/core/connection.h | 7 | ||||
-rw-r--r-- | hicn-light/src/hicn/core/mapme.c | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/hicn-light/src/hicn/core/connection.c b/hicn-light/src/hicn/core/connection.c index 6295d08df..8ec38f75f 100644 --- a/hicn-light/src/hicn/core/connection.c +++ b/hicn-light/src/hicn/core/connection.c @@ -332,6 +332,26 @@ void connection_SetAdminState(Connection *conn, connection_state_t admin_state) ioOperations_SetAdminState(conn->ops, admin_state); } +#ifdef WITH_POLICY +uint32_t connection_GetPriority(const Connection *conn) +{ + parcAssertNotNull(conn, "Parameter conn must be non-null"); + if (!conn->ops) + return CONNECTION_STATE_UNDEFINED; + return ioOperations_GetPriority(conn->ops); +} + +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 */ + const char * connection_GetInterfaceName(const Connection * conn) { parcAssertNotNull(conn, "Parameter conn must be non-null"); diff --git a/hicn-light/src/hicn/core/connection.h b/hicn-light/src/hicn/core/connection.h index b7b5e3c91..3b647dd7a 100644 --- a/hicn-light/src/hicn/core/connection.h +++ b/hicn-light/src/hicn/core/connection.h @@ -36,6 +36,7 @@ typedef enum { CONNECTION_EVENT_UPDATE, CONNECTION_EVENT_SET_UP, CONNECTION_EVENT_SET_DOWN, + CONNECTION_EVENT_PRIORITY_CHANGED, } connection_event_t; #endif /* WITH_MAPME */ @@ -183,6 +184,12 @@ connection_state_t connection_GetAdminState(const Connection *conn); void connection_SetAdminState(Connection *conn, connection_state_t admin_state); +#ifdef WITH_POLICY +uint32_t connection_GetPriority(const Connection *conn); + +void connection_SetPriority(Connection *conn, uint32_t priority); +#endif /* WITH_POLICY */ + const char * connection_GetInterfaceName(const Connection * conn); #ifdef WITH_POLICY diff --git a/hicn-light/src/hicn/core/mapme.c b/hicn-light/src/hicn/core/mapme.c index 94ada3afa..0eba02e49 100644 --- a/hicn-light/src/hicn/core/mapme.c +++ b/hicn-light/src/hicn/core/mapme.c @@ -488,6 +488,7 @@ void mapme_onConnectionEvent(const MapMe *mapme, const Connection *conn_added, c case CONNECTION_EVENT_DELETE: case CONNECTION_EVENT_SET_DOWN: case CONNECTION_EVENT_UPDATE: + case CONNECTION_EVENT_PRIORITY_CHANGED: break; } } |