3.0.0.0R11
Software Development Kit
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
Protocols

Data Structures

struct  input_stream_from_open_abstract_socket
 Concrete struct for an abstract network protocol input stream. More...
 
struct  ltrx_network_protocol
 Represents a network protocol for registration. More...
 
struct  output_stream_to_open_abstract_socket
 Concrete struct for a network protocol output stream. More...
 

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

const char * ltrx_network_allowed_protocols (unsigned int zeroBasedIterator, enum ltrx_network_allowed_protocols_flag flags)
 Iterate through allowed protocols. 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...
 
bool ltrx_output_stream_init_to_open_abstract_socket (struct output_stream_to_open_abstract_socket *outStream, struct ltrx_ip_socket *lis, const struct ltrx_network_protocol *lnp, struct ltrx_network_protocol_handle *lnph)
 Set up an output stream to an open socket. More...
 

Detailed Description

Protocols facilitates modular addition of network protocols on top of either TCP or UDP.

Enumeration Type Documentation

Used by ltrx_network_allowed_protocols() and ltrx_network_lookup_network_protocol().

More than one of these values may be "or'ed" together.

If neither LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__TCP nor LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__UDP is set, both TCP and UDP are allowed.

Enumerator
LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__REQUIRE_NONBLOCKING 

Requires non-blocking send.

LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__CLIENT 

Requires client.

LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__SERVER 

Requires server.

LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__TCP 

Allow TCP based.

LTRX_NETWORK_ALLOWED_PROTOCOLS_FLAGS__UDP 

Allow UDP based.

How in protocolShutdown call.

Enumerator
LTRX_NETWORK_PROTOCOL_SHUTDOWN__SEND 

Send direction only.

LTRX_NETWORK_PROTOCOL_SHUTDOWN__RECEIVE 

Receive direction only.

LTRX_NETWORK_PROTOCOL_SHUTDOWN__BOTH 

Both directions.

Return code from optProtocolSendDataNonBlocking.

Enumerator
LTRX_NETWORK_RETURN__WORKING 

Working.

LTRX_NETWORK_RETURN__SUCCESS 

Success.

LTRX_NETWORK_RETURN__FAILURE 

Failure.

Function Documentation

const char* ltrx_network_allowed_protocols ( unsigned int  zeroBasedIterator,
enum ltrx_network_allowed_protocols_flag  flags 
)

Iterate through allowed protocols.

By incrementing zeroBasedIterator in successive calls, caller may iterate through allowed protocols.

Returns
Protocol name.
Return values
NULLNo more protocols were found.
Parameters
[in]zeroBasedIterator0 in first call, 1 in second, and so on.
[in]flagsSpecifies restrictions, so only the allowed protocols will be returned.
const struct ltrx_network_protocol* ltrx_network_lookup_network_protocol ( const char *  protocolName,
enum ltrx_network_allowed_protocols_flag  flags 
)

Lookup a protocol.

Returns
Protocol structure.
Return values
NULLNo acceptable protocol was found.
Parameters
[in]protocolNameName of desired protocol.
[in]flagsSpecifies restrictions, so only an allowed protocol will be returned.
void ltrx_network_register_protocol ( const struct ltrx_network_protocol lnp)

Register a network protocol.

Registers procedures into the system for supporting another network protocol.

Registration must be done in early module initialization.

Parameters
[in]lnpDesignates the procedures to support this protocol.
bool ltrx_output_stream_init_to_open_abstract_socket ( struct output_stream_to_open_abstract_socket outStream,
struct ltrx_ip_socket *  lis,
const struct ltrx_network_protocol lnp,
struct ltrx_network_protocol_handle *  lnph 
)

Set up an output stream to an open socket.

Return values
trueSuccess.
falseFailed.
Parameters
[out]outStreamYour tcp output stream struct to initialize.
[in]lisThe open TCP socket that will be fed by the stream.
[in]lnpThe abstract network protocol.
[in]lnphThe abstract network protocol instance.