2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-02 15:25:22 +00:00

ofpbuf: Rename ofpbuf "private" member for C++ header compatibility.

From partner.
This commit is contained in:
Ben Pfaff
2010-02-01 09:46:31 -08:00
parent 0b3f40f371
commit d45e9c65c6
3 changed files with 13 additions and 5 deletions

View File

@@ -36,7 +36,7 @@ ofpbuf_use(struct ofpbuf *b, void *base, size_t allocated)
b->size = 0; b->size = 0;
b->l2 = b->l3 = b->l4 = b->l7 = NULL; b->l2 = b->l3 = b->l4 = b->l7 = NULL;
b->next = NULL; b->next = NULL;
b->private = NULL; b->private_p = NULL;
} }
/* Initializes 'b' as an empty ofpbuf with an initial capacity of 'size' /* Initializes 'b' as an empty ofpbuf with an initial capacity of 'size'

View File

@@ -19,6 +19,10 @@
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Buffer for holding arbitrary data. An ofpbuf is automatically reallocated /* Buffer for holding arbitrary data. An ofpbuf is automatically reallocated
* as necessary if it grows too large for the available memory. */ * as necessary if it grows too large for the available memory. */
struct ofpbuf { struct ofpbuf {
@@ -34,7 +38,7 @@ struct ofpbuf {
void *l7; /* Application data. */ void *l7; /* Application data. */
struct ofpbuf *next; /* Next in a list of ofpbufs. */ struct ofpbuf *next; /* Next in a list of ofpbufs. */
void *private; /* Private pointer for use by owner. */ void *private_p; /* Private pointer for use by owner. */
}; };
void ofpbuf_use(struct ofpbuf *, void *, size_t); void ofpbuf_use(struct ofpbuf *, void *, size_t);
@@ -70,4 +74,8 @@ void ofpbuf_clear(struct ofpbuf *);
void *ofpbuf_pull(struct ofpbuf *, size_t); void *ofpbuf_pull(struct ofpbuf *, size_t);
void *ofpbuf_try_pull(struct ofpbuf *, size_t); void *ofpbuf_try_pull(struct ofpbuf *, size_t);
#ifdef __cplusplus
}
#endif
#endif /* ofpbuf.h */ #endif /* ofpbuf.h */

View File

@@ -547,7 +547,7 @@ rconn_send(struct rconn *rc, struct ofpbuf *b,
if (rconn_is_connected(rc)) { if (rconn_is_connected(rc)) {
COVERAGE_INC(rconn_queued); COVERAGE_INC(rconn_queued);
copy_to_monitor(rc, b); copy_to_monitor(rc, b);
b->private = counter; b->private_p = counter;
if (counter) { if (counter) {
rconn_packet_counter_inc(counter); rconn_packet_counter_inc(counter);
} }
@@ -845,7 +845,7 @@ try_send(struct rconn *rc)
{ {
int retval = 0; int retval = 0;
struct ofpbuf *next = rc->txq.head->next; struct ofpbuf *next = rc->txq.head->next;
struct rconn_packet_counter *counter = rc->txq.head->private; struct rconn_packet_counter *counter = rc->txq.head->private_p;
retval = vconn_send(rc->vconn, rc->txq.head); retval = vconn_send(rc->vconn, rc->txq.head);
if (retval) { if (retval) {
if (retval != EAGAIN) { if (retval != EAGAIN) {
@@ -914,7 +914,7 @@ flush_queue(struct rconn *rc)
} }
while (rc->txq.n > 0) { while (rc->txq.n > 0) {
struct ofpbuf *b = queue_pop_head(&rc->txq); struct ofpbuf *b = queue_pop_head(&rc->txq);
struct rconn_packet_counter *counter = b->private; struct rconn_packet_counter *counter = b->private_p;
if (counter) { if (counter) {
rconn_packet_counter_dec(counter); rconn_packet_counter_dec(counter);
} }