libcoap
4.3.5
Toggle main menu visibility
Loading...
Searching...
No Matches
coap_proxy_internal.h
Go to the documentation of this file.
1
/*
2
* coap_proxy_internal.h -- Proxy functions for libcoap
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_INTERNAL_H_
18
#define COAP_PROXY_INTERNAL_H_
19
20
#include "
coap_internal.h
"
21
28
29
typedef
struct
coap_proxy_req_t
{
30
coap_pdu_t
*
pdu
;
31
coap_resource_t
*
resource
;
32
coap_session_t
*
incoming
;
33
coap_bin_const_t
*
token_used
;
34
coap_cache_key_t
*
cache_key
;
35
}
coap_proxy_req_t
;
36
37
struct
coap_proxy_list_t
{
38
coap_session_t
*
ongoing
;
39
coap_session_t
*
incoming
;
40
coap_proxy_req_t
*
req_list
;
41
size_t
req_count
;
42
coap_uri_t
uri
;
43
coap_tick_t
idle_timeout_ticks
;
44
coap_tick_t
last_used
;
45
};
46
52
void
coap_proxy_cleanup
(
coap_context_t
*context);
53
64
int
coap_proxy_check_timeouts
(
coap_context_t
*context,
coap_tick_t
now,
65
coap_tick_t
*tim_rem);
66
67
void
coap_proxy_remove_association
(
coap_session_t
*session,
int
send_failure);
68
94
int
coap_proxy_forward_request_lkd
(
coap_session_t
*session,
95
const
coap_pdu_t
*request,
96
coap_pdu_t
*response,
97
coap_resource_t
*resource,
98
coap_cache_key_t
*cache_key,
99
coap_proxy_server_list_t
*server_list);
100
115
coap_response_t
coap_proxy_forward_response_lkd
(
coap_session_t
*session,
116
const
coap_pdu_t
*received,
117
coap_cache_key_t
**cache_key);
118
120
121
#endif
/* COAP_PROXY_INTERNAL_H_ */
coap_internal.h
Pulls together all the internal only header files.
coap_proxy_check_timeouts
int coap_proxy_check_timeouts(coap_context_t *context, coap_tick_t now, coap_tick_t *tim_rem)
Idle timeout inactive proxy sessions as well as return in tim_rem the time to remaining to timeout th...
coap_proxy_forward_response_lkd
coap_response_t coap_proxy_forward_response_lkd(coap_session_t *session, const coap_pdu_t *received, coap_cache_key_t **cache_key)
Forward the returning response back to the appropriate client.
coap_proxy_cleanup
void coap_proxy_cleanup(coap_context_t *context)
Close down proxy tracking, releasing any memory used.
coap_proxy_remove_association
void coap_proxy_remove_association(coap_session_t *session, int send_failure)
coap_proxy_forward_request_lkd
int coap_proxy_forward_request_lkd(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.
coap_tick_t
uint64_t coap_tick_t
This data type represents internal timer ticks with COAP_TICKS_PER_SECOND resolution.
Definition
coap_time.h:143
coap_response_t
coap_response_t
Definition
coap_net.h:48
coap_bin_const_t
CoAP binary data definition with const data.
Definition
coap_str.h:64
coap_cache_key_t
Definition
coap_cache_internal.h:37
coap_context_t
The CoAP stack's global state is stored in a coap_context_t object.
Definition
coap_net_internal.h:50
coap_pdu_t
structure for CoAP PDUs
Definition
coap_pdu_internal.h:135
coap_proxy_list_t
Definition
coap_proxy_internal.h:37
coap_proxy_list_t::idle_timeout_ticks
coap_tick_t idle_timeout_ticks
Idle timeout (0 == no timeout).
Definition
coap_proxy_internal.h:43
coap_proxy_list_t::incoming
coap_session_t * incoming
Incoming session (used if client tracking(.
Definition
coap_proxy_internal.h:39
coap_proxy_list_t::req_list
coap_proxy_req_t * req_list
Incoming list of request info.
Definition
coap_proxy_internal.h:40
coap_proxy_list_t::last_used
coap_tick_t last_used
Last time entry was used.
Definition
coap_proxy_internal.h:44
coap_proxy_list_t::uri
coap_uri_t uri
URI info for connection.
Definition
coap_proxy_internal.h:42
coap_proxy_list_t::ongoing
coap_session_t * ongoing
Ongoing session.
Definition
coap_proxy_internal.h:38
coap_proxy_list_t::req_count
size_t req_count
Count of incoming request info.
Definition
coap_proxy_internal.h:41
coap_proxy_req_t
Definition
coap_proxy_internal.h:29
coap_proxy_req_t::pdu
coap_pdu_t * pdu
Definition
coap_proxy_internal.h:30
coap_proxy_req_t::token_used
coap_bin_const_t * token_used
Definition
coap_proxy_internal.h:33
coap_proxy_req_t::cache_key
coap_cache_key_t * cache_key
Definition
coap_proxy_internal.h:34
coap_proxy_req_t::incoming
coap_session_t * incoming
Definition
coap_proxy_internal.h:32
coap_proxy_req_t::resource
coap_resource_t * resource
Definition
coap_proxy_internal.h:31
coap_proxy_server_list_t
Definition
coap_proxy.h:43
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_internal.h
Generated on
for libcoap by
1.17.0