From c75f20d2ef73b0193e75fa59c4679be713a342c7 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Wed, 10 May 2017 16:39:58 +0200 Subject: ipcpd: Remove FRCT from normal IPCP In order to ensure 100% reliable transfer, the protocol state machine that takes care of retransmission and SDU ordering has to be in the application. Flow allocation in the normal now uses fds. The PDU_type field was deprecated and AE's within the DIF can use reserved fds. --- src/ipcpd/normal/dt.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/ipcpd/normal/dt.c') diff --git a/src/ipcpd/normal/dt.c b/src/ipcpd/normal/dt.c index 4e0ba51d..33070fa2 100644 --- a/src/ipcpd/normal/dt.c +++ b/src/ipcpd/normal/dt.c @@ -36,7 +36,6 @@ #include "gam.h" #include "routing.h" #include "sdu_sched.h" -#include "frct.h" #include "ae.h" #include "ribconfig.h" #include "fa.h" @@ -113,19 +112,21 @@ static int sdu_handler(int fd, } else { dt_pci_shrink(sdb); - switch (dt_pci.pdu_type) { - case PDU_TYPE_FRCT: - if (frct_post_sdu(sdb)) { + if (dt_pci.fd > AP_RES_FDS) { + if (ipcp_flow_write(dt_pci.fd, sdb)) { ipcp_sdb_release(sdb); return -1; } - break; - case PDU_TYPE_FA: + return 0; + } + + switch (dt_pci.fd) { + case FD_FA: if (fa_post_sdu(sdb)) { ipcp_sdb_release(sdb); return -1; } - break; + return 0; default: log_err("Unknown PDU type received."); ipcp_sdb_release(sdb); @@ -133,6 +134,7 @@ static int sdu_handler(int fd, } } + /* silence compiler */ return 0; } @@ -150,7 +152,7 @@ int dt_init(void) memset(&info, 0, sizeof(info)); strcpy(info.ae_name, DT_AE); - strcpy(info.protocol, FRCT_PROTO); + strcpy(info.protocol, DT_PROTO); info.pref_version = 1; info.pref_syntax = PROTO_FIXED; info.addr = ipcpi.dt_addr; @@ -265,7 +267,7 @@ void dt_stop(void) int dt_write_sdu(uint64_t dst_addr, qoscube_t qc, - uint8_t pdu_type, + int np1_fd, struct shm_du_buff * sdb) { int fd; @@ -280,8 +282,8 @@ int dt_write_sdu(uint64_t dst_addr, } dt_pci.dst_addr = dst_addr; - dt_pci.qc = qc; - dt_pci.pdu_type = pdu_type; + dt_pci.qc = qc; + dt_pci.fd = np1_fd; if (dt_pci_ser(sdb, &dt_pci)) { log_err("Failed to serialize PDU."); -- cgit v1.2.3