quic/qbox
Loading...
Searching...
No Matches
tap.h
1/*
2 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
3 * Author: GreenSocs 2022
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#pragma once
9
10#include <mutex>
11#include <queue>
12
13#include <backends/net-backend.h>
14
15#include <async_event.h>
16
17class NetworkBackendTap : public NetworkBackend, public sc_core::sc_module
18{
19private:
20 gs::async_event m_event;
21 std::queue<Payload*> m_queue;
22 std::mutex m_mutex;
23 int m_fd;
24
25 void open(std::string& tun);
26 void* rcv_thread();
27 void rcv();
28 void close();
29
30public:
31 NetworkBackendTap(sc_core::sc_module_name name, std::string tun);
32
33 virtual ~NetworkBackendTap();
34
35 void send(Payload& frame);
36};
Definition tap.h:18
Definition net-backend.h:13
Definition payload.h:15
Definition target.h:160
Definition async_event.h:22