From f23e3cc218a5ad01f3b335400157aef7d4088cb5 Mon Sep 17 00:00:00 2001
From: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: Sun, 10 Jan 2021 20:58:47 +0100
Subject: [PATCH] rename cmdu_get_tlv() aptly to cmdu_extract_tlv()

---
 src/cmdu.c | 6 +++---
 src/cmdu.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/cmdu.c b/src/cmdu.c
index 381cfaa0..c06f1855 100644
--- a/src/cmdu.c
+++ b/src/cmdu.c
@@ -391,11 +391,11 @@ int cmdu_parse_tlvs(struct cmdu_buff *c, struct tlv *tv[][16],
 	return 0;
 }
 
-/* Find a tlv and pulls it from tlv stream.
- * This function is destructive.
+/* Extracts the first matching tlv from tlv-stream.
+ * This function is destructive, i.e. it modifies the passed cmdu buffer.
  * Use cmdu_peek_tlv() for the non-destructive version.
  */
-struct tlv *cmdu_get_tlv(struct cmdu_buff *c, uint8_t tlv_type)
+struct tlv *cmdu_extract_tlv(struct cmdu_buff *c, uint8_t tlv_type)
 {
 	struct tlv *t, *tmp;
 	int found = 0;
diff --git a/src/cmdu.h b/src/cmdu.h
index 1f500ff6..90fcd0d9 100644
--- a/src/cmdu.h
+++ b/src/cmdu.h
@@ -163,7 +163,7 @@ int cmdu_put_tlv(struct cmdu_buff *c, struct tlv *t);
 int cmdu_put(struct cmdu_buff *c, uint8_t *bytes, int len);
 int cmdu_put_eom(struct cmdu_buff *c);
 
-struct tlv *cmdu_get_tlv(struct cmdu_buff *c, uint8_t tlv_type);
+struct tlv *cmdu_extract_tlv(struct cmdu_buff *c, uint8_t tlv_type);
 struct tlv *cmdu_peek_tlv(struct cmdu_buff *c, uint8_t tlv_type);
 int cmdu_reserve(struct cmdu_buff *c, size_t s);
 int cmdu_expand(struct cmdu_buff *c, size_t newsize);
-- 
GitLab