1
0
Fork 0

only send packets for enabled IP protocols

This commit is contained in:
Kevin Matz 2022-11-26 12:36:42 -05:00
parent ab0c2f0e62
commit 79ba3a18b7
1 changed files with 27 additions and 0 deletions

View File

@ -23,6 +23,7 @@
*/
#include "component.h"
#include "sdt/sdt.h"
#include "tcp.h"
#include "udp.h"
@ -72,6 +73,19 @@ void Component::rlpSendUdp (const uint32_t vector,
const PDU::Message<PDU::pdu_data> data,
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.
auto rlp = std::make_shared<RLP::Pdu>();
rlp->setVector(vector);
@ -119,6 +133,19 @@ void Component::rlpSendTcp (const uint32_t vector,
const PDU::Message<PDU::pdu_data> data,
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.
auto rlp = std::make_shared<RLP::Pdu>();
rlp->setVector(vector);