Skip to content

Commit

Permalink
make generate after go-build update
Browse files Browse the repository at this point in the history
  • Loading branch information
rene-dekker committed Feb 22, 2023
1 parent 597fedb commit 317c6ad
Show file tree
Hide file tree
Showing 64 changed files with 467 additions and 459 deletions.
14 changes: 7 additions & 7 deletions api/pkg/client/clientset_generated/clientset/fake/register.go

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

14 changes: 7 additions & 7 deletions api/pkg/client/clientset_generated/clientset/scheme/register.go

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

2 changes: 1 addition & 1 deletion api/pkg/lib/numorstring/numorstring_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
8 changes: 4 additions & 4 deletions api/pkg/lib/numorstring/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (

// Port represents either a range of numeric ports or a named port.
//
// - For a named port, set the PortName, leaving MinPort and MaxPort as 0.
// - For a port range, set MinPort and MaxPort to the (inclusive) port numbers. Set
// PortName to "".
// - For a single port, set MinPort = MaxPort and PortName = "".
// - For a named port, set the PortName, leaving MinPort and MaxPort as 0.
// - For a port range, set MinPort and MaxPort to the (inclusive) port numbers. Set
// PortName to "".
// - For a single port, set MinPort = MaxPort and PortName = "".
type Port struct {
MinPort uint16 `json:"minPort,omitempty"`
MaxPort uint16 `json:"maxPort,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion api/pkg/openapi/openapi_generated.go

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

2 changes: 1 addition & 1 deletion calicoctl/tests/fv/utils/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion felix/bpf/asm/asm.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type FieldOffset struct {
Field string
}

//noinspection GoUnusedConst
// noinspection GoUnusedConst
const (
// Registers.

Expand Down
2 changes: 1 addition & 1 deletion felix/bpf/asm/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package asm

type Helper int32

//noinspection GoUnusedConst
// noinspection GoUnusedConst
const (
HelperUnspec Helper = 0
HelperMapLookupElem Helper = 1
Expand Down
14 changes: 9 additions & 5 deletions felix/bpf/bpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -1217,9 +1217,11 @@ func (b *BPFLib) GetXDPIfaces() ([]string, error) {
// For example, for 8080/TCP:
//
// [
// 06, IPPROTO_TCP as defined by <linux/in.h>
// 00, padding
// 90, 1F LSB in little endian order
//
// 06, IPPROTO_TCP as defined by <linux/in.h>
// 00, padding
// 90, 1F LSB in little endian order
//
// ]
func failsafeToHex(proto uint8, port uint16) ([]string, error) {
portBytes := make([]byte, 2)
Expand Down Expand Up @@ -1281,8 +1283,10 @@ func hexToFailsafe(hexString []string) (proto uint8, port uint16, err error) {
// For example, for "192.168.0.0/16":
//
// [
// 10, 00, 00, 00, mask in little endian order
// C0, A8, 00, 00 IP address
//
// 10, 00, 00, 00, mask in little endian order
// C0, A8, 00, 00 IP address
//
// ]
func CidrToHex(cidr string) ([]string, error) {
cidrParts := strings.Split(cidr, "/")
Expand Down
1 change: 0 additions & 1 deletion felix/bpf/cmd/felix-xdp.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func dump() {
}

// main is the entry point to the binary.
//
func main() {
// Parse command-line args.
version := "Version: " + buildinfo.GitVersion + "\n" +
Expand Down
10 changes: 5 additions & 5 deletions felix/bpf/conntrack/v2/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (
"github.com/projectcalico/calico/felix/bpf/maps"
)

// struct calico_ct_key {
// uint32_t protocol;
// __be32 addr_a, addr_b; // NBO
// uint16_t port_a, port_b; // HBO
// };
// struct calico_ct_key {
// uint32_t protocol;
// __be32 addr_a, addr_b; // NBO
// uint16_t port_a, port_b; // HBO
// };
const KeySize = 16
const ValueSize = 64
const MaxEntries = 512000
Expand Down
10 changes: 5 additions & 5 deletions felix/bpf/conntrack/v3/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (
"github.com/projectcalico/calico/felix/bpf/maps"
)

// struct calico_ct_key {
// uint32_t protocol;
// __be32 addr_a, addr_b; // NBO
// uint16_t port_a, port_b; // HBO
// };
// struct calico_ct_key {
// uint32_t protocol;
// __be32 addr_a, addr_b; // NBO
// uint16_t port_a, port_b; // HBO
// };
const KeySize = 16
const ValueSize = 88
const MaxEntries = 512000
Expand Down
2 changes: 1 addition & 1 deletion felix/bpf/mock_bpf_lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
62 changes: 31 additions & 31 deletions felix/bpf/nat/maps.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,49 +42,49 @@ func SetMapSizes(fsize, bsize, asize int) {
maps.SetSize(AffinityMapParameters.VersionedName(), asize)
}

// struct calico_nat_v4_key {
// uint32_t prefixLen;
// uint32_t addr; // NBO
// uint16_t port; // HBO
// uint8_t protocol;
// uint32_t saddr;
// uint8_t pad;
// };
// struct calico_nat_v4_key {
// uint32_t prefixLen;
// uint32_t addr; // NBO
// uint16_t port; // HBO
// uint8_t protocol;
// uint32_t saddr;
// uint8_t pad;
// };
const frontendKeySize = 16

// struct calico_nat {
// uint32_t addr;
// uint16_t port;
// uint8_t protocol;
// uint8_t pad;
// };
// struct calico_nat {
// uint32_t addr;
// uint16_t port;
// uint8_t protocol;
// uint8_t pad;
// };
const frontendAffKeySize = 8

// struct calico_nat_v4_value {
// uint32_t id;
// uint32_t count;
// uint32_t local;
// uint32_t affinity_timeo;
// uint32_t flags;
// };
// struct calico_nat_v4_value {
// uint32_t id;
// uint32_t count;
// uint32_t local;
// uint32_t affinity_timeo;
// uint32_t flags;
// };
const frontendValueSize = 20

// struct calico_nat_secondary_v4_key {
// uint32_t id;
// uint32_t ordinal;
// };
// struct calico_nat_secondary_v4_key {
// uint32_t id;
// uint32_t ordinal;
// };
const backendKeySize = 8

// struct calico_nat_dest {
// uint32_t addr;
// uint16_t port;
// uint8_t pad[2];
// };
// struct calico_nat_dest {
// uint32_t addr;
// uint16_t port;
// uint8_t pad[2];
// };
const backendValueSize = 8

const BlackHoleCount uint32 = 0xffffffff

//(sizeof(addr) + sizeof(port) + sizeof(proto)) in bits
// (sizeof(addr) + sizeof(port) + sizeof(proto)) in bits
const ZeroCIDRPrefixLen = 56

var ZeroCIDR = ip.MustParseCIDROrIP("0.0.0.0/0").(ip.V4CIDR)
Expand Down
16 changes: 7 additions & 9 deletions felix/bpf/routes/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func SetMapSize(size int) {
maps.SetSize(MapParameters.VersionedName(), size)
}

//
// struct cali_rt_key {
// __u32 mask;
// __be32 addr; // NBO
Expand Down Expand Up @@ -86,14 +85,13 @@ const (
_ = FlagsUnknown
)

//
// struct cali_rt_value {
// __u32 flags;
// union {
// __u32 next_hop;
// __u32 ifIndex;
// };
// };
// struct cali_rt_value {
// __u32 flags;
// union {
// __u32 next_hop;
// __u32 ifIndex;
// };
// };
const ValueSize = 8

type Value [ValueSize]byte
Expand Down
74 changes: 37 additions & 37 deletions felix/bpf/state/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,43 +36,43 @@ const (
MaxRuleIDs = 32
)

// struct cali_tc_state {
// __be32 ip_src;
// __be32 ip_src1;
// __be32 ip_src2;
// __be32 ip_src3;
// __be32 ip_dst;
// __be32 ip_dst1;
// __be32 ip_dst2;
// __be32 ip_dst3;
// __be32 pre_nat_ip_dst;
// __be32 pre_nat_ip_dst1;
// __be32 pre_nat_ip_dst2;
// __be32 pre_nat_ip_dst3;
// __be32 post_nat_ip_dst;
// __be32 post_nat_ip_dst1;
// __be32 post_nat_ip_dst2;
// __be32 post_nat_ip_dst3;
// __be32 tun_ip;
// __be32 tun_ip1;
// __be32 tun_ip2;
// __be32 tun_ip3;
// __u32 unused;
// __s32 pol_rc;
// __u16 sport;
// __u16 dport;
// __u16 pre_nat_dport;
// __u16 post_nat_dport;
// __u8 ip_proto;
// __u8 __pad;
// __be16 ip_size;
// __u32 rules_hit;
// __u64 rule_ids[MAX_RULE_IDS];
// struct calico_ct_result ct_result;
// struct calico_nat_dest nat_dest;
// __u64 prog_start_time;
// __u64 flags;
// };
// struct cali_tc_state {
// __be32 ip_src;
// __be32 ip_src1;
// __be32 ip_src2;
// __be32 ip_src3;
// __be32 ip_dst;
// __be32 ip_dst1;
// __be32 ip_dst2;
// __be32 ip_dst3;
// __be32 pre_nat_ip_dst;
// __be32 pre_nat_ip_dst1;
// __be32 pre_nat_ip_dst2;
// __be32 pre_nat_ip_dst3;
// __be32 post_nat_ip_dst;
// __be32 post_nat_ip_dst1;
// __be32 post_nat_ip_dst2;
// __be32 post_nat_ip_dst3;
// __be32 tun_ip;
// __be32 tun_ip1;
// __be32 tun_ip2;
// __be32 tun_ip3;
// __u32 unused;
// __s32 pol_rc;
// __u16 sport;
// __u16 dport;
// __u16 pre_nat_dport;
// __u16 post_nat_dport;
// __u8 ip_proto;
// __u8 __pad;
// __be16 ip_size;
// __u32 rules_hit;
// __u64 rule_ids[MAX_RULE_IDS];
// struct calico_ct_result ct_result;
// struct calico_nat_dest nat_dest;
// __u64 prog_start_time;
// __u64 flags;
// };
type State struct {
SrcAddr uint32
SrcAddr1 uint32
Expand Down
10 changes: 5 additions & 5 deletions felix/calc/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
// In addition, it converts the callbacks into structs from the felix/proto
// package, which are ready to be marshaled directly to the felix front-end.
//
// // Using the async API.
// asyncCalcGraph := calc.NewAsyncCalcGraph("hostname", outputChannel, nil)
// syncer := fc.datastore.Syncer(asyncCalcGraph)
// syncer.Start()
// asyncCalcGraph.Start()
// // Using the async API.
// asyncCalcGraph := calc.NewAsyncCalcGraph("hostname", outputChannel, nil)
// syncer := fc.datastore.Syncer(asyncCalcGraph)
// syncer.Start()
// asyncCalcGraph.Start()
// for event := range outputChannel {
// switch event := event.(type) {
// case *proto.XYZ:
Expand Down
Loading

0 comments on commit 317c6ad

Please sign in to comment.