summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 15:31:19 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 15:31:19 +0200
commitd7b077f5d63625beaca1bcfe971e3b853dbfcc06 (patch)
tree7d0e8d62cca65ae2dd3d5e6231657f1e43630b5a /proto
parentd024f471ea5239a8cb6ce2ccd83b686a1d438aa5 (diff)
parent4a23ede2b056a41456790cc20a0c3d92a7137693 (diff)
Merge commit '4a23ede2b056a41456790cc20a0c3d92a7137693' into haugesund
Diffstat (limited to 'proto')
-rw-r--r--proto/babel/Makefile1
-rw-r--r--proto/babel/babel.c6
-rw-r--r--proto/bfd/Makefile3
-rw-r--r--proto/bfd/bfd.c17
-rw-r--r--proto/bgp/Makefile3
-rw-r--r--proto/bgp/attrs.c8
-rw-r--r--proto/bgp/bgp.c5
-rw-r--r--proto/bgp/bgp.h4
-rw-r--r--proto/bgp/packets.c2
-rw-r--r--proto/mrt/Makefile3
-rw-r--r--proto/mrt/mrt.c6
-rw-r--r--proto/ospf/Makefile3
-rw-r--r--proto/ospf/ospf.c6
-rw-r--r--proto/perf/Makefile1
-rw-r--r--proto/perf/perf.c6
-rw-r--r--proto/pipe/Makefile3
-rw-r--r--proto/pipe/pipe.c6
-rw-r--r--proto/radv/Makefile3
-rw-r--r--proto/radv/radv.c6
-rw-r--r--proto/rip/Makefile3
-rw-r--r--proto/rip/rip.c6
-rw-r--r--proto/rpki/Makefile3
-rw-r--r--proto/rpki/rpki.c6
-rw-r--r--proto/static/Makefile3
-rw-r--r--proto/static/static.c6
25 files changed, 93 insertions, 26 deletions
diff --git a/proto/babel/Makefile b/proto/babel/Makefile
index 06b58e95..ae6aeaf2 100644
--- a/proto/babel/Makefile
+++ b/proto/babel/Makefile
@@ -2,5 +2,6 @@ src := babel.c packets.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,babel_build)
tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 9551b594..a8ca9e52 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -2497,3 +2497,9 @@ struct protocol proto_babel = {
.get_route_info = babel_get_route_info,
.get_attr = babel_get_attr
};
+
+void
+babel_build(void)
+{
+ proto_build(&proto_babel);
+}
diff --git a/proto/bfd/Makefile b/proto/bfd/Makefile
index 402122fc..dbdc0a09 100644
--- a/proto/bfd/Makefile
+++ b/proto/bfd/Makefile
@@ -2,5 +2,6 @@ src := bfd.c io.c packets.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,bfd_build)
-tests_objs := $(tests_objs) $(src-o-files) \ No newline at end of file
+tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/bfd/bfd.c b/proto/bfd/bfd.c
index 277f38bf..d1e97cd5 100644
--- a/proto/bfd/bfd.c
+++ b/proto/bfd/bfd.c
@@ -113,8 +113,8 @@
#define HASH_IP_EQ(a1,n1,a2,n2) ipa_equal(a1, a2) && n1 == n2
#define HASH_IP_FN(a,n) ipa_hash(a) ^ u32_hash(n)
-static list bfd_proto_list;
-static list bfd_wait_list;
+static list STATIC_LIST_INIT(bfd_proto_list);
+static list STATIC_LIST_INIT(bfd_wait_list);
const char *bfd_state_names[] = { "AdminDown", "Down", "Init", "Up" };
@@ -998,13 +998,6 @@ bfd_notify_init(struct bfd_proto *p)
* BFD protocol glue
*/
-void
-bfd_init_all(void)
-{
- init_list(&bfd_proto_list);
- init_list(&bfd_wait_list);
-}
-
static struct proto *
bfd_init(struct proto_config *c)
{
@@ -1186,3 +1179,9 @@ struct protocol proto_bfd = {
.reconfigure = bfd_reconfigure,
.copy_config = bfd_copy_config,
};
+
+void
+bfd_build(void)
+{
+ proto_build(&proto_bfd);
+}
diff --git a/proto/bgp/Makefile b/proto/bgp/Makefile
index 00aaef5e..2a4cc99c 100644
--- a/proto/bgp/Makefile
+++ b/proto/bgp/Makefile
@@ -2,5 +2,6 @@ src := attrs.c bgp.c packets.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,bgp_build)
-tests_objs := $(tests_objs) $(src-o-files) \ No newline at end of file
+tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index e2138679..f4f7d15a 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -106,7 +106,7 @@ bgp_set_attr(ea_list **attrs, struct linpool *pool, uint code, uint flags, uintp
({ REPORT(msg, ## args); s->err_withdraw = 1; return; })
#define UNSET(a) \
- ({ a->type = EAF_TYPE_UNDEF; return; })
+ ({ a->undef = 1; return; })
#define REJECT(msg, args...) \
({ log(L_ERR "%s: " msg, s->proto->p.name, ## args); s->err_reject = 1; return; })
@@ -1153,7 +1153,7 @@ bgp_export_attr(struct bgp_export_state *s, eattr *a, ea_list *to)
a->flags = (a->flags & BAF_PARTIAL) | desc->flags;
/* Set partial bit if new opt-trans attribute is attached to non-local route */
- if ((s->src != NULL) && (a->type & EAF_ORIGINATED) &&
+ if ((s->src != NULL) && (a->originated) &&
(a->flags & BAF_OPTIONAL) && (a->flags & BAF_TRANSITIVE))
a->flags |= BAF_PARTIAL;
@@ -1161,7 +1161,7 @@ bgp_export_attr(struct bgp_export_state *s, eattr *a, ea_list *to)
CALL(desc->export, s, a);
/* Attribute might become undefined in hook */
- if ((a->type & EAF_TYPE_MASK) == EAF_TYPE_UNDEF)
+ if (a->undef)
return;
}
else
@@ -1776,7 +1776,7 @@ bgp_update_attrs(struct bgp_proto *p, struct bgp_channel *c, rte *e, ea_list *at
/* MULTI_EXIT_DESC attribute - accept only if set in export filter */
a = bgp_find_attr(attrs0, BA_MULTI_EXIT_DISC);
- if (a && !(a->type & EAF_FRESH))
+ if (a && !(a->fresh))
bgp_unset_attr(&attrs, pool, BA_MULTI_EXIT_DISC);
}
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index f52eb2f0..220551f6 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -2592,3 +2592,8 @@ struct protocol proto_bgp = {
.get_route_info = bgp_get_route_info,
.show_proto_info = bgp_show_proto_info
};
+
+void bgp_build(void)
+{
+ proto_build(&proto_bgp);
+}
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h
index 655b2636..022adb39 100644
--- a/proto/bgp/bgp.h
+++ b/proto/bgp/bgp.h
@@ -563,9 +563,7 @@ bgp_set_attr_data(ea_list **to, struct linpool *pool, uint code, uint flags, voi
bgp_set_attr(to, pool, code, flags, (uintptr_t) a);
}
-static inline void
-bgp_unset_attr(ea_list **to, struct linpool *pool, uint code)
-{ eattr *e = bgp_set_attr(to, pool, code, 0, 0); e->type = EAF_TYPE_UNDEF; }
+#define bgp_unset_attr(to, pool, code) ea_unset_attr(to, pool, 0, code)
int bgp_encode_mp_reach_mrt(struct bgp_write_state *s, eattr *a, byte *buf, uint size);
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index adfaf2f1..c88165bc 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -1062,7 +1062,7 @@ bgp_use_next_hop(struct bgp_export_state *s, eattr *a)
return 1;
/* Keep it when explicitly set in export filter */
- if (a->type & EAF_FRESH)
+ if (a->fresh)
return 1;
/* Check for non-matching AF */
diff --git a/proto/mrt/Makefile b/proto/mrt/Makefile
index 925fb102..000e1c1c 100644
--- a/proto/mrt/Makefile
+++ b/proto/mrt/Makefile
@@ -2,5 +2,6 @@ src := mrt.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,mrt_build)
-tests_objs := $(tests_objs) $(src-o-files) \ No newline at end of file
+tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/mrt/mrt.c b/proto/mrt/mrt.c
index 5da3c7c6..589e43fb 100644
--- a/proto/mrt/mrt.c
+++ b/proto/mrt/mrt.c
@@ -913,3 +913,9 @@ struct protocol proto_mrt = {
.reconfigure = mrt_reconfigure,
.copy_config = mrt_copy_config,
};
+
+void
+mrt_build(void)
+{
+ proto_build(&proto_mrt);
+}
diff --git a/proto/ospf/Makefile b/proto/ospf/Makefile
index 39e74f71..85664543 100644
--- a/proto/ospf/Makefile
+++ b/proto/ospf/Makefile
@@ -2,5 +2,6 @@ src := dbdes.c hello.c iface.c lsack.c lsalib.c lsreq.c lsupd.c neighbor.c ospf.
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,ospf_build)
-tests_objs := $(tests_objs) $(src-o-files) \ No newline at end of file
+tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index 22150590..d651d48d 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -1534,3 +1534,9 @@ struct protocol proto_ospf = {
.get_attr = ospf_get_attr,
.get_route_info = ospf_get_route_info
};
+
+void
+ospf_build(void)
+{
+ proto_build(&proto_ospf);
+}
diff --git a/proto/perf/Makefile b/proto/perf/Makefile
index 7877fb19..42051f43 100644
--- a/proto/perf/Makefile
+++ b/proto/perf/Makefile
@@ -2,5 +2,6 @@ src := perf.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,perf_build)
tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/perf/perf.c b/proto/perf/perf.c
index 8b2cb69f..a4945933 100644
--- a/proto/perf/perf.c
+++ b/proto/perf/perf.c
@@ -314,3 +314,9 @@ struct protocol proto_perf = {
.reconfigure = perf_reconfigure,
.copy_config = perf_copy_config,
};
+
+void
+perf_build(void)
+{
+ proto_build(&proto_perf);
+}
diff --git a/proto/pipe/Makefile b/proto/pipe/Makefile
index 5093da98..ba66027f 100644
--- a/proto/pipe/Makefile
+++ b/proto/pipe/Makefile
@@ -2,5 +2,6 @@ src := pipe.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,pipe_build)
-tests_objs := $(tests_objs) $(src-o-files) \ No newline at end of file
+tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c
index bbcd8f0d..da4104a8 100644
--- a/proto/pipe/pipe.c
+++ b/proto/pipe/pipe.c
@@ -309,3 +309,9 @@ struct protocol proto_pipe = {
.get_status = pipe_get_status,
.show_proto_info = pipe_show_proto_info
};
+
+void
+pipe_build(void)
+{
+ proto_build(&proto_pipe);
+}
diff --git a/proto/radv/Makefile b/proto/radv/Makefile
index 05317eff..4780bee3 100644
--- a/proto/radv/Makefile
+++ b/proto/radv/Makefile
@@ -2,5 +2,6 @@ src := packets.c radv.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,radv_build)
-tests_objs := $(tests_objs) $(src-o-files) \ No newline at end of file
+tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/radv/radv.c b/proto/radv/radv.c
index fa228c69..24b1ce24 100644
--- a/proto/radv/radv.c
+++ b/proto/radv/radv.c
@@ -771,3 +771,9 @@ struct protocol proto_radv = {
.get_status = radv_get_status,
.get_attr = radv_get_attr
};
+
+void
+radv_build(void)
+{
+ proto_build(&proto_radv);
+}
diff --git a/proto/rip/Makefile b/proto/rip/Makefile
index 7feabcd8..b9ff62d6 100644
--- a/proto/rip/Makefile
+++ b/proto/rip/Makefile
@@ -2,5 +2,6 @@ src := packets.c rip.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,rip_build)
-tests_objs := $(tests_objs) $(src-o-files) \ No newline at end of file
+tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index b04238fb..eeca7834 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -1341,3 +1341,9 @@ struct protocol proto_rip = {
.get_route_info = rip_get_route_info,
.get_attr = rip_get_attr
};
+
+void
+rip_build(void)
+{
+ proto_build(&proto_rip);
+}
diff --git a/proto/rpki/Makefile b/proto/rpki/Makefile
index eb09b7df..8e3a2761 100644
--- a/proto/rpki/Makefile
+++ b/proto/rpki/Makefile
@@ -2,5 +2,6 @@ src := rpki.c packets.c tcp_transport.c ssh_transport.c transport.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,rpki_build)
-tests_objs := $(tests_objs) $(src-o-files) \ No newline at end of file
+tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/rpki/rpki.c b/proto/rpki/rpki.c
index 95066499..766b8445 100644
--- a/proto/rpki/rpki.c
+++ b/proto/rpki/rpki.c
@@ -955,3 +955,9 @@ struct protocol proto_rpki = {
.reconfigure = rpki_reconfigure,
.get_status = rpki_get_status,
};
+
+void
+rpki_build(void)
+{
+ proto_build(&proto_rpki);
+}
diff --git a/proto/static/Makefile b/proto/static/Makefile
index e38f9b74..26aed31f 100644
--- a/proto/static/Makefile
+++ b/proto/static/Makefile
@@ -2,5 +2,6 @@ src := static.c
obj := $(src-o-files)
$(all-daemon)
$(cf-local)
+$(call proto-build,static_build)
-tests_objs := $(tests_objs) $(src-o-files) \ No newline at end of file
+tests_objs := $(tests_objs) $(src-o-files)
diff --git a/proto/static/static.c b/proto/static/static.c
index f8ac9c81..8e0a3489 100644
--- a/proto/static/static.c
+++ b/proto/static/static.c
@@ -775,3 +775,9 @@ struct protocol proto_static = {
.copy_config = static_copy_config,
.get_route_info = static_get_route_info,
};
+
+void
+static_build(void)
+{
+ proto_build(&proto_static);
+}