Readonly property holding the FD owned by this object. Don't store this value elsewhere, query it from here every time to make sure it's valid.
Throws if close()
was successfully called.
Flags specified on map creation, see MapFlags
Map ID (since Linux 4.13)
For offloading, ifindex of network device the map was created on (reported since Linux 4.16)
Size of every key, in bytes
Maximum amount of entries: the meaning of this is type-dependent
Map name (might get truncated if longer than OBJ_NAME_LEN) (since Linux 4.15)
Map type. This decides the available operations and their semantics.
Size of every value, in bytes
Closes the FD early. Instances don't necessarily support this operation (and will throw in that case), but all instances returned by this module do.
If supported, calling it a second time does nothing.
Generated using TypeDoc
Object holdling a file descriptor (plus parameters) for an eBPF map. The object must own the file descriptor, meaning that it won't get closed while this object is alive.
If you got a file descriptor from someplace else, you can use createMapRef to obtain a MapRef pointing to the same map.
Implementing a custom
MapRef
You can also choose to implement your own
MapRef
s, but you must make sure to report the parameters correctly (otherwise, it can lead to buffer overflow) and make sure the object holds a reference to whatever is keeping the file descriptor from being closed. You may optionally implement close if you completely own the FD.