mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
vswitchd: Log all tunnel parameters of given flow.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
44
lib/flow.c
44
lib/flow.c
@@ -479,6 +479,50 @@ flow_to_string(const struct flow *flow)
|
||||
return ds_cstr(&ds);
|
||||
}
|
||||
|
||||
const char *
|
||||
flow_tun_flag_to_string(uint32_t flags)
|
||||
{
|
||||
switch (flags) {
|
||||
case FLOW_TNL_F_DONT_FRAGMENT:
|
||||
return "df";
|
||||
case FLOW_TNL_F_CSUM:
|
||||
return "csum";
|
||||
case FLOW_TNL_F_KEY:
|
||||
return "key";
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
format_flags(struct ds *ds, const char *(*bit_to_string)(uint32_t),
|
||||
uint32_t flags, char del)
|
||||
{
|
||||
uint32_t bad = 0;
|
||||
|
||||
if (!flags) {
|
||||
return;
|
||||
}
|
||||
while (flags) {
|
||||
uint32_t bit = rightmost_1bit(flags);
|
||||
const char *s;
|
||||
|
||||
s = bit_to_string(bit);
|
||||
if (s) {
|
||||
ds_put_format(ds, "%s%c", s, del);
|
||||
} else {
|
||||
bad |= bit;
|
||||
}
|
||||
|
||||
flags &= ~bit;
|
||||
}
|
||||
|
||||
if (bad) {
|
||||
ds_put_format(ds, "0x%"PRIx32"%c", bad, del);
|
||||
}
|
||||
ds_chomp(ds, del);
|
||||
}
|
||||
|
||||
void
|
||||
flow_format(struct ds *ds, const struct flow *flow)
|
||||
{
|
||||
|
Reference in New Issue
Block a user