27 #ifndef _EVENT2_TAG_H_ 28 #define _EVENT2_TAG_H_ 40 #include <event2/event-config.h> 41 #ifdef _EVENT_HAVE_SYS_TYPES_H 42 #include <sys/types.h> 44 #ifdef _EVENT_HAVE_SYS_TIME_H 59 void evtag_init(
void);
70 void evtag_marshal(
struct evbuffer *evbuf, ev_uint32_t tag,
const void *data,
72 void evtag_marshal_buffer(
struct evbuffer *evbuf, ev_uint32_t tag,
86 void evtag_encode_int64(
struct evbuffer *evbuf, ev_uint64_t number);
88 void evtag_marshal_int(
struct evbuffer *evbuf, ev_uint32_t tag,
90 void evtag_marshal_int64(
struct evbuffer *evbuf, ev_uint32_t tag,
93 void evtag_marshal_string(
struct evbuffer *buf, ev_uint32_t tag,
96 void evtag_marshal_timeval(
struct evbuffer *evbuf, ev_uint32_t tag,
99 int evtag_unmarshal(
struct evbuffer *src, ev_uint32_t *ptag,
101 int evtag_peek(
struct evbuffer *evbuf, ev_uint32_t *ptag);
102 int evtag_peek_length(
struct evbuffer *evbuf, ev_uint32_t *plength);
103 int evtag_payload_length(
struct evbuffer *evbuf, ev_uint32_t *plength);
104 int evtag_consume(
struct evbuffer *evbuf);
106 int evtag_unmarshal_int(
struct evbuffer *evbuf, ev_uint32_t need_tag,
107 ev_uint32_t *pinteger);
108 int evtag_unmarshal_int64(
struct evbuffer *evbuf, ev_uint32_t need_tag,
109 ev_uint64_t *pinteger);
111 int evtag_unmarshal_fixed(
struct evbuffer *src, ev_uint32_t need_tag,
112 void *data,
size_t len);
114 int evtag_unmarshal_string(
struct evbuffer *evbuf, ev_uint32_t need_tag,
117 int evtag_unmarshal_timeval(
struct evbuffer *evbuf, ev_uint32_t need_tag,
118 struct timeval *ptv);
void evtag_encode_int(struct evbuffer *evbuf, ev_uint32_t number)
Encode an integer and store it in an evbuffer.
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:95
Common convenience functions for cross-platform portability and related socket manipulations.