quic/qbox
Loading...
Searching...
No Matches
systemc-components
common
include
backends
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
17
class
NetworkBackendTap
:
public
NetworkBackend
,
public
sc_core::sc_module
18
{
19
private
:
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
30
public
:
31
NetworkBackendTap
(sc_core::sc_module_name name, std::string
tun
);
32
33
virtual
~NetworkBackendTap
();
34
35
void
send(
Payload
&
frame
);
36
};
NetworkBackendTap
Definition
tap.h:18
NetworkBackend
Definition
net-backend.h:13
Payload
Definition
payload.h:15
QemuTargetSocket
Definition
target.h:160
gs::async_event
Definition
async_event.h:22
Generated by
1.9.8