OSAPI  0.29
Open System API

The networking module. More...

Collaboration diagram for COM:

Functions

t_status com_module_supported (void)
 Declares if the module is supported on the current implementation. More...
 
t_status com_connection_accept (char *uri, t_connection *connection)
 Accepts connections for any valid URI. More...
 
t_status com_connection_establish (char *uri, t_connection *connection)
 Creates a connection to any valid URI. More...
 
t_status com_connection_close (t_connection *connection)
 Closes an established connection. More...
 
t_status com_endpoint_create (t_protocol prot, t_endpoint *ep)
 Create a TCP type based on IP and logical Port. More...
 
t_status com_endpoint_destroy (t_endpoint *ep)
 Destroy the resources associated with an endpoint. More...
 
t_status com_ip_getStringSize (t_protocol prot, t_size *size)
 Obtain the required size to store a C-String for the given IP protocol. More...
 
t_status com_ip_getHost (t_ip *ip, t_size size, char *string)
 Get the source IP. More...
 
t_status com_ip_getMask (t_ip *ip, t_size size, char *string)
 Get the mask associated with the IP. More...
 
t_status com_ip_getTarget (t_ip *ip, t_size size, char *string)
 Obtain the C-String for the target protocol: Broadcast, Point to Point,. More...
 
t_status com_ip_isV4 (t_ip *ip, bool *result)
 Verify if the IP is Version 4. More...
 
t_status com_ip_isV6 (t_ip *ip, bool *result)
 Verify if the IP is Version 6. More...
 
t_status com_ip_isBroadcast (t_ip *ip, bool *result)
 Verify if the IP is of type broadcast. More...
 
t_status com_ip_isP2P (t_ip *ip, bool *result)
 Verify if the IP is of type Point to Point. More...
 
t_status com_ip_create (char *ipString, t_ip *ip)
 Create a TCP type based on IP and logical Port. More...
 
t_status com_ip_destroy (t_ip *ip)
 Destroy the resources associated with a IP type. More...
 
t_status com_semaphore_supported (void)
 Are semaphores supported in this platform ? More...
 
t_status com_semaphore_create (key_t key, int sem_value, int sem_options, int *semid)
 Create an IPC semaphore. More...
 
t_status com_semaphore_destroy (int semid)
 Destroys the semaphore identified by "semid". More...
 
t_status com_semaphore_open (key_t key, int *semid)
 Returns the semaphore ID for the provided semaphore key. More...
 
t_status com_semaphore_lock (int semid, bool wait)
 Locks a given semaphore. More...
 
t_status com_semaphore_unlock (int semid, bool wait)
 Unlocks a given semaphore. More...
 
t_status com_semaphore_getValue (int semid, int *value)
 Obtains the semaphore value that corresponds to the given ID. More...
 
t_status com_tcp_create (t_ip ip, t_lport port, t_tcp *tcp)
 Create a TCP type based on IP and logical Port. More...
 
t_status com_tcp_destroy (t_tcp *tcp)
 Destroy the resources associated with a TCP type. More...
 

Detailed Description

The networking module.

The TCP section of the communication module.

The IP section of the communication module.

The endpoint section of the communication module.

The communication module IPC.


Function Documentation

◆ com_connection_accept()

t_status com_connection_accept ( char *  uri,
t_connection connection 
)

Accepts connections for any valid URI.

Parameters
[in]uri- The connection identification string
[out]connection- Connection information
Returns
Success or error information.

◆ com_connection_close()

t_status com_connection_close ( t_connection connection)

Closes an established connection.

Parameters
[in]connection- Connection address
Returns
Success or error information.

◆ com_connection_establish()

t_status com_connection_establish ( char *  uri,
t_connection connection 
)

Creates a connection to any valid URI.

Parameters
[in]uri- The connection identification string
[out]connection- Connection information
Returns
Success or error information.

◆ com_endpoint_create()

t_status com_endpoint_create ( t_protocol  prot,
t_endpoint ep 
)

Create a TCP type based on IP and logical Port.

Parameters
[in]prot- The endpoint communication protocol
[out]ep- Communication endpoint
Returns
Operation status

◆ com_endpoint_destroy()

t_status com_endpoint_destroy ( t_endpoint ep)

Destroy the resources associated with an endpoint.

Returns
Operation status

◆ com_ip_create()

t_status com_ip_create ( char *  ipString,
t_ip ip 
)

Create a TCP type based on IP and logical Port.

Parameters
[in]ipString- A source or target IP in string format
[out]ip- The decoded (from string) IP
Returns
Operation status

◆ com_ip_destroy()

t_status com_ip_destroy ( t_ip ip)

Destroy the resources associated with a IP type.

Parameters
[in]ip- IP type address
Returns
Operation status

◆ com_ip_getHost()

t_status com_ip_getHost ( t_ip ip,
t_size  size,
char *  string 
)

Get the source IP.

Parameters
[in]ip- The IP to verify
[in]size- The size of the C-String
[out]string- The source IP
Returns
Operation status

◆ com_ip_getMask()

t_status com_ip_getMask ( t_ip ip,
t_size  size,
char *  string 
)

Get the mask associated with the IP.

Parameters
[in]ip- The IP to verify
[in]size- The size of the C-String
[out]string- The IP mask
Returns
Operation status

◆ com_ip_getStringSize()

t_status com_ip_getStringSize ( t_protocol  prot,
t_size size 
)

Obtain the required size to store a C-String for the given IP protocol.

Parameters
[in]prot- IP protocol (IPv4/6)
[out]size- Required size
Returns
Operation status

◆ com_ip_getTarget()

t_status com_ip_getTarget ( t_ip ip,
t_size  size,
char *  string 
)

Obtain the C-String for the target protocol: Broadcast, Point to Point,.

Parameters
[in]ip- The IP to verify
[in]size- The size of the C-String
[out]string- The IP string
Returns
Operation status

◆ com_ip_isBroadcast()

t_status com_ip_isBroadcast ( t_ip ip,
bool *  result 
)

Verify if the IP is of type broadcast.

Parameters
[in]ip- The IP to verify
[out]result- True/False
Returns
Operation status

◆ com_ip_isP2P()

t_status com_ip_isP2P ( t_ip ip,
bool *  result 
)

Verify if the IP is of type Point to Point.

Parameters
[in]ip- The IP to verify
[out]result- True/False
Returns
Operation status

◆ com_ip_isV4()

t_status com_ip_isV4 ( t_ip ip,
bool *  result 
)

Verify if the IP is Version 4.

Parameters
[in]ip- The IP to verify
[out]result- True/False
Returns
Operation status

◆ com_ip_isV6()

t_status com_ip_isV6 ( t_ip ip,
bool *  result 
)

Verify if the IP is Version 6.

Parameters
[in]ip- The IP to verify
[out]result- True/False
Returns
Operation status

◆ com_module_supported()

t_status com_module_supported ( void  )

Declares if the module is supported on the current implementation.

Returns
SUCCESS or FAILURE

◆ com_semaphore_create()

t_status com_semaphore_create ( key_t  key,
int  sem_value,
int  sem_options,
int *  semid 
)

Create an IPC semaphore.

Parameters
[in]key- Semaphore key
[in]sem_value- Semaphore value
[in]sem_options- Semaphore options
[out]semid- Semaphore ID
Returns
Operation status

◆ com_semaphore_destroy()

t_status com_semaphore_destroy ( int  semid)

Destroys the semaphore identified by "semid".

Parameters
[in]semid- Semaphore ID
Returns
Operation status

◆ com_semaphore_getValue()

t_status com_semaphore_getValue ( int  semid,
int *  value 
)

Obtains the semaphore value that corresponds to the given ID.

Parameters
[in]semid- Semaphore ID
[out]value- Semaphore value
Returns
Operation status

◆ com_semaphore_lock()

t_status com_semaphore_lock ( int  semid,
bool  wait 
)

Locks a given semaphore.

Parameters
[in]semid- Semaphore ID
[in]wait- Block until semaphore lock is acquired
Returns
Operation status

◆ com_semaphore_open()

t_status com_semaphore_open ( key_t  key,
int *  semid 
)

Returns the semaphore ID for the provided semaphore key.

Parameters
[in]key- Semaphore key
[out]semid- Semaphore ID
Returns
Operation status

◆ com_semaphore_supported()

t_status com_semaphore_supported ( void  )

Are semaphores supported in this platform ?

Returns
Supported/Unsupported

◆ com_semaphore_unlock()

t_status com_semaphore_unlock ( int  semid,
bool  wait 
)

Unlocks a given semaphore.

Parameters
[in]semid- Semaphore ID
[in]wait- Block until semaphore lock is released
Returns
Operation status

◆ com_tcp_create()

t_status com_tcp_create ( t_ip  ip,
t_lport  port,
t_tcp tcp 
)

Create a TCP type based on IP and logical Port.

Parameters
[in]ip- A source or target IP
[in]port- A source or target Port
[out]tcp- A combination of IP and Port
Returns
Operation status

◆ com_tcp_destroy()

t_status com_tcp_destroy ( t_tcp tcp)

Destroy the resources associated with a TCP type.

Parameters
[in]tcp- TCP type address
Returns
Operation status