picoquic/frames.c
uint8_t * picoquic_format_first_misc_or_dg_frame(uint8_t* bytes, uint8_t * bytes_max, int * more_data, int * is_pure_ack,
    picoquic_misc_frame_header_t** first, picoquic_misc_frame_header_t** last)
{
    picoquic_misc_frame_header_t* misc_frame = *first;

    if (bytes + misc_frame->length > bytes_max) {
        *more_data = 1;
    } else {
        uint8_t* frame = ((uint8_t*)misc_frame) + sizeof(picoquic_misc_frame_header_t);
        memcpy(bytes, frame, misc_frame->length);
        bytes += misc_frame->length;
        *is_pure_ack &= misc_frame->is_pure_ack;
        picoquic_delete_misc_or_dg(first, last, *first);
    }

    return bytes;
}
/* Common code for datagrams and misc frames
 */
Common code for datagrams and misc frames
Common code for datagrams and misc frames
uint8_t * picoquic_format_first_misc_or_dg_frame(uint8_t* bytes, uint8_t * bytes_max, int * more_data, int * is_pure_ack,
    picoquic_misc_frame_header_t** first, picoquic_misc_frame_header_t** last)
{
    picoquic_misc_frame_header_t* misc_frame = *first;
    if (bytes + misc_frame->length > bytes_max) {
        *more_data = 1;
    } else {
        uint8_t* frame = ((uint8_t*)misc_frame) + sizeof(picoquic_misc_frame_header_t);
        memcpy(bytes, frame, misc_frame->length);
        bytes += misc_frame->length;
        *is_pure_ack &= misc_frame->is_pure_ack;
        picoquic_delete_misc_or_dg(first, last, *first);
    }
    return bytes;
}
uint8_t * picoquic_format_first_misc_or_dg_frame ( uint8_t * bytes , uint8_t * bytes_max , int * more_data , int * is_pure_ack , picoquic_misc_frame_header_t * * first , picoquic_misc_frame_header_t * * last ) { picoquic_misc_frame_header_t * misc_frame = * first ; if ( bytes + misc_frame -> length > bytes_max ) { * more_data = 1 ; } else { uint8_t * frame = ( ( uint8_t * ) misc_frame ) + sizeof ( picoquic_misc_frame_header_t ) ; memcpy ( bytes , frame , misc_frame -> length ) ; bytes += misc_frame -> length ; * is_pure_ack &= misc_frame -> is_pure_ack ; picoquic_delete_misc_or_dg ( first , last , * first ) ; } return bytes ; }
Common code for datagrams and misc frames
Common code for datagrams and misc frames