50 pTransport_ = std::move(pTransport);
52 pTransport_->setDownstreamTransport(
this);
62 "IPv4 or IPv6 NEM Platform Service endpoint.");
64 configRegistrar.registerNonNumeric<
INETAddr>(
"transportendpoint",
67 "IPv4 or IPv6 Transport endpoint.");
69 configRegistrar.registerNonNumeric<std::string>(
"protocol",
72 "Defines the protocl used for communictation:" 81 for(
const auto & item : update)
83 if(item.first ==
"platformendpoint")
85 platformEndpointAddr_ = item.second[0].asINETAddr();
89 "TRANS %03hu TransportAdapterImpl::configure %s: %s",
92 platformEndpointAddr_.
str().c_str());
95 else if(item.first ==
"transportendpoint")
97 transportEndpointAddr_ = item.second[0].asINETAddr();
101 "TRANS %03hu TransportAdapterImpl::configure %s: %s",
104 transportEndpointAddr_.
str().c_str());
106 else if(item.first ==
"protocol")
108 std::string sProtocol{item.second[0].asString()};
110 protocol_ = sProtocol ==
"udp" ?
116 "NEM %03hu TransportAdapterImpl::configure %s: %s",
123 throw makeException<ConfigureException>(
"TransportAdapterImpl: " 124 "Unexpected configuration item %s",
134 throw makeException<StartException>(
"TransportAdapterImpl transport not set for NEM %hu",
140 open(transportEndpointAddr_, platformEndpointAddr_,protocol_);
147 pTransport_->start();
152 pTransport_->postStart();
163 pTransport_->destroy();
181 void EMANE::Application::TransportAdapterImpl::doProcessPacketMessage(
const PacketInfo & packetInfo,
182 const void * pPacketData,
190 pTransport_->processUpstreamPacket(pkt,msgs);
193 void EMANE::Application::TransportAdapterImpl::doProcessControlMessage(
const ControlMessages & msgs)
195 pTransport_->processUpstreamControl(msgs);
A Packet class that allows upstream processing to strip layer headers as the packet travels up the st...
const PacketInfo & getPacketInfo() const
The Registrar interface provides access to all of the emulator registrars.
virtual ConfigurationRegistrar & configurationRegistrar()=0
std::list< const ControlMessage * > ControlMessages
void sendPacketMessage(const PacketInfo &packetInfo, const void *pPacketData, size_t packetLength, const ControlMessages &msgs)
void registerNonNumeric(const std::string &sName, const ConfigurationProperties &properties=ConfigurationProperties::NONE, const std::initializer_list< T > &values={}, const std::string &sUsage="", std::size_t minOccurs=1, std::size_t maxOccurs=1, const std::string &sRegexPattern={})
void open(const INETAddr &localAddress, const INETAddr &remoteAddress, Protocol protocol)
void initialize(Registrar ®istrar) override
void sendControlMessage(const ControlMessages &msgs)
Store source, destination, creation time and priority information for a packet.
void processDownstreamPacket(DownstreamPacket &pkt, const ControlMessages &msgs)
const char * what() const
void postStart() override
Specialized packet the allows downstream processing to add layer specific headers as the packet trave...
std::string str(bool bWithPort=true) const
void configure(const ConfigurationUpdate &update) override
void processDownstreamControl(const ControlMessages &msgs)
void setTransport(std::unique_ptr< NEMLayer > &pTransport) override
virtual void setUpstreamTransport(UpstreamTransport *pUpstreamTransport)
Transport Adapter interface. A Transport Adapter combines with a Transport to connect with its respec...
Exception thrown by the during BoundaryMessageManagerException to indicate connection failure...
Component start exception is used to indicate an exception during transition to the start state...
std::vector< ConfigurationNameAnyValues > ConfigurationUpdate
Utils::VectorIO getVectorIO() const
#define LOGGER_STANDARD_LOGGING(logger, level, fmt, args...)
static LogService * instance()
TransportAdapterImpl(NEMId id)