github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/container-hook/privatedata_x86_bpfel.go (about) 1 // Code generated by bpf2go; DO NOT EDIT. 2 //go:build 386 || amd64 3 4 package containerhook 5 6 import ( 7 "bytes" 8 _ "embed" 9 "fmt" 10 "io" 11 12 "github.com/cilium/ebpf" 13 ) 14 15 // loadPrivatedata returns the embedded CollectionSpec for privatedata. 16 func loadPrivatedata() (*ebpf.CollectionSpec, error) { 17 reader := bytes.NewReader(_PrivatedataBytes) 18 spec, err := ebpf.LoadCollectionSpecFromReader(reader) 19 if err != nil { 20 return nil, fmt.Errorf("can't load privatedata: %w", err) 21 } 22 23 return spec, err 24 } 25 26 // loadPrivatedataObjects loads privatedata and converts it into a struct. 27 // 28 // The following types are suitable as obj argument: 29 // 30 // *privatedataObjects 31 // *privatedataPrograms 32 // *privatedataMaps 33 // 34 // See ebpf.CollectionSpec.LoadAndAssign documentation for details. 35 func loadPrivatedataObjects(obj interface{}, opts *ebpf.CollectionOptions) error { 36 spec, err := loadPrivatedata() 37 if err != nil { 38 return err 39 } 40 41 return spec.LoadAndAssign(obj, opts) 42 } 43 44 // privatedataSpecs contains maps and programs before they are loaded into the kernel. 45 // 46 // It can be passed ebpf.CollectionSpec.Assign. 47 type privatedataSpecs struct { 48 privatedataProgramSpecs 49 privatedataMapSpecs 50 } 51 52 // privatedataSpecs contains programs before they are loaded into the kernel. 53 // 54 // It can be passed ebpf.CollectionSpec.Assign. 55 type privatedataProgramSpecs struct { 56 IgFgetX *ebpf.ProgramSpec `ebpf:"ig_fget_x"` 57 IgScmSndE *ebpf.ProgramSpec `ebpf:"ig_scm_snd_e"` 58 } 59 60 // privatedataMapSpecs contains maps before they are loaded into the kernel. 61 // 62 // It can be passed ebpf.CollectionSpec.Assign. 63 type privatedataMapSpecs struct { 64 IgPrivateData *ebpf.MapSpec `ebpf:"ig_private_data"` 65 } 66 67 // privatedataObjects contains all objects after they have been loaded into the kernel. 68 // 69 // It can be passed to loadPrivatedataObjects or ebpf.CollectionSpec.LoadAndAssign. 70 type privatedataObjects struct { 71 privatedataPrograms 72 privatedataMaps 73 } 74 75 func (o *privatedataObjects) Close() error { 76 return _PrivatedataClose( 77 &o.privatedataPrograms, 78 &o.privatedataMaps, 79 ) 80 } 81 82 // privatedataMaps contains all maps after they have been loaded into the kernel. 83 // 84 // It can be passed to loadPrivatedataObjects or ebpf.CollectionSpec.LoadAndAssign. 85 type privatedataMaps struct { 86 IgPrivateData *ebpf.Map `ebpf:"ig_private_data"` 87 } 88 89 func (m *privatedataMaps) Close() error { 90 return _PrivatedataClose( 91 m.IgPrivateData, 92 ) 93 } 94 95 // privatedataPrograms contains all programs after they have been loaded into the kernel. 96 // 97 // It can be passed to loadPrivatedataObjects or ebpf.CollectionSpec.LoadAndAssign. 98 type privatedataPrograms struct { 99 IgFgetX *ebpf.Program `ebpf:"ig_fget_x"` 100 IgScmSndE *ebpf.Program `ebpf:"ig_scm_snd_e"` 101 } 102 103 func (p *privatedataPrograms) Close() error { 104 return _PrivatedataClose( 105 p.IgFgetX, 106 p.IgScmSndE, 107 ) 108 } 109 110 func _PrivatedataClose(closers ...io.Closer) error { 111 for _, closer := range closers { 112 if err := closer.Close(); err != nil { 113 return err 114 } 115 } 116 return nil 117 } 118 119 // Do not access this directly. 120 // 121 //go:embed privatedata_x86_bpfel.o 122 var _PrivatedataBytes []byte