From cac0554c72e7f02965c53406efa308e1cffaa67b Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 16 Jul 2025 11:38:30 +0200 Subject: Add support for UDP EDI input to specify local interface IP --- src/input/Edi.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/input/Edi.cpp b/src/input/Edi.cpp index 141641f..b100f32 100644 --- a/src/input/Edi.cpp +++ b/src/input/Edi.cpp @@ -80,6 +80,7 @@ Edi::~Edi() { void Edi::open(const std::string& name) { const std::regex re_udp("udp://:([0-9]+)"); + const std::regex re_udp_bindto("udp://([^:]+):([0-9]+)"); const std::regex re_udp_multicast("udp://@([0-9.]+):([0-9]+)"); const std::regex re_udp_multicast_bindto("udp://([0-9.])+@([0-9.]+):([0-9]+)"); const std::regex re_tcp("tcp://(.*):([0-9]+)"); @@ -98,6 +99,12 @@ void Edi::open(const std::string& name) m_udp_sock.reinit(udp_port); m_udp_sock.setBlocking(false); } + else if (std::regex_match(name, m, re_udp_bindto)) { + const int udp_port = std::stoi(m[2].str()); + m_input_used = InputUsed::UDP; + m_udp_sock.reinit(udp_port, m[1].str()); + m_udp_sock.setBlocking(false); + } else if (std::regex_match(name, m, re_udp_multicast_bindto)) { const string bind_to = m[1].str(); const string multicast_address = m[2].str(); -- cgit v1.2.3