Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Stephen Hemminger
Sat, 10 Oct 2026 16:27
Re: [PATCH iproute2-next 2/2] bridge: add cfm command
Author: Stephen Hemminger
Date: Sat, 10 Oct 2026 16:27
Date: Sat, 10 Oct 2026 16:27
50 lines
9538 bytes
9538 bytes
On Sun, 4 Oct 2026 04:13:07 +0000
Abdul Wasey <w453y.me@gmail.com> wrote:
> +static int cfm_parse_interval(const char *str)
> +{
> + if (!strcmp(str, "none"))
> + return BR_CFM_CCM_INTERVAL_NONE;
> + if (!strcmp(str, "3ms3") || !strcmp(str, "3.3ms"))
> + return BR_CFM_CCM_INTERVAL_3_3_MS;
> + if (!strcmp(str, "10ms"))
> + return BR_CFM_CCM_INTERVAL_10_MS;
> + if (!strcmp(str, "100ms"))
> + return BR_CFM_CCM_INTERVAL_100_MS;
> + if (!strcmp(str, "1s"))
> + return BR_CFM_CCM_INTERVAL_1_SEC;
> + if (!strcmp(str, "10s"))
> + return BR_CFM_CCM_INTERVAL_10_SEC;
> + if (!strcmp(str, "1m"))
> + return BR_CFM_CCM_INTERVAL_1_MIN;
> + if (!strcmp(str, "10m"))
> + return BR_CFM_CCM_INTERVAL_10_MIN;
> + return -1;
> +}
> +
> +static const char *cfm_interval_str(__u32 interval)
> +{
> + switch (interval) {
> + case BR_CFM_CCM_INTERVAL_NONE:
> + return "none";
> + case BR_CFM_CCM_INTERVAL_3_3_MS:
> + return "3ms3";
> + case BR_CFM_CCM_INTERVAL_10_MS:
> + return "10ms";
> + case BR_CFM_CCM_INTERVAL_100_MS:
> + return "100ms";
> + case BR_CFM_CCM_INTERVAL_1_SEC:
> + return "1s";
> + case BR_CFM_CCM_INTERVAL_10_SEC:
> + return "10s";
> + case BR_CFM_CCM_INTERVAL_1_MIN:
> + return "1m";
> + case BR_CFM_CCM_INTERVAL_10_MIN:
> + return "10m";
> + default:
> + return "unknown";
> + }
> +}
Iproute2 already has helpers get_time and print_time.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads