diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2023-02-12 21:05:40 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2023-02-13 21:10:11 +0100 |
commit | 269f25d3bac5ab871d8044935eacc15cfeadeec6 (patch) | |
tree | d68cba31a7a4b941658836d0c0d616fc7ec6400b /src/ipcpd/unicast/dt.c | |
parent | c3814fa77eb7afbe6e798ded0fdff2df74ad8642 (diff) | |
download | ouroboros-269f25d3bac5ab871d8044935eacc15cfeadeec6.tar.gz ouroboros-269f25d3bac5ab871d8044935eacc15cfeadeec6.zip |
ipcpd: refactor IPCP configuration
The ipcp configuration struct now has internal structures for the
different IPCPs and for IPCP components of the unicast IPCP.
Split the very long IPCP main loop into individual handler functions.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/unicast/dt.c')
-rw-r--r-- | src/ipcpd/unicast/dt.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/ipcpd/unicast/dt.c b/src/ipcpd/unicast/dt.c index 48940a2b..60975aed 100644 --- a/src/ipcpd/unicast/dt.c +++ b/src/ipcpd/unicast/dt.c @@ -563,10 +563,7 @@ static void * dt_conn_handle(void * o) return 0; } -int dt_init(enum pol_routing pr, - uint8_t addr_size, - uint8_t eid_size, - uint8_t max_ttl) +int dt_init(struct dt_config cfg) { int i; int j; @@ -582,14 +579,14 @@ int dt_init(enum pol_routing pr, info.pref_syntax = PROTO_FIXED; info.addr = ipcpi.dt_addr; - if (eid_size != 8) { /* only support 64 bits from now */ + if (cfg.eid_size != 8) { /* only support 64 bits from now */ log_warn("Invalid EID size. Only 64 bit is supported."); - eid_size = 8; + cfg.eid_size = 8; } - dt_pci_info.addr_size = addr_size; - dt_pci_info.eid_size = eid_size; - dt_pci_info.max_ttl = max_ttl; + dt_pci_info.addr_size = cfg.addr_size; + dt_pci_info.eid_size = cfg.eid_size; + dt_pci_info.max_ttl = cfg.max_ttl; dt_pci_info.qc_o = dt_pci_info.addr_size; dt_pci_info.ttl_o = dt_pci_info.qc_o + QOS_LEN; @@ -607,7 +604,7 @@ int dt_init(enum pol_routing pr, goto fail_connmgr_comp_init; } - pp = routing_init(pr); + pp = routing_init(cfg.routing_type); if (pp < 0) { log_err("Failed to init routing."); goto fail_routing; |