ustream: add function ustream_read(). It can be used to fill caller-specified buffer with data already in ustream read buffer. Useful in the following use pattern. int available = ustream_pending_data(s, false); if (available >= sizeof(struct msghdr)) { struct msghdr h; ustream_read(s, &h, sizeof(h)); } Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
ustream: another fix for ustream_read_buf_full() with split read buffers Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream: fix ustream_read_buf_full() for multiple read buffers Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream: add ustream_pending_data accessor function Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream: add ustream_read_buf_full() helper Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream: make notify_state optional as well
ustream: mark notify_read cb as optional
ustream: add a poll callback function defined by the ustream implementation
ustream: add a pointer to the ustream struct useful for chaining ustreams
ustream.h: include stdarg.h
add ustream, an api for stream buffer management