net.h: Add in unknown_resource to coap_context_t

Needed to handle
"RFC7252: 5.8.3.  PUT
 If no resource exists, then the server MAY create a new resource with that
 URI, resulting in a 2.01 (Created) Response Code."

Needed for support of PUT requests to an unknown resource.

Remove structure coap_mid_cache_t as it is not used and refers to the now
obsolete coap_key_t.
This commit is contained in:
Jon Shallow committed 2018-03-10 16:02:56 +00:00
1 parent a674334afc
commit cfe82719d3
1 file changed
+4 -7
+4 -7
View File
@@ -88,16 +88,13 @@ typedef void (*coap_pong_handler_t)(struct coap_context_t *,
coap_pdu_t *received,
const coap_tid_t id);
#define COAP_MID_CACHE_SIZE 3
typedef struct {
unsigned char flags[COAP_MID_CACHE_SIZE];
coap_key_t item[COAP_MID_CACHE_SIZE];
} coap_mid_cache_t;
/** The CoAP stack's global state is stored in a coap_context_t object */
typedef struct coap_context_t {
coap_opt_filter_t known_options;
struct coap_resource_t *resources; /**< hash table or list of known resources */
struct coap_resource_t *resources; /**< hash table or list of known
resources */
struct coap_resource_t *unknown_resource; /**< can be used for handling
unknown resources */
#ifndef WITHOUT_ASYNC
/**