libcoap 4.3.2rc2

Data Structures | Macros | Functions
Resources
Libcoap Internal API

Internal API for handling resources. More...

## Data Structures
struct | coap_attr_t
| Limits the number of subscribers for each resource that this server support. More...
struct | coap_resource_t
| Abstraction of resource that can be attached to coap_context_t. More...

## Macros
#define | RESOURCES_ADD(r, obj) HASH_ADD(hh, (r), uri_path->s[0], (obj)->uri_path->length, (obj))
#define | RESOURCES_DELETE(r, obj) HASH_DELETE(hh, (r), (obj))
#define | RESOURCES_ITER(r, tmp)
#define | RESOURCES_FIND(r, k, res)

## Functions
void | coap_delete_all_resources (coap_context_t *context)
| Deletes all resources from given `context` and frees their storage. More...
void | coap_delete_attr (coap_attr_t *attr)
| Deletes an attribute. More...
coap_print_status_t | coap_print_wellknown (coap_context_t *, unsigned char *, size_t *, size_t, const coap_string_t *)

## Detailed Description

Internal API for handling resources.

## Macro Definition Documentation

## ◆ RESOURCES_ADD

#define RESOURCES_ADD | ( |  | r,
|  |  | obj
| ) |  | HASH_ADD(hh, (r), uri_path->s[0], (obj)->uri_path->length, (obj))

Definition at line 121 of file coap_resource_internal.h.

## ◆ RESOURCES_DELETE

#define RESOURCES_DELETE | ( |  | r,
|  |  | obj
| ) |  | HASH_DELETE(hh, (r), (obj))

Definition at line 124 of file coap_resource_internal.h.

## ◆ RESOURCES_FIND

#define RESOURCES_FIND | ( |  | r,
|  |  | k,
|  |  | res
| ) |  |

Value:
{ \
HASH_FIND(hh, (r), (k)->s, (k)->length, (res)); \
}

Definition at line 131 of file coap_resource_internal.h.

## ◆ RESOURCES_ITER

#define RESOURCES_ITER | ( |  | r,
|  |  | tmp
| ) |  |

Value:
coap_resource_t *tmp, *rtmp; \
HASH_ITER(hh, (r), tmp, rtmp)
coap_resource_t
Abstraction of resource that can be attached to coap_context_t.
Definition: coap_resource_internal.h:53

Definition at line 127 of file coap_resource_internal.h.

## Function Documentation

## ◆ coap_delete_all_resources()

void coap_delete_all_resources | ( | coap_context_t * | context | ) |

Deletes all resources from given `context` and frees their storage.

Parameters

  context | The CoAP context with the resources to be deleted.

## ◆ coap_delete_attr()

void coap_delete_attr | ( | coap_attr_t * | attr | ) |

Deletes an attribute.

Note: This is for internal use only, as it is not deleted from its chain.

Parameters

  attr | Pointer to a previously created attribute.

## ◆ coap_print_wellknown()

coap_print_status_t coap_print_wellknown | ( | coap_context_t * | ,
|  | unsigned char * | ,
|  | size_t * | ,
|  | size_t | ,
|  | const coap_string_t * |
| ) |  |