~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to lib/ofpbuf.h

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
 
2
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
3
3
 *
4
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
5
 * you may not use this file except in compliance with the License.
43
43
    size_t size;                /* Number of bytes in use. */
44
44
 
45
45
    void *l2;                   /* Link-level header. */
 
46
    void *l2_5;                 /* MPLS label stack */
46
47
    void *l3;                   /* Network-level header. */
47
48
    void *l4;                   /* Transport-level header. */
48
49
    void *l7;                   /* Application data. */
51
52
    void *private_p;            /* Private pointer for use by owner. */
52
53
};
53
54
 
54
 
/* Declares NAME as a SIZE-byte array aligned properly for storing any kind of
55
 
 * data.  For use with ofpbuf_use_stack(). */
56
 
#define OFPBUF_STACK_BUFFER(NAME, SIZE) uint64_t NAME[DIV_ROUND_UP(SIZE, 8)]
57
 
 
58
55
void ofpbuf_use(struct ofpbuf *, void *, size_t);
59
56
void ofpbuf_use_stack(struct ofpbuf *, void *, size_t);
60
57
void ofpbuf_use_stub(struct ofpbuf *, void *, size_t);
110
107
}
111
108
void ofpbuf_list_delete(struct list *);
112
109
 
 
110
static inline bool
 
111
ofpbuf_equal(const struct ofpbuf *a, const struct ofpbuf *b)
 
112
{
 
113
    return a->size == b->size && memcmp(a->data, b->data, a->size) == 0;
 
114
}
 
115
 
113
116
#ifdef  __cplusplus
114
117
}
115
118
#endif