A transport that communicates over IPv4 unicast UDP tunnel.
More...
#include <udp-unicast.hpp>
Inherits ndnph::transport::Transport, and ndnph::transport::DynamicRxQueueMixin.
|
| | UdpUnicastTransport (size_t bufLen=DEFAULT_BUFLEN) |
| |
| | ~UdpUnicastTransport () override |
| |
| bool | beginListen (const sockaddr_in *laddr) |
| | Start listening on given local IPv4 address.
|
| |
| bool | beginListen (const sockaddr_in6 *laddr, int v6only=-1) |
| | Start listening on given local IPv6 address.
|
| |
| bool | beginListen (uint16_t localPort=6363) |
| | Start listening on given local port for both IPv4 and IPv6.
|
| |
| bool | beginTunnel (const sockaddr_in *raddr) |
| | Connect to given remote IPv4 address.
|
| |
| bool | beginTunnel (const sockaddr_in6 *raddr, int v6only=-1) |
| | Connect to given remote IPv6 address.
|
| |
| bool | beginTunnel (std::initializer_list< uint8_t > remoteHost, uint16_t remotePort=6363) |
| | Connect to given remote IP and port.
|
| |
| bool | end () |
| | Stop listening or close connection.
|
| |
| virtual | ~Transport ()=default |
| |
| bool | isUp () const |
| | Determine whether transport is connected.
|
| |
| void | loop () |
| | Process periodical events, such as receiving packets.
|
| |
| void | setRxCallback (RxCallback cb, void *ctx) |
| | Set incoming packet callback.
|
| |
| bool | send (const uint8_t *pkt, size_t pktLen, uint64_t endpointId=0) |
| | Synchronously transmit a packet.
|
| |
|
| bool | doIsUp () const final |
| |
| void | doLoop () final |
| |
| bool | doSend (const uint8_t *pkt, size_t pktLen, uint64_t endpointId) final |
| |
A transport that communicates over IPv4 unicast UDP tunnel.
◆ UdpUnicastTransport()
| ndnph::port_transport_socket::UdpUnicastTransport::UdpUnicastTransport |
( |
size_t |
bufLen = DEFAULT_BUFLEN | ) |
|
|
inlineexplicit |
◆ ~UdpUnicastTransport()
| ndnph::port_transport_socket::UdpUnicastTransport::~UdpUnicastTransport |
( |
| ) |
|
|
inlineoverride |
◆ beginListen() [1/3]
| bool ndnph::port_transport_socket::UdpUnicastTransport::beginListen |
( |
const sockaddr_in * |
laddr | ) |
|
|
inline |
Start listening on given local IPv4 address.
- Parameters
-
| laddr | local IPv4 address and UDP port. |
- Returns
- whether success.
◆ beginListen() [2/3]
| bool ndnph::port_transport_socket::UdpUnicastTransport::beginListen |
( |
const sockaddr_in6 * |
laddr, |
|
|
int |
v6only = -1 |
|
) |
| |
|
inline |
Start listening on given local IPv6 address.
- Parameters
-
| laddr | local IPv6 address and UDP port. |
| v6only | IPV6_V6ONLY socket option: 0=no, 1=yes, -1=unchanged. |
- Returns
- whether success.
◆ beginListen() [3/3]
| bool ndnph::port_transport_socket::UdpUnicastTransport::beginListen |
( |
uint16_t |
localPort = 6363 | ) |
|
|
inline |
Start listening on given local port for both IPv4 and IPv6.
- Returns
- whether success.
◆ beginTunnel() [1/3]
| bool ndnph::port_transport_socket::UdpUnicastTransport::beginTunnel |
( |
const sockaddr_in * |
raddr | ) |
|
|
inline |
Connect to given remote IPv4 address.
- Parameters
-
| raddr | remote IPv4 address and UDP port. |
- Returns
- whether success.
◆ beginTunnel() [2/3]
| bool ndnph::port_transport_socket::UdpUnicastTransport::beginTunnel |
( |
const sockaddr_in6 * |
raddr, |
|
|
int |
v6only = -1 |
|
) |
| |
|
inline |
Connect to given remote IPv6 address.
- Parameters
-
| raddr | remote IPv6 address and UDP port. |
| v6only | IPV6_V6ONLY socket option: 0=no, 1=yes, -1=unchanged. |
- Returns
- whether success.
◆ beginTunnel() [3/3]
| bool ndnph::port_transport_socket::UdpUnicastTransport::beginTunnel |
( |
std::initializer_list< uint8_t > |
remoteHost, |
|
|
uint16_t |
remotePort = 6363 |
|
) |
| |
|
inline |
Connect to given remote IP and port.
- Parameters
-
| remoteHost | four octets to represent IPv4 address. |
| remotePort | port number. |
◆ doIsUp()
| bool ndnph::port_transport_socket::UdpUnicastTransport::doIsUp |
( |
| ) |
const |
|
inlinefinalprivatevirtual |
◆ doLoop()
| void ndnph::port_transport_socket::UdpUnicastTransport::doLoop |
( |
| ) |
|
|
inlinefinalprivatevirtual |
◆ doSend()
| bool ndnph::port_transport_socket::UdpUnicastTransport::doSend |
( |
const uint8_t * |
pkt, |
|
|
size_t |
pktLen, |
|
|
uint64_t |
endpointId |
|
) |
| |
|
inlinefinalprivatevirtual |
◆ end()
| bool ndnph::port_transport_socket::UdpUnicastTransport::end |
( |
| ) |
|
|
inline |
Stop listening or close connection.
The documentation for this class was generated from the following file:
- /home/runner/work/esp8266ndn/NDNph/src/ndnph/port/transport/socket/udp-unicast.hpp