static void clear_sel(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->sel.reservation);

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

        rsp[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

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

        ibs->sel.next_free = 0;

        ibs->sel.overflow = 0;

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

        IPMI_ADD_RSP_DATA(1); /* Erasure complete */

        sel_inc_reservation(&ibs->sel);

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

        IPMI_ADD_RSP_DATA(1); /* Erasure complete */

    } else {

        rsp[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

}

static void clear_sel(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->sel.reservation);

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

        rsp[2] = IPMI_CC_INVALID_DATA_FIELD;

        return;

    }

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

        ibs->sel.next_free = 0;

        ibs->sel.overflow = 0;

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

        IPMI_ADD_RSP_DATA(1); 

        sel_inc_reservation(&ibs->sel);

    } 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->sel.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->sel.next_free = 0;

        VAR_0->sel.overflow = 0;

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

        IPMI_ADD_RSP_DATA(1); 

        sel_inc_reservation(&VAR_0->sel);

    } 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->sel.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->sel.next_free = 0; VAR_0->sel.overflow = 0; set_timestamp(VAR_0, VAR_0->sdr.last_clear); IPMI_ADD_RSP_DATA(1); sel_inc_reservation(&VAR_0->sel); } else if (VAR_1[7] == 0) { IPMI_ADD_RSP_DATA(1); } else { VAR_3[2] = IPMI_CC_INVALID_DATA_FIELD; return; } }