KFunc bpf_session_cookie
Get a pointer to a 64-bit session cookie.
Definition
Returns
Returns pointer to the cookie value. The bpf program can use the pointer to store (on entry) and load (on return) the value.
Signature
__u64 *bpf_session_cookie(void *ctx)
Note
In v7.0 the signature of this kfunc has been changed. It used to be __u64 *bpf_session_cookie(). Weak symbols and bpf_ksym_exists can be used to write fallback logic for older kernels.
Usage
The session cookie is u64 value, implemented via fprobe feature that allows to share values between entry and return ftrace fprobe callbacks.
Program types
The following program types can make use of this kfunc:
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome