Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.57 KB

bpf_dynptr_data.md

File metadata and controls

47 lines (30 loc) · 1.57 KB
title description
Helper Function 'bpf_dynptr_data'
This page documents the 'bpf_dynptr_data' eBPF helper function, including its defintion, usage, program types that can use it, and examples.

Helper function bpf_dynptr_data

:octicons-tag-24: v5.19

Definition

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

Get a pointer to the underlying dynptr data.

len must be a statically known value. The returned data slice is invalidated whenever the dynptr is invalidated.

skb and xdp type dynptrs may not use bpf_dynptr_data. They should instead use bpf_dynptr_slice and bpf_dynptr_slice_rdwr.

Returns

Pointer to the underlying dynptr data, NULL if the dynptr is read-only, if the dynptr is invalid, or if the offset and length is out of bounds.

#!c static void *(* const bpf_dynptr_data)(const struct bpf_dynptr *ptr, __u32 offset, __u32 len) = (void *) 203;

Usage

!!! example "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

!!! example "Docs could be improved" This part of the docs is incomplete, contributions are very welcome