OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

Functions
tag.h File Reference

Helper functions for reading and writing tagged data onto buffers. More...

`#include <event2/event-config.h>`
`#include <event2/util.h>`

Go to the source code of this file.

## Functions
void | evtag_init (void)
int | evtag_unmarshal_header (struct evbuffer *evbuf, ev_uint32_t *ptag)
| Unmarshals the header and returns the length of the payload. More...
void | evtag_marshal (struct evbuffer *evbuf, ev_uint32_t tag, const void *data, ev_uint32_t len)
void | evtag_marshal_buffer (struct evbuffer *evbuf, ev_uint32_t tag, struct evbuffer *data)
void | evtag_encode_int (struct evbuffer *evbuf, ev_uint32_t number)
| Encode an integer and store it in an evbuffer. More...
void | evtag_encode_int64 (struct evbuffer *evbuf, ev_uint64_t number)
void | evtag_marshal_int (struct evbuffer *evbuf, ev_uint32_t tag, ev_uint32_t integer)
void | evtag_marshal_int64 (struct evbuffer *evbuf, ev_uint32_t tag, ev_uint64_t integer)
void | evtag_marshal_string (struct evbuffer *buf, ev_uint32_t tag, const char *string)
void | evtag_marshal_timeval (struct evbuffer *evbuf, ev_uint32_t tag, struct timeval *tv)
int | evtag_unmarshal (struct evbuffer *src, ev_uint32_t *ptag, struct evbuffer *dst)
int | evtag_peek (struct evbuffer *evbuf, ev_uint32_t *ptag)
int | evtag_peek_length (struct evbuffer *evbuf, ev_uint32_t *plength)
int | evtag_payload_length (struct evbuffer *evbuf, ev_uint32_t *plength)
int | evtag_consume (struct evbuffer *evbuf)
int | evtag_unmarshal_int (struct evbuffer *evbuf, ev_uint32_t need_tag, ev_uint32_t *pinteger)
int | evtag_unmarshal_int64 (struct evbuffer *evbuf, ev_uint32_t need_tag, ev_uint64_t *pinteger)
int | evtag_unmarshal_fixed (struct evbuffer *src, ev_uint32_t need_tag, void *data, size_t len)
int | evtag_unmarshal_string (struct evbuffer *evbuf, ev_uint32_t need_tag, char **pstring)
int | evtag_unmarshal_timeval (struct evbuffer *evbuf, ev_uint32_t need_tag, struct timeval *ptv)

## Detailed Description

Helper functions for reading and writing tagged data onto buffers.

## Function Documentation

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.

Parameters

  evbuf | evbuffer to store the encoded number
  number | a 32-bit integer

References evbuffer_add().

int evtag_unmarshal_header | ( | struct evbuffer * | evbuf,
|  | ev_uint32_t * | ptag
| ) |  |

Unmarshals the header and returns the length of the payload.

Parameters

  evbuf | the buffer from which to unmarshal data
  ptag | a pointer in which the tag id is being stored

Returns
  -1 on failure or the number of bytes in the remaining payload.

References evbuffer_get_length().