Skip to content

KFunc bpf_strncasecmp

v7.0

Compare two length-limited strings, ignoring the case of the characters.

Definition

Parameters

s1__ign: One string

s2__ign: Another string

len: The maximum number of characters to compare

Returns

  • 0 - Strings are equal
  • -1 - s1__ign is smaller
  • 1 - s2__ign is smaller
  • -EFAULT - Cannot read one of the strings
  • -E2BIG - One of strings is too large
  • -ERANGE - One of strings is outside of kernel address space

Signature

int bpf_strncasecmp(const char *s1__ign, const char *s2__ign, size_t len)

Usage

This kfunc is equivalent to bpf_strcasecmp, but bounds the comparison by len characters.

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