summaryrefslogtreecommitdiffstats
path: root/ctrl/facemgr/includes
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2019-11-27 09:05:39 +0100
committerJordan Augé <jordan.auge+fdio@cisco.com>2019-12-05 00:32:28 +0100
commit94350c13fe983a7cfb99dafecb0d029ed58361bf (patch)
treeed82fbed47a3ec2b9855e93402b3f75f3f403b57 /ctrl/facemgr/includes
parentdafa145fb5a4a10c1e600ee72fe639ac4f7e718d (diff)
[HICN-420] MAP-Me code refactoring & face manager changes in support of mobility
Change-Id: Ifde50b4c161d1bda1326f18b705f575e539aea71 Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'ctrl/facemgr/includes')
-rw-r--r--ctrl/facemgr/includes/hicn/facemgr/facelet.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/ctrl/facemgr/includes/hicn/facemgr/facelet.h b/ctrl/facemgr/includes/hicn/facemgr/facelet.h
index a0318b206..355af551d 100644
--- a/ctrl/facemgr/includes/hicn/facemgr/facelet.h
+++ b/ctrl/facemgr/includes/hicn/facemgr/facelet.h
@@ -71,6 +71,13 @@ typedef struct {
face_type_encap_t encap;
} facemgr_face_type_t;
+
+extern const char * face_type_layer_str[];
+extern const char * face_type_encap_str[];
+
+#define FACEMGR_FACE_TYPE_STR(x) \
+ face_type_layer_str[x.layer], face_type_encap_str[x.encap]
+
#define FACEMGR_FACE_TYPE_UNDEFINED (facemgr_face_type_t) { \
.layer = FACE_TYPE_LAYER_UNDEFINED, \
.encap = FACE_TYPE_ENCAP_UNDEFINED, \
@@ -96,10 +103,10 @@ typedef struct {
.encap = FACE_TYPE_ENCAP_TCP, \
}
-
/* Facelet status */
#define foreach_facelet_status \
_(UNDEFINED) \
+ _(DOWN) \
_(UNCERTAIN) \
_(INCOMPLETE) \
_(CREATE) \
@@ -194,6 +201,8 @@ extern const char * facelet_attr_status_str_short[];
_(CREATE) \
_(UPDATE) \
_(DELETE) \
+ _(SET_UP) \
+ _(SET_DOWN) \
_(N)
#define MAXSZ_EVENT__ 10
@@ -246,6 +255,8 @@ bool facelet_has_key(const facelet_t * facelet);
#define FACELET_ACCESSORS_H(TYPE, NAME) \
bool facelet_has_ ## NAME(const facelet_t * facelet); \
facelet_attr_status_t facelet_get_ ## NAME ## _status(const facelet_t * facelet);\
+void facelet_set_ ## NAME ## _status(facelet_t * facelet, \
+ facelet_attr_status_t status); \
int facelet_get_ ## NAME(const facelet_t * facelet, TYPE * NAME); \
int facelet_set_ ## NAME(facelet_t * facelet, TYPE NAME); \
int facelet_unset_ ## NAME(facelet_t * facelet);
@@ -256,7 +267,7 @@ foreach_facelet_attr
int facelet_get_face(const facelet_t * facelet, face_t ** pface);
-int facelet_merge(facelet_t * facelet, const facelet_t * facelet_to_merge);
+int facelet_merge(facelet_t * facelet, facelet_t * facelet_to_merge);
facelet_status_t facelet_get_status(const facelet_t * facelet);
void facelet_set_status(facelet_t * facelet, facelet_status_t status);