LoadMapValue stores a pointer to the value at a certain offset of a map.
(dst Register, fd int, offset uint32)
| 249 | |
| 250 | // LoadMapValue stores a pointer to the value at a certain offset of a map. |
| 251 | func LoadMapValue(dst Register, fd int, offset uint32) Instruction { |
| 252 | if fd < 0 { |
| 253 | return Instruction{OpCode: InvalidOpCode} |
| 254 | } |
| 255 | |
| 256 | fdAndOffset := (uint64(offset) << 32) | uint64(uint32(fd)) |
| 257 | return Instruction{ |
| 258 | OpCode: LoadImmOp(DWord), |
| 259 | Dst: dst, |
| 260 | Src: PseudoMapValue, |
| 261 | Constant: int64(fdAndOffset), |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | // LoadIndOp returns the OpCode for loading a value of given size from an sk_buff. |
| 266 | func LoadIndOp(size Size) OpCode { |
searching dependent graphs…