static void clear_sdr_rep(IPMIBmcSim *ibs,

                          uint8_t *cmd, unsigned int cmd_len,

                          uint8_t *rsp, unsigned int *rsp_len,

                          unsigned int max_rsp_len)

{

    IPMI_CHECK_CMD_LEN(8);

    IPMI_CHECK_RESERVATION(2, ibs->sdr.reservation);

    if (cmd[4] != 'C' || cmd[5] != 'L' || cmd[6] != 'R') {

        rsp[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

    if (cmd[7] == 0xaa) {

        ibs->sdr.next_free = 0;

        ibs->sdr.overflow = 0;

        set_timestamp(ibs, ibs->sdr.last_clear);

        IPMI_ADD_RSP_DATA(1); /* Erasure complete */

        sdr_inc_reservation(&ibs->sdr);

    } else if (cmd[7] == 0) {

        IPMI_ADD_RSP_DATA(1); /* Erasure complete */

    } else {

        rsp[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

}

static void clear_sdr_rep(IPMIBmcSim *ibs,

                          uint8_t *cmd, unsigned int cmd_len,

                          uint8_t *rsp, unsigned int *rsp_len,

                          unsigned int max_rsp_len)

{

    IPMI_CHECK_CMD_LEN(8);

    IPMI_CHECK_RESERVATION(2, ibs->sdr.reservation);

    if (cmd[4] != 'C' || cmd[5] != 'L' || cmd[6] != 'R') {

        rsp[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

    if (cmd[7] == 0xaa) {

        ibs->sdr.next_free = 0;

        ibs->sdr.overflow = 0;

        set_timestamp(ibs, ibs->sdr.last_clear);

        IPMI_ADD_RSP_DATA(1); 

        sdr_inc_reservation(&ibs->sdr);

    } else if (cmd[7] == 0) {

        IPMI_ADD_RSP_DATA(1); 

    } else {

        rsp[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

}

    IPMI_CHECK_CMD_LEN(8);     IPMI_CHECK_CMD_LEN(8);     IPMI_CHECK_CMD_LEN(8);     IPMI_CHECK_CMD_LEN(8);     IPMI_CHECK_CMD_LEN(8);
static void FUNC_0(IPMIBmcSim *VAR_0,

                          uint8_t *VAR_1, unsigned int VAR_2,

                          uint8_t *VAR_3, unsigned int *VAR_4,

                          unsigned int VAR_5)

{

    IPMI_CHECK_CMD_LEN(8);

    IPMI_CHECK_RESERVATION(2, VAR_0->sdr.reservation);

    if (VAR_1[4] != 'C' || VAR_1[5] != 'L' || VAR_1[6] != 'R') {

        VAR_3[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

    if (VAR_1[7] == 0xaa) {

        VAR_0->sdr.next_free = 0;

        VAR_0->sdr.overflow = 0;

        set_timestamp(VAR_0, VAR_0->sdr.last_clear);

        IPMI_ADD_RSP_DATA(1); 

        sdr_inc_reservation(&VAR_0->sdr);

    } else if (VAR_1[7] == 0) {

        IPMI_ADD_RSP_DATA(1); 

    } else {

        VAR_3[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

}

static void FUNC_0(IPMIBmcSim *VAR_0,
uint8_t *VAR_1, unsigned int VAR_2,
uint8_t *VAR_3, unsigned int *VAR_4,
unsigned int VAR_5)
{ IPMI_CHECK_CMD_LEN(8); IPMI_CHECK_RESERVATION(2, VAR_0->sdr.reservation); if (VAR_1[4] != 'C' || VAR_1[5] != 'L' || VAR_1[6] != 'R') { VAR_3[2] = IPMI_CC_INVALID_DATA_FIELD; return; } if (VAR_1[7] == 0xaa) { VAR_0->sdr.next_free = 0; VAR_0->sdr.overflow = 0; set_timestamp(VAR_0, VAR_0->sdr.last_clear); IPMI_ADD_RSP_DATA(1); sdr_inc_reservation(&VAR_0->sdr); } else if (VAR_1[7] == 0) { IPMI_ADD_RSP_DATA(1); } else { VAR_3[2] = IPMI_CC_INVALID_DATA_FIELD; return; } }