aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2021-01-08 09:31:56 +0100
committerAngelo Mantellini <angelo.mantellini@cisco.com>2021-01-08 09:31:56 +0100
commit2f46913d96f0a2b4107384c949d07f471f59df3e (patch)
tree331b33a4d84a4d4b23da617c5bec19201b9fc4e2
parent82372f5a24039e4fa964e8d247d836c867d4761a (diff)
[HICN-669] policy_t yet used in mac os 11
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com> Change-Id: I8d5d5c37eaab3f84a920f1753591fa4ab09f4799
-rw-r--r--ctrl/libhicnctrl/includes/hicn/ctrl/api.h2
-rw-r--r--ctrl/libhicnctrl/includes/hicn/ctrl/commands.h4
-rw-r--r--hicn-light/src/hicn/config/controlAddPolicy.c2
-rw-r--r--hicn-light/src/hicn/processor/fibEntry.c10
-rw-r--r--hicn-light/src/hicn/processor/fibEntry.h4
-rw-r--r--hicn-light/src/hicn/utils/commands.h4
-rw-r--r--lib/includes/hicn/policy.h6
7 files changed, 16 insertions, 16 deletions
diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h
index bdb0c0a..f92b39f 100644
--- a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h
+++ b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h
@@ -711,7 +711,7 @@ typedef struct {
int family; /* Krw */
ip_address_t remote_addr; /* krw */
u8 len; /* krw */
- policy_t policy; /* .rw */
+ hicn_policy_t policy; /* .rw */
} hc_policy_t;
int hc_policy_parse(void *in, hc_policy_t *policy);
diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/commands.h b/ctrl/libhicnctrl/includes/hicn/ctrl/commands.h
index d8e5329..3758f0f 100644
--- a/ctrl/libhicnctrl/includes/hicn/ctrl/commands.h
+++ b/ctrl/libhicnctrl/includes/hicn/ctrl/commands.h
@@ -329,14 +329,14 @@ typedef struct {
ip_address_t address;
uint8_t addressType;
uint8_t len;
- policy_t policy;
+ hicn_policy_t policy;
} add_policy_command;
typedef struct {
ip_address_t address;
uint8_t addressType;
uint8_t len;
- policy_t policy;
+ hicn_policy_t policy;
} list_policies_command;
typedef struct {
diff --git a/hicn-light/src/hicn/config/controlAddPolicy.c b/hicn-light/src/hicn/config/controlAddPolicy.c
index 8618c62..66439d2 100644
--- a/hicn-light/src/hicn/config/controlAddPolicy.c
+++ b/hicn-light/src/hicn/config/controlAddPolicy.c
@@ -139,7 +139,7 @@ static CommandReturn _controlAddPolicy_Execute(CommandParser *parser,
addPolicyCommand->len = len;
- policy_t policy;
+ hicn_policy_t policy;
snprintf((char*)policy.app_name, APP_NAME_LEN, "%s", (char*)parcList_GetAtIndex(args, 3));
for (int i=4; i < 11; i++) {
const char *tag = parcList_GetAtIndex(args, i);
diff --git a/hicn-light/src/hicn/processor/fibEntry.c b/hicn-light/src/hicn/processor/fibEntry.c
index 077e33f..7412b4c 100644
--- a/hicn-light/src/hicn/processor/fibEntry.c
+++ b/hicn-light/src/hicn/processor/fibEntry.c
@@ -55,7 +55,7 @@ struct fib_entry {
#ifdef WITH_POLICY
NumberSet *nexthops;
const Forwarder * forwarder;
- policy_t policy;
+ hicn_policy_t policy;
policy_counters_t policy_counters;
// NumberSet *available_nexthops;
#ifdef WITH_MAPME
@@ -198,7 +198,7 @@ fibEntry_GetAvailableNextHops(const FibEntry *fibEntry, unsigned in_connection)
ConnectionTable * table = forwarder_GetConnectionTable(fibEntry->forwarder);
NumberSet * nexthops;
bool dealloc_nexthops = false;
- policy_t policy = fibEntry_GetPolicy(fibEntry);
+ hicn_policy_t policy = fibEntry_GetPolicy(fibEntry);
/* Reset available next hops and start filtering */
NumberSet * available_nexthops = numberSet_Create();
@@ -465,11 +465,11 @@ fibEntry_GetAvailableNextHops(const FibEntry *fibEntry, unsigned in_connection)
return priority_nexthops;
}
-policy_t fibEntry_GetPolicy(const FibEntry *fibEntry) {
+hicn_policy_t fibEntry_GetPolicy(const FibEntry *fibEntry) {
return fibEntry->policy;
}
-void fibEntry_SetPolicy(FibEntry *fibEntry, policy_t policy) {
+void fibEntry_SetPolicy(FibEntry *fibEntry, hicn_policy_t policy) {
fibEntry->policy = policy;
mapme_reconsiderFibEntry(forwarder_getMapmeInstance(fibEntry->forwarder), fibEntry);
}
@@ -541,7 +541,7 @@ const NumberSet *fibEntry_GetNexthopsFromForwardingStrategy(
ConnectionTable * table = forwarder_GetConnectionTable(fibEntry->forwarder);
unsigned in_connection = message_GetIngressConnectionId(interestMessage);
- policy_t policy = fibEntry_GetPolicy(fibEntry);
+ hicn_policy_t policy = fibEntry_GetPolicy(fibEntry);
NumberSet * out;
diff --git a/hicn-light/src/hicn/processor/fibEntry.h b/hicn-light/src/hicn/processor/fibEntry.h
index 9e438b0..3934194 100644
--- a/hicn-light/src/hicn/processor/fibEntry.h
+++ b/hicn-light/src/hicn/processor/fibEntry.h
@@ -117,9 +117,9 @@ void fibEntry_ReceiveObjectMessage(const FibEntry *fibEntry,
Ticks objReception);
#ifdef WITH_POLICY
-policy_t fibEntry_GetPolicy(const FibEntry *fibEntry);
+hicn_policy_t fibEntry_GetPolicy(const FibEntry *fibEntry);
void fibEntry_ReconsiderPolicy(FibEntry *fibEntry);
-void fibEntry_SetPolicy(FibEntry *fibEntry, policy_t policy);
+void fibEntry_SetPolicy(FibEntry *fibEntry, hicn_policy_t policy);
void fibEntry_UpdateStats(FibEntry *fibEntry, uint64_t now);
NumberSet * fibEntry_GetAvailableNextHops(const FibEntry *fibEntry, unsigned in_connection);
NumberSet * fibEntry_GetPreviousNextHops(const FibEntry *fibEntry);
diff --git a/hicn-light/src/hicn/utils/commands.h b/hicn-light/src/hicn/utils/commands.h
index d8e5329..3758f0f 100644
--- a/hicn-light/src/hicn/utils/commands.h
+++ b/hicn-light/src/hicn/utils/commands.h
@@ -329,14 +329,14 @@ typedef struct {
ip_address_t address;
uint8_t addressType;
uint8_t len;
- policy_t policy;
+ hicn_policy_t policy;
} add_policy_command;
typedef struct {
ip_address_t address;
uint8_t addressType;
uint8_t len;
- policy_t policy;
+ hicn_policy_t policy;
} list_policies_command;
typedef struct {
diff --git a/lib/includes/hicn/policy.h b/lib/includes/hicn/policy.h
index 51bab42..3de34ee 100644
--- a/lib/includes/hicn/policy.h
+++ b/lib/includes/hicn/policy.h
@@ -217,9 +217,9 @@ typedef struct {
char app_name[APP_NAME_LEN];
policy_tag_state_t tags[POLICY_TAG_N];
policy_stats_t stats;
-} policy_t;
+} hicn_policy_t;
-static const policy_t POLICY_NONE = {
+static const hicn_policy_t POLICY_NONE = {
.app_name = { 0 },
.tags = {
#define _(x, y) [POLICY_TAG_ ## x] = { POLICY_STATE_NEUTRAL, 0 },
@@ -240,7 +240,7 @@ typedef struct {
char ipv4_prefix[INET_ADDRSTRLEN + PFX_STRLEN];
char ipv6_prefix[INET6_ADDRSTRLEN + PFX_STRLEN];
};
- policy_t policy;
+ hicn_policy_t policy;
} policy_description_t;
#endif /* HICN_POLICY_H */