From afef44b519153463838ed54327f1b7fca184d97d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C5=ABnas=20Ma=C5=BEeikis?= Date: Tue, 28 May 2019 20:42:39 +0300 Subject: Protocol: more docs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ramūnas Mažeikis --- include/protocol.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/protocol.h') diff --git a/include/protocol.h b/include/protocol.h index 38f5aa9..6d8bbd9 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -102,12 +102,24 @@ struct tlv { void *data; }; +/** + * Keeps state of the parsing process. + * + * Related functions return one tlv at a time. + */ struct tlv_parser { char *data; size_t offset; size_t size; }; + +/** + * Fills tlv structure to represent the next tlv in the packet. + * + * Returns END_OF_PACKET if all tlv's were read of E_TLV_OVERFLOW, if the last + * tlv, according to its declared size should not fit in a packet. + */ int get_tlv(struct tlv_parser *parser, struct tlv *ret); /** -- cgit v1.2.3