PRV_NextPDUType(PRIVATE_ASSOCIATIONKEY ** association, DUL_BLOCKOPTIONS block,
                int timeout, unsigned char *pduType)
{
    OFCondition cond = EC_Normal;

    /* if the association does not contain PDU header information, do something */
    if ((*association)->inputPDU == NO_PDU) {
        /* try to receive a PDU header on the network */
        cond = readPDUHead(association, (*association)->pduHead,
                           sizeof((*association)->pduHead),
                           block, timeout, &(*association)->nextPDUType,
                           &(*association)->nextPDUReserved,
                           &(*association)->nextPDULength);
        /* if receiving was not successful, return this error */
        if (cond.bad())
            return cond;
        /* indicate that the association does contain PDU header information */
        (*association)->inputPDU = PDU_HEAD;
    }
    /* determine PDU type and assign it to reference parameter */
    *pduType = (*association)->nextPDUType;

    /* return ok */
    return EC_Normal;
}
PRV_NextPDUType(PRIVATE_ASSOCIATIONKEY ** association, DUL_BLOCKOPTIONS block,
                int timeout, unsigned char *pduType)
{
    OFCondition cond = EC_Normal;

     
    if ((*association)->inputPDU == NO_PDU) {
         
        cond = readPDUHead(association, (*association)->pduHead,
                           sizeof((*association)->pduHead),
                           block, timeout, &(*association)->nextPDUType,
                           &(*association)->nextPDUReserved,
                           &(*association)->nextPDULength);
         
        if (cond.bad())
            return cond;
         
        (*association)->inputPDU = PDU_HEAD;
    }
     
    *pduType = (*association)->nextPDUType;

     
    return EC_Normal;
}