github.com/cilium/cilium@v1.16.2/bpf/tests/lib/clear.h (about)

     1  /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
     2  /* Copyright Authors of Cilium */
     3  
     4  static long __clear_map_cb_fn(void *map, const void *key,
     5  			      const void __maybe_unused *value, const void __maybe_unused *ctx)
     6  {
     7      map_delete_elem(map, key);
     8  
     9      return 0;
    10  }
    11  
    12  static __u64 clear_map(void *map)
    13  {
    14      return for_each_map_elem(map, __clear_map_cb_fn, NULL, 0);
    15  }