Loading...
Searching...
No Matches
coap_proxy_internal.h
Go to the documentation of this file.
/*
* coap_proxy_internal.h -- Proxy functions for libcoap
*
* Copyright (C) 2024 Jon Shallow <supjps-libcoap@jpshallow.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
#ifndef COAP_PROXY_INTERNAL_H_
#define COAP_PROXY_INTERNAL_H_
#include "coap_internal.h"
typedef struct coap_proxy_req_t {
coap_pdu_t *pdu;
coap_resource_t *resource;
coap_session_t *incoming;
coap_bin_const_t *token_used;
coap_cache_key_t *cache_key;
} coap_proxy_req_t;
struct coap_proxy_list_t {
coap_session_t *ongoing;
coap_session_t *incoming;
coap_proxy_req_t *req_list;
size_t req_count;
coap_uri_t uri;
coap_tick_t idle_timeout_ticks;
coap_tick_t last_used;
};
void coap_proxy_cleanup(coap_context_t *context);
int coap_proxy_check_timeouts(coap_context_t *context, coap_tick_t now,
coap_tick_t *tim_rem);
void coap_proxy_remove_association(coap_session_t *session, int send_failure);
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);
coap_response_t coap_proxy_forward_response_lkd(coap_session_t *session,
const coap_pdu_t *received,
coap_cache_key_t **cache_key);
#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