XDP Interface

Defaults

XDP_IFACE_DEFAULT
[source]

The default network interface

XDP_IFACE_XDP_PROG_DEFAULT
[source]

Default XDP program name

Constructor

xdp_iface_t *xdp_iface_new(const char *interface)
[source]

Create new xdp_iface object.

Returns:

On success new xdp_iface object, or NULL if the new xdp_iface could not be created.

Destructor

void xdp_iface_destroy(xdp_iface_t **self_p)
[source]

Destroy xdp_iface object. You must use this for any tcp server created via the xdp_iface_new method.

Parameters:
  • self_p (xdp_iface_t**) – pointer to xdp_iface_t object reference, so the destructor can nullify it

Returns:

None (void)

Methods

int xdp_iface_load_program(xdp_iface_t *self, const char *xdp_prog_path)
[source]

Load eBPF program

Parameters:
  • xdp_prog_path (const char*) –

Returns:

0 on success, err value on failiure

void xdp_iface_unload_program(xdp_iface_t *self)
[source]

Unlooad eBPF program

Returns:

None (void)

const char *xdp_iface_get_name(xdp_iface_t *self)
[source]

Get the network interfaces name associated to the xdp_iface object

Returns:

RO string

void *xdp_iface_get_prog(xdp_iface_t *self)
[source]

Get the loaded xdp program obejct

Returns:

void pointer (Any)