Files
libcoap/include/coap3/coap_uri_internal.h
T
Jon Shallow eff1f38f9f path_query parsing: Remove need to define scratch buffer
Create new options coap_uri_into_optlist(), coap_path_into_optlist() and
coap_query_into_optlist() to be used instead of coap_uri_into_options(),
coap_split_path() and coap_split_query() functions so the requirement
for a scratch buffer is not needed.

Getting the minimum size for a scratch buffer is not straight forward and
potential for unexpected boundary condition errors to occurif too small.

Correct parsing and stripping out of "%2E%2E" ("..") and "%2E" (".")
path segments.  ".." now removes the previous segment (if it exists).

Update documentation and unit testcases.

Update examples to use new options.
2024-06-25 08:23:33 +01:00

49 lines
1.1 KiB
C

/*
* coap_uri_internal.h -- URI functions for libcoap
*
* Copyright (C) 2019--2024 Olaf Bergmann <bergmann@tzi.org> and others
*
* SPDX-License-Identifier: BSD-2-Clause
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
/**
* @file coap_uri_internal.h
* @brief CoAP URI internal information
*/
#ifndef COAP_URI_INTERNAL_H_
#define COAP_URI_INTERNAL_H_
#include "coap_internal.h"
/**
* @ingroup internal_api
* @defgroup uri URI Support
* Internal API for handling CoAP URIs
* @{
*/
typedef struct {
const char *name; /**< scheme name */
uint16_t port; /**< default scheme port */
uint16_t proxy_only; /**< set if proxy support only */
coap_uri_scheme_t scheme; /**< scheme */
} coap_uri_info_t;
extern coap_uri_info_t coap_uri_scheme[COAP_URI_SCHEME_LAST];
/**
* replace any % hex definitions with the actual character.
*
* @param optlist The optlist entry to modify if % hex definitions.
*
*/
void coap_replace_percents(coap_optlist_t *optlist);
/** @} */
#endif /* COAP_URI_INTERNAL_H_ */