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);
75 void evtag_marshal(
struct evbuffer *evbuf, ev_uint32_t tag,
const void *data,
78 void evtag_marshal_buffer(
struct evbuffer *evbuf, ev_uint32_t tag,
94 void evtag_encode_int64(
struct evbuffer *evbuf, ev_uint64_t number);
97 void evtag_marshal_int(
struct evbuffer *evbuf, ev_uint32_t tag,
100 void evtag_marshal_int64(
struct evbuffer *evbuf, ev_uint32_t tag,
101 ev_uint64_t integer);
104 void evtag_marshal_string(
struct evbuffer *buf, ev_uint32_t tag,
108 void evtag_marshal_timeval(
struct evbuffer *evbuf, ev_uint32_t tag,
112 int evtag_unmarshal(
struct evbuffer *src, ev_uint32_t *ptag,
115 int evtag_peek(
struct evbuffer *evbuf, ev_uint32_t *ptag);
117 int evtag_peek_length(
struct evbuffer *evbuf, ev_uint32_t *plength);
119 int evtag_payload_length(
struct evbuffer *evbuf, ev_uint32_t *plength);
121 int evtag_consume(
struct evbuffer *evbuf);
124 int evtag_unmarshal_int(
struct evbuffer *evbuf, ev_uint32_t need_tag,
125 ev_uint32_t *pinteger);
127 int evtag_unmarshal_int64(
struct evbuffer *evbuf, ev_uint32_t need_tag,
128 ev_uint64_t *pinteger);
131 int evtag_unmarshal_fixed(
struct evbuffer *src, ev_uint32_t need_tag,
132 void *data,
size_t len);
135 int evtag_unmarshal_string(
struct evbuffer *evbuf, ev_uint32_t need_tag,
139 int evtag_unmarshal_timeval(
struct evbuffer *evbuf, ev_uint32_t need_tag,
140 struct timeval *ptv);
EVENT2_EXPORT_SYMBOL int evtag_unmarshal_header(struct evbuffer *evbuf, ev_uint32_t *ptag)
Unmarshals the header and returns the length of the payload.
An evbuffer is an opaque data type for efficiently buffering data to be sent or received on the netwo...
Definition: buffer.h:97
Common convenience functions for cross-platform portability and related socket manipulations.
EVENT2_EXPORT_SYMBOL void evtag_encode_int(struct evbuffer *evbuf, ev_uint32_t number)
Encode an integer and store it in an evbuffer.