1.5.0.3R3
Software Development Kit
Protocols

Data Structures

struct  ltrx_network_protocol
 Represents a network protocol for registration. More...
 

Enumerations

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_protocolltrx_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...
 

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.