+
+ rmi = nb_running_get_entry(dnode, NULL, false);
+ if (rmi == NULL) {
+ /*
+ * We can't have outdated rules if route map hasn't
+ * been created yet.
+ */
+ return;
+ }
+
+#define SKIP_RULE(name) if (strcmp((name), rmr->cmd->str) == 0) continue
+
+ /* Print route map `match` for old CLI users. */
+ for (rmr = rmi->match_list.head; rmr; rmr = rmr->next) {
+ /* Skip all matches implemented by northbound. */
+ SKIP_RULE("interface");
+ SKIP_RULE("ip address");
+ SKIP_RULE("ip address prefix-list");
+ SKIP_RULE("ip next-hop");
+ SKIP_RULE("ip next-hop prefix-list");
+ SKIP_RULE("ip next-hop type");
+ SKIP_RULE("ipv6 address");
+ SKIP_RULE("ipv6 address prefix-list");
+ SKIP_RULE("ipv6 next-hop type");
+ SKIP_RULE("metric");
+ SKIP_RULE("tag");
+
+ vty_out(vty, " match %s %s\n", rmr->cmd->str,
+ rmr->rule_str ? rmr->rule_str : "");
+ }
+
+ /* Print route map `set` for old CLI users. */
+ for (rmr = rmi->set_list.head; rmr; rmr = rmr->next) {
+ /* Skip all sets implemented by northbound. */
+ SKIP_RULE("metric");
+ SKIP_RULE("tag");
+
+ vty_out(vty, " set %s %s\n", rmr->cmd->str,
+ rmr->rule_str ? rmr->rule_str : "");
+ }
+
+#undef SKIP_RULE