Loading...
Searching...
No Matches
GCoAP Forward Proxy

Forward proxy implementation for GCoAP. More...

Detailed Description

Forward proxy implementation for GCoAP.

Note
Does not support CoAPS yet.
See also
RFC 7252

Modules

 GCoAP compile configurations
 

Files

file  forward_proxy.h
 Definitions for the GCoAP forward proxy.
 

Functions

void gcoap_forward_proxy_init (void)
 Registers a listener for forward proxy operation.
 
int gcoap_forward_proxy_request_process (coap_pkt_t *pkt, const sock_udp_ep_t *client, const sock_udp_ep_t *local)
 Handles proxied requests.
 
void gcoap_forward_proxy_find_req_memo (gcoap_request_memo_t **memo_ptr, coap_pkt_t *src_pdu, const sock_udp_ep_t *remote)
 Finds the memo for an outstanding request within the _coap_state.open_reqs array.
 

Function Documentation

◆ gcoap_forward_proxy_find_req_memo()

void gcoap_forward_proxy_find_req_memo ( gcoap_request_memo_t **  memo_ptr,
coap_pkt_t src_pdu,
const sock_udp_ep_t remote 
)

Finds the memo for an outstanding request within the _coap_state.open_reqs array.

Matches on remote endpoint and token.

Parameters
[out]memo_ptrRegistered request memo, or NULL if not found
[in]src_pduPDU for token to match
[in]remoteRemote endpoint to match

◆ gcoap_forward_proxy_request_process()

int gcoap_forward_proxy_request_process ( coap_pkt_t pkt,
const sock_udp_ep_t client,
const sock_udp_ep_t local 
)

Handles proxied requests.

Parameters
[in]pktPacket to parse
[in]clientEndpoint of the client
[in]localLocal endpoint
Returns
0 if parsing was successful
-ENOTSUP if the forward proxy is not compiled in
-ENOENT if pkt does not contain a Proxy-Uri option
-EINVAL if Proxy-Uri is malformed