src/occ_405/cmdh/cmdh_snapshot.c
// Function Specification
//
// Name: cmdh_get_snapshot_buffer
//
// Description: Returns requested snapshot buffer to tmgt when requested.
//
// End Function Specification
Function Specification
Name: cmdh_get_snapshot_buffer

Returns requested snapshot buffer to tmgt when requested.

End Function Specification
Function Specification Name : cmdh_get_snapshot_buffer Returns requested snapshot buffer to tmgt when requested . End Function Specification
errlHndl_t cmdh_get_snapshot_buffer(const cmdh_fsp_cmd_t * i_cmd_ptr,
                                          cmdh_fsp_rsp_t * o_rsp_ptr)
{
    cmdh_get_snapshot_query_t   *l_cmd_ptr        = (cmdh_get_snapshot_query_t *) i_cmd_ptr;
    ERRL_RC                     l_rc              = ERRL_RC_SUCCESS;
    uint16_t                    l_query_sz        = 0;
    errlHndl_t                  l_err             = NULL;
    do
    {
        if (G_occ_role == OCC_SLAVE)
        {
            TRAC_ERR("cmdh_get_snapshot_buffer: Get snapshot buffer command not supported on Slave OCCs!");
            l_rc = ERRL_RC_INVALID_CMD;
            break;
        }
        if( (NULL == i_cmd_ptr) || (NULL == o_rsp_ptr) )
        {
            TRAC_ERR("cmdh_get_snapshot_buffer: Received invalid inputs.");
            l_rc = ERRL_RC_INTERNAL_FAIL;
            break;
        }
        l_query_sz = CMDH_DATALEN_FIELD_UINT16(i_cmd_ptr);
        if(l_query_sz != CMDH_GET_SNAPSHOT_QUERY_DATALEN)
        {
            TRAC_ERR("cmdh_get_snapshot_buffer: Received an invalid packet size. Expecting 4 bytes, received:%i",
                     l_query_sz);
            l_rc = ERRL_RC_INVALID_CMD_LEN;
            break;
        }
        switch (l_cmd_ptr->version)
        {
            case CMDH_GET_SNAPSHOT_NONITE_VERSION:
                l_rc = cmdh_snapshot_buffer_nonite(i_cmd_ptr, o_rsp_ptr);
                break;
            case CMDH_GET_SNAPSHOT_ITE_VERSION:
            default:
                TRAC_ERR("cmdh_get_snapshot_buffer: Version %i cmd is not supported.", l_cmd_ptr->version);
                l_rc = ERRL_RC_INVALID_DATA;
                break;
        }
    } while(0);
    if (l_rc)
    {
        cmdh_build_errl_rsp(i_cmd_ptr, o_rsp_ptr, l_rc, &l_err);
    }
    return l_err;
}
errlHndl_t cmdh_get_snapshot_buffer ( const cmdh_fsp_cmd_t * i_cmd_ptr , cmdh_fsp_rsp_t * o_rsp_ptr ) { cmdh_get_snapshot_query_t * l_cmd_ptr = ( cmdh_get_snapshot_query_t * ) i_cmd_ptr ; ERRL_RC l_rc = ERRL_RC_SUCCESS ; uint16_t l_query_sz = 0 ; errlHndl_t l_err = NULL ; do { if ( G_occ_role == OCC_SLAVE ) { TRAC_ERR ( " " ) ; l_rc = ERRL_RC_INVALID_CMD ; break ; } if ( ( NULL == i_cmd_ptr ) || ( NULL == o_rsp_ptr ) ) { TRAC_ERR ( " " ) ; l_rc = ERRL_RC_INTERNAL_FAIL ; break ; } l_query_sz = CMDH_DATALEN_FIELD_UINT16 ( i_cmd_ptr ) ; if ( l_query_sz != CMDH_GET_SNAPSHOT_QUERY_DATALEN ) { TRAC_ERR ( " " , l_query_sz ) ; l_rc = ERRL_RC_INVALID_CMD_LEN ; break ; } switch ( l_cmd_ptr -> version ) { case CMDH_GET_SNAPSHOT_NONITE_VERSION : l_rc = cmdh_snapshot_buffer_nonite ( i_cmd_ptr , o_rsp_ptr ) ; break ; case CMDH_GET_SNAPSHOT_ITE_VERSION : default : TRAC_ERR ( " " , l_cmd_ptr -> version ) ; l_rc = ERRL_RC_INVALID_DATA ; break ; } } while ( 0 ) ; if ( l_rc ) { cmdh_build_errl_rsp ( i_cmd_ptr , o_rsp_ptr , l_rc , & l_err ) ; } return l_err ; }
Function Specification
Name: cmdh_get_snapshot_buffer
Function Specification Name : cmdh_get_snapshot_buffer
// Command is only supported on Master OCC // Function Inputs Sanity Check // Command Length Check.  Should have 4 bytes total // Call appropriate function based on version. // Build Error Response packet