4.2.0.0R6
Software Development Kit
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
ltrx_network.h File Reference

Definitions related to Networking. More...

Data Structures

struct  ltrx_ip_address
 
struct  ltrx_network_protocol
 Represents a network protocol for registration. More...
 
struct  ltrx_tcp_listener
 Abstract structure containing data for TCP listener. More...
 
struct  ltrx_udp_socket_options
 Contains parameters for ltrx_udp_socket_open_with_options(). More...
 

Macros

#define LTRX_IP_ADDRESS_STATE__ALL_INTERFACES   0xff
 
#define LTRX_IP_ADDRESS_STATE__NON_AP_INTERFACES   0xfe
 
#define LTRX_TCP_LISTENER__ANY_INTERFACE   0xff
 

Enumerations

enum  ltrx_network_allowed_protocols_flag {
  LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__REQUIRE_NONBLOCKING = 0x0001, LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__CLIENT = 0x0002, LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__SERVER = 0x0004, LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__TCP = 0x0008,
  LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__UDP = 0x0010
}
 
enum  ltrx_network_protocol_shutdown { LTRX_NETWORK_PROTOCOL_SHUTDOWN__SEND = 0, LTRX_NETWORK_PROTOCOL_SHUTDOWN__RECEIVE = 1, LTRX_NETWORK_PROTOCOL_SHUTDOWN__BOTH = 2 }
 
enum  ltrx_network_return { LTRX_NETWORK_RETURN__WORKING, LTRX_NETWORK_RETURN__SUCCESS, LTRX_NETWORK_RETURN__FAILURE }
 

Functions

bool ltrx_host_lookup (const char *hostname, uint32_t timeout_ms, uint8_t *zeroBasedInterface, struct ltrx_ip_address *ipaddr)
 Host lookup. More...
 
uint8_t ltrx_ip_address_state (uint8_t zeroBasedInterface)
 Are IP interfaces up? More...
 
void ltrx_ip_addresses_get (uint8_t zeroBasedInterface, struct ltrx_ip_address addressArray[], uint8_t addressCount)
 Get all IP addresses for an interface. More...
 
bool ltrx_ip_and_port_display (char *outputBuffer, size_t bufferLength, const struct ltrx_ip_address *ipAddress, uint16_t port)
 Print an IP address and port. More...
 
bool ltrx_ip_display (char *outputBuffer, size_t bufferLength, const struct ltrx_ip_address *ipAddress)
 Print an IP address. More...
 
size_t ltrx_ip_socket_can_send (struct ltrx_ip_socket *socket)
 How much data can be sent? More...
 
void ltrx_ip_socket_get_local_information (struct ltrx_ip_socket *socket, int32_t *optZeroBasedInterface, uint16_t *optLocalPort)
 Get local information. More...
 
void ltrx_ip_socket_get_peer_information (struct ltrx_ip_socket *socket, struct ltrx_ip_address *optRemoteAddress, uint16_t *optRemotePort)
 Get peer information. More...
 
bool ltrx_ip_socket_has_data (struct ltrx_ip_socket *socket, uint32_t blockTimeMsec)
 Is data available? More...
 
size_t ltrx_ip_socket_receive (struct ltrx_ip_socket *socket, uint8_t **dataPointerLocation, size_t length)
 Receive data. More...
 
bool ltrx_ip_socket_send (struct ltrx_ip_socket *socket, const void *data, size_t length, bool push)
 Send data. More...
 
void ltrx_ip_socket_shutdown (struct ltrx_ip_socket *socket, enum ltrx_network_protocol_shutdown how)
 Socket shutdown. More...
 
const char * ltrx_network_allowed_protocols (unsigned int zeroBasedIterator, enum ltrx_network_allowed_protocols_flag flags)
 Iterate through allowed protocols. More...
 
bool ltrx_network_get_mac_address (uint8_t zeroBasedInterface, void *mac, size_t size)
 Get MAC address. More...
 
const struct
vardef_values_interface * 
ltrx_network_interface_configuration_get (uint8_t zeroBasedInterface)
 Get Interface configuration. More...
 
const char * ltrx_network_interface_get_name (uint8_t zeroBasedInterface)
 Get Interface name. More...
 
const struct
ltrx_network_protocol
ltrx_network_lookup_network_protocol (const char *protocolName, enum ltrx_network_allowed_protocols_flag flags)
 Lookup a protocol. More...
 
void ltrx_network_register_protocol (const struct ltrx_network_protocol *lnp)
 Register a network protocol. More...
 
struct ltrx_ip_socket * ltrx_tcp_accept (struct ltrx_tcp_listener *listener, struct ltrx_trigger *optReceiveEventTrigger)
 Accept a connection request. More...
 
struct ltrx_ip_socket * ltrx_tcp_connect (uint16_t optLocalPort, const char *remoteAddress, uint16_t remotePort, struct ltrx_trigger *optReceiveEventTrigger)
 Make connection. More...
 
bool ltrx_tcp_listen (const struct ltrx_tcp_listener *listener, uint32_t blockTimeMsec)
 Begin listening. More...
 
bool ltrx_tcp_listener_begin (struct ltrx_tcp_listener *listener, uint8_t zeroBasedInterface, uint16_t localPort, uint8_t backlog, struct ltrx_trigger *optListenerTrigger)
 Begin listening. More...
 
void ltrx_tcp_listener_end (struct ltrx_tcp_listener *listener)
 End listening. More...
 
bool ltrx_tcp_socket_close (struct ltrx_ip_socket *socket, uint32_t lingerMsec)
 Close socket. More...
 
bool ltrx_tcp_socket_is_closed (struct ltrx_ip_socket *socket)
 Is TCP socket closed? More...
 
bool ltrx_tcp_socket_is_eof (struct ltrx_ip_socket *socket)
 Is receive at end of file? More...
 
bool ltrx_tcp_socket_send (struct ltrx_ip_socket *sock, const void *data, size_t length, bool push)
 Send data. More...
 
enum ltrx_network_return ltrx_tcp_socket_send_nonblocking (struct ltrx_ip_socket *socket, const void *data, size_t length, bool push, struct ltrx_trigger *sendTrigger)
 Send data non-blocking. More...
 
void ltrx_tcp_socket_shutdown (struct ltrx_ip_socket *socket)
 Socket shutdown. More...
 
void ltrx_udp_socket_close (struct ltrx_ip_socket *sock)
 Close socket. More...
 
bool ltrx_udp_socket_get_received_packet_information (struct ltrx_ip_socket *sock, struct ltrx_ip_address *optRemoteAddress, uint16_t *optRemotePort)
 Get received packet information. More...
 
bool ltrx_udp_socket_is_active (struct ltrx_ip_socket *sock)
 Check if the UDP socket is active. More...
 
bool ltrx_udp_socket_multicast_join (uint8_t zeroBasedInterface, struct ltrx_ip_address *groupAddress)
 Multicast join. More...
 
struct ltrx_ip_socket * ltrx_udp_socket_open (uint8_t zeroBasedInterface, uint16_t optLocalPort)
 Open socket. More...
 
struct ltrx_ip_socket * ltrx_udp_socket_open_with_options (const struct ltrx_udp_socket_options *luso)
 Open socket with options. More...
 
bool ltrx_udp_socket_reply (struct ltrx_ip_socket *socket, size_t length)
 Send reply. More...
 
bool ltrx_udp_socket_send (struct ltrx_ip_socket *sock, const struct ltrx_ip_address *address, uint16_t port, const void *data, size_t length)
 Send data. More...
 

Detailed Description

Definitions related to Networking.