summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-08-16 19:46:34 +0000
committerSander Vrijders <sander@ouroboros.rocks>2026-08-31 08:31:46 +0200
commitf921e50952334d99b6c25ee8df09e7fb1523e92f (patch)
treeaa25e0c1745ada1300f5c214198399d12706ec61 /include
parent016c3c438e9b066bb45d4934ad039a49bde7014d (diff)
downloadouroboros-f921e50952334d99b6c25ee8df09e7fb1523e92f.tar.gz
ouroboros-f921e50952334d99b6c25ee8df09e7fb1523e92f.zip
lib: Update FRCT loss recovery
Some more stability fixes in FRCT. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/atomics.h2
-rw-r--r--include/ouroboros/flow.h2
-rw-r--r--include/ouroboros/ipcp-dev.h116
-rw-r--r--include/ouroboros/ssm_rbuff.h10
4 files changed, 69 insertions, 61 deletions
diff --git a/include/ouroboros/atomics.h b/include/ouroboros/atomics.h
index 8e667522..9783fc78 100644
--- a/include/ouroboros/atomics.h
+++ b/include/ouroboros/atomics.h
@@ -35,5 +35,7 @@
#define FETCH_SUB_RELAXED(p, v) (__atomic_fetch_sub(p, v, __ATOMIC_RELAXED))
#define FETCH_ADD(p, v) (__atomic_fetch_add(p, v, __ATOMIC_SEQ_CST))
#define FETCH_SUB(p, v) (__atomic_fetch_sub(p, v, __ATOMIC_SEQ_CST))
+#define FETCH_OR(p, v) (__atomic_fetch_or(p, v, __ATOMIC_SEQ_CST))
+#define FETCH_AND(p, v) (__atomic_fetch_and(p, v, __ATOMIC_SEQ_CST))
#endif /* OUROBOROS_LIB_ATOMICS_H */
diff --git a/include/ouroboros/flow.h b/include/ouroboros/flow.h
index 8b096410..3d3c74ec 100644
--- a/include/ouroboros/flow.h
+++ b/include/ouroboros/flow.h
@@ -53,6 +53,8 @@ struct flow_info {
uint32_t mtu; /* n-1 layer MTU in bytes, 0 = unknown */
+ uint32_t max_rtt; /* declared max path RTT (ms), 0 = unknown */
+
struct qos_spec qs;
enum flow_state state;
diff --git a/include/ouroboros/ipcp-dev.h b/include/ouroboros/ipcp-dev.h
index ab99d950..c0899c2b 100644
--- a/include/ouroboros/ipcp-dev.h
+++ b/include/ouroboros/ipcp-dev.h
@@ -33,109 +33,111 @@
#include <stdint.h>
#include <time.h>
-int ipcp_create_r(const struct ipcp_info * info);
+int ipcp_create_r(const struct ipcp_info * info);
-int ipcp_flow_req_arr(const buffer_t * dst,
- qosspec_t qs,
- time_t mpl,
- uint32_t mtu,
- const buffer_t * data);
+void ipcp_flow_set_max_rtt(uint32_t max_rtt);
-int ipcp_flow_update_arr(int flow_id,
- const buffer_t * data);
+int ipcp_flow_req_arr(const buffer_t * dst,
+ qosspec_t qs,
+ time_t mpl,
+ uint32_t mtu,
+ const buffer_t * data);
-int ipcp_flow_alloc_reply(int fd,
- int response,
- time_t mpl,
- uint32_t mtu,
+int ipcp_flow_update_arr(int flow_id,
const buffer_t * data);
-int ipcp_flow_read(int fd,
- struct ssm_pk_buff ** spb);
+int ipcp_flow_alloc_reply(int fd,
+ int response,
+ time_t mpl,
+ uint32_t mtu,
+ const buffer_t * data);
+
+int ipcp_flow_read(int fd,
+ struct ssm_pk_buff ** spb);
-int ipcp_flow_write(int fd,
- struct ssm_pk_buff * spb);
+int ipcp_flow_write(int fd,
+ struct ssm_pk_buff * spb);
-int np1_flow_read(int fd,
- struct ssm_pk_buff ** spb,
- struct ssm_pool * pool);
+int np1_flow_read(int fd,
+ struct ssm_pk_buff ** spb,
+ struct ssm_pool * pool);
-int np1_flow_write(int fd,
- struct ssm_pk_buff * spb,
- struct ssm_pool * pool);
+int np1_flow_write(int fd,
+ struct ssm_pk_buff * spb,
+ struct ssm_pool * pool);
-int ipcp_flow_dealloc(int fd);
+int ipcp_flow_dealloc(int fd);
-int ipcp_flow_fini(int fd);
+int ipcp_flow_fini(int fd);
-int ipcp_flow_get_qoscube(int fd,
- qoscube_t * cube);
+int ipcp_flow_get_qoscube(int fd,
+ qoscube_t * cube);
/* Bytes queued in the transmit path of the flow. */
-size_t ipcp_flow_queued(int fd);
+size_t ipcp_flow_queued(int fd);
/* Mean size of a packet written to the flow, bytes. */
-size_t ipcp_flow_mean_len(int fd);
+size_t ipcp_flow_mean_len(int fd);
/*
* Capacity estimator of the transmit queue behind the flow.
* Flows attached to one point of attachment share a queue and
* share the estimator. Armed by the IPCP; unarmed flows read 0.
*/
-int ipcp_flow_cap_arm(int fd);
+int ipcp_flow_cap_arm(int fd);
-void ipcp_flow_cap_update(int fd,
- size_t qlen,
- size_t len);
+void ipcp_flow_cap_update(int fd,
+ size_t qlen,
+ size_t len);
/* Estimated capacity of the transmit queue (bytes/s), 0 = unknown. */
uint64_t ipcp_flow_cap(int fd);
-int ipcp_spb_reserve(struct ssm_pk_buff ** spb,
- size_t len);
+int ipcp_spb_reserve(struct ssm_pk_buff ** spb,
+ size_t len);
-void ipcp_spb_release(struct ssm_pk_buff * spb);
+void ipcp_spb_release(struct ssm_pk_buff * spb);
/* PoA lifecycle; an IPCP owns its PoAs, applications have none. */
-int poa_init(const char * name);
+int poa_init(const char * name);
-int poa_start(void);
+int poa_start(void);
-void poa_stop(void);
+void poa_stop(void);
-void poa_fini(void);
+void poa_fini(void);
/* Also answer name queries for the layer; set at bootstrap/enroll. */
-int poa_set_layer(const char * layer);
+int poa_set_layer(const char * layer);
/* Attach or release a PoA; the type in the spec picks the transport. */
-int poa_attach(const struct poa_spec * poa);
+int poa_attach(const struct poa_spec * poa);
-int poa_detach(const struct poa_spec * poa);
+int poa_detach(const struct poa_spec * poa);
/* The PoAs this process has attached. */
-ssize_t poa_list(struct poa_spec * specs,
- size_t max);
+ssize_t poa_list(struct poa_spec * specs,
+ size_t max);
/* Allocate a flow to dst over the PoA that carries addr. */
-int poa_flow_alloc(const char * dst,
- const struct poa_addr * addr,
- qosspec_t * qs,
- const struct timespec * timeo);
+int poa_flow_alloc(const char * dst,
+ const struct poa_addr * addr,
+ qosspec_t * qs,
+ const struct timespec * timeo);
/* Resolve dst on the attached PoAs; no flow is created. */
-int poa_query(const char * dst,
- const struct timespec * timeo,
- struct poa_addr * addr);
+int poa_query(const char * dst,
+ const struct timespec * timeo,
+ struct poa_addr * addr);
/* PoA counterparts of the ipcp_flow_* operations */
-int poa_flow_alloc_resp(int flow_id,
- int response,
- const buffer_t * data);
+int poa_flow_alloc_resp(int flow_id,
+ int response,
+ const buffer_t * data);
-int poa_flow_update(int flow_id,
- const buffer_t * data);
+int poa_flow_update(int flow_id,
+ const buffer_t * data);
-int poa_flow_dealloc(int flow_id);
+int poa_flow_dealloc(int flow_id);
#endif /* OUROBOROS_LIB_IPCP_DEV_H */
diff --git a/include/ouroboros/ssm_rbuff.h b/include/ouroboros/ssm_rbuff.h
index 9ff880e9..297aad9f 100644
--- a/include/ouroboros/ssm_rbuff.h
+++ b/include/ouroboros/ssm_rbuff.h
@@ -35,6 +35,8 @@
#define RB_FLOWPEER 0010
#define RB_REKEY 0020 /* re-key seed parked (out-of-band signal) */
+#define SSM_RBUFF_TXQ_MAX_DELAY 1000000000LL
+
struct ssm_rbuff;
struct ssm_rbuff * ssm_rbuff_create(pid_t pid,
@@ -47,11 +49,11 @@ struct ssm_rbuff * ssm_rbuff_open(pid_t pid,
void ssm_rbuff_close(struct ssm_rbuff * rb);
-void ssm_rbuff_set_bits(struct ssm_rbuff * rb,
- uint32_t bits);
+void ssm_rbuff_set_flags(struct ssm_rbuff * rb,
+ uint32_t flags);
-void ssm_rbuff_clr_bits(struct ssm_rbuff * rb,
- uint32_t bits);
+void ssm_rbuff_clr_flags(struct ssm_rbuff * rb,
+ uint32_t flags);
uint32_t ssm_rbuff_get_flags(struct ssm_rbuff * rb);