From 3fb70b26faca6788aa0bdf1d558414f9f777c6cd Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Thu, 31 Mar 2022 19:22:07 +0200 Subject: [PATCH] Complex route attributes are data structures, shall be in lib also --- filter/data.c | 2 +- filter/filter.c | 2 +- filter/filter.h | 2 +- lib/Makefile | 4 ++-- {nest => lib}/a-path.c | 2 +- {nest => lib}/a-path_test.c | 2 +- {nest => lib}/a-set.c | 2 +- {nest => lib}/a-set_test.c | 2 +- {nest => lib}/attrs.h | 0 nest/Makefile | 4 ++-- nest/rt-attr.c | 2 +- proto/bgp/attrs.c | 2 +- proto/bgp/packets.c | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) rename {nest => lib}/a-path.c (99%) rename {nest => lib}/a-path_test.c (99%) rename {nest => lib}/a-set.c (99%) rename {nest => lib}/a-set_test.c (99%) rename {nest => lib}/attrs.h (100%) diff --git a/filter/data.c b/filter/data.c index 87ef4ff1..381448fa 100644 --- a/filter/data.c +++ b/filter/data.c @@ -19,7 +19,7 @@ #include "nest/rt.h" #include "nest/protocol.h" #include "nest/iface.h" -#include "nest/attrs.h" +#include "lib/attrs.h" #include "conf/conf.h" #include "filter/filter.h" #include "filter/f-inst.h" diff --git a/filter/filter.c b/filter/filter.c index 31ae79fe..8f946f5b 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -38,7 +38,7 @@ #include "nest/rt.h" #include "nest/protocol.h" #include "nest/iface.h" -#include "nest/attrs.h" +#include "lib/attrs.h" #include "conf/conf.h" #include "filter/filter.h" #include "filter/f-inst.h" diff --git a/filter/filter.h b/filter/filter.h index 8ce6c1e0..385f1179 100644 --- a/filter/filter.h +++ b/filter/filter.h @@ -14,7 +14,7 @@ #include "lib/ip.h" #include "lib/macro.h" #include "nest/rt.h" -#include "nest/attrs.h" +#include "lib/attrs.h" /* Possible return values of filter execution */ enum filter_return { diff --git a/lib/Makefile b/lib/Makefile index 812f721c..853e0a22 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,7 +1,7 @@ -src := bitmap.c bitops.c blake2s.c blake2b.c checksum.c event.c flowspec.c idm.c ip.c lists.c mac.c md5.c mempool.c net.c patmatch.c printf.c resource.c sha1.c sha256.c sha512.c slab.c slists.c strtoul.c tbf.c timer.c xmalloc.c +src := a-path.c a-set.c bitmap.c bitops.c blake2s.c blake2b.c checksum.c event.c flowspec.c idm.c ip.c lists.c mac.c md5.c mempool.c net.c patmatch.c printf.c resource.c sha1.c sha256.c sha512.c slab.c slists.c strtoul.c tbf.c timer.c xmalloc.c obj := $(src-o-files) $(all-daemon) -tests_src := bitmap_test.c heap_test.c buffer_test.c event_test.c flowspec_test.c bitops_test.c patmatch_test.c fletcher16_test.c slist_test.c checksum_test.c lists_test.c mac_test.c ip_test.c hash_test.c printf_test.c slab_test.c +tests_src := a-set_test.c a-path_test.c bitmap_test.c heap_test.c buffer_test.c event_test.c flowspec_test.c bitops_test.c patmatch_test.c fletcher16_test.c slist_test.c checksum_test.c lists_test.c mac_test.c ip_test.c hash_test.c printf_test.c slab_test.c tests_targets := $(tests_targets) $(tests-target-files) tests_objs := $(tests_objs) $(src-o-files) diff --git a/nest/a-path.c b/lib/a-path.c similarity index 99% rename from nest/a-path.c rename to lib/a-path.c index 64504c93..0eca8475 100644 --- a/nest/a-path.c +++ b/lib/a-path.c @@ -9,7 +9,7 @@ #include "nest/bird.h" #include "nest/rt.h" -#include "nest/attrs.h" +#include "lib/attrs.h" #include "lib/resource.h" #include "lib/unaligned.h" #include "lib/string.h" diff --git a/nest/a-path_test.c b/lib/a-path_test.c similarity index 99% rename from nest/a-path_test.c rename to lib/a-path_test.c index a6b4d3d8..38f77642 100644 --- a/nest/a-path_test.c +++ b/lib/a-path_test.c @@ -10,7 +10,7 @@ #include "test/bt-utils.h" #include "nest/rt.h" -#include "nest/attrs.h" +#include "lib/attrs.h" #include "lib/resource.h" #define TESTS_NUM 30 diff --git a/nest/a-set.c b/lib/a-set.c similarity index 99% rename from nest/a-set.c rename to lib/a-set.c index 93f6431e..8ede9b83 100644 --- a/nest/a-set.c +++ b/lib/a-set.c @@ -11,7 +11,7 @@ #include "nest/bird.h" #include "nest/rt.h" -#include "nest/attrs.h" +#include "lib/attrs.h" #include "lib/resource.h" #include "lib/string.h" diff --git a/nest/a-set_test.c b/lib/a-set_test.c similarity index 99% rename from nest/a-set_test.c rename to lib/a-set_test.c index daa6ab74..3280031f 100644 --- a/nest/a-set_test.c +++ b/lib/a-set_test.c @@ -11,7 +11,7 @@ #include "lib/net.h" #include "nest/rt.h" -#include "nest/attrs.h" +#include "lib/attrs.h" #include "lib/resource.h" #define SET_SIZE 10 diff --git a/nest/attrs.h b/lib/attrs.h similarity index 100% rename from nest/attrs.h rename to lib/attrs.h diff --git a/nest/Makefile b/nest/Makefile index 7d451ba4..c0765530 100644 --- a/nest/Makefile +++ b/nest/Makefile @@ -1,4 +1,4 @@ -src := a-path.c a-set.c cli.c cmds.c iface.c locks.c neighbor.c password.c proto.c proto-build.c rt-attr.c rt-dev.c rt-fib.c rt-show.c rt-table.c +src := cli.c cmds.c iface.c locks.c neighbor.c password.c proto.c proto-build.c rt-attr.c rt-dev.c rt-fib.c rt-show.c rt-table.c obj := $(src-o-files) $(all-daemon) $(cf-local) @@ -8,6 +8,6 @@ $(proto-build-c): $(lastword $(MAKEFILE_LIST)) $(E)echo GEN $@ $(Q)echo "$(patsubst %,void %(void); ,$(PROTO_BUILD)) void protos_build_gen(void) { $(patsubst %, %(); ,$(PROTO_BUILD))}" > $@ -tests_src := a-set_test.c a-path_test.c +tests_src := tests_targets := $(tests_targets) $(tests-target-files) tests_objs := $(tests_objs) $(src-o-files) diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 8f4319c5..2fa9b673 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -49,7 +49,7 @@ #include "nest/protocol.h" #include "nest/iface.h" #include "nest/cli.h" -#include "nest/attrs.h" +#include "lib/attrs.h" #include "lib/alloca.h" #include "lib/hash.h" #include "lib/idm.h" diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 3265cb5e..2c0d011f 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -16,7 +16,7 @@ #include "nest/iface.h" #include "nest/protocol.h" #include "nest/rt.h" -#include "nest/attrs.h" +#include "lib/attrs.h" #include "conf/conf.h" #include "lib/resource.h" #include "lib/string.h" diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index 5def0f27..8eeae490 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -16,7 +16,7 @@ #include "nest/iface.h" #include "nest/protocol.h" #include "nest/rt.h" -#include "nest/attrs.h" +#include "lib/attrs.h" #include "proto/mrt/mrt.h" #include "conf/conf.h" #include "lib/unaligned.h"