libcoap
4.3.5
Toggle main menu visibility
Loading...
Searching...
No Matches
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
16
17
#ifndef COAP_PROXY_H_
18
#define COAP_PROXY_H_
19
26
27
typedef
enum
{
28
COAP_PROXY_REVERSE
,
29
COAP_PROXY_REVERSE_STRIP
,
30
COAP_PROXY_FORWARD
,
31
COAP_PROXY_FORWARD_STRIP
,
32
COAP_PROXY_DIRECT
,
33
COAP_PROXY_DIRECT_STRIP
,
34
}
coap_proxy_t
;
35
36
typedef
struct
coap_proxy_server_t
{
37
coap_uri_t
uri
;
38
coap_dtls_pki_t
*
dtls_pki
;
39
coap_dtls_cpsk_t
*
dtls_cpsk
;
40
coap_oscore_conf_t
*
oscore_conf
;
41
}
coap_proxy_server_t
;
42
43
typedef
struct
coap_proxy_server_list_t
{
44
coap_proxy_server_t
*
entry
;
45
size_t
entry_count
;
46
size_t
next_entry
;
47
coap_proxy_t
type
;
48
int
track_client_session
;
50
unsigned
int
idle_timeout_secs
;
51
}
coap_proxy_server_list_t
;
52
60
int
coap_verify_proxy_scheme_supported
(
coap_uri_scheme_t
scheme);
61
85
int
COAP_API
coap_proxy_forward_request
(
coap_session_t
*session,
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
104
coap_response_t
COAP_API
coap_proxy_forward_response
(
coap_session_t
*session,
105
const
coap_pdu_t
*received,
106
coap_cache_key_t
**cache_key);
107
109
110
#endif
/* COAP_PROXY_H_ */
COAP_API
#define COAP_API
Definition
coap_libcoap_build.h:41
coap_uri_scheme_t
coap_uri_scheme_t
The scheme specifiers.
Definition
coap_uri.h:28
coap_response_t
coap_response_t
Definition
coap_net.h:48
coap_proxy_t
coap_proxy_t
Definition
coap_proxy.h:27
coap_proxy_forward_response
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:895
coap_verify_proxy_scheme_supported
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:905
coap_proxy_forward_request
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:879
COAP_PROXY_DIRECT_STRIP
@ COAP_PROXY_DIRECT_STRIP
Act as a direct proxy, strip out proxy options.
Definition
coap_proxy.h:33
COAP_PROXY_REVERSE_STRIP
@ COAP_PROXY_REVERSE_STRIP
Act as a reverse proxy, strip out proxy options.
Definition
coap_proxy.h:29
COAP_PROXY_REVERSE
@ COAP_PROXY_REVERSE
Act as a reverse proxy.
Definition
coap_proxy.h:28
COAP_PROXY_DIRECT
@ COAP_PROXY_DIRECT
Act as a direct proxy.
Definition
coap_proxy.h:32
COAP_PROXY_FORWARD_STRIP
@ COAP_PROXY_FORWARD_STRIP
Act as a forward proxy, strip out proxy options.
Definition
coap_proxy.h:31
COAP_PROXY_FORWARD
@ COAP_PROXY_FORWARD
Act as a forward proxy.
Definition
coap_proxy.h:30
coap_cache_key_t
Definition
coap_cache_internal.h:37
coap_dtls_cpsk_t
The structure used for defining the Client PSK setup data to be used.
Definition
coap_dtls.h:410
coap_dtls_pki_t
The structure used for defining the PKI setup data to be used.
Definition
coap_dtls.h:312
coap_oscore_conf_t
The structure used to hold the OSCORE configuration information.
Definition
coap_oscore_internal.h:36
coap_pdu_t
structure for CoAP PDUs
Definition
coap_pdu_internal.h:135
coap_proxy_server_list_t
Definition
coap_proxy.h:43
coap_proxy_server_list_t::track_client_session
int track_client_session
If 1, track individual connections to upstream server, else 0.
Definition
coap_proxy.h:48
coap_proxy_server_list_t::entry
coap_proxy_server_t * entry
Set of servers to connect to.
Definition
coap_proxy.h:44
coap_proxy_server_list_t::type
coap_proxy_t type
The proxy type.
Definition
coap_proxy.h:47
coap_proxy_server_list_t::idle_timeout_secs
unsigned int idle_timeout_secs
Proxy session idle timeout (0 is no timeout).
Definition
coap_proxy.h:50
coap_proxy_server_list_t::next_entry
size_t next_entry
Next server to us (% entry_count).
Definition
coap_proxy.h:46
coap_proxy_server_list_t::entry_count
size_t entry_count
The number of servers.
Definition
coap_proxy.h:45
coap_proxy_server_t
Definition
coap_proxy.h:36
coap_proxy_server_t::dtls_pki
coap_dtls_pki_t * dtls_pki
PKI configuration to use if not NULL.
Definition
coap_proxy.h:38
coap_proxy_server_t::oscore_conf
coap_oscore_conf_t * oscore_conf
OSCORE configuration if not NULL.
Definition
coap_proxy.h:40
coap_proxy_server_t::uri
coap_uri_t uri
host and port define the server, scheme method
Definition
coap_proxy.h:37
coap_proxy_server_t::dtls_cpsk
coap_dtls_cpsk_t * dtls_cpsk
PSK configuration to use if not NULL.
Definition
coap_proxy.h:39
coap_resource_t
Abstraction of resource that can be attached to coap_context_t.
Definition
coap_resource_internal.h:53
coap_session_t
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...
Definition
coap_session_internal.h:68
coap_uri_t
Representation of parsed URI.
Definition
coap_uri.h:65
include
coap3
coap_proxy.h
Generated on
for libcoap by
1.17.0