libcoap 4.3.5-develop-19cef11
coap_proxy.h
Go to the documentation of this file.
1/*
2 * coap_proxy.h -- helper functions for proxy handling
3 *
4 * Copyright (C) 2024 Jon Shallow <supjps-libcoap@jpshallow.com>
5 *
6 * SPDX-License-Identifier: BSD-2-Clause
7 *
8 * This file is part of the CoAP library libcoap. Please see README for terms
9 * of use.
10 */
11
17#ifndef COAP_PROXY_H_
18#define COAP_PROXY_H_
19
27typedef enum {
35
36typedef struct coap_proxy_server_t {
42
45 size_t entry_count;
46 size_t next_entry;
50 unsigned int idle_timeout_secs;
52
61
86 const coap_pdu_t *request,
87 coap_pdu_t *response,
88 coap_resource_t *resource,
89 coap_cache_key_t *cache_key,
90 coap_proxy_server_list_t *server_list);
91
105 const coap_pdu_t *received,
106 coap_cache_key_t **cache_key);
107
110#endif /* COAP_PROXY_H_ */
#define COAP_API
coap_uri_scheme_t
The scheme specifiers.
Definition: coap_uri.h:28
coap_response_t
Definition: coap_net.h:48
struct coap_proxy_server_t coap_proxy_server_t
coap_proxy_t
Definition: coap_proxy.h:27
struct coap_proxy_server_list_t coap_proxy_server_list_t
coap_response_t COAP_API coap_proxy_forward_response(coap_session_t *session, const coap_pdu_t *received, coap_cache_key_t **cache_key)
Forward the returning response back to the appropriate client.
Definition: coap_proxy.c:902
int coap_verify_proxy_scheme_supported(coap_uri_scheme_t scheme)
Verify that the CoAP Scheme is supported for an ongoing proxy connection.
Definition: coap_proxy.c:912
int COAP_API coap_proxy_forward_request(coap_session_t *session, const coap_pdu_t *request, coap_pdu_t *response, coap_resource_t *resource, coap_cache_key_t *cache_key, coap_proxy_server_list_t *server_list)
Forward incoming request upstream to the next proxy/server.
Definition: coap_proxy.c:886
@ COAP_PROXY_DIRECT_STRIP
Act as a direct proxy, strip out proxy options.
Definition: coap_proxy.h:33
@ COAP_PROXY_REVERSE_STRIP
Act as a reverse proxy, strip out proxy options.
Definition: coap_proxy.h:29
@ COAP_PROXY_REVERSE
Act as a reverse proxy.
Definition: coap_proxy.h:28
@ COAP_PROXY_DIRECT
Act as a direct proxy.
Definition: coap_proxy.h:32
@ COAP_PROXY_FORWARD_STRIP
Act as a forward proxy, strip out proxy options.
Definition: coap_proxy.h:31
@ COAP_PROXY_FORWARD
Act as a forward proxy.
Definition: coap_proxy.h:30
The structure used for defining the Client PSK setup data to be used.
Definition: coap_dtls.h:410
The structure used for defining the PKI setup data to be used.
Definition: coap_dtls.h:312
The structure used to hold the OSCORE configuration information.
structure for CoAP PDUs
int track_client_session
If 1, track individual connections to upstream server, else 0.
Definition: coap_proxy.h:48
coap_proxy_server_t * entry
Set of servers to connect to.
Definition: coap_proxy.h:44
coap_proxy_t type
The proxy type.
Definition: coap_proxy.h:47
unsigned int idle_timeout_secs
Proxy session idle timeout (0 is no timeout)
Definition: coap_proxy.h:50
size_t next_entry
Next server to us (% entry_count)
Definition: coap_proxy.h:46
size_t entry_count
The number of servers.
Definition: coap_proxy.h:45
coap_dtls_pki_t * dtls_pki
PKI configuration to use if not NULL.
Definition: coap_proxy.h:38
coap_oscore_conf_t * oscore_conf
OSCORE configuration if not NULL.
Definition: coap_proxy.h:40
coap_uri_t uri
host and port define the server, scheme method
Definition: coap_proxy.h:37
coap_dtls_cpsk_t * dtls_cpsk
PSK configuration to use if not NULL.
Definition: coap_proxy.h:39
Abstraction of resource that can be attached to coap_context_t.
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...
Representation of parsed URI.
Definition: coap_uri.h:65