On Wed, 9 Aug 2017 15:17:00 +0200
David Lebrun <david.leb...@uclouvain.be> wrote:

> +
> +static int read_action_type(const char *name)
> +{
> +     if (strcmp(name, "End") == 0)
> +             return SEG6_LOCAL_ACTION_END;
> +     else if (strcmp(name, "End.X") == 0)
> +             return SEG6_LOCAL_ACTION_END_X;
> +     else if (strcmp(name, "End.T") == 0)
> +             return SEG6_LOCAL_ACTION_END_T;
> +     else if (strcmp(name, "End.DX2") == 0)
> +             return SEG6_LOCAL_ACTION_END_DX2;
> +     else if (strcmp(name, "End.DX6") == 0)
> +             return SEG6_LOCAL_ACTION_END_DX6;
> +     else if (strcmp(name, "End.DX4") == 0)
> +             return SEG6_LOCAL_ACTION_END_DX4;
> +     else if (strcmp(name, "End.DT6") == 0)
> +             return SEG6_LOCAL_ACTION_END_DT6;
> +     else if (strcmp(name, "End.DT4") == 0)
> +             return SEG6_LOCAL_ACTION_END_DT4;
> +     else if (strcmp(name, "End.B6") == 0)
> +             return SEG6_LOCAL_ACTION_END_B6;
> +     else if (strcmp(name, "End.B6.Encaps") == 0)
> +             return SEG6_LOCAL_ACTION_END_B6_ENCAP;
> +     else if (strcmp(name, "End.BM") == 0)
> +             return SEG6_LOCAL_ACTION_END_BM;
> +     else if (strcmp(name, "End.S") == 0)
> +             return SEG6_LOCAL_ACTION_END_S;
> +     else if (strcmp(name, "End.AS") == 0)
> +             return SEG6_LOCAL_ACTION_END_AS;
> +     else if (strcmp(name, "End.AM") == 0)
> +             return SEG6_LOCAL_ACTION_END_AM;
> +
> +     return SEG6_LOCAL_ACTION_UNSPEC;
> +}

Why is this not a table instead of code?

Reply via email to