diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2022-02-25 17:34:29 +0100 | 
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2022-03-03 12:00:54 +0100 | 
| commit | f5d642a06f9c1a58197313b32f6b213a152e446f (patch) | |
| tree | 19ec9813f2d83fae986ff2bddbf5511c5b7662da /src/ipcpd/eth | |
| parent | db5e9bf4f884097ec919aa40b02d8eafab05cfa8 (diff) | |
| download | ouroboros-f5d642a06f9c1a58197313b32f6b213a152e446f.tar.gz ouroboros-f5d642a06f9c1a58197313b32f6b213a152e446f.zip | |
lib: Make flow liveness timeout configurable
The qosspec_t now has a timeout value that sets the timeout value of
the flow. Flows with a peer that has timed out will now return
-EFLOWPEER on flow_read() or flow_write().
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/eth')
| -rw-r--r-- | src/ipcpd/eth/eth.c | 3 | 
1 files changed, 3 insertions, 0 deletions
| diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c index e22dd7bc..8b34d303 100644 --- a/src/ipcpd/eth/eth.c +++ b/src/ipcpd/eth/eth.c @@ -164,6 +164,7 @@ struct mgmt_msg {          uint32_t ber;          uint32_t max_gap;          uint32_t delay; +        uint32_t timeout;          uint16_t cypher_s;          uint8_t  in_order;  #if defined (BUILD_ETH_DIX) @@ -492,6 +493,7 @@ static int eth_ipcp_alloc(const uint8_t * dst_addr,          msg->in_order     = qs.in_order;          msg->max_gap      = hton32(qs.max_gap);          msg->cypher_s     = hton16(qs.cypher_s); +        msg->timeout      = hton32(qs.timeout);          memcpy(msg + 1, hash, ipcp_dir_hash_len());          memcpy(buf + len + ETH_HEADER_TOT_SIZE, data, dlen); @@ -753,6 +755,7 @@ static int eth_ipcp_mgmt_frame(const uint8_t * buf,                  qs.in_order = msg->in_order;                  qs.max_gap = ntoh32(msg->max_gap);                  qs.cypher_s = ntoh16(msg->cypher_s); +                qs.timeout = ntoh32(msg->timeout);                  if (shim_data_reg_has(eth_data.shim_data,                                        buf + sizeof(*msg))) { | 
