From: Stephen Hemminger <stephen@networkplumber.org>
To: David Lebrun <david.lebrun@uclouvain.be>
Cc: <netdev@vger.kernel.org>
Subject: Re: [PATCH iproute2 net-next 2/3] iproute: add support for SRv6 local segment processing
Date: Wed, 9 Aug 2017 07:43:16 -0700 [thread overview]
Message-ID: <20170809074316.3acaafa1@xeon-e3> (raw)
In-Reply-To: <20170809131701.21304-3-david.lebrun@uclouvain.be>
On Wed, 9 Aug 2017 15:17:00 +0200
David Lebrun <david.lebrun@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?
next prev parent reply other threads:[~2017-08-09 14:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 13:16 [PATCH iproute2 net-next 0/3] Add support for SRv6 local segment processing David Lebrun
2017-08-09 13:16 ` [PATCH iproute2 net-next 1/3] iproute: add helper functions for SRH processing David Lebrun
2017-08-09 13:17 ` [PATCH iproute2 net-next 2/3] iproute: add support for SRv6 local segment processing David Lebrun
2017-08-09 14:43 ` Stephen Hemminger [this message]
2017-08-09 14:53 ` David Lebrun
2017-08-09 13:17 ` [PATCH iproute2 net-next 3/3] man: add documentation for seg6local lwt David Lebrun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170809074316.3acaafa1@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=david.lebrun@uclouvain.be \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).