libevent
2.2.1
Event notification library
|
Helper functions for reading and writing tagged data onto buffers. More...
Go to the source code of this file.
Functions | |
EVENT2_EXPORT_SYMBOL int | evtag_consume (struct evbuffer *evbuf) |
EVENT2_EXPORT_SYMBOL void | evtag_encode_int (struct evbuffer *evbuf, ev_uint32_t number) |
Encode an integer and store it in an evbuffer. More... | |
EVENT2_EXPORT_SYMBOL void | evtag_encode_int64 (struct evbuffer *evbuf, ev_uint64_t number) |
EVENT2_EXPORT_SYMBOL void | evtag_init (void) |
EVENT2_EXPORT_SYMBOL void | evtag_marshal (struct evbuffer *evbuf, ev_uint32_t tag, const void *data, ev_uint32_t len) |
EVENT2_EXPORT_SYMBOL void | evtag_marshal_buffer (struct evbuffer *evbuf, ev_uint32_t tag, struct evbuffer *data) |
EVENT2_EXPORT_SYMBOL void | evtag_marshal_int (struct evbuffer *evbuf, ev_uint32_t tag, ev_uint32_t integer) |
EVENT2_EXPORT_SYMBOL void | evtag_marshal_int64 (struct evbuffer *evbuf, ev_uint32_t tag, ev_uint64_t integer) |
EVENT2_EXPORT_SYMBOL void | evtag_marshal_string (struct evbuffer *buf, ev_uint32_t tag, const char *string) |
EVENT2_EXPORT_SYMBOL void | evtag_marshal_timeval (struct evbuffer *evbuf, ev_uint32_t tag, struct timeval *tv) |
EVENT2_EXPORT_SYMBOL int | evtag_payload_length (struct evbuffer *evbuf, ev_uint32_t *plength) |
EVENT2_EXPORT_SYMBOL int | evtag_peek (struct evbuffer *evbuf, ev_uint32_t *ptag) |
EVENT2_EXPORT_SYMBOL int | evtag_peek_length (struct evbuffer *evbuf, ev_uint32_t *plength) |
EVENT2_EXPORT_SYMBOL int | evtag_unmarshal (struct evbuffer *src, ev_uint32_t *ptag, struct evbuffer *dst) |
EVENT2_EXPORT_SYMBOL int | evtag_unmarshal_fixed (struct evbuffer *src, ev_uint32_t need_tag, void *data, size_t len) |
EVENT2_EXPORT_SYMBOL int | evtag_unmarshal_header (struct evbuffer *evbuf, ev_uint32_t *ptag) |
Unmarshals the header and returns the length of the payload. More... | |
EVENT2_EXPORT_SYMBOL int | evtag_unmarshal_int (struct evbuffer *evbuf, ev_uint32_t need_tag, ev_uint32_t *pinteger) |
EVENT2_EXPORT_SYMBOL int | evtag_unmarshal_int64 (struct evbuffer *evbuf, ev_uint32_t need_tag, ev_uint64_t *pinteger) |
EVENT2_EXPORT_SYMBOL int | evtag_unmarshal_string (struct evbuffer *evbuf, ev_uint32_t need_tag, char **pstring) |
EVENT2_EXPORT_SYMBOL int | evtag_unmarshal_timeval (struct evbuffer *evbuf, ev_uint32_t need_tag, struct timeval *ptv) |
Helper functions for reading and writing tagged data onto buffers.
EVENT2_EXPORT_SYMBOL void evtag_encode_int | ( | struct evbuffer * | evbuf, |
ev_uint32_t | number | ||
) |
Encode an integer and store it in an evbuffer.
We encode integers by nybbles; the first nibble contains the number of significant nibbles - 1; this allows us to encode up to 64-bit integers. This function is byte-order independent.
evbuf | evbuffer to store the encoded number |
number | a 32-bit integer |
EVENT2_EXPORT_SYMBOL int evtag_unmarshal_header | ( | struct evbuffer * | evbuf, |
ev_uint32_t * | ptag | ||
) |
Unmarshals the header and returns the length of the payload.
evbuf | the buffer from which to unmarshal data |
ptag | a pointer in which the tag id is being stored |