Skip to content

KFunc bpf_strcasestr

v6.19

Find the first sub-string in a string, ignoring the case of the characters

Definition

Parameters

s1__ign: The string to be searched

s2__ign: The string to search for

Returns

  • >=0 - Index of the first character of the first occurrence of s2__ign within s1__ign
  • -ENOENT - s2__ign is not a substring of s1__ign
  • -EFAULT - Cannot read one of the strings
  • -E2BIG - One of the strings is too large
  • -ERANGE - One of the strings is outside of kernel address space

Signature

int bpf_strcasestr(const char *s1__ign, const char *s2__ign)

Usage

Docs could be improved

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

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