Documentation
¶
Overview ¶
Copyright © 2020 GUILLAUME FOURNIER
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func Bytes(str string) []byte
- func GetCgroupFromPid(pid uint32) uint64
- func GetCommFromPid(pid uint32) string
- func GetHostByteOrder() binary.ByteOrder
- func GetMntnsFromPid(pid uint32) uint64
- func GetNetnsFromPid(pid uint32) uint64
- func GetPidnsFromPid(pid uint32) uint64
- func GetPpid(pid uint32) uint32
- func GetUsernsFromPid(pid uint32) uint64
- func InterfaceToBytes(data interface{}, byteOrder binary.ByteOrder) ([]byte, error)
- func String(bytes []byte) string
Constants ¶
This section is empty.
Variables ¶
var ByteOrder binary.ByteOrder
ByteOrder - host byte order
Functions ¶
func GetCgroupFromPid ¶
GetCgroupFromPid - Returns the cgroup of a process
func GetCommFromPid ¶
GetCommFromPid - Returns the comm of a process
func GetHostByteOrder ¶
GetHostByteOrder - Returns the host byte order
func GetMntnsFromPid ¶
GetMntnsFromPid - Returns the mount namespace of a process
func GetNetnsFromPid ¶
GetNetnsFromPid - Returns the network namespace of a process
func GetPidnsFromPid ¶
GetPidnsFromPid - Returns the pid namespace of a process
func GetPpid ¶
GetPpid is a fallback to read the parent PID from /proc. Some kernel versions, like 4.13.0 return 0 getting the parent PID from the current task, so we need to use this fallback to have the parent PID in any kernel.
func GetUsernsFromPid ¶
GetUsernsFromPid - Returns the user namespace of a process
func InterfaceToBytes ¶
InterfaceToBytes - Tranforms an interface into a C bytes array
Types ¶
This section is empty.