mn::net Namespace Reference

Classes

class  basic_dgram_ip_socket
 Basic dram socket class. More...
 
class  basic_dgram_ip6_socket
 Basic dram socket class. More...
 
class  basic_endpoint
 This abstract basic class represents an endpoint/socket address. More...
 
class  basic_ip_endpoint
 This template basic class represents an ip endpoint/socket address. More...
 
class  basic_ip4_address
 This class represents an internet (IP) version 6 host address. More...
 
class  basic_ip4_endpoint
 
class  basic_ip4_socket
 This class represents an internet (IP) version 4 host socket. More...
 
class  basic_ip6_address
 This class represents an internet (IP) version 6 host address. More...
 
class  basic_ip6_endpoint
 This class represents an IPv6 endpoint/socket address. More...
 
class  basic_ip6_socket
 This class represents an internet (IP) version 6 host socket. More...
 
class  basic_ip_address
 Wrapper class around lwip implementation of a ip address. More...
 
class  basic_multicast_ip_socket
 A multicast_ip_socket is a special dgram_ip_socket that can be used to send packets to and receive packets from multicast groups. More...
 
class  basic_multicast_ip6_socket
 A basic_multicast_ip6_socket is a special dgram_ip6_socket that can be used to send packets to and receive packets from multicast groups. More...
 
class  basic_raw_ip4_socket
 This class provides an interface to a raw IPv4 socket. More...
 
class  basic_raw_ip6_socket
 This class provides an interface to a raw IPv6 socket. More...
 
class  basic_ip_socket
 Wrapper class around lwip implementation of a socket. More...
 
class  basic_stream_ip_socket
 This class provides an interface to a tcp IPv4 socket. More...
 
class  basic_stream_ip6_socket
 This class provides an interface to a tcp IPv6 socket. More...
 

Typedefs

using ip4_address = basic_ip4_address
 using basic_ip4_address for ip4_address More...
 
using ip4_endpoint = basic_ip4_endpoint
 using basic_ip4_endpoint for ip4_endpoint More...
 
using dgram_ip4_socket = basic_dgram_ip_socket
 using basic_dgram_ip_socket for dgram_ip4_socket More...
 
using multicast_ip4_socket = basic_multicast_ip_socket
 using basic_multicast_ip_socket for multicast_ip4_socket More...
 
using stream_ip4_socket = basic_stream_ip_socket
 using basic_ip6_address for stream_ip4_socket More...
 
using raw_ip4_socket = basic_raw_ip4_socket
 using basic_raw_ip4_socket for raw_ip4_socket More...
 
using ip6_address = basic_ip6_address
 using basic_ip6_address for ip6_address More...
 
using ip6_endpoint = basic_ip6_endpoint
 using basic_ip6_endpoint for ip6_endpoint More...
 
using dgram_ip6_socket = basic_dgram_ip6_socket
 using basic_dgram_ip6_socket for dgram_ip6_socket More...
 
using stream_ip6_socket = basic_stream_ip6_socket
 using basic_stream_ip6_socket for stream_ip6_socket More...
 
using raw_ip6_socket = basic_raw_ip6_socket
 using basic_raw_ip6_socket for raw_ip6_socket - - not IMPL More...
 

Enumerations

enum class  address_family { Unspecified = AF_UNSPEC , inet_v4 = AF_INET , inet_v6 = AF_INET6 }
 Defines socket address types for creating. More...
 
enum class  protocol_type : int {
  unspec = IPPROTO_IP , icmp = IPPROTO_ICMP , tcp = IPPROTO_TCP , udp = IPPROTO_UDP ,
  udp_lite = IPPROTO_UDPLITE , raw = IPPROTO_RAW
}
 Defines socket protoco types for creating. More...
 
enum class  socket_type : int { stream = SOCK_STREAM , dgram = SOCK_DGRAM , raw = SOCK_RAW }
 Defines socket socket types for creating. More...
 
enum class  socket_flags : int {
  none = 0x00 , out_of_band = MSG_OOB , peek = MSG_PEEK , wait_all = MSG_WAITALL ,
  non_blocking = MSG_DONTWAIT , more = MSG_MORE , no_signal = MSG_NOSIGNAL
}
 Specifies socket send and receive behaviors. More...
 
enum class  socket_shutdown_type : uint8_t { read = SHUT_RD , write = SHUT_WR , rw = SHUT_RDWR }
 Commands for lwip_shutdown. More...
 
enum class  socket_option_level : int {
  socket = SOL_SOCKET , ip = IPPROTO_IP , tcp = (int)protocol_type::tcp , udp = (int)protocol_type::udp ,
  udp_lite = (int)protocol_type::udp_lite
}
 Items for socket option levels for the mn_socket::set_options and mn_socket::get_options. More...
 
enum class  socket_option_name : int {
  debug = SO_DEBUG , acceptconn = SO_ACCEPTCONN , dont_route = SO_DONTROUTE , use_loopback = SO_USELOOPBACK ,
  linger = SO_LINGER , nolinger = SO_DONTLINGER , oob_inline = SO_OOBINLINE , reuse_port = SO_REUSEPORT ,
  reuse_addr = SO_REUSEADDR , sendbuffer = SO_SNDBUF , recivebuffer = SO_RCVBUF , send_lowat = SO_SNDLOWAT ,
  recive_lowat = SO_RCVLOWAT , send_timeout = SO_SNDTIMEO , recive_timeout = SO_RCVTIMEO , error = SO_ERROR ,
  get_type = SO_TYPE , commected_timeout = SO_CONTIMEO , no_check = SO_NO_CHECK , bind_device = SO_BINDTODEVICE ,
  broadcast = SO_BROADCAST , keepalive = SO_KEEPALIVE , tos = IP_TOS , ttl = IP_TTL
}
 Items for socket option name for the mn_socket::set_options and mn_socket::get_options. More...
 
enum  service_provides {
  tos_mask = IPTOS_TOS_MASK , low_delay = IPTOS_LOWDELAY , through_put = IPTOS_THROUGHPUT , reliability = IPTOS_RELIABILITY ,
  low_cost = IPTOS_LOWCOST , min_cost = IPTOS_MINCOST
}
 
enum class  ioctl_request_type { available = FIONREAD , non_blocking = FIONBIO }
 Commands for ioctlsocket(), taken from the BSD file fcntl.h. lwip_ioctl only supports FIONREAD and FIONBIO, for now. More...
 

Typedef Documentation

◆ dgram_ip4_socket

using basic_dgram_ip_socket for dgram_ip4_socket

◆ dgram_ip6_socket

using basic_dgram_ip6_socket for dgram_ip6_socket

◆ ip4_address

using basic_ip4_address for ip4_address

◆ ip4_endpoint

using basic_ip4_endpoint for ip4_endpoint

◆ ip6_address

using basic_ip6_address for ip6_address

◆ ip6_endpoint

using basic_ip6_endpoint for ip6_endpoint

◆ multicast_ip4_socket

◆ raw_ip4_socket

using basic_raw_ip4_socket for raw_ip4_socket

◆ raw_ip6_socket

using basic_raw_ip6_socket for raw_ip6_socket - - not IMPL

◆ stream_ip4_socket

using basic_ip6_address for stream_ip4_socket

◆ stream_ip6_socket

using basic_stream_ip6_socket for stream_ip6_socket

Enumeration Type Documentation

◆ address_family

Defines socket address types for creating.

Enumerator
Unspecified 

The address family is unspecified.

inet_v4 

The Internet Protocol version 4 (IPv4) address family.

inet_v6 

The Internet Protocol version 6 (IPv6) address family.

◆ ioctl_request_type

Commands for ioctlsocket(), taken from the BSD file fcntl.h. lwip_ioctl only supports FIONREAD and FIONBIO, for now.

Enumerator
available 

get # bytes to read

non_blocking 

set/clear non-blocking i/o

◆ protocol_type

enum mn::net::protocol_type : int
strong

Defines socket protoco types for creating.

Enumerator
unspec 
icmp 

@briefThe Internet Control Message Protocol (ICMP)

tcp 

The Transmission Control Protocol (TCP).

udp 

The User Datagram Protocol (UDP)

udp_lite 

This is an implementation of the Lightweight User Datagram Protocol (UDP-Lite), as described in RFC 3828.

raw 

Raw sockets allow new IPv4 protocols to be implemented in user space.

◆ service_provides

Enumerator
tos_mask 
low_delay 
through_put 
reliability 
low_cost 
min_cost 

◆ socket_flags

enum mn::net::socket_flags : int
strong

Specifies socket send and receive behaviors.

Enumerator
none 

Use no flags for this call.

out_of_band 

Processes Out Of Band (OOB) data.

peek 

Peeks at the incoming data. The data is copied into the buffer, but is not removed from the input queue.

wait_all 

@ brief The receive request will complete only when one of the following events occurs:

  • The buffer supplied by the caller is completely full.
  • The connection has been closed.
  • The request has been canceled or an error occurred.
non_blocking 

Nonblocking i/o for this operation only.

more 

Sender will send more.

no_signal 

Requests not to send any data on errors on stream oriented sockets when the other end breaks the connection.

◆ socket_option_level

enum mn::net::socket_option_level : int
strong

Items for socket option levels for the mn_socket::set_options and mn_socket::get_options.

Enumerator
socket 

options for socket level

ip 

options for IPv4 level

tcp 

options for TCP level

udp 

options for UDP level

udp_lite 

options for UDPLite level

◆ socket_option_name

enum mn::net::socket_option_name : int
strong

Items for socket option name for the mn_socket::set_options and mn_socket::get_options.

Enumerator
debug 

Enables debug output.

acceptconn 

Returns whether a socket is in listening mode.

dont_route 

Sets whether outgoing data should be sent on interface the socket is bound to and not a routed on some other interface.

use_loopback 

Use the local loopback address when sending data from this socket.

linger 

Lingers on close if unsent data is present.

nolinger 

Does not block close waiting for unsent data to be sent. Setting this option is equivalent to setting SO_LINGER with 0.

oob_inline 

Indicates that out-of-bound data should be returned in-line with regular data. This option is only valid for connection-oriented protocols that support out-of-band data.

reuse_port 

Allows the socket to be bound to an port that is already in use.

reuse_addr 

Allows the socket to be bound to an address that is already in use.

sendbuffer 

Specifies the total per-socket buffer space reserved for sends.

recivebuffer 

Specifies the total per-socket buffer space reserved for receives.

send_lowat 

This option sets the minimum number of bytes to process for socket output operations.

recive_lowat 

This option sets the minimum number of bytes to process for socket input operations.

send_timeout 

Sets the timeout, in milliseconds, for blocking send calls.

recive_timeout 

Sets the timeout, in milliseconds, for blocking receive calls.

error 

Get last error.

get_type 

Returns the socket type for the given socket (socket_type::stream or socket_type::dgram)

commected_timeout 

Unimplemented: connect timeout.

no_check 

don't create UDP checksum

bind_device 

TODO: e.

broadcast 

Configures a socket for sending broadcast data.

keepalive 

Enables sending keep-alive packets for a socket connection.

tos 
ttl 

◆ socket_shutdown_type

enum mn::net::socket_shutdown_type : uint8_t
strong

Commands for lwip_shutdown.

Enumerator
read 

receptions will be disallowed

write 

transmissions will be disallowed

rw 

receptions and transmissions will be disallowed

◆ socket_type

enum mn::net::socket_type : int
strong

Defines socket socket types for creating.

Enumerator
stream 

Socket type for stream (tcp)

dgram 

Socket type for datagram (udp for example)

raw 

A socket type that provides a raw socket that allows an application to manipulate the next upper-layer protocol header.