diff --git a/rm_transport.h b/rm_transport.h
index e97e8f6dc6ea49037272a37d94f2b7eb157cd42d..426a3cbe7117638bce5985353fd492a14d5f79c8 100644 (file)
--- a/rm_transport.h
+++ b/rm_transport.h
*
* \par
* ============================================================================
- * @n (C) Copyright 2012-2013, Texas Instruments, Inc.
+ * @n (C) Copyright 2012-2014, Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
/**
* @brief 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,
+ * 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
/** Remote RM instance type at other end of the application transport
* "pipe". */
Rm_InstType remoteInstType;
- /** Pointer to the remote RM instance name at other end of the
- * application transport "pipe". */
- char *remoteInstName;
- /** Specifies whether the transport callouts are valid.
- * TRUE - Transport callouts are valid and can be stored by the RM
- * instance.
- * FALSE - Transport callouts are not valid and cannot not be stored by
- * the RM instance. */
- bool transportCalloutsValid;
/** Pointers to application implemented transport APIs. The APIs for the
* provided functions must match the prototypes defined in the
- * #Rm_TransportCallouts structure. Callouts need only be defined
- * once per RM instance. Multiple transport registrations on the same
- * intance need the transportsCallouts defined and set as valid once. */
+ * #Rm_TransportCallouts structure. Callouts need to be defined
+ * for each registered transport. However, based on the application's
+ * implementation of transport code the same function can be provided
+ * for each transport registration. In these cases, the transport
+ * must mux/demux the packets it receives from RM based on the
+ * #Rm_TransportHandle. */
Rm_TransportCallouts transportCallouts;
} Rm_TransportCfg;
+/**
+ * @brief RM transport reconfiguration structure
+ */
+typedef struct {
+ /** Application transport handle associated with the registered
+ * transport. This value can be anything that helps the application
+ * identify the application transport "pipe" for which a RM packet
+ * should be sent on. For example, a QMSS queue number, network
+ * port data structure, etc. */
+ Rm_AppTransportHandle appTransportHandle;
+ /** Pointers to application implemented transport APIs. The APIs for the
+ * provided functions must match the prototypes defined in the
+ * #Rm_TransportCallouts structure. Callouts need to be defined
+ * for each registered transport. However, based on the application's
+ * implementation of transport code the same function can be provided
+ * for each transport registration. In these cases, the transport
+ * must mux/demux the packets it receives from RM based on the
+ * #Rm_TransportHandle. */
+ Rm_TransportCallouts transportCallouts;
+} Rm_TransportReCfg;
+
/**
* @b Description
* @n
* @retval
* Failure - NULL RM_TransportHandle and result = #RM_ERROR_ALREADY_REGD_SERVER_OR_CD
* @retval
- * Failure - NULL RM_TransportHandle and result = #RM_ERROR_NULL_CALLOUTS_WHEN_VALID
+ * Failure - NULL RM_TransportHandle and result = #RM_ERROR_TRANSPORT_ALLOC_PKT_NOT_REGD
+ * @retval
+ * Failure - NULL RM_TransportHandle and result = #RM_ERROR_TRANSPORT_SEND_NOT_REGD
+ */
+Rm_TransportHandle Rm_transportRegister(const Rm_TransportCfg *transportCfg, int32_t *result);
+
+/**
+ * @b Description
+ * @n
+ * This function reconfigures an existing transport handle using the
+ * provided transport configurations
+ *
+ * @param[in] transportHandle
+ * Transport handle to unregister. The RM instance that the handle will
+ * be unregistered from is contained within the transportHandle.
+ *
+ * @param[in] transportReCfg
+ * Pointer to the transport registration configuration structure.
+ *
+ * @retval
+ * Success - #RM_OK
+ * @retval
+ * Failure - #RM_ERROR_TRANSPORT_HANDLE_DOES_NOT_EXIST
*/
-Rm_TransportHandle Rm_transportRegister(Rm_TransportCfg *transportCfg, int32_t *result);
+int32_t Rm_transportReconfig (Rm_TransportHandle transportHandle, const Rm_TransportReCfg *transportReCfg);
/**
* @b Description
@@ -274,6 +311,64 @@ Rm_TransportHandle Rm_transportRegister(Rm_TransportCfg *transportCfg, int32_t *
*/
int32_t Rm_transportUnregister (Rm_TransportHandle transportHandle);
+/**
+ * @b Description
+ * @n
+ * 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
+ *
+ * @param[in] pkt
+ * RM packet to extract service source instance name from.
+ *
+ * @param[out] serviceInstName
+ * Pointer 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
+ *
+ * @param[in] charBufLen
+ * Length of the provided pktInstName buffer
+ *
+ * @retval
+ * Success - #RM_OK
+ * @retval
+ * Failure - #RM_ERROR_PKT_AND_SERVICE_SRC_NOT_AVAIL
+ * Failure - #RM_ERROR_SRC_NAME_BUF_INVALID_SIZE
+ */
+int32_t Rm_receiveGetPktServiceSrcName(const Rm_Packet *pkt, char *serviceInstName,
+ int32_t charBufLen);
+
+/**
+ * @b Description
+ * @n
+ * 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
+ *
+ * @param[in] pkt
+ * RM packet to extract packet source instance name from.
+ *
+ * @param[out] pktInstName
+ * Pointer 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
+ *
+ * @param[in] charBufLen
+ * Length of the provided pktInstName buffer
+ *
+ * @retval
+ * Success - #RM_OK
+ * @retval
+ * 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);
+
/**
* @b Description
* @n
* @retval
* Failure - < #RM_OK
*/
-int32_t Rm_receivePacket(Rm_TransportHandle transportHandle, Rm_Packet *pkt);
+int32_t Rm_receivePacket(Rm_TransportHandle transportHandle, const Rm_Packet *pkt);
/**
@}