27 #ifndef EVENT2_TAG_H_INCLUDED_
28 #define EVENT2_TAG_H_INCLUDED_
36 #include <event2/visibility.h>
42 #include <event2/event-config.h>
43 #ifdef EVENT__HAVE_SYS_TYPES_H
44 #include <sys/types.h>
46 #ifdef EVENT__HAVE_SYS_TIME_H
62 void evtag_init(
void);
77 void evtag_marshal(
struct evbuffer *evbuf, ev_uint32_t tag,
const void *data,
80 void evtag_marshal_buffer(
struct evbuffer *evbuf, ev_uint32_t tag,
96 void evtag_encode_int64(
struct evbuffer *evbuf, ev_uint64_t number);
99 void evtag_marshal_int(
struct evbuffer *evbuf, ev_uint32_t tag,
100 ev_uint32_t integer);
102 void evtag_marshal_int64(
struct evbuffer *evbuf, ev_uint32_t tag,
103 ev_uint64_t integer);
106 void evtag_marshal_string(
struct evbuffer *buf, ev_uint32_t tag,
110 void evtag_marshal_timeval(
struct evbuffer *evbuf, ev_uint32_t tag,
114 int evtag_unmarshal(
struct evbuffer *src, ev_uint32_t *ptag,
117 int evtag_peek(
struct evbuffer *evbuf, ev_uint32_t *ptag);
119 int evtag_peek_length(
struct evbuffer *evbuf, ev_uint32_t *plength);
121 int evtag_payload_length(
struct evbuffer *evbuf, ev_uint32_t *plength);
123 int evtag_consume(
struct evbuffer *evbuf);
126 int evtag_unmarshal_int(
struct evbuffer *evbuf, ev_uint32_t need_tag,
127 ev_uint32_t *pinteger);
129 int evtag_unmarshal_int64(
struct evbuffer *evbuf, ev_uint32_t need_tag,
130 ev_uint64_t *pinteger);
133 int evtag_unmarshal_fixed(
struct evbuffer *src, ev_uint32_t need_tag,
134 void *data,
size_t len);
137 int evtag_unmarshal_string(
struct evbuffer *evbuf, ev_uint32_t need_tag,
141 int evtag_unmarshal_timeval(
struct evbuffer *evbuf, ev_uint32_t need_tag,
142 struct timeval *ptv);
An evbuffer is an opaque data type for efficiently buffering data to be sent or received on the netwo...
Definition: buffer.h:99
EVENT2_EXPORT_SYMBOL void evtag_encode_int(struct evbuffer *evbuf, ev_uint32_t number)
Encode an integer and store it in an evbuffer.
EVENT2_EXPORT_SYMBOL int evtag_unmarshal_header(struct evbuffer *evbuf, ev_uint32_t *ptag)
Unmarshals the header and returns the length of the payload.
Common convenience functions for cross-platform portability and related socket manipulations.