From f6658cab2f74b4e1a199c72d6721454b86ab446f Mon Sep 17 00:00:00 2001 From: Daniel Grau Date: Tue, 18 Jun 2024 14:35:19 -0700 Subject: [PATCH] Deinternalize kernel package (#437) --- dataplane/cpusink/BUILD | 2 +- dataplane/cpusink/cpusink.go | 2 +- dataplane/dplanerc/BUILD | 4 ++-- dataplane/dplanerc/interface.go | 2 +- dataplane/forwarding/fwdport/ports/BUILD | 4 ++-- dataplane/forwarding/fwdport/ports/kernel.go | 2 +- dataplane/forwarding/fwdport/ports/tap.go | 2 +- dataplane/{internal => }/kernel/BUILD | 2 +- dataplane/{internal => }/kernel/genetlink.go | 0 dataplane/{internal => }/kernel/kernel.go | 0 dataplane/{internal => }/kernel/kerneltest/BUILD | 2 +- dataplane/{internal => }/kernel/kerneltest/kernel.go | 0 dataplane/{internal => }/kernel/kerneltest/kernel_test.go | 0 dataplane/{internal => }/kernel/tap.go | 0 dataplane/standalone/pkthandler/pktiohandler/BUILD | 4 ++-- dataplane/standalone/pkthandler/pktiohandler/pktiohandler.go | 2 +- .../standalone/pkthandler/pktiohandler/pktiohandler_test.go | 2 +- 17 files changed, 15 insertions(+), 15 deletions(-) rename dataplane/{internal => }/kernel/BUILD (91%) rename dataplane/{internal => }/kernel/genetlink.go (100%) rename dataplane/{internal => }/kernel/kernel.go (100%) rename dataplane/{internal => }/kernel/kerneltest/BUILD (92%) rename dataplane/{internal => }/kernel/kerneltest/kernel.go (100%) rename dataplane/{internal => }/kernel/kerneltest/kernel_test.go (100%) rename dataplane/{internal => }/kernel/tap.go (100%) diff --git a/dataplane/cpusink/BUILD b/dataplane/cpusink/BUILD index ae323c9a..a03ce562 100644 --- a/dataplane/cpusink/BUILD +++ b/dataplane/cpusink/BUILD @@ -9,7 +9,7 @@ go_library( "//dataplane/dplaneopts", "//dataplane/forwarding/attributes", "//dataplane/forwarding/fwdconfig", - "//dataplane/internal/kernel", + "//dataplane/kernel", "//proto/forwarding", "@com_github_golang_glog//:glog", "@com_github_vishvananda_netlink//:netlink", diff --git a/dataplane/cpusink/cpusink.go b/dataplane/cpusink/cpusink.go index 1dd88bc9..a9c81024 100644 --- a/dataplane/cpusink/cpusink.go +++ b/dataplane/cpusink/cpusink.go @@ -30,7 +30,7 @@ import ( "github.com/openconfig/lemming/dataplane/dplaneopts" "github.com/openconfig/lemming/dataplane/forwarding/attributes" "github.com/openconfig/lemming/dataplane/forwarding/fwdconfig" - "github.com/openconfig/lemming/dataplane/internal/kernel" + "github.com/openconfig/lemming/dataplane/kernel" log "github.com/golang/glog" diff --git a/dataplane/dplanerc/BUILD b/dataplane/dplanerc/BUILD index 545c50d6..5cd515c6 100644 --- a/dataplane/dplanerc/BUILD +++ b/dataplane/dplanerc/BUILD @@ -22,7 +22,7 @@ go_library( "@org_golang_google_protobuf//proto", ] + select({ "@io_bazel_rules_go//go/platform:android": [ - "//dataplane/internal/kernel", + "//dataplane/kernel", "//gnmi/gnmiclient", "//gnmi/oc", "//gnmi/oc/ocpath", @@ -32,7 +32,7 @@ go_library( "@org_golang_x_sys//unix", ], "@io_bazel_rules_go//go/platform:linux": [ - "//dataplane/internal/kernel", + "//dataplane/kernel", "//gnmi/gnmiclient", "//gnmi/oc", "//gnmi/oc/ocpath", diff --git a/dataplane/dplanerc/interface.go b/dataplane/dplanerc/interface.go index 0da78511..db7d0c9e 100644 --- a/dataplane/dplanerc/interface.go +++ b/dataplane/dplanerc/interface.go @@ -32,7 +32,7 @@ import ( "google.golang.org/grpc" "google.golang.org/protobuf/proto" - "github.com/openconfig/lemming/dataplane/internal/kernel" + "github.com/openconfig/lemming/dataplane/kernel" "github.com/openconfig/lemming/gnmi/gnmiclient" "github.com/openconfig/lemming/gnmi/oc" "github.com/openconfig/lemming/gnmi/oc/ocpath" diff --git a/dataplane/forwarding/fwdport/ports/BUILD b/dataplane/forwarding/fwdport/ports/BUILD index fc415032..cb5de7ab 100644 --- a/dataplane/forwarding/fwdport/ports/BUILD +++ b/dataplane/forwarding/fwdport/ports/BUILD @@ -31,13 +31,13 @@ go_library( "@com_github_google_gopacket//pcapgo", ] + select({ "@io_bazel_rules_go//go/platform:android": [ - "//dataplane/internal/kernel", + "//dataplane/kernel", "@com_github_google_gopacket//afpacket", "@com_github_vishvananda_netlink//:netlink", "@org_golang_x_sys//unix", ], "@io_bazel_rules_go//go/platform:linux": [ - "//dataplane/internal/kernel", + "//dataplane/kernel", "@com_github_google_gopacket//afpacket", "@com_github_vishvananda_netlink//:netlink", "@org_golang_x_sys//unix", diff --git a/dataplane/forwarding/fwdport/ports/kernel.go b/dataplane/forwarding/fwdport/ports/kernel.go index a49368ba..870af0f0 100644 --- a/dataplane/forwarding/fwdport/ports/kernel.go +++ b/dataplane/forwarding/fwdport/ports/kernel.go @@ -30,7 +30,7 @@ import ( "github.com/openconfig/lemming/dataplane/forwarding/infra/fwdcontext" "github.com/openconfig/lemming/dataplane/forwarding/infra/fwdobject" "github.com/openconfig/lemming/dataplane/forwarding/infra/fwdpacket" - "github.com/openconfig/lemming/dataplane/internal/kernel" + "github.com/openconfig/lemming/dataplane/kernel" "github.com/openconfig/lemming/internal/debug" log "github.com/golang/glog" diff --git a/dataplane/forwarding/fwdport/ports/tap.go b/dataplane/forwarding/fwdport/ports/tap.go index 6e457e38..ee5e7831 100644 --- a/dataplane/forwarding/fwdport/ports/tap.go +++ b/dataplane/forwarding/fwdport/ports/tap.go @@ -31,7 +31,7 @@ import ( "github.com/openconfig/lemming/dataplane/forwarding/infra/fwdcontext" "github.com/openconfig/lemming/dataplane/forwarding/infra/fwdobject" "github.com/openconfig/lemming/dataplane/forwarding/infra/fwdpacket" - "github.com/openconfig/lemming/dataplane/internal/kernel" + "github.com/openconfig/lemming/dataplane/kernel" "github.com/openconfig/lemming/internal/debug" log "github.com/golang/glog" diff --git a/dataplane/internal/kernel/BUILD b/dataplane/kernel/BUILD similarity index 91% rename from dataplane/internal/kernel/BUILD rename to dataplane/kernel/BUILD index d076b4b0..e0764711 100644 --- a/dataplane/internal/kernel/BUILD +++ b/dataplane/kernel/BUILD @@ -7,7 +7,7 @@ go_library( "kernel.go", "tap.go", ], - importpath = "github.com/openconfig/lemming/dataplane/internal/kernel", + importpath = "github.com/openconfig/lemming/dataplane/kernel", visibility = ["//dataplane:__subpackages__"], deps = [ "@com_github_vishvananda_netlink//:netlink", diff --git a/dataplane/internal/kernel/genetlink.go b/dataplane/kernel/genetlink.go similarity index 100% rename from dataplane/internal/kernel/genetlink.go rename to dataplane/kernel/genetlink.go diff --git a/dataplane/internal/kernel/kernel.go b/dataplane/kernel/kernel.go similarity index 100% rename from dataplane/internal/kernel/kernel.go rename to dataplane/kernel/kernel.go diff --git a/dataplane/internal/kernel/kerneltest/BUILD b/dataplane/kernel/kerneltest/BUILD similarity index 92% rename from dataplane/internal/kernel/kerneltest/BUILD rename to dataplane/kernel/kerneltest/BUILD index 1a2bad92..f4a9f06b 100644 --- a/dataplane/internal/kernel/kerneltest/BUILD +++ b/dataplane/kernel/kerneltest/BUILD @@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "kerneltest", srcs = ["kernel.go"], - importpath = "github.com/openconfig/lemming/dataplane/internal/kernel/kerneltest", + importpath = "github.com/openconfig/lemming/dataplane/kernel/kerneltest", visibility = ["//dataplane:__subpackages__"], deps = select({ "@io_bazel_rules_go//go/platform:android": [ diff --git a/dataplane/internal/kernel/kerneltest/kernel.go b/dataplane/kernel/kerneltest/kernel.go similarity index 100% rename from dataplane/internal/kernel/kerneltest/kernel.go rename to dataplane/kernel/kerneltest/kernel.go diff --git a/dataplane/internal/kernel/kerneltest/kernel_test.go b/dataplane/kernel/kerneltest/kernel_test.go similarity index 100% rename from dataplane/internal/kernel/kerneltest/kernel_test.go rename to dataplane/kernel/kerneltest/kernel_test.go diff --git a/dataplane/internal/kernel/tap.go b/dataplane/kernel/tap.go similarity index 100% rename from dataplane/internal/kernel/tap.go rename to dataplane/kernel/tap.go diff --git a/dataplane/standalone/pkthandler/pktiohandler/BUILD b/dataplane/standalone/pkthandler/pktiohandler/BUILD index 15dd8d6e..21544088 100644 --- a/dataplane/standalone/pkthandler/pktiohandler/BUILD +++ b/dataplane/standalone/pkthandler/pktiohandler/BUILD @@ -7,7 +7,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//dataplane/forwarding/util/queue", - "//dataplane/internal/kernel", + "//dataplane/kernel", "//dataplane/proto/packetio", "@com_github_golang_glog//:glog", "@org_golang_google_genproto_googleapis_rpc//status", @@ -21,7 +21,7 @@ go_test( srcs = ["pktiohandler_test.go"], embed = [":pktiohandler"], deps = [ - "//dataplane/internal/kernel", + "//dataplane/kernel", "//dataplane/proto/packetio", "@com_github_google_go_cmp//cmp", "@org_golang_google_grpc//codes", diff --git a/dataplane/standalone/pkthandler/pktiohandler/pktiohandler.go b/dataplane/standalone/pkthandler/pktiohandler/pktiohandler.go index 08032e33..57279885 100644 --- a/dataplane/standalone/pkthandler/pktiohandler/pktiohandler.go +++ b/dataplane/standalone/pkthandler/pktiohandler/pktiohandler.go @@ -27,7 +27,7 @@ import ( "google.golang.org/protobuf/encoding/protojson" "github.com/openconfig/lemming/dataplane/forwarding/util/queue" - "github.com/openconfig/lemming/dataplane/internal/kernel" + "github.com/openconfig/lemming/dataplane/kernel" log "github.com/golang/glog" diff --git a/dataplane/standalone/pkthandler/pktiohandler/pktiohandler_test.go b/dataplane/standalone/pkthandler/pktiohandler/pktiohandler_test.go index beee44e6..ebe2425d 100644 --- a/dataplane/standalone/pkthandler/pktiohandler/pktiohandler_test.go +++ b/dataplane/standalone/pkthandler/pktiohandler/pktiohandler_test.go @@ -24,7 +24,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/protobuf/testing/protocmp" - "github.com/openconfig/lemming/dataplane/internal/kernel" + "github.com/openconfig/lemming/dataplane/kernel" pktiopb "github.com/openconfig/lemming/dataplane/proto/packetio" )