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 ¶
- func Char6ToEth(ethChar [6]byte) string
- func DecodeDNS(domain [kernel.DNSMaxLength]byte) string
- func EncodeDNS(name string) ([kernel.DNSMaxLength]byte, error)
- 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 Uint64ToIPv4(ipUint uint64) string
- func Uint64sToIPv6(ipUints [2]uint64) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Char6ToEth ¶
Char6ToEth - Transforms an int64 representation of an IPv4 into a string
func DecodeDNS ¶
func DecodeDNS(domain [kernel.DNSMaxLength]byte) string
DecodeDNS - Returns the domain name from its kernel representation
func EncodeDNS ¶
func EncodeDNS(name string) ([kernel.DNSMaxLength]byte, error)
EncodeDNS - Returns the DNS packet representation of a domain name
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
func Uint64ToIPv4 ¶
Uint64ToIPv4 - Transforms an uint64 representation of an IPv4 into a string
func Uint64sToIPv6 ¶
Uint64sToIPv6 - Transforms an [2]uint64 representation of an IPv6 into a string
Types ¶
This section is empty.