Skip to content

Commit

Permalink
NETOBSERV-868: Update to use cilium auto generated golang structures (n…
Browse files Browse the repository at this point in the history
…etobserv#90)

* update vendor package and update cilium to 0.10.0

Signed-off-by: msherif1234 <mmahmoud@redhat.com>

* update cilium version in the Makefile

Signed-off-by: msherif1234 <mmahmoud@redhat.com>

* fix typo in the README.md

Signed-off-by: msherif1234 <mmahmoud@redhat.com>

* replace custom go struct with cilium auto generated ones

Signed-off-by: msherif1234 <mmahmoud@redhat.com>

---------

Signed-off-by: msherif1234 <mmahmoud@redhat.com>
  • Loading branch information
msherif1234 authored and shach33 committed Apr 6, 2023
1 parent 8312023 commit 351c4d3
Show file tree
Hide file tree
Showing 35 changed files with 1,313 additions and 455 deletions.
3 changes: 3 additions & 0 deletions bpf/flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ typedef struct payload_meta_t {
u32 if_index;
u32 pkt_len;
} __attribute__((packed)) payload_meta;

// Force emitting struct flow_record into the ELF.
const struct flow_record_t *unused3 __attribute__((unused));
#endif
1 change: 1 addition & 0 deletions bpf/flows.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ static inline int fill_ip6hdr(struct ipv6hdr *ip, void *data_end, u8 direction,
return DISCARD;
}
__builtin_memset(&l4_info, 0, sizeof(l4_info));

__builtin_memcpy(id->src_ip, ip->saddr.in6_u.u6_addr8, 16);
__builtin_memcpy(id->dst_ip, ip->daddr.in6_u.u6_addr8, 16);
id->transport_protocol = ip->nexthdr;
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/caarlos0/env/v6 v6.9.1
github.com/cilium/ebpf v0.10.0
github.com/gavv/monotime v0.0.0-20190418164738-30dba4353424
github.com/golang/protobuf v1.5.2
github.com/mariomac/guara v0.0.0-20220523124851-5fc279816f1f
github.com/netobserv/gopipes v0.3.0
github.com/paulbellamy/ratecounter v0.2.0
Expand Down Expand Up @@ -36,6 +35,7 @@ require (
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
Expand Down
93 changes: 47 additions & 46 deletions pkg/ebpf/bpf_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_bpfeb.o
Binary file not shown.
93 changes: 47 additions & 46 deletions pkg/ebpf/bpf_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_bpfel.o
Binary file not shown.
Loading

0 comments on commit 351c4d3

Please sign in to comment.