only send packets for enabled IP protocols
This commit is contained in:
parent
ab0c2f0e62
commit
79ba3a18b7
@ -23,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "component.h"
|
#include "component.h"
|
||||||
|
#include "sdt/sdt.h"
|
||||||
#include "tcp.h"
|
#include "tcp.h"
|
||||||
#include "udp.h"
|
#include "udp.h"
|
||||||
|
|
||||||
@ -72,6 +73,19 @@ void Component::rlpSendUdp (const uint32_t vector,
|
|||||||
const PDU::Message<PDU::pdu_data> data,
|
const PDU::Message<PDU::pdu_data> data,
|
||||||
const SDT::UDP::ipAddress& ip)
|
const SDT::UDP::ipAddress& ip)
|
||||||
{
|
{
|
||||||
|
switch (ip.type) {
|
||||||
|
case ACN::SDT::SDT_ADDR_IPV4:
|
||||||
|
if (!enable_IPv4)
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
case ACN::SDT::SDT_ADDR_IPV6:
|
||||||
|
if (!enable_IPv6)
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/// Constructs an RLP PDU.
|
/// Constructs an RLP PDU.
|
||||||
auto rlp = std::make_shared<RLP::Pdu>();
|
auto rlp = std::make_shared<RLP::Pdu>();
|
||||||
rlp->setVector(vector);
|
rlp->setVector(vector);
|
||||||
@ -119,6 +133,19 @@ void Component::rlpSendTcp (const uint32_t vector,
|
|||||||
const PDU::Message<PDU::pdu_data> data,
|
const PDU::Message<PDU::pdu_data> data,
|
||||||
const SDT::UDP::ipAddress& ip)
|
const SDT::UDP::ipAddress& ip)
|
||||||
{
|
{
|
||||||
|
switch (ip.type) {
|
||||||
|
case ACN::SDT::SDT_ADDR_IPV4:
|
||||||
|
if (!enable_IPv4)
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
case ACN::SDT::SDT_ADDR_IPV6:
|
||||||
|
if (!enable_IPv6)
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/// Constructs an RLP PDU.
|
/// Constructs an RLP PDU.
|
||||||
auto rlp = std::make_shared<RLP::Pdu>();
|
auto rlp = std::make_shared<RLP::Pdu>();
|
||||||
rlp->setVector(vector);
|
rlp->setVector(vector);
|
||||||
|
Loading…
Reference in New Issue
Block a user