src/wolfSSL/src/internal.c
static DtlsFrag* CreateFragment(word32* begin, word32 end, const byte* data,
                                byte* buf, word32* bytesLeft, void* heap)
{
    DtlsFrag* newFrag;
    word32 added = end - *begin + 1;

    newFrag = (DtlsFrag*)XMALLOC(sizeof(DtlsFrag), heap,
                                 DYNAMIC_TYPE_DTLS_FRAG);
    if (newFrag != NULL) {
        newFrag->next = NULL;
        newFrag->begin = *begin;
        newFrag->end = end;

        XMEMCPY(buf + *begin, data, added);
        *bytesLeft -= added;
        *begin = newFrag->end + 1;
    }

    return newFrag;
}
/* Create a DTLS Fragment from *begin - end, adjust new *begin and bytesLeft */
Create a DTLS Fragment from *begin - end, adjust new *begin and bytesLeft
Create a DTLS Fragment from * begin - end adjust new * begin and bytesLeft
static DtlsFrag* CreateFragment(word32* begin, word32 end, const byte* data,
                                byte* buf, word32* bytesLeft, void* heap)
{
    DtlsFrag* newFrag;
    word32 added = end - *begin + 1;
    newFrag = (DtlsFrag*)XMALLOC(sizeof(DtlsFrag), heap,
                                 DYNAMIC_TYPE_DTLS_FRAG);
    if (newFrag != NULL) {
        newFrag->next = NULL;
        newFrag->begin = *begin;
        newFrag->end = end;
        XMEMCPY(buf + *begin, data, added);
        *bytesLeft -= added;
        *begin = newFrag->end + 1;
    }
    return newFrag;
}
static DtlsFrag * CreateFragment ( word32 * begin , word32 end , const byte * data , byte * buf , word32 * bytesLeft , void * heap ) { DtlsFrag * newFrag ; word32 added = end - * begin + 1 ; newFrag = ( DtlsFrag * ) XMALLOC ( sizeof ( DtlsFrag ) , heap , DYNAMIC_TYPE_DTLS_FRAG ) ; if ( newFrag != NULL ) { newFrag -> next = NULL ; newFrag -> begin = * begin ; newFrag -> end = end ; XMEMCPY ( buf + * begin , data , added ) ; * bytesLeft -= added ; * begin = newFrag -> end + 1 ; } return newFrag ; }
Create a DTLS Fragment from *begin - end, adjust new *begin and bytesLeft
Create a DTLS Fragment from * begin - end adjust new * begin and bytesLeft