m/node/allocs: split new package off m/node
The metropolis/node package contains various unrelated things. One of
these things are node-wide allocations of identifiers.
These are moved here to the new metropolis/node/allocs package.
Additionally, the constants are renamed to move the type of identifier
in front.
Change-Id: Ibc841ca64d4450a7054463e6d2d44753a118e07a
Reviewed-on: https://review.monogon.dev/c/monogon/+/4566
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/node/allocs/net_protocols.go b/metropolis/node/allocs/net_protocols.go
new file mode 100644
index 0000000..360f763
--- /dev/null
+++ b/metropolis/node/allocs/net_protocols.go
@@ -0,0 +1,22 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
+package allocs
+
+// These are netlink protocol numbers used internally for various netlink
+// resource (e.g. route) owners/manager.
+const (
+ // ProtocolOverlay is used by //metropolis/node/core/network/overlay
+ // when creating/removing routes pointing to the overlay interface.
+ ProtocolOverlay int = 129
+)
+
+// Netlink link groups used for interface classification and traffic matching.
+const (
+ // LinkGroupK8sPod is set on all host side PtP interfaces going to K8s
+ // pods.
+ LinkGroupK8sPod uint32 = 8
+ // LinkGroupOverlay is set on all interfaces which are part of the overlay
+ // network and thus exempt from SNATing of workload traffic.
+ LinkGroupOverlay uint32 = 9
+)