From bf16a163cc70733653f68b50dabfab42741d4c3f Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 4 Dec 2021 19:26:50 +0100 Subject: ipcpd: Consolidate policies within folder Each policy folder will now have a pol.h file, so that (in most cases) adding a new policy only requires changes inside the policy folder. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/addr-auth.c | 3 +-- src/ipcpd/unicast/addr-auth/pol.h | 23 +++++++++++++++++++++++ src/ipcpd/unicast/ca.c | 4 +--- src/ipcpd/unicast/ca/pol.h | 24 ++++++++++++++++++++++++ src/ipcpd/unicast/dir.c | 3 +-- src/ipcpd/unicast/dir/dht.h | 2 ++ src/ipcpd/unicast/dir/pol.h | 23 +++++++++++++++++++++++ src/ipcpd/unicast/pff.c | 5 +---- src/ipcpd/unicast/pff/pol.h | 25 +++++++++++++++++++++++++ src/ipcpd/unicast/routing.c | 2 +- src/ipcpd/unicast/routing/pol.h | 23 +++++++++++++++++++++++ 11 files changed, 125 insertions(+), 12 deletions(-) create mode 100644 src/ipcpd/unicast/addr-auth/pol.h create mode 100644 src/ipcpd/unicast/ca/pol.h create mode 100644 src/ipcpd/unicast/dir/pol.h create mode 100644 src/ipcpd/unicast/pff/pol.h create mode 100644 src/ipcpd/unicast/routing/pol.h diff --git a/src/ipcpd/unicast/addr-auth.c b/src/ipcpd/unicast/addr-auth.c index 4aff9361..01c2188f 100644 --- a/src/ipcpd/unicast/addr-auth.c +++ b/src/ipcpd/unicast/addr-auth.c @@ -25,8 +25,7 @@ #include #include "addr-auth.h" -#include "addr-auth/ops.h" -#include "addr-auth/flat.h" +#include "addr-auth/pol.h" #include diff --git a/src/ipcpd/unicast/addr-auth/pol.h b/src/ipcpd/unicast/addr-auth/pol.h new file mode 100644 index 00000000..70747af9 --- /dev/null +++ b/src/ipcpd/unicast/addr-auth/pol.h @@ -0,0 +1,23 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2021 + * + * Address Authority policies + * + * Dimitri Staessens + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., http://www.fsf.org/about/contact/. + */ + +#include "flat.h" diff --git a/src/ipcpd/unicast/ca.c b/src/ipcpd/unicast/ca.c index 20cdc6be..3dbc93d5 100644 --- a/src/ipcpd/unicast/ca.c +++ b/src/ipcpd/unicast/ca.c @@ -25,9 +25,7 @@ #include #include "ca.h" -#include "ca/ops.h" -#include "ca/mb-ecn.h" -#include "ca/nop.h" +#include "ca/pol.h" struct { struct ca_ops * ops; diff --git a/src/ipcpd/unicast/ca/pol.h b/src/ipcpd/unicast/ca/pol.h new file mode 100644 index 00000000..713c59b9 --- /dev/null +++ b/src/ipcpd/unicast/ca/pol.h @@ -0,0 +1,24 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2021 + * + * Congestion avoidance policies + * + * Dimitri Staessens + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., http://www.fsf.org/about/contact/. + */ + +#include "mb-ecn.h" +#include "nop.h" diff --git a/src/ipcpd/unicast/dir.c b/src/ipcpd/unicast/dir.c index 984f1b60..0c48de0d 100644 --- a/src/ipcpd/unicast/dir.c +++ b/src/ipcpd/unicast/dir.c @@ -34,8 +34,7 @@ #include #include "dir.h" -#include "dir/ops.h" -#include "dir/dht.h" +#include "dir/pol.h" #include #include diff --git a/src/ipcpd/unicast/dir/dht.h b/src/ipcpd/unicast/dir/dht.h index f6fb8e83..c34cf1c4 100644 --- a/src/ipcpd/unicast/dir/dht.h +++ b/src/ipcpd/unicast/dir/dht.h @@ -25,6 +25,8 @@ #include +#include "ops.h" + #include #include diff --git a/src/ipcpd/unicast/dir/pol.h b/src/ipcpd/unicast/dir/pol.h new file mode 100644 index 00000000..3aa2d59f --- /dev/null +++ b/src/ipcpd/unicast/dir/pol.h @@ -0,0 +1,23 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2021 + * + * Directory policies + * + * Dimitri Staessens + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., http://www.fsf.org/about/contact/. + */ + +#include "dht.h" diff --git a/src/ipcpd/unicast/pff.c b/src/ipcpd/unicast/pff.c index 192552b9..3d36e6b0 100644 --- a/src/ipcpd/unicast/pff.c +++ b/src/ipcpd/unicast/pff.c @@ -26,10 +26,7 @@ #include #include "pff.h" -#include "pff/ops.h" -#include "pff/alternate.h" -#include "pff/multipath.h" -#include "pff/simple.h" +#include "pff/pol.h" struct pff { struct pff_ops * ops; diff --git a/src/ipcpd/unicast/pff/pol.h b/src/ipcpd/unicast/pff/pol.h new file mode 100644 index 00000000..322d6dd6 --- /dev/null +++ b/src/ipcpd/unicast/pff/pol.h @@ -0,0 +1,25 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2021 + * + * PDU Forwarding Function policies + * + * Dimitri Staessens + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., http://www.fsf.org/about/contact/. + */ + +#include "alternate.h" +#include "multipath.h" +#include "simple.h" diff --git a/src/ipcpd/unicast/routing.c b/src/ipcpd/unicast/routing.c index b1e1ed77..09f7d711 100644 --- a/src/ipcpd/unicast/routing.c +++ b/src/ipcpd/unicast/routing.c @@ -26,7 +26,7 @@ #include "pff.h" #include "routing.h" -#include "routing/link-state.h" +#include "routing/pol.h" struct routing_ops * r_ops; diff --git a/src/ipcpd/unicast/routing/pol.h b/src/ipcpd/unicast/routing/pol.h new file mode 100644 index 00000000..f6e5274e --- /dev/null +++ b/src/ipcpd/unicast/routing/pol.h @@ -0,0 +1,23 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2021 + * + * Routing policies + * + * Dimitri Staessens + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., http://www.fsf.org/about/contact/. + */ + +#include "link-state.h" -- cgit v1.2.3