owamp/protocol.c
/*
 * Function:        _OWPEncodeDataRecord
 *
 * Description:        
 *         This function is used to encode the 25 octet "packet record" from
 *         the values in the given OWPDataRec. It returns false if the
 *         timestamp err estimates are invalid values.
 *
 * In Args:        
 *
 * Out Args:        
 *
 * Scope:        
 * Returns:        
 * Side Effect:        
 */
_OWPEncodeDataRecord
Description:
This function is used to encode the 25 octet "packet record" from
the values in the given OWPDataRec. It returns false if the
timestamp err estimates are invalid values.

In Args.

Out Args.

Side Effect.
_OWPEncodeDataRecord Description : This function is used to encode the 25 octet " packet record " from the values in the given OWPDataRec . It returns false if the timestamp err estimates are invalid values . In Args . Out Args . Side Effect .
OWPBoolean
_OWPEncodeDataRecord(
        char        buf[25],
        OWPDataRec  *rec
        )
{
    uint32_t   nlbuf;
    memset(buf,0,25);
    nlbuf = htonl(rec->seq_no);
    memcpy(&buf[0],&nlbuf,4);
    _OWPEncodeTimeStamp((uint8_t *)&buf[8],&rec->send);
    if(!_OWPEncodeTimeStampErrEstimate((uint8_t *)&buf[4],&rec->send)){
        return False;
    }
    if(!_OWPEncodeTimeStampErrEstimate((uint8_t *)&buf[6],&rec->recv)){
        return False;
    }
    _OWPEncodeTimeStamp((uint8_t *)&buf[16],&rec->recv);
    buf[24] = rec->ttl;
    return True;
}
OWPBoolean _OWPEncodeDataRecord ( char buf [ 25 ] , OWPDataRec * rec ) { uint32_t nlbuf ; memset ( buf , 0 , 25 ) ; nlbuf = htonl ( rec -> seq_no ) ; memcpy ( & buf [ 0 ] , & nlbuf , 4 ) ; _OWPEncodeTimeStamp ( ( uint8_t * ) & buf [ 8 ] , & rec -> send ) ; if ( ! _OWPEncodeTimeStampErrEstimate ( ( uint8_t * ) & buf [ 4 ] , & rec -> send ) ) { return False ; } if ( ! _OWPEncodeTimeStampErrEstimate ( ( uint8_t * ) & buf [ 6 ] , & rec -> recv ) ) { return False ; } _OWPEncodeTimeStamp ( ( uint8_t * ) & buf [ 16 ] , & rec -> recv ) ; buf [ 24 ] = rec -> ttl ; return True ; }
Function:        _OWPEncodeDataRecord
 Description:
         This function is used to encode the 25 octet "packet record" from
         the values in the given OWPDataRec.
Function : _OWPEncodeDataRecord Description : This function is used to encode the 25 octet " packet record " from the values in the given OWPDataRec .
/* seq no */ /* send stamp */ /* send err */ /* recv err */ /* recv stamp */