mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
flow: New function ct_state_from_string().
This will have its first user in an upcoming commit. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Miguel Angel Ajo <majopela@redhat.com>
This commit is contained in:
15
lib/flow.c
15
lib/flow.c
@@ -1000,7 +1000,8 @@ flow_get_metadata(const struct flow *flow, struct match *flow_metadata)
|
||||
}
|
||||
}
|
||||
|
||||
const char *ct_state_to_string(uint32_t state)
|
||||
const char *
|
||||
ct_state_to_string(uint32_t state)
|
||||
{
|
||||
switch (state) {
|
||||
#define CS_STATE(ENUM, INDEX, NAME) case CS_##ENUM: return NAME;
|
||||
@@ -1011,6 +1012,18 @@ const char *ct_state_to_string(uint32_t state)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t
|
||||
ct_state_from_string(const char *s)
|
||||
{
|
||||
#define CS_STATE(ENUM, INDEX, NAME) \
|
||||
if (!strcmp(s, NAME)) { \
|
||||
return CS_##ENUM; \
|
||||
}
|
||||
CS_STATES
|
||||
#undef CS_STATE
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
flow_to_string(const struct flow *flow)
|
||||
{
|
||||
|
Reference in New Issue
Block a user