X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fofpbuf.h;h=9072cc47407398358affe62b2fb076b89a176f41;hb=c6278d208924bb04c41266ddca276712f95533bc;hp=06083ae34cdeef608427808bc5eb9be561df4492;hpb=a14bc59fb8f27db193d74662dc9c5cb8237177ef;p=openvswitch diff --git a/lib/ofpbuf.h b/lib/ofpbuf.h index 06083ae3..9072cc47 100644 --- a/lib/ofpbuf.h +++ b/lib/ofpbuf.h @@ -19,6 +19,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Buffer for holding arbitrary data. An ofpbuf is automatically reallocated * as necessary if it grows too large for the available memory. */ struct ofpbuf { @@ -34,7 +38,7 @@ struct ofpbuf { void *l7; /* Application data. */ 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); @@ -60,8 +64,8 @@ void ofpbuf_reserve(struct ofpbuf *, size_t); void *ofpbuf_push_uninit(struct ofpbuf *b, size_t); void *ofpbuf_push(struct ofpbuf *b, const void *, size_t); -size_t ofpbuf_headroom(struct ofpbuf *); -size_t ofpbuf_tailroom(struct ofpbuf *); +size_t ofpbuf_headroom(const struct ofpbuf *); +size_t ofpbuf_tailroom(const struct ofpbuf *); void ofpbuf_prealloc_headroom(struct ofpbuf *, size_t); void ofpbuf_prealloc_tailroom(struct ofpbuf *, size_t); void ofpbuf_trim(struct ofpbuf *); @@ -70,4 +74,10 @@ void ofpbuf_clear(struct ofpbuf *); void *ofpbuf_pull(struct ofpbuf *, size_t); void *ofpbuf_try_pull(struct ofpbuf *, size_t); +char *ofpbuf_to_string(const struct ofpbuf *, size_t maxbytes); + +#ifdef __cplusplus +} +#endif + #endif /* ofpbuf.h */