1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
.TH "event2/tag.h" 3 "Tue Jan 27 2015" "libevent" \" -*- nroff -*-
.ad l
.nh
.SH NAME
event2/tag.h \-
.PP
Helper functions for reading and writing tagged data onto buffers\&.
.SH SYNOPSIS
.br
.PP
\fC#include <event2/event-config\&.h>\fP
.br
\fC#include <event2/util\&.h>\fP
.br
.SS "Functions"
.in +1c
.ti -1c
.RI "int \fBevtag_consume\fP (struct \fBevbuffer\fP *evbuf)"
.br
.ti -1c
.RI "void \fBevtag_encode_int\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t number)"
.br
.RI "\fIEncode an integer and store it in an evbuffer\&. \fP"
.ti -1c
.RI "void \fBevtag_encode_int64\fP (struct \fBevbuffer\fP *evbuf, ev_uint64_t number)"
.br
.ti -1c
.RI "void \fBevtag_init\fP (void)"
.br
.ti -1c
.RI "void \fBevtag_marshal\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t tag, const void *data, ev_uint32_t len)"
.br
.ti -1c
.RI "void \fBevtag_marshal_buffer\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t tag, struct \fBevbuffer\fP *data)"
.br
.ti -1c
.RI "void \fBevtag_marshal_int\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t tag, ev_uint32_t integer)"
.br
.ti -1c
.RI "void \fBevtag_marshal_int64\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t tag, ev_uint64_t integer)"
.br
.ti -1c
.RI "void \fBevtag_marshal_string\fP (struct \fBevbuffer\fP *buf, ev_uint32_t tag, const char *string)"
.br
.ti -1c
.RI "void \fBevtag_marshal_timeval\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t tag, struct timeval *tv)"
.br
.ti -1c
.RI "int \fBevtag_payload_length\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t *plength)"
.br
.ti -1c
.RI "int \fBevtag_peek\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t *ptag)"
.br
.ti -1c
.RI "int \fBevtag_peek_length\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t *plength)"
.br
.ti -1c
.RI "int \fBevtag_unmarshal\fP (struct \fBevbuffer\fP *src, ev_uint32_t *ptag, struct \fBevbuffer\fP *dst)"
.br
.ti -1c
.RI "int \fBevtag_unmarshal_fixed\fP (struct \fBevbuffer\fP *src, ev_uint32_t need_tag, void *data, size_t len)"
.br
.ti -1c
.RI "int \fBevtag_unmarshal_header\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t *ptag)"
.br
.RI "\fIUnmarshals the header and returns the length of the payload\&. \fP"
.ti -1c
.RI "int \fBevtag_unmarshal_int\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t need_tag, ev_uint32_t *pinteger)"
.br
.ti -1c
.RI "int \fBevtag_unmarshal_int64\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t need_tag, ev_uint64_t *pinteger)"
.br
.ti -1c
.RI "int \fBevtag_unmarshal_string\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t need_tag, char **pstring)"
.br
.ti -1c
.RI "int \fBevtag_unmarshal_timeval\fP (struct \fBevbuffer\fP *evbuf, ev_uint32_t need_tag, struct timeval *ptv)"
.br
.in -1c
.SH "Detailed Description"
.PP
Helper functions for reading and writing tagged data onto buffers\&.
.SH "Function Documentation"
.PP
.SS "void evtag_encode_int (struct \fBevbuffer\fP *evbuf, ev_uint32_tnumber)"
.PP
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\&.
.PP
\fBParameters:\fP
.RS 4
\fIevbuf\fP evbuffer to store the encoded number
.br
\fInumber\fP a 32-bit integer
.RE
.PP
.SS "int evtag_unmarshal_header (struct \fBevbuffer\fP *evbuf, ev_uint32_t *ptag)"
.PP
Unmarshals the header and returns the length of the payload\&.
.PP
\fBParameters:\fP
.RS 4
\fIevbuf\fP the buffer from which to unmarshal data
.br
\fIptag\fP a pointer in which the tag id is being stored
.RE
.PP
\fBReturns:\fP
.RS 4
-1 on failure or the number of bytes in the remaining payload\&.
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for libevent from the source code\&.
|