| [Insert name here] Reference Manual |
|---|
prelude_msgbuf_t* prelude_msgbuf_new (int async_send); void prelude_msgbuf_close (prelude_msgbuf_t *msgbuf); void prelude_msgbuf_mark_end (prelude_msgbuf_t *msgbuf); void prelude_msgbuf_set (prelude_msgbuf_t *msgbuf, uint8_t tag, uint32_t len, const void *data); void prelude_msgbuf_set_header (prelude_msgbuf_t *msgbuf, uint8_t tag, uint8_t priority);
prelude_msgbuf_t* prelude_msgbuf_new (int async_send);
Create a new prelude_msgbuf_t object. You can then write data to msgbuf using the prelude_msgbuf_set function.
When the message buffer is full, the message will be flushed either asynchronously if async_send is TRUE, or synchronously otherwise.
| async_send : | Tell if the message should be written asynchronously or not. |
| Returns : | a prelude_msgbuf_t object, or NULL if an error occured. |
void prelude_msgbuf_close (prelude_msgbuf_t *msgbuf);
Close the message associated with msgbuf, all data remaining will be flushed before closing it.
| msgbuf : | Pointer on a prelude_msgbuf_t object. |
void prelude_msgbuf_mark_end (prelude_msgbuf_t *msgbuf);
This function should be called to tell the msgbuf subsystem that you finished writing your message.
| msgbuf : | Pointer on prelude_msgbuf_t object. |
void prelude_msgbuf_set (prelude_msgbuf_t *msgbuf,
uint8_t tag,
uint32_t len,
const void *data);prelude_msgbuf_set() append len bytes of data from the data buffer to the msgbuf object representing a message. The data is tagged with tag.
| msgbuf : | Pointer on a prelude_msgbuf_t object to store the data to. |
| tag : | 8 bits unsigned integer describing the kind of data. |
| len : | len of the data chunk. |
| data : | Pointer to the data. |
void prelude_msgbuf_set_header (prelude_msgbuf_t *msgbuf,
uint8_t tag,
uint8_t priority);Associate tag and priority, with the current message being constructed in the msgbuf message buffer. This function should be called before prelude_msgbuf_mark_end().
| msgbuf : | Pointer on prelude_msgbuf_t object. |
| tag : | Tag to associate to the current message within msgbuf. |
| priority : | Priority to associate to the current message within msgbuf. |
| <<< idmef-tree | prelude-message >>> |