unix: add Linux network namespace constants

This adds the NETNSA constants from net_namespace.h, used for creating
and querying network namespace IDs.

Fixes golang/go#26330
Change-Id: I786c4c4771be3eddc4fdb830a52e128aa1a2b9fd
Reviewed-on: https://go-review.googlesource.com/124436
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Casey Callendrello
2018-08-01 22:11:39 +00:00
committed by Ian Lance Taylor
parent bd9dbc187b
commit 3dc4335d56
24 changed files with 112 additions and 1 deletions
+11
View File
@@ -74,6 +74,7 @@ package unix
#include <linux/hdreg.h>
#include <linux/rtc.h>
#include <linux/blkpg.h>
#include <linux/net_namespace.h>
// abi/abi.h generated by mkall.go.
#include "abi/abi.h"
@@ -1539,3 +1540,13 @@ const (
BLKPG_DEL_PARTITION = C.BLKPG_DEL_PARTITION
BLKPG_RESIZE_PARTITION = C.BLKPG_RESIZE_PARTITION
)
// netlink namespace
// generated from
// perl -nlE '/^\s*(NETNSA\w+)/ && say "$1 = C.$1"' /usr/include/linux/net_namespace.h
const (
NETNSA_NONE = C.NETNSA_NONE
NETNSA_NSID = C.NETNSA_NSID
NETNSA_PID = C.NETNSA_PID
NETNSA_FD = C.NETNSA_FD
)