summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedl Rubrecht <friedl_rubrecht@hotmail.com>2018-11-20 15:30:40 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2018-11-20 16:04:13 +0100
commit90517a16bc784b462aa7a65a1c721bb4b77444bc (patch)
tree153abce0d774b172fc997d76e245e888306775ce
parent96682a8284cc234207d2ba6a60b8f9939c17834f (diff)
downloadouroboros-90517a16bc784b462aa7a65a1c721bb4b77444bc.tar.gz
ouroboros-90517a16bc784b462aa7a65a1c721bb4b77444bc.zip
ipcpd: Add Explicit Congestion Notification field
This adds an extra field to the data transfer PCI which can be used to flag congestion by intermediate routers. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
-rw-r--r--src/ipcpd/normal/dt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ipcpd/normal/dt.c b/src/ipcpd/normal/dt.c
index 54346458..0958c0eb 100644
--- a/src/ipcpd/normal/dt.c
+++ b/src/ipcpd/normal/dt.c
@@ -82,11 +82,13 @@ enum dtp_fields {
/* Fixed field lengths */
#define TTL_LEN 1
#define QOS_LEN 1
+#define ECN_LEN 1
struct dt_pci {
uint64_t dst_addr;
qoscube_t qc;
uint8_t ttl;
+ uint8_t ecn;
uint32_t eid;
};
@@ -98,6 +100,7 @@ struct {
/* Offsets */
size_t qc_o;
size_t ttl_o;
+ size_t ecn_o;
size_t eid_o;
/* Initial TTL value */
@@ -121,6 +124,7 @@ static int dt_pci_ser(struct shm_du_buff * sdb,
memcpy(head, &dt_pci->dst_addr, dt_pci_info.addr_size);
memcpy(head + dt_pci_info.qc_o, &dt_pci->qc, QOS_LEN);
memcpy(head + dt_pci_info.ttl_o, &ttl, TTL_LEN);
+ memcpy(head + dt_pci_info.ecn_o, &dt_pci->ecn, ECN_LEN);
memcpy(head + dt_pci_info.eid_o, &dt_pci->eid, dt_pci_info.eid_size);
return 0;
@@ -143,6 +147,7 @@ static void dt_pci_des(struct shm_du_buff * sdb,
memcpy(&dt_pci->dst_addr, head, dt_pci_info.addr_size);
memcpy(&dt_pci->qc, head + dt_pci_info.qc_o, QOS_LEN);
memcpy(&dt_pci->ttl, head + dt_pci_info.ttl_o, TTL_LEN);
+ memcpy(&dt_pci->ecn, head + dt_pci_info.ecn_o, ECN_LEN);
memcpy(&dt_pci->eid, head + dt_pci_info.eid_o, dt_pci_info.eid_size);
}
@@ -649,7 +654,8 @@ int dt_init(enum pol_routing pr,
dt_pci_info.qc_o = dt_pci_info.addr_size;
dt_pci_info.ttl_o = dt_pci_info.qc_o + QOS_LEN;
- dt_pci_info.eid_o = dt_pci_info.ttl_o + TTL_LEN;
+ dt_pci_info.ecn_o = dt_pci_info.ttl_o + TTL_LEN;
+ dt_pci_info.eid_o = dt_pci_info.ecn_o + ECN_LEN;
dt_pci_info.head_size = dt_pci_info.eid_o + dt_pci_info.eid_size;
if (notifier_reg(handle_event, NULL)) {