github.com/cilium/cilium@v1.16.2/pkg/monitor/api/files.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Cilium
     3  
     4  package api
     5  
     6  import "fmt"
     7  
     8  // Keep in sync with __source_file_name_to_id in bpf/source_names_to_ids.h.
     9  var files = map[uint8]string{
    10  	// @@ source files list begin
    11  
    12  	// source files from bpf/
    13  	1: "bpf_host.c",
    14  	2: "bpf_lxc.c",
    15  	3: "bpf_overlay.c",
    16  	4: "bpf_xdp.c",
    17  	5: "bpf_sock.c",
    18  	6: "bpf_network.c",
    19  	7: "bpf_wireguard.c",
    20  
    21  	// header files from bpf/lib/
    22  	101: "arp.h",
    23  	102: "drop.h",
    24  	103: "srv6.h",
    25  	104: "icmp6.h",
    26  	105: "nodeport.h",
    27  	106: "lb.h",
    28  	107: "mcast.h",
    29  	108: "ipv4.h",
    30  	109: "conntrack.h",
    31  	110: "l3.h",
    32  	111: "trace.h",
    33  	112: "encap.h",
    34  	113: "encrypt.h",
    35  
    36  	// @@ source files list end
    37  }
    38  
    39  // BPFFileName returns the file name for the given BPF file id.
    40  func BPFFileName(id uint8) string {
    41  	if name, ok := files[id]; ok {
    42  		return name
    43  	}
    44  	return fmt.Sprintf("unknown(%d)", id)
    45  }