aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/utils/commands.h
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2019-07-26 23:20:30 +0200
committerMauro Sardara <msardara@cisco.com>2019-07-29 17:13:35 +0200
commit0a1c6b5565e20167d1f1f33a5a8b597f420b18b0 (patch)
tree98c5da8f231fbd3dc2ce6502040e29c8333d9ffc /hicn-light/src/hicn/utils/commands.h
parent05ca0aa8f612ee48fb66d4dbebe596b7f1e03181 (diff)
[HICN-252] Add per-application policy framework to hicn-light forwarder
Change-Id: I0531cd7a7de179581295ae34766c81cd9cf3e172 Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com> Signed-off-by: Mauro Sardara <msardara@cisco.com> Co-authored-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'hicn-light/src/hicn/utils/commands.h')
-rw-r--r--hicn-light/src/hicn/utils/commands.h51
1 files changed, 51 insertions, 0 deletions
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 <stdint.h>
#include <stdlib.h>
+#include <hicn/utils/policy.h>
+
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: