예제 #1
0
static void
ofpbuf_use__(struct ofpbuf *b, void *base, size_t allocated,
             enum ofpbuf_source source)
{
    ofpbuf_set_base(b, base);
    ofpbuf_set_data(b, base);
    ofpbuf_set_size(b, 0);

    ofpbuf_init__(b, allocated, source);
}
예제 #2
0
파일: ofpbuf.c 프로젝트: cho4036/MyProject
static void
ofpbuf_use__(struct ofpbuf *b, void *base, size_t allocated,
             enum ofpbuf_source source)
{
    b->base = base;
    b->data = base;
    b->size = 0;

    ofpbuf_init__(b, allocated, source);
}
예제 #3
0
/* Initializes 'b' as an empty ofpbuf that contains the 'allocated' bytes of
 * memory starting at 'base'.  DPDK allocated ofpbuf and *data is allocated
 * from one continous memory region, so in memory data start right after
 * ofpbuf.  Therefore there is special method to free this type of
 * buffer.  ofpbuf base, data and size are initialized by dpdk rcv() so no
 * need to initialize those fields. */
void
ofpbuf_init_dpdk(struct ofpbuf *b, size_t allocated)
{
    ofpbuf_init__(b, allocated, OFPBUF_DPDK);
}