Skip to content

Helper function bpf_skb_ancestor_cgroup_id

v4.19

Definition

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

Return id of cgroup v2 that is ancestor of cgroup associated with the skb at the ancestor_level. The root cgroup is at ancestor_level zero and each step down the hierarchy increments the level. If ancestor_level == level of cgroup associated with skb, then return value will be same as that of bpf_skb_cgroup_id().

The helper is useful to implement policies based on cgroups that are upper in hierarchy than immediate cgroup associated with skb.

The format of returned id and helper limitations are same as in bpf_skb_cgroup_id().

Returns

The id is returned or 0 in case the id could not be retrieved.

static __u64 (* const bpf_skb_ancestor_cgroup_id)(struct __sk_buff *skb, int ancestor_level) = (void *) 83;

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