The Message Packing Utility

This document is part of the online Horus Documentation, under Horus Utilities.


--MUTS provides a utility that packs multiple messages into a single one. This is very useful when you want to boost the performance of a protocol by batching messages. Examples of the use of this can be found in the Horus TOTAL total ordering layer, or the Horus FC flow control layer.

Some care has been taken to pack the messages efficiently. Rather than prepending a header for each message separately, it puts a single header in front of sets of messages of the same size. Due to the way xxx_messages work, the messages themselves are packed in reverse order, but who cares?

SOURCES

include/muts/pack.h
src/util/pack.c

INCLUDE

#include "muts.h"
#include "muts/pack.h"

INTERFACE

error_t pack_pack(
	xxx_message_t *msg,
	unsigned int options,
	xxx_message_t **msg_list,
	int nmsgs
);
Pack a set of messages into a single message.
error_t pack_unpack(
	xxx_message_t *msg,
	unsigned int options,
	xxx_message_t ***mp,
	int *np
);
Unpack a packed set of messages into an array of messages. The array is allocated from the input message using xxx_message_mem_alloc.
error_t pack_init(void);
Initialize this module.

EXAMPLE

not available yet.

FUTURE WORK

It is currently not possible to use this recursively, that is, to pack a set of messages, some of which may be packed themselves. This is useful when you stack multiple Horus layers on top of each other, each of which may or may not pack messages.


This document is part of the online Horus Documentation, under Horus Utilities.