summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2022-10-31 16:24:43 +0100
committerGitHub <noreply@github.com>2022-10-31 16:24:43 +0100
commita5dac029016a780251931e1c1806ca2050c5a044 (patch)
tree307736ad495775343a124bd79ccc0ae6cc862959 /lib
parentMerge pull request #12195 from anlancs/fix/ospfd-missing-max-metric (diff)
parentbgpd: Implement Accumulated IGP Metric Attribute for BGP (diff)
downloadfrr-a5dac029016a780251931e1c1806ca2050c5a044.tar.xz
frr-a5dac029016a780251931e1c1806ca2050c5a044.zip
Merge pull request #12114 from opensourcerouting/feature/bgp_aigp_attribute
bgpd: Implement AIGP
Diffstat (limited to 'lib')
-rw-r--r--lib/routemap.h1
-rw-r--r--lib/routemap_cli.c5
-rw-r--r--lib/stream.h12
3 files changed, 18 insertions, 0 deletions
diff --git a/lib/routemap.h b/lib/routemap.h
index c2e9de6cf..9c78e1573 100644
--- a/lib/routemap.h
+++ b/lib/routemap.h
@@ -348,6 +348,7 @@ DECLARE_QOBJ_TYPE(route_map);
(strmatch(A, "frr-bgp-route-map:set-origin"))
#define IS_SET_ATOMIC_AGGREGATE(A) \
(strmatch(A, "frr-bgp-route-map:atomic-aggregate"))
+#define IS_SET_AIGP_METRIC(A) (strmatch(A, "frr-bgp-route-map:aigp-metric"))
#define IS_SET_ORIGINATOR_ID(A) \
(strmatch(A, "frr-bgp-route-map:originator-id"))
#define IS_SET_COMM_LIST_DEL(A) \
diff --git a/lib/routemap_cli.c b/lib/routemap_cli.c
index 6be5d15ec..e3da29bd7 100644
--- a/lib/routemap_cli.c
+++ b/lib/routemap_cli.c
@@ -1089,6 +1089,11 @@ void route_map_action_show(struct vty *vty, const struct lyd_node *dnode,
"./rmap-set-action/frr-bgp-route-map:origin"));
} else if (IS_SET_ATOMIC_AGGREGATE(action)) {
vty_out(vty, " set atomic-aggregate\n");
+ } else if (IS_SET_AIGP_METRIC(action)) {
+ vty_out(vty, " set aigp-metric %s\n",
+ yang_dnode_get_string(
+ dnode,
+ "./rmap-set-action/frr-bgp-route-map:aigp-metric"));
} else if (IS_SET_ORIGINATOR_ID(action)) {
vty_out(vty, " set originator-id %s\n",
yang_dnode_get_string(
diff --git a/lib/stream.h b/lib/stream.h
index 35733e743..a3c148c9c 100644
--- a/lib/stream.h
+++ b/lib/stream.h
@@ -386,6 +386,18 @@ extern void stream_fifo_free(struct stream_fifo *fifo);
* bit), for 64-bit values (you need to cast them anyway), and neither for
* encoding (because it's downcasted.)
*/
+static inline const uint8_t *ptr_get_be64(const uint8_t *ptr, uint64_t *out)
+{
+ uint32_t tmp1, tmp2;
+
+ memcpy(&tmp1, ptr, sizeof(tmp1));
+ memcpy(&tmp2, ptr + sizeof(tmp1), sizeof(tmp1));
+
+ *out = (((uint64_t)ntohl(tmp1)) << 32) | ntohl(tmp2);
+
+ return ptr + 8;
+}
+
static inline const uint8_t *ptr_get_be32(const uint8_t *ptr, uint32_t *out)
{
uint32_t tmp;