func GetNetnsFromPid(pid uint32) uint64 {
	raw, err := os.Readlink(fmt.Sprintf("/proc/%v/ns/net", pid))
	if err != nil {
		return 0
	}
	return getNamespaceID(raw)
}
GetNetnsFromPid - Returns the network namespace of a process
package utils
import (
	"C"
	"bufio"
	"bytes"
	"encoding/binary"
	"fmt"
	"io/ioutil"
	"os"
	"strconv"
	"strings"
	"unsafe"
	"github.com/pkg/errors"
	"github.com/Gui774ume/network-security-probe/pkg/model/kernel"
)
func GetPpid(pid uint32) uint32 {
	f, err := os.OpenFile(fmt.Sprintf("/proc/%d/status", pid), os.O_RDONLY, os.ModePerm)
	if err != nil {
		return 0
	}
	defer f.Close()
	sc := bufio.NewScanner(f)
	for sc.Scan() {
		text := sc.Text()
		if strings.Contains(text, "PPid:") {
			f := strings.Fields(text)
			i, _ := strconv.ParseUint(f[len(f)-1], 10, 64)
			return uint32(i)
		}
	}
	return 0
}
func getNamespaceID(raw string) uint64 {
	i := strings.Index(raw, "[")
	if i > 0 {
		id, err := strconv.ParseUint(raw[i+1:len(raw)-1], 10, 64)
		if err != nil {
			return 0
		}
		return id
	}
	return 0
}
func GetPidnsFromPid(pid uint32) uint64 {
	raw, err := os.Readlink(fmt.Sprintf("/proc/%v/ns/pid_for_children", pid))
	if err != nil {
		return 0
	}
	return getNamespaceID(raw)
}