github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/trace/tcpretrans/tracer/tcpretrans_x86_bpfel.go (about) 1 // Code generated by bpf2go; DO NOT EDIT. 2 //go:build 386 || amd64 3 4 package tracer 5 6 import ( 7 "bytes" 8 _ "embed" 9 "fmt" 10 "io" 11 12 "github.com/cilium/ebpf" 13 ) 14 15 type tcpretransEvent struct { 16 Saddr [16]uint8 17 Daddr [16]uint8 18 Timestamp uint64 19 Af uint16 20 Dport uint16 21 Sport uint16 22 State uint8 23 Tcpflags uint8 24 Reason uint32 25 Netns uint32 26 Type tcpretransType 27 _ [4]byte 28 ProcCurrent struct { 29 MountNsId uint64 30 Pid uint32 31 Tid uint32 32 Uid uint32 33 Gid uint32 34 Task [16]uint8 35 } 36 ProcSocket struct { 37 MountNsId uint64 38 Pid uint32 39 Tid uint32 40 Uid uint32 41 Gid uint32 42 Task [16]uint8 43 } 44 } 45 46 type tcpretransType uint32 47 48 const ( 49 tcpretransTypeRETRANS tcpretransType = 0 50 tcpretransTypeLOSS tcpretransType = 1 51 ) 52 53 // loadTcpretrans returns the embedded CollectionSpec for tcpretrans. 54 func loadTcpretrans() (*ebpf.CollectionSpec, error) { 55 reader := bytes.NewReader(_TcpretransBytes) 56 spec, err := ebpf.LoadCollectionSpecFromReader(reader) 57 if err != nil { 58 return nil, fmt.Errorf("can't load tcpretrans: %w", err) 59 } 60 61 return spec, err 62 } 63 64 // loadTcpretransObjects loads tcpretrans and converts it into a struct. 65 // 66 // The following types are suitable as obj argument: 67 // 68 // *tcpretransObjects 69 // *tcpretransPrograms 70 // *tcpretransMaps 71 // 72 // See ebpf.CollectionSpec.LoadAndAssign documentation for details. 73 func loadTcpretransObjects(obj interface{}, opts *ebpf.CollectionOptions) error { 74 spec, err := loadTcpretrans() 75 if err != nil { 76 return err 77 } 78 79 return spec.LoadAndAssign(obj, opts) 80 } 81 82 // tcpretransSpecs contains maps and programs before they are loaded into the kernel. 83 // 84 // It can be passed ebpf.CollectionSpec.Assign. 85 type tcpretransSpecs struct { 86 tcpretransProgramSpecs 87 tcpretransMapSpecs 88 } 89 90 // tcpretransSpecs contains programs before they are loaded into the kernel. 91 // 92 // It can be passed ebpf.CollectionSpec.Assign. 93 type tcpretransProgramSpecs struct { 94 IgTcplossprobe *ebpf.ProgramSpec `ebpf:"ig_tcplossprobe"` 95 IgTcpretrans *ebpf.ProgramSpec `ebpf:"ig_tcpretrans"` 96 } 97 98 // tcpretransMapSpecs contains maps before they are loaded into the kernel. 99 // 100 // It can be passed ebpf.CollectionSpec.Assign. 101 type tcpretransMapSpecs struct { 102 Events *ebpf.MapSpec `ebpf:"events"` 103 GadgetSockets *ebpf.MapSpec `ebpf:"gadget_sockets"` 104 } 105 106 // tcpretransObjects contains all objects after they have been loaded into the kernel. 107 // 108 // It can be passed to loadTcpretransObjects or ebpf.CollectionSpec.LoadAndAssign. 109 type tcpretransObjects struct { 110 tcpretransPrograms 111 tcpretransMaps 112 } 113 114 func (o *tcpretransObjects) Close() error { 115 return _TcpretransClose( 116 &o.tcpretransPrograms, 117 &o.tcpretransMaps, 118 ) 119 } 120 121 // tcpretransMaps contains all maps after they have been loaded into the kernel. 122 // 123 // It can be passed to loadTcpretransObjects or ebpf.CollectionSpec.LoadAndAssign. 124 type tcpretransMaps struct { 125 Events *ebpf.Map `ebpf:"events"` 126 GadgetSockets *ebpf.Map `ebpf:"gadget_sockets"` 127 } 128 129 func (m *tcpretransMaps) Close() error { 130 return _TcpretransClose( 131 m.Events, 132 m.GadgetSockets, 133 ) 134 } 135 136 // tcpretransPrograms contains all programs after they have been loaded into the kernel. 137 // 138 // It can be passed to loadTcpretransObjects or ebpf.CollectionSpec.LoadAndAssign. 139 type tcpretransPrograms struct { 140 IgTcplossprobe *ebpf.Program `ebpf:"ig_tcplossprobe"` 141 IgTcpretrans *ebpf.Program `ebpf:"ig_tcpretrans"` 142 } 143 144 func (p *tcpretransPrograms) Close() error { 145 return _TcpretransClose( 146 p.IgTcplossprobe, 147 p.IgTcpretrans, 148 ) 149 } 150 151 func _TcpretransClose(closers ...io.Closer) error { 152 for _, closer := range closers { 153 if err := closer.Close(); err != nil { 154 return err 155 } 156 } 157 return nil 158 } 159 160 // Do not access this directly. 161 // 162 //go:embed tcpretrans_x86_bpfel.o 163 var _TcpretransBytes []byte