Skip to content

Commit

Permalink
Pack flow id
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak committed Dec 18, 2024
1 parent 0cc19d8 commit 65886f7
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bpf/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ typedef struct flow_id_t {
u8 icmp_code;
// OS interface index
u32 if_index;
} flow_id;
} __attribute__((packed)) flow_id;

// Force emitting enums/structs into the ELF
const struct flow_id_t *unused7 __attribute__((unused));
Expand Down
3 changes: 1 addition & 2 deletions pkg/ebpf/bpf_arm64_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_arm64_bpfel.o
Binary file not shown.
3 changes: 1 addition & 2 deletions pkg/ebpf/bpf_powerpc_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_powerpc_bpfel.o
Binary file not shown.
3 changes: 1 addition & 2 deletions pkg/ebpf/bpf_s390_bpfeb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_s390_bpfeb.o
Binary file not shown.
3 changes: 1 addition & 2 deletions pkg/ebpf/bpf_x86_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified pkg/ebpf/bpf_x86_bpfel.o
Binary file not shown.
9 changes: 4 additions & 5 deletions pkg/model/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ func TestRecordBinaryEncoding(t *testing.T) {
0x03, // u8 direction
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x06, 0x07, 0x08, 0x09, // network: u8[16] src_ip
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x0b, 0x0c, 0x0d, // network: u8[16] dst_ip
0x00, // 1 byte padding
0x0e, 0x0f, // transport: u16 src_port
0x10, 0x11, // transport: u16 dst_port
0x12, // transport: u8 transport_protocol
0x00, // icmp: u8 icmp_type
0x00, // icmp: u8 icmp_code
0x00, 0x00, 0x00, // 3 bytes padding
0x12, // transport: u8 transport_protocol
0x00, // icmp: u8 icmp_type
0x00, // icmp: u8 icmp_code
0x13, 0x14, 0x15, 0x16, // interface index
0x00, 0x00, 0x00, 0x00, // 4 bytes padding
// Metrics
0x00, 0x00, 0x00, 0x00, // u32 lock
0x01, 0x02, // u16 eth_protocol
Expand Down

0 comments on commit 65886f7

Please sign in to comment.