Skip to content

Helper function bpf_get_route_realm

v4.4

Definition

Copyright (c) 2015 The Libbpf Authors. All rights reserved.

Retrieve the realm or the route, that is to say the tclassid field of the destination for the skb. The identifier retrieved is a user-provided tag, similar to the one used with the net_cls cgroup (see description for bpf_get_cgroup_classid() helper), but here this tag is held by a route (a destination entry), not by a task.

Retrieving this identifier works with the clsact TC egress hook (see also tc-bpf(8)), or alternatively on conventional classful egress qdiscs, but not on TC ingress path. In case of clsact TC egress hook, this has the advantage that, internally, the destination entry has not been dropped yet in the transmit path. Therefore, the destination entry does not need to be artificially held via netif_keep_dst() for a classful qdisc until the skb is freed.

This helper is available only if the kernel was compiled with CONFIG_IP_ROUTE_CLASSID configuration option.

Returns

The realm of the route for the packet associated to skb, or 0 if none was found.

static __u32 (* const bpf_get_route_realm)(struct __sk_buff *skb) = (void *) 24;

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Program types

This helper call can be used in the following program types:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome