public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Vadim Kochan <vadim4j@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 v3] ip: Simplify executing ip cmd within network ns
Date: Thu, 11 Dec 2014 17:26:40 -0800	[thread overview]
Message-ID: <20141211172640.1afc3283@urahara> (raw)
In-Reply-To: <1418337171-2792-1-git-send-email-vadim4j@gmail.com>

On Fri, 12 Dec 2014 00:32:51 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:

> +
> +#define NETNS_RUN_DIR "/var/run/netns"
> +#define NETNS_ETC_DIR "/etc/netns"
> +
> +#ifndef CLONE_NEWNET
> +#define CLONE_NEWNET 0x40000000	/* New network namespace (lo, device, names sockets, etc) */
> +#endif
> +
> +#ifndef MNT_DETACH
> +#define MNT_DETACH	0x00000002	/* Just detach from the tree */
> +#endif /* MNT_DETACH */
> +
> +/* sys/mount.h may be out too old to have these */
> +#ifndef MS_REC
> +#define MS_REC		16384
> +#endif
> +
> +#ifndef MS_SLAVE
> +#define MS_SLAVE	(1 << 19)
> +#endif
> +
> +#ifndef MS_SHARED
> +#define MS_SHARED	(1 << 20)
> +#endif
> +
> +extern int netns_switch(char *netns);
> +

Maybe it would be cleaner to introduce a new file netns.h
with this and the setnetns syscall wrapper

  reply	other threads:[~2014-12-12  1:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 22:32 [PATCH iproute2 v3] ip: Simplify executing ip cmd within network ns Vadim Kochan
2014-12-12  1:26 ` Stephen Hemminger [this message]
2014-12-12  6:04   ` vadim4j
2014-12-12 19:26     ` vadim4j

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=20141211172640.1afc3283@urahara \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    --cc=vadim4j@gmail.com \
    /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