diff options
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; } } |