gtpc1m7dTransmission Control Protocol/Internet Protocol

claw_send -- Send a Message on an Active Logical Link

ISO-C only

The claw_send function is not available in the TARGET(TPF) C library.

The claw_send function sends a message on an active logical link.

Format

#include  <claw.h>
int       claw_send(unsigned int   adapter_id,
               unsigned int   path_id,
               char           *msg_addr,
               int            msg_len,
               enum s_send_method send_method);

adapter_id
A 4-byte field that contains the adapter ID for this adapter that was returned by the claw_openadapter request.

path_id
A 4-byte field that contains the path ID assigned to this path at claw_connect time.

msg_addr
A pointer to a data buffer or a list of discontiguous buffers. If send_method for this message is SEND_LIST, this field contains the address of the first element in an array of CLAWPAGE structures. This structure describes the address, length, and more-to-come bit status of a page frame to be transferred. If send_method for this message is SEND_NOLIST, this field contains the address of the message to be sent.

msg_len
A 4-byte field that contains the number of bytes in a data buffer or the number of elements in an array of pointers. If send_method for this message is SEND_LIST, this field contains the number of elements in an array of CLAWPAGE structures. If send_method for this message is SEND_NOLIST, this field contains the length of the message to be sent up to 4 KB.

send_method
A variable specifying how messages are to be sent on this path. This variable must belong to the enumeration type s_send_method, defined in the claw.h header file. The following values may be specified:

SEND_LIST
The application passes an array of descriptors to TPF CLAW services, each containing the address, length, and status of a message or portion of a message. A message or portion of a message described by one of these descriptors can be any length but it must not cross a 4 KB boundary (thereby effectively limiting its length to 4096 bytes).

SEND_NOLIST
The application passes the address and length of the message to CLAW. The message must not cross a 4 KB boundary.

Normal Return

Return code 0 indicates that the function was successful.

Error Return

Following is a list of return codes that can be returned to the program that calls the claw_send function. See CLAW Return Codes for a complete list of the return codes.

RC_CLAW_INVALID_FUNCTION

RC_CLAW_NOT INITED

RC_CLAW_ADAPTER_NOT_OPEN

RC_CLAW_ACQUIRE_ERROR

RC_CLAW_PATH_NOT_THERE

RC_CLAW_BAD_SEND_METHOD

Programming Considerations

Examples

The following example issues the claw_send function to send the message to the workstation.

#include  <claw.h>
 
     unsigned int adapter_id;
     unsigned int path_id;
     char      *msg;
     int       length;
     int       claw_rc;
 
/* Set up adapter_id with the value returned from the claw_openadapter function
and path_id with the value returned from the claw_connect function */

·
·
·
claw_rc = claw_send(adapter_id,path_id,msg,length,SEND_NOLIST); /*normal processing path */
·
·
·

Related Information