blob: 85299ac9e3e0bf66bd0392e5af5e908ffc6707b3 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <fbl/ref_ptr.h>
#include "src/connectivity/overnet/lib/embedded/udp_nub.h"
#include "src/connectivity/overnet/lib/omdp/omdp.h"
namespace overnet {
class OmdpNub final : public OvernetEmbedded::Actor, private Omdp {
public:
OmdpNub(OvernetEmbedded* root, UdpNub* udp_nub);
~OmdpNub();
Status Start() override;
private:
void OnNewNode(uint64_t node_id, IpAddr addr) override;
void Broadcast(Slice slice) override;
void WaitForInbound();
void InboundReady(const Status& status);
HostReactor* const reactor_;
UdpNub* const udp_nub_;
Timer* const timer_;
Socket incoming_;
};
} // namespace overnet