UdpConfig¶
struct nmeasim::io::UdpConfig ยท Library API
Settings of a UDP output, applied when the transport is opened.
#include <nmeasim/io/transports/udp_transport.hpp>
Declared in src/io/include/nmeasim/io/transports/udp_transport.hpp (line 23)
Summary¶
Public types
| Name | Description |
|---|---|
Mode |
How datagrams are addressed; the profile key mode. |
Public data members
| Name | Description |
|---|---|
mode |
Addressing mode. |
address |
Destination address as an IPv4 literal such as 192.168.1.255 or 239.192.0.1. |
port |
Destination UDP port. |
interface_name |
Network interface to send from, by system name (eth0, en0) or descriptive name; empty lets the operating system choose. |
multicast_ttl |
Time to live of multicast datagrams, in router hops; ignored in the other modes. |
Public types¶
Mode¶
enum class Mode
How datagrams are addressed; the profile key mode.
| Enumerator | Value | Description |
|---|---|---|
Unicast |
To a single host; the profile value unicast. |
|
Broadcast |
To every host on a subnet; the profile value broadcast. |
|
Multicast |
To the members of a multicast group; the profile value multicast. |
Declared in src/io/include/nmeasim/io/transports/udp_transport.hpp:25
Public data members¶
mode¶
Mode mode{Mode::Unicast}
Addressing mode.
It decides how an empty address is resolved and whether multicast_ttl applies; the address itself is not checked against it.
Declared in src/io/include/nmeasim/io/transports/udp_transport.hpp:35
address¶
QString address{QStringLiteral("127.0.0.1")}
Destination address as an IPv4 literal such as 192.168.1.255 or 239.192.0.1.
Host names are not resolved: an address that does not parse, or an IPv6 address, makes UdpTransport::open fail. In broadcast mode an empty address resolves to the subnet broadcast address of interface_name, or to the limited broadcast address 255.255.255.255 when no interface is chosen or the interface has no broadcast address. Leading and trailing spaces are ignored.
Declared in src/io/include/nmeasim/io/transports/udp_transport.hpp:43
port¶
quint16 port{10110}
Destination UDP port.
Declared in src/io/include/nmeasim/io/transports/udp_transport.hpp:45
interface_name¶
QString interface_name
Network interface to send from, by system name (eth0, en0) or descriptive name; empty lets the operating system choose.
When set, the interface must be up and running and have an IPv4 address. It is looked up once, with find_ipv4_interface; the datagrams leave from its first IPv4 address, and in multicast mode it is also the multicast egress.
Declared in src/io/include/nmeasim/io/transports/udp_transport.hpp:52
multicast_ttl¶
int multicast_ttl{1}
Time to live of multicast datagrams, in router hops; ignored in the other modes.
The default of 1 keeps the datagrams on the local subnet. The value is passed to the socket unchecked; IP limits it to [0, 255].
Declared in src/io/include/nmeasim/io/transports/udp_transport.hpp:57