Documentation
¶
Index ¶
- Variables
- func DumpData(typ btf.Type, data []byte) (string, error)
- func FindStruct(spec *btf.Spec, name string) (*btf.Struct, error)
- func FindStructMember(strct *btf.Struct, name string) (*btf.Member, error)
- func FindUnionMember(union *btf.Union, name string) (*btf.Member, error)
- func HaveEnumValue(spec *btf.Spec, enumName, enumValue string) bool
- func IsBigEndian(t btf.Type) bool
- func IsBool(typ btf.Type) bool
- func IsChar(t btf.Type) bool
- func IsInt(typ btf.Type) bool
- func IsStructPointer(t btf.Type, structName string) bool
- func IsVoid(t btf.Type) bool
- func IsVoidPointer(t btf.Type) bool
- func StructMemberOffset(strct *btf.Struct, name string) (uint32, error)
- func UnderlyingType(t btf.Type) btf.Type
- func UnionMemberOffset(union *btf.Union, name string) (uint32, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
func FindStruct ¶
FindStruct finds a struct by name in the BTF spec. It returns the very first struct with the given name even if there are multiple structs with the same name, i.e. Ubuntu 20.04 has a malformed BTF with multiple sk_buff structs.
func FindStructMember ¶
FindStructMember finds a member in a struct by name, even if the member is in embedded anonymous struct/union.
func FindUnionMember ¶
FindUnionMember finds a member in a union by name, even if the member is in embedded anonymous struct/union.
func IsBigEndian ¶
IsBigEndian checks if the given btf.Type is big-endian or not by checking if it is typedef with a name starting with "__be". At most time, the big-endian type is typedef with a name starting with "__be" in the kernel.
func IsVoidPointer ¶
func StructMemberOffset ¶
StructMemberOffset calculates the offset of a member in a struct, even if the member is in embedded anonymous struct/union.
func UnderlyingType ¶
UnderlyingType returns the underlying type of the given btf.Type if it is typedef, volatile, const, restrict or type tag.
Types ¶
This section is empty.