EthernetPortal.h Source File

Simu5G: EthernetPortal.h Source File
Simu5G
EthernetPortal.h
1//
2// Simu5G
3//
4// Copyright (C) 2026 Andras Varga (OpenSim Ltd)
5//
6// This file is part of a software released under the license included in file
7// "license.pdf". Please read LICENSE and README files before using it.
8// The above files and the present reference are part of the software itself,
9// and cannot be removed from it.
10//
11
12#ifndef _ETHERNETPORTAL_H_
13#define _ETHERNETPORTAL_H_
14
15#include <inet/common/packet/Packet.h>
16#include <inet/networklayer/common/NetworkInterface.h>
17#include <inet/queueing/contract/IPassivePacketSink.h>
18
19namespace simu5g {
20
26class EthernetPortal : public omnetpp::cSimpleModule, public virtual inet::queueing::IPassivePacketSink
27{
28 protected:
29 inet::NetworkInterface *networkInterface_ = nullptr;
30
31 protected:
32 int numInitStages() const override { return inet::NUM_INIT_STAGES; }
33 void initialize(int stage) override;
34 void handleMessage(omnetpp::cMessage *msg) override;
35
36 public:
37 bool canPushSomePacket(const omnetpp::cGate *gate) const override { return true; }
38 bool canPushPacket(inet::Packet *packet, const omnetpp::cGate *gate) const override { return true; }
39 void pushPacket(inet::Packet *packet, const omnetpp::cGate *gate) override;
40 void pushPacketStart(inet::Packet *packet, const omnetpp::cGate *gate, inet::bps datarate) override { throw omnetpp::cRuntimeError("EthernetPortal: packet streaming is not supported"); }
41 void pushPacketEnd(inet::Packet *packet, const omnetpp::cGate *gate) override { throw omnetpp::cRuntimeError("EthernetPortal: packet streaming is not supported"); }
42 void pushPacketProgress(inet::Packet *packet, const omnetpp::cGate *gate, inet::bps datarate, inet::b position, inet::b extraProcessableLength = inet::b(0)) override { throw omnetpp::cRuntimeError("EthernetPortal: packet streaming is not supported"); }
43};
44
45} //namespace
46
47#endif
Definition EthernetPortal.h:27
Definition AlertReceiver.h:24