ladybird/Kernel/Net/LoopbackAdapter.h
Liav A 3f63be949a Kernel/Net: Don't allocate memory for adapters' names
Instead, use a FixedStringBuffer to store a string with up to 16 chars.
2023-08-12 11:48:48 -06:00

31 lines
889 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <Kernel/Net/NetworkAdapter.h>
namespace Kernel {
class LoopbackAdapter final : public NetworkAdapter {
private:
LoopbackAdapter(StringView);
public:
static ErrorOr<NonnullRefPtr<LoopbackAdapter>> try_create();
virtual ~LoopbackAdapter() override;
virtual ErrorOr<void> initialize(Badge<NetworkingManagement>) override { VERIFY_NOT_REACHED(); }
virtual void send_raw(ReadonlyBytes) override;
virtual StringView class_name() const override { return "LoopbackAdapter"sv; }
virtual Type adapter_type() const override { return Type::Loopback; }
virtual bool link_up() override { return true; }
virtual bool link_full_duplex() override { return true; }
virtual int link_speed() override { return 1000; }
};
}