Data Structures | Defines | Typedefs | Enumerations | Functions
RM Transport API
Resource Manager API

Data Structures

struct  Rm_Packet
 RM transport layer packet. More...
struct  Rm_TransportCallouts
 RM transport callout functions used by RM to allocate and send RM packets via the application data paths between RM instances. More...
struct  Rm_TransportCfg
 RM transport registration configuration structure. More...
struct  Rm_TransportReCfg
 RM transport reconfiguration structure. More...

Defines

#define RM_TRANSPORT_PACKET_MAX_SIZE_BYTES   (256)
 Maximum size of RM transport packet.

Typedefs

typedef void * Rm_TransportHandle
 RM transport handle.
typedef void * Rm_AppTransportHandle
 Application transport handle. Void casted application transport data structure. The Rm_AppTransportHandle provided by the application could be anything from a queue number to a pointer to an application transport data structure. RM will provide a Rm_AppTransportHandle to the application any time RM wants to alloc or send a packet via the transport callouts.
typedef void * Rm_PacketHandle
 A void pointer to the start of a registered application transport packet buffer. The Rm_PacketHandle may be different from the Rm_Packet pointer based on the application transport. For example, for a QMSS based transport the Rm_PacketHandle may point to the beginning of a Host descriptor where as the Rm_Packet pointer would point to the beginning of the data buffer linked with the Host descriptor.

Enumerations

enum  Rm_pktType { Rm_pktType_RESOURCE_REQUEST = 0, Rm_pktType_RESOURCE_RESPONSE, Rm_pktType_NAMESERVER_REQUEST, Rm_pktType_NAMESERVER_RESPONSE }
 RM packet types. More...

Functions

Rm_TransportHandle Rm_transportRegister (const Rm_TransportCfg *transportCfg, int32_t *result)
int32_t Rm_transportReconfig (Rm_TransportHandle transportHandle, const Rm_TransportReCfg *transportReCfg)
int32_t Rm_transportUnregister (Rm_TransportHandle transportHandle)
int32_t Rm_receiveGetPktServiceSrcName (const Rm_Packet *pkt, char *serviceInstName, int32_t charBufLen)
int32_t Rm_receiveGetPktSrcName (const Rm_Packet *pkt, char *pktInstName, int32_t charBufLen)
int32_t Rm_receivePacket (Rm_TransportHandle transportHandle, const Rm_Packet *pkt)

Enumeration Type Documentation

enum Rm_pktType

RM packet types.

Enumerator:
Rm_pktType_RESOURCE_REQUEST 

Allocate/Free request packet

Rm_pktType_RESOURCE_RESPONSE 

Allocate/Free response packet

Rm_pktType_NAMESERVER_REQUEST 

RM NameServer mapping request

Rm_pktType_NAMESERVER_RESPONSE 

RM NameServer mapping response


Function Documentation

int32_t Rm_receiveGetPktServiceSrcName ( const Rm_Packet pkt,
char *  serviceInstName,
int32_t  charBufLen 
)

Description
This function returns the RM instance name from which the service encapsulated within the RM packet originated

Restrictions: This API is only valid for Rm_pktType_RESOURCE_REQUEST and Rm_pktType_NAMESERVER_REQUEST packet types

Parameters:
[in]pktRM packet to extract service source instance name from.
[out]serviceInstNamePointer to a character array that will contain the RM instance name that originated the service request. The character array MUST be RM_NAME_MAX_CHARS bytes in length
[in]charBufLenLength of the provided pktInstName buffer
Return values:
Success- RM_OK
Failure- RM_ERROR_PKT_AND_SERVICE_SRC_NOT_AVAIL Failure - RM_ERROR_SRC_NAME_BUF_INVALID_SIZE
int32_t Rm_receiveGetPktSrcName ( const Rm_Packet pkt,
char *  pktInstName,
int32_t  charBufLen 
)

Description
This function returns the RM instance name from which the RM packet originated

Restrictions: This API is only valid for Rm_pktType_RESOURCE_REQUEST and Rm_pktType_NAMESERVER_REQUEST packet types

Parameters:
[in]pktRM packet to extract packet source instance name from.
[out]pktInstNamePointer to a character array that will contain the RM instance name that originated the RM request packet. The character array MUST be RM_NAME_MAX_CHARS bytes in length
[in]charBufLenLength of the provided pktInstName buffer
Return values:
Success- RM_OK
Failure- RM_ERROR_PKT_AND_SERVICE_SRC_NOT_AVAIL Failure - RM_ERROR_SRC_NAME_BUF_INVALID_SIZE
int32_t Rm_receivePacket ( Rm_TransportHandle  transportHandle,
const Rm_Packet pkt 
)

Description
This function is called by the application when it has received a RM packet for processing. The application provides the transportHandle associated with the RM instance that should receive the packet and a pointer to the data buffer containing the Rm_Packet.

RM assumes that the application will free the data buffer containing the Rm_Packet after RM has finished processing the packet.

Parameters:
[in]transportHandleRM transportHandle containing the instance that should process the received packet.
[in]pktPointer to the data buffer containing the Rm_Packet
Return values:
Success- RM_OK
Failure- < RM_OK
int32_t Rm_transportReconfig ( Rm_TransportHandle  transportHandle,
const Rm_TransportReCfg transportReCfg 
)

Description
This function reconfigures an existing transport handle using the provided transport configurations

Parameters:
[in]transportHandleTransport handle to unregister. The RM instance that the handle will be unregistered from is contained within the transportHandle.
[in]transportReCfgPointer to the transport registration configuration structure.
Return values:
Success- RM_OK
Failure- RM_ERROR_TRANSPORT_HANDLE_DOES_NOT_EXIST
Rm_TransportHandle Rm_transportRegister ( const Rm_TransportCfg transportCfg,
int32_t *  result 
)

Description
This function is used to register transports with RM for sending and receiving packets between RM instances over application transport data paths.

RM Transport Restrictions: a) RM Servers cannot register with other Servers b) RM CDs cannot register with other CDs c) RM Clients cannot register with other Clients d) Clients cannot register with more than one CD or Server e) Clients cannot register with both a CD and Server (either or) f) CDs cannot register with more than one Server

Parameters:
[in]transportCfgPointer to the transport registration configuration structure.
[out]resultPointer to a signed int used to return any errors encountered during the transport registration process.
Return values:
Success- RM_TransportHandle and result = RM_OK
Failure- NULL RM_TransportHandle and result = RM_ERROR_INVALID_REMOTE_INST_TYPE
Failure- NULL RM_TransportHandle and result = RM_ERROR_ALREADY_REGD_SERVER_OR_CD
Failure- NULL RM_TransportHandle and result = RM_ERROR_TRANSPORT_ALLOC_PKT_NOT_REGD
Failure- NULL RM_TransportHandle and result = RM_ERROR_TRANSPORT_SEND_NOT_REGD
int32_t Rm_transportUnregister ( Rm_TransportHandle  transportHandle)

Description
This function unregisters the provided transportHandle from the RM instance

Parameters:
[in]transportHandleTransport handle to unregister. The RM instance that the handle will be unregistered from is contained within the transportHandle.
Return values:
Success- RM_OK
Failure- RM_ERROR_TRANSPORT_HANDLE_DOES_NOT_EXIST

Copyright 2014, Texas Instruments Incorporated