/* * file rmtransportloc.h * * Private data structures of Resource Manager transport layer. * * ============================================================================ * (C) Copyright 2012, Texas Instruments, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * \par */ #ifndef RMTRANSPORTLOC_H_ #define RMTRANSPORTLOC_H_ #ifdef __cplusplus extern "C" { #endif /* Device Include */ #include /* RM external includes */ #include /* RM internal includes */ #include /** Pointer to RM instance's transport routing map */ typedef void *Rm_TransRouteMap; /** * @brief RM transport routing map linked list node. The created * transport nodes are provided to the application casted * as a Rm_TransportHandle */ typedef struct { /** The remote RM instance type */ Rm_InstType remoteInstType; /** The remote RM instance name */ char remoteInstName[RM_INSTANCE_NAME_MAX_CHARS]; /** Link to the next route node in the route map list */ Rm_TransportNode *nextNode; } Rm_TransportNode; /********************************************************************** ************************* RM Packet Defs ***************************** **********************************************************************/ /** * @brief Resource Request Packet Types */ typedef enum { /** Resource allocation request */ Rm_resReqPktType_ALLOCATE = 0, /** Block resource allocation request */ Rm_resReqPktType_BLOCK_ALLOCATE = 1, /** Resource allocate by name */ Rm_resReqPktType_ALLOCATE_NAMED = 2, /** Free resource */ Rm_resReqPktType_FREE = 3, /** Free resource block */ Rm_resReqPktType_BLOCK_FREE = 4, /** Free named resource */ Rm_resReqPktType_FREE_NAMED = 5 } Rm_ResourceReqPktType; /** * @brief Resource Request Packet - Packet sent to higher level RM agents to request * a resource service that cannot be handled on the local RM instance due to * permission restrictions. */ typedef struct { /** The transaction ID associated with the request packet */ uint32_t requestId; /** The resource request type */ Rm_ResourceReqPktType resourceReqType; /** Name of RM instance that is issuing the resource request. The instance * name will be used to validate the request against the RM policy defined * for the instance. */ char instName[RM_INST_NAME_MAX_CHARS]; /** Resource request information */ Rm_ResourceInfo resourceInfo; } Rm_ResourceRequestPkt; /** * @brief Resource Response Packet - Packet sent to RM instances that requested * a resource service from a higher level RM agent. The packet will contain * resource response information based on the request */ typedef struct { /** responseID will equal the requestId received in the resource request * packet. This ID should be associated with a transaction stored in * the RM instance that sent the resource request packet */ uint32_t responseId; /** Result of the request. Resource request, denied, or error. The * return values are externally visible so they're tracked in rmservice.h */ int32_t requestResult; /* Resource response information */ Rm_ResourceInfo resourceInfo; } Rm_ResourceResponsePkt; /** * @brief NameServer Request Packet Types */ typedef enum { /** Request to map the specified name to the specified resources */ Rm_nsReqPktType_MAP_RESOURCE = 0, /** Request to unmap the specified name from the specifed resources */ Rm_nsReqPktType_UNMAP_RESOURCE = 1 } Rm_NsReqPktType; /** * @brief NameServer Request Packet - Packet sent by RM instances containing * NameServer mapping or unmapping data */ typedef struct { /** The transaction ID associated with the request packet */ uint32_t requestId; /** The resource request type */ Rm_NsReqPktType nsRequestType; /** RM instance name making the request. Policies may restrict who * can and cannot map and unmap resources via the RM NameServer */ char instName[RM_INST_NAME_MAX_CHARS]; /** Resource request information */ Rm_ResourceInfo resourceInfo; } Rm_NsRequestPkt; /** * @brief NameServer Response Packet - Provides NameServer transaction response * data to RM instances that request a name map or unmap */ typedef struct { /** responseID will equal the requestId received in the resource request * packet. This ID should be associated with a transaction stored in * the RM instance that sent the resource request packet */ uint32_t responseId; /** Result of the request. Resource request, denied, or error. The * return values are externally visible so they're tracked in rmservice.h */ int32_t requestResult; } Rm_NsResponsePkt; /** * @brief Policy Request Packet - Packet used by a RM instance to request an * update to its policy data (supported on Client Delegates and Servers only) */ typedef struct { /** The transaction ID associated with the request packet */ uint32_t requestId; /** Name of RM instance that is issuing the policy request. The instance * name will be used to validate the request against the RM policy defined * for the instance in the global policy. * WARNING: Only Client Delegates and Servers can request policy updates */ char instName[RM_INST_NAME_MAX_CHARS]; } Rm_PolicyRequestPkt; /** * @brief Policy Change Packet - Provides policy changes to RM instances that * support policy storage (Client Delegates and Servers) */ typedef struct { /** responseID will equal the requestId received in the resource request * packet. This ID should be associated with a transaction stored in * the RM instance that sent the resource request packet */ uint32_t responseId; /** Byte array containing new policy data for receiving RM instance */ char policyData[RM_MAX_POLICY_SIZE_BYTES]; } Rm_PolicyChangePkt; /** * @brief Resource Pool Modification Request Packet Types */ typedef enum { /** Resource pool allocation request */ Rm_resPoolModType_ALLOCATE = 0, /** Resource pool free request */ Rm_resPoolModType_FREE = 1 } Rm_ResourcePoolModReqType; /** * @brief Resource Pool Modification Request Packet - Packet sent to RM Server from * RM Client Delegates in order to request resource pool modifications on * the Client Delegate. The Client Delegate can request more resource's for * its local resource pool or it can free resources from its resource pool back * to the Server. */ typedef struct { /** The transaction ID associated with the request packet */ uint32_t requestId; /** The resource pool modification request type */ Rm_ResourcePoolModReqType resourcePoolModReqType; /** Name of RM Client Delegate instance that is issuing the resource pool * modification request. The instance name will be used to validate the * request against the RM policy defined for the instance. */ char instName[RM_INST_NAME_MAX_CHARS]; /** Resource pool resource request information */ Rm_ResourceInfo resourceInfo; } Rm_ResourcePoolModRequestPkt; /** * @brief Resource Pool Modification Response Packet - Packet sent to RM Client * Delegates from RM Servers in response to resource pool modification requests. * The packet will contain resource response information based on the request */ typedef struct { /** responseID will equal the requestId received in the resource pool mod request * packet. This ID should be associated with a transaction stored in * the RM instance that sent the resource request packet */ uint32_t responseId; /** Result of the resource pool mod request. Resource request, denied, or error. The * return values are externally visible so they're tracked in rmservice.h */ int32_t requestResult; /* Resource pool resource response information */ Rm_ResourceInfo resourceInfo; } Rm_ResourcePoolModResponsePkt; #ifdef __cplusplus } #endif #endif /* RMTRANSPORTLOC_H_ */