From 235a11ebe8e116eeb3e2adb51f87baff26e9b78c Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Tue, 6 Mar 2018 20:06:28 +0000 Subject: [PATCH] uri.h: remove coap_hash_path() and add coap_get_uri_path() The old hashed key is no longer used, so coap_hash_path() is obsolete. coap_get_uri_path() added to build the resource Uri Path from the pdu. --- include/coap/uri.h | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/include/coap/uri.h b/include/coap/uri.h index e3c14875..e5192c0f 100644 --- a/include/coap/uri.h +++ b/include/coap/uri.h @@ -12,7 +12,6 @@ #include -#include "hashkey.h" #include "str.h" struct coap_pdu_t; @@ -68,18 +67,6 @@ coap_uri_t *coap_new_uri(const unsigned char *uri, unsigned int length); * be released with coap_free(). */ coap_uri_t *coap_clone_uri(const coap_uri_t *uri); -/** - * Calculates a hash over the given path and stores the result in - * @p key. This function returns @c 0 on error or @c 1 on success. - * - * @param path The URI path to generate hash for. - * @param len The length of @p path. - * @param key The output buffer. - * - * @return @c 1 if @p key was set, @c 0 otherwise. - */ -int coap_hash_path(const unsigned char *path, size_t len, coap_key_t key); - /** * @defgroup uri_parse URI Parsing Functions * @@ -148,6 +135,13 @@ int coap_split_query(const unsigned char *s, */ str *coap_get_query(struct coap_pdu_t *request); +/** + * Extract uri_path string from request PDU + * @param request Request PDU. + * @return Reconstructed and escaped uri path string part. + */ +str *coap_get_uri_path(struct coap_pdu_t *request); + /** @} */ #endif /* _COAP_URI_H_ */