From 54f0ba9d41b446b83090dc0f3b220db9c82491d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C5=ABnas=20Ma=C5=BEeikis?= Date: Wed, 22 May 2019 20:52:26 +0300 Subject: Protocol: tossed a bunch of function out the window. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ramūnas Mažeikis --- src/common/protocol.c | 47 +------------------------------------------ src/common/protocol_private.h | 6 ------ 2 files changed, 1 insertion(+), 52 deletions(-) (limited to 'src/common') diff --git a/src/common/protocol.c b/src/common/protocol.c index 2b4e3bf..5498704 100644 --- a/src/common/protocol.c +++ b/src/common/protocol.c @@ -56,57 +56,12 @@ int push_data(enum tlv_type type) return ret; } -static int push_string(struct tlv_packet *packet, const char *str) -{ - size_t strsize = strlen(str); - int ret = 0; - - if (strsize + packet->offset >= packet->size) { - ret = E_TLV_OVERFLOW; - } else { - memcpy(packet->data, str, strsize); - } - return ret; -} - -static int push_fpi1(struct tlv_packet *packet, const char *num) -{ - int ret = 0; - - if (packet->offset + sizeof(fpi1_t) >= packet->size) { - ret = E_TLV_OVERFLOW; - } else { - memcpy(packet->data, num, sizeof(fpi1_t)); - } - return ret; -} - -static int push_timestamp(struct tlv_packet *packet, const char *data) -{ - return 0; -} - -static int push_request(struct tlv_packet *packet, const char *data) -{ - return 0; -} - -static int push_reply(struct tlv_packet *packet, const char *data) -{ - return 0; -} - -static int push_uuid(struct tlv_packet *packet, const char *data) -{ - return 0; -} - size_t parse_tlv(const char *data, size_t cursor, struct tlv *t) { return 0; } -int clear_data() +void clear_data(struct tlv_packet *packet) { return 0; } diff --git a/src/common/protocol_private.h b/src/common/protocol_private.h index a31103a..206046f 100644 --- a/src/common/protocol_private.h +++ b/src/common/protocol_private.h @@ -3,12 +3,6 @@ #include "protocol_private.h" -int push_string(struct tlv_packet *packet, const char *str); -int push_fpi1(struct tlv_packet *packet, const char *num); -int push_timestamp(struct tlv_packet *packet, const char *data); -int push_request(struct tlv_packet *packet, const char *data); -int push_reply(struct tlv_packet *packet, const char *data); -int push_uuid(struct tlv_packet *packet, const char *data); int push_bytes(struct tlv_packet *packet, size_t size); int push_tlv_header(struct tlv_packet *packet, enum tlv_type type, size_t size); -- cgit v1.2.3