diff options
author | 2019-05-22 20:52:26 +0300 | |
---|---|---|
committer | 2019-05-22 20:52:26 +0300 | |
commit | 54f0ba9d41b446b83090dc0f3b220db9c82491d0 (patch) | |
tree | df288c979a4a1f41445c204e18ef9d7bffcfaa03 | |
parent | dd7556097b373bc62f646016a9b368899043dcc9 (diff) | |
download | usurpation-54f0ba9d41b446b83090dc0f3b220db9c82491d0.tar.gz usurpation-54f0ba9d41b446b83090dc0f3b220db9c82491d0.tar.bz2 usurpation-54f0ba9d41b446b83090dc0f3b220db9c82491d0.zip |
Protocol: tossed a bunch of function out the window.
Signed-off-by: Ramūnas Mažeikis <ramunasnezinomas@gmail.com>
-rw-r--r-- | include/protocol.h | 2 | ||||
-rw-r--r-- | src/common/protocol.c | 47 | ||||
-rw-r--r-- | src/common/protocol_private.h | 6 |
3 files changed, 3 insertions, 52 deletions
diff --git a/include/protocol.h b/include/protocol.h index bf2a943..4721a22 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -114,4 +114,6 @@ int get_tlv(struct tlv_parser *parser, struct tlv *ret); * */ int push_tlv(struct tlv_packet *packet, const char *data, enum tlv_type); +void clear_data(struct tlv_packet *packet); + #endif /* PROTOCOL_H_INCLUDED */ 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); |