stream_fifo_deinit(fifo);
XFREE(MTYPE_STREAM_FIFO, fifo);
}
+
+void stream_pulldown(struct stream *s)
+{
+ size_t rlen = STREAM_READABLE(s);
+
+ /* No more data, so just move the pointers. */
+ if (rlen == 0) {
+ stream_reset(s);
+ return;
+ }
+
+ /* Move the available data to the beginning. */
+ memmove(s->data, &s->data[s->getp], rlen);
+ s->getp = 0;
+ s->endp = rlen;
+}
/* debugging */
extern void stream_hexdump(const struct stream *s);
+/**
+ * Reorganize the buffer data so it can fit more. This function is normally
+ * called right after stream data is consumed so we can read more data
+ * (the functions that consume data start with `stream_get*()` and macros
+ * `STREAM_GET*()`).
+ *
+ * \param s stream pointer.
+ */
+extern void stream_pulldown(struct stream *s);
+
/* deprecated */
extern uint8_t *stream_pnt(struct stream *);
static int fpm_rmac_send(struct thread *t);
static int fpm_rmac_reset(struct thread *t);
-/*
- * Helper functions.
- */
-
-/**
- * Reorganizes the data on the buffer so it can fit more data.
- *
- * @param s stream pointer.
- */
-static void stream_pulldown(struct stream *s)
-{
- size_t rlen = STREAM_READABLE(s);
-
- /* No more data, so just move the pointers. */
- if (rlen == 0) {
- stream_reset(s);
- return;
- }
-
- /* Move the available data to the beginning. */
- memmove(s->data, &s->data[s->getp], rlen);
- s->getp = 0;
- s->endp = rlen;
-}
-
/*
* CLI.
*/