From 0a1c6b5565e20167d1f1f33a5a8b597f420b18b0 Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Fri, 26 Jul 2019 23:20:30 +0200 Subject: [HICN-252] Add per-application policy framework to hicn-light forwarder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0531cd7a7de179581295ae34766c81cd9cf3e172 Signed-off-by: Jordan Augé Signed-off-by: Mauro Sardara Co-authored-by: Mauro Sardara --- hicn-light/src/hicn/utils/commands.h | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'hicn-light/src/hicn/utils/commands.h') diff --git a/hicn-light/src/hicn/utils/commands.h b/hicn-light/src/hicn/utils/commands.h index 96415d8da..223bbffaa 100644 --- a/hicn-light/src/hicn/utils/commands.h +++ b/hicn-light/src/hicn/utils/commands.h @@ -31,6 +31,8 @@ #include #include +#include + typedef struct in6_addr ipv6_addr_t; typedef uint32_t ipv4_addr_t; @@ -67,6 +69,12 @@ typedef enum { MAPME_TIMESCALE, MAPME_RETX, CONNECTION_SET_ADMIN_STATE, +#ifdef WITH_POLICY + ADD_POLICY, + LIST_POLICIES, + REMOVE_POLICY, + UPDATE_CONNECTION, +#endif /* WITH_POLICY */ LAST_COMMAND_VALUE } command_id; @@ -129,6 +137,9 @@ typedef struct { uint8_t ipType; uint8_t connectionType; uint8_t admin_state; +#ifdef WITH_POLICY + policy_tags_t tags; +#endif /* WITH_POLICY */ } add_connection_command; // SIZE=56 @@ -291,6 +302,36 @@ typedef struct { uint8_t admin_state; } connection_set_admin_state_command; +#ifdef WITH_POLICY + +typedef struct { + union commandAddr address; + uint8_t addressType; + uint8_t len; + policy_t policy; +} add_policy_command; + +typedef struct { + union commandAddr address; + uint8_t addressType; + uint8_t len; + policy_t policy; +} list_policies_command; + +typedef struct { + union commandAddr address; + uint8_t addressType; + uint8_t len; +} remove_policy_command; + +typedef struct { + char symbolicOrConnid[16]; + uint8_t admin_state; + policy_tags_t tags; +} update_connection_command; + +#endif /* WITH_POLICY */ + //===== size of commands ====== // REMINDER: when a new_command is added, the following switch has to be // updated. @@ -334,6 +375,16 @@ static inline int payloadLengthDaemon(command_id id) { return sizeof(mapme_timing_command); case CONNECTION_SET_ADMIN_STATE: return sizeof(connection_set_admin_state_command); +#ifdef WITH_POLICY + case ADD_POLICY: + return sizeof(add_policy_command); + case LIST_POLICIES: + return 0; // list policies: payload always 0 + case REMOVE_POLICY: + return sizeof(remove_policy_command); + case UPDATE_CONNECTION: + return sizeof(update_connection_command); +#endif /* WITH_POLICY */ case LAST_COMMAND_VALUE: return 0; default: -- cgit 1.2.3-korg