arc: Move platform2/arc/network/ to platform2/patchpanel
Next step in the arc-networkd -> patchpanel rename, this patch moves the
location of the code.
BUG=b:151879931
TEST=units,flashed image to atlas
TEST=tasts arc.PlayStore, crostini.LaunchTerminal.download
Change-Id: I1b5cf8d670e1631d46f6449b725395157bf88dde
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2115863
Tested-by: Garrick Evans <garrick@chromium.org>
Commit-Queue: Garrick Evans <garrick@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-by: Hugo Benichi <hugobenichi@google.com>
diff --git a/patchpanel/multicast_forwarder_fuzzer.cc b/patchpanel/multicast_forwarder_fuzzer.cc
new file mode 100644
index 0000000..632cb73
--- /dev/null
+++ b/patchpanel/multicast_forwarder_fuzzer.cc
@@ -0,0 +1,30 @@
+// Copyright 2019 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "patchpanel/multicast_forwarder.h"
+#include "patchpanel/net_util.h"
+
+namespace patchpanel {
+
+constexpr const struct in_addr kLanIp = {.s_addr = Ipv4Addr(192, 168, 1, 1)};
+constexpr const struct in_addr kGuestIp = {.s_addr = Ipv4Addr(100, 115, 92, 2)};
+
+namespace {
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ // Turn off logging.
+ logging::SetMinLogLevel(logging::LOG_FATAL);
+
+ // Copy the input data so that TranslateMdnsIp can mutate it.
+ char* payload = new char[size];
+ memcpy(payload, data, size);
+
+ MulticastForwarder::TranslateMdnsIp(kLanIp, kGuestIp, payload, size);
+
+ delete[] payload;
+ return 0;
+}
+
+} // namespace
+} // namespace patchpanel