All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: David Lebrun <david.lebrun@uclouvain.be>
Cc: <netdev@vger.kernel.org>
Subject: Re: [PATCH iproute2 net-next 1/2] iproute: add support for seg6 l2encap mode
Date: Mon, 28 Aug 2017 12:07:24 -0700	[thread overview]
Message-ID: <20170828120724.53904cbf@xeon-e3> (raw)
In-Reply-To: <20170828190525.15655-2-david.lebrun@uclouvain.be>

On Mon, 28 Aug 2017 20:05:24 +0100
David Lebrun <david.lebrun@uclouvain.be> wrote:

>  
> +static const char *format_seg6mode_type(int mode)
> +{
> +	if (mode == SEG6_IPTUN_MODE_ENCAP)
> +		return "encap";
> +	else if (mode == SEG6_IPTUN_MODE_INLINE)
> +		return "inline";
> +	else if (mode == SEG6_IPTUN_MODE_L2ENCAP)
> +		return "l2encap";
> +
> +	return "<unknown>";
> +}
> +
> +static int read_seg6mode_type(const char *mode)
> +{
> +	if (strcmp(mode, "encap") == 0)
> +		return SEG6_IPTUN_MODE_ENCAP;
> +	else if (strcmp(mode, "inline") == 0)
> +		return SEG6_IPTUN_MODE_INLINE;
> +	else if (strcmp(mode, "l2encap") == 0)
> +		return SEG6_IPTUN_MODE_L2ENCAP;
> +
> +	return -1;
> +}

Since these values probably will grow over time, it would make
sense to have this a name/value table.

  reply	other threads:[~2017-08-28 19:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 19:05 [PATCH iproute2 net-next 0/2] Add support for seg6 l2encap mode David Lebrun
2017-08-28 19:05 ` [PATCH iproute2 net-next 1/2] iproute: add " David Lebrun
2017-08-28 19:07   ` Stephen Hemminger [this message]
2017-08-28 19:11     ` David Lebrun
2017-08-28 19:32       ` Stephen Hemminger
2017-08-28 19:05 ` [PATCH iproute2 net-next 2/2] man: add documentation " 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=20170828120724.53904cbf@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.