blob: bef644b8434623ac62be6a5e734335e604ece966 [file] [log] [blame]
Taoyu Li906553a2019-10-18 13:44:41 +09001// Copyright 2019 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Garrick Evans3388a032020-03-24 11:25:55 +09005#include "patchpanel/ndproxy.h"
Taoyu Li906553a2019-10-18 13:44:41 +09006
Garrick Evans3388a032020-03-24 11:25:55 +09007namespace patchpanel {
Taoyu Li906553a2019-10-18 13:44:41 +09008
9namespace {
10
Taoyu Lie47df4a2019-11-08 12:48:57 +090011constexpr MacAddress guest_if_mac({0xd2, 0x47, 0xf7, 0xc5, 0x9e, 0x53});
Taoyu Li906553a2019-10-18 13:44:41 +090012
13extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
14 // Turn off logging.
15 logging::SetMinLogLevel(logging::LOG_FATAL);
16
Taoyu Li18041fe2019-11-13 15:49:31 +090017 uint8_t* out_buffer_extended = new uint8_t[size + 4];
18 uint8_t* out_buffer = NDProxy::AlignFrameBuffer(out_buffer_extended);
Taoyu Lie47df4a2019-11-08 12:48:57 +090019 NDProxy ndproxy;
20 ndproxy.Init();
21 ndproxy.TranslateNDFrame(data, size, guest_if_mac, out_buffer);
Taoyu Li18041fe2019-11-13 15:49:31 +090022 delete[] out_buffer_extended;
Taoyu Li906553a2019-10-18 13:44:41 +090023
24 return 0;
25}
26
27} // namespace
Garrick Evans3388a032020-03-24 11:25:55 +090028} // namespace patchpanel