The common message passing library offers unreliable connection oriented
data blocks exchange messaging between software modules over raw Ethernet
packets.
-
- morep values returned by MOREP_Connect are standard Linux file descriptors
- that can be used in select()/poll() system calls.
*/
/**
Establish a connection between a local MOREP and a remote MOREP. Block
until connection is established or refused.
- @param local_address local address of the MOREP with the following
- syntax: 'rep://macaddress/ethertype
+ @param url url of the MOREP with the following syntax: 'interface://macaddress/ethertype
+ - interface name
- macaddress format is xx:xx:xx:xx:xx:xx
- ethertype is a number from 1536 to 65355
- Can be NULL if local address dot not need to be specified
- @param remote_address same format as for local_address
- @return a new file descriptor associated with this connection
+ @return a new MOREP descriptor associated with this connection
@see MOREP_Close()
@see MOREP_Send()
/**
@ingroup MOREP
- Destroy a MOREP.
+ Close a connection and relase its descriptor.
- @param morep file descriptor retuned by MOREP_Connect()
+ @param index descriptor retuned by MOREP_Connect()
@see MOREP_Connect()
*/
Send a message over an existing MOREP connection. Will block until
resolution in case of congestion.
- @param morep file descriptor retuned by MOREP_Connect()
+ @param index MOREP descriptor retuned by MOREP_Connect()
@param msgtype a user defined message type identifier, transported
transparently
- @param data a pointer to the buffer containing the message to be
- transmitted
- @param len length of the message
+ @param buffer a pointer to the message to be transmitted
+ @param len length of the message. Length must be less than 16 * (ETHERSIZE - 4) - 1 bytes
+
+ @return sequence number of the transmit message
@see MOREP_Connect()
*/
/**
@ingroup MOREP
- Received a message over an existing MOREP connection. Returns
- immediately if MOREP not set to blocking mode
+ Received a message over an existing MOREP connection.
- @param morep file descriptor retuned by MOREP_Connect()
- @param msgtype a pointer to an unsigned long to receive the user
+ @param index MOREP descriptor retuned by MOREP_Connect()
+ @param msgtype a pointer to retreive the user
defined message type identifier, transported transparently
@param buffer a pointer to the reception buffer
- @param buflen length of the reception buffer
+ @param buflen length of the received message
+
+ By carreful that recevied message can be as large as 16 * (ETHERSIZE - 4) - 1 bytes
- @return length of the message or 0 if no message was pending
+ @return sequence number of the received message
@see MOREP_Connect()
*/
int MOREP_Receive (int index, uint8_t *msgtype, uint8_t *buffer, int *len);
-/**
- @ingroup MOREP
-
- Received a message over an existing MOREP connection with a timeout
-
- @param morep file descriptor retuned by MOREP_Connect()
- @param msgtype a pointer to an unsigned long to receive the user
- defined message type identifier, transported transparently
- @param buffer a pointer to the reception buffer
- @param buflen length of the reception buffer
- @param ms Exit after microseconds if now data is received
-
- @return length of the message or 0 if no message was pending
-
- @see MOREP_Connect()
-*/
-int MOREP_Receive_timeout (int morep, unsigned long *msgtype, unsigned char *buffer, int buflen, int ms);
-
__END_DECLS
#endif /* __MOREP_H__ */