diff options
author | Jordan Augé <jordan.auge+fdio@cisco.com> | 2020-09-23 17:50:52 +0200 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2021-03-19 14:15:14 +0100 |
commit | a070b0de9f9e9cbca150eea4eda74757ca588bed (patch) | |
tree | 9f2a11fa1afcd51b0b14f4b26bebf4deb8289a2f /lib/src | |
parent | 32dccec98e4c7d7e4ce902e19ba8d1b29b823758 (diff) |
[HICN-645] Control plane (WIP)
Change-Id: I4be6a40b690b62f22f57de6d8c10b01a1be42a6d
Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Signed-off-by: Enrico Loparco (eloparco) <eloparco@cisco.com>
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'lib/src')
-rw-r--r-- | lib/src/policy.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/src/policy.c b/lib/src/policy.c index 694f0ea5e..8f317bc11 100644 --- a/lib/src/policy.c +++ b/lib/src/policy.c @@ -39,6 +39,18 @@ const char * policy_state_str[] = { #undef _ }; +policy_state_t +policy_state_from_str(const char * str) +{ +#define _(x) \ + if (strcasecmp(str, #x) == 0) \ + return POLICY_STATE_ ## x; \ + else + foreach_policy_state +#undef _ + return POLICY_STATE_N; +} + int policy_tag_state_snprintf(char * s, size_t size, const policy_tag_state_t * tag_state) { |