osbase/net/dhcp4c: move package out of metropolis
Move the dhcp4c package from metropolis/node/core/network/dhcp4c to
osbase/net/dhcp4c. The package is not specific to metropolis, and is
also used by nanoswitch and cloud/agent.
Change-Id: I508261c93c623d5b7a33a2089da11625b7a3abd0
Reviewed-on: https://review.monogon.dev/c/monogon/+/4565
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/osbase/net/dhcp4c/callback/BUILD.bazel b/osbase/net/dhcp4c/callback/BUILD.bazel
new file mode 100644
index 0000000..a8780fc
--- /dev/null
+++ b/osbase/net/dhcp4c/callback/BUILD.bazel
@@ -0,0 +1,33 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("//osbase/test/ktest:ktest.bzl", "k_test")
+
+go_library(
+ name = "callback",
+ srcs = ["callback.go"],
+ importpath = "source.monogon.dev/osbase/net/dhcp4c/callback",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//osbase/net/dhcp4c",
+ "@com_github_insomniacslk_dhcp//dhcpv4",
+ "@com_github_vishvananda_netlink//:netlink",
+ "@org_golang_x_sys//unix",
+ ],
+)
+
+go_test(
+ name = "callback_test",
+ srcs = ["callback_test.go"],
+ embed = [":callback"],
+ deps = [
+ "//osbase/net/dhcp4c",
+ "@com_github_google_go_cmp//cmp",
+ "@com_github_insomniacslk_dhcp//dhcpv4",
+ "@com_github_vishvananda_netlink//:netlink",
+ "@org_golang_x_sys//unix",
+ ],
+)
+
+k_test(
+ name = "ktest",
+ tester = ":callback_test",
+)