Loading...
Searching...
No Matches
forward_proxy_internal.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 ML!PA Consulting GmbH
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for
6 * more details.
7 */
8
9#pragma once
10
23
24#include <stdint.h>
25#include "net/coap.h"
26#include "net/gcoap.h"
27#include "net/sock/udp.h"
28#include "ztimer.h"
29#include "event.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
38typedef struct {
43 uint16_t mid;
44 uint8_t flags;
45#if IS_USED(MODULE_NANOCOAP_CACHE)
46 uint8_t req_etag[COAP_ETAG_LENGTH_MAX];
47#endif
51
56#ifndef GCOAP_PROXY_STACK_SIZE
57#define GCOAP_PROXY_STACK_SIZE (THREAD_STACKSIZE_DEFAULT + DEBUG_EXTRA_STACKSIZE \
58 + sizeof(coap_pkt_t) + GCOAP_DTLS_EXTRA_STACKSIZE)
59#endif
60
64enum {
65 GCOAP_FORWARD_PROXY_MSG_SEND,
66};
67
72
82
83#ifdef __cplusplus
84}
85#endif
86
gcoap definition
#define COAP_ETAG_LENGTH_MAX
maximum length of the ETag option
Definition coap.h:535
void gcoap_forward_proxy_thread_init(void)
Initialize the forward proxy thread.
int gcoap_forward_proxy_req_send(client_ep_t *cep)
Forward the CoAP request to the server The client endpoint is passed as an argument and freed if the ...
struct _sock_tl_ep sock_udp_ep_t
An end point for a UDP sock object.
Definition udp.h:293
struct event event_t
event structure forward declaration
Definition event.h:135
Generic CoAP values as defined by RFC7252.
UDP sock definitions.
client ep structure
sock_udp_ep_t proxy_ep
proxy endpoint
sock_udp_ep_t server_ep
forward Server endpoint
sock_udp_ep_t ep
client endpoint
coap_pkt_t pdu
forward CoAP PDU
uint16_t mid
message ID
ztimer_t empty_ack_timer
empty ACK timer
event_t event
client event
uint8_t flags
client flags
CoAP PDU parsing context structure.
Definition nanocoap.h:221
ztimer structure
Definition ztimer.h:319
ztimer API