Module: RbBCC::Table
- Defined in:
- lib/rbbcc/table.rb
Constant Summary collapse
- BPF_MAP_TYPE_HASH =
1
- BPF_MAP_TYPE_ARRAY =
2
- BPF_MAP_TYPE_PROG_ARRAY =
3
- BPF_MAP_TYPE_PERF_EVENT_ARRAY =
4
- BPF_MAP_TYPE_PERCPU_HASH =
5
- BPF_MAP_TYPE_PERCPU_ARRAY =
6
- BPF_MAP_TYPE_STACK_TRACE =
7
- BPF_MAP_TYPE_CGROUP_ARRAY =
8
- BPF_MAP_TYPE_LRU_HASH =
9
- BPF_MAP_TYPE_LRU_PERCPU_HASH =
10
- BPF_MAP_TYPE_LPM_TRIE =
11
- BPF_MAP_TYPE_ARRAY_OF_MAPS =
12
- BPF_MAP_TYPE_HASH_OF_MAPS =
13
- BPF_MAP_TYPE_DEVMAP =
14
- BPF_MAP_TYPE_SOCKMAP =
15
- BPF_MAP_TYPE_CPUMAP =
16
- BPF_MAP_TYPE_XSKMAP =
17
- BPF_MAP_TYPE_SOCKHASH =
18
- BPF_MAP_TYPE_CGROUP_STORAGE =
19
- BPF_MAP_TYPE_REUSEPORT_SOCKARRAY =
20
- BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE =
21
- BPF_MAP_TYPE_QUEUE =
22
- BPF_MAP_TYPE_STACK =
23
- BPF_MAP_TYPE_SK_STORAGE =
24
- BPF_MAP_TYPE_DEVMAP_HASH =
25
- BPF_MAP_TYPE_STRUCT_OPS =
26
- BPF_MAP_TYPE_RINGBUF =
27
- BPF_MAP_TYPE_INODE_STORAGE =
28
- BPF_MAP_TYPE_TASK_STORAGE =
29
Class Method Summary collapse
Class Method Details
.new(bpf, map_id, map_fd, keytype, leaftype, name, **kwargs) ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/rbbcc/table.rb', line 94 def self.new(bpf, map_id, map_fd, keytype, leaftype, name, **kwargs) ttype = Clib.bpf_table_type_id(bpf.module, map_id) case ttype when BPF_MAP_TYPE_HASH HashTable.new(bpf, map_id, map_fd, keytype, leaftype) when BPF_MAP_TYPE_ARRAY ArrayTable.new(bpf, map_id, map_fd, keytype, leaftype) when BPF_MAP_TYPE_PERF_EVENT_ARRAY PerfEventArray.new(bpf, map_id, map_fd, keytype, leaftype, name: name) when BPF_MAP_TYPE_RINGBUF RingBuf.new(bpf, map_id, map_fd, keytype, leaftype, name: name) when BPF_MAP_TYPE_STACK_TRACE StackTrace.new(bpf, map_id, map_fd, keytype, leaftype) else raise "Unknown table type #{ttype}" end end |