extern void rib_close_table(struct route_table *);
extern void rib_init(void);
extern unsigned long rib_score_proto(u_char proto, u_short instance);
+extern unsigned long rib_score_proto_table(u_char proto, u_short instance,
+ struct route_table *table);
extern void rib_queue_add(struct route_node *rn);
extern void meta_queue_free(struct meta_queue *mq);
extern int zebra_rib_labeled_unicast(struct route_entry *re);
#include "zebra_netns_notify.h"
#include "zebra_netns_id.h"
#include "zebra_pbr.h"
+#include "rib.h"
extern struct zebra_privs_t zserv_privs;
return NULL;
}
+unsigned long zebra_ns_score_proto(u_char proto, u_short instance)
+{
+ struct zebra_ns *zns;
+ struct zebra_ns_table *znst;
+ unsigned long cnt = 0;
+
+ zns = zebra_ns_lookup(NS_DEFAULT);
+
+ RB_FOREACH (znst, zebra_ns_table_head, &zns->ns_tables)
+ cnt += rib_score_proto_table(proto, instance, znst->table);
+
+ return cnt;
+}
+
struct route_table *zebra_ns_get_table(struct zebra_ns *zns,
struct zebra_vrf *zvrf, uint32_t tableid,
afi_t afi)
struct zebra_vrf *zvrf,
uint32_t tableid, afi_t afi);
int zebra_ns_config_write(struct vty *vty, struct ns *ns);
+
+unsigned long zebra_ns_score_proto(u_char proto, u_short instance);
#endif
}
/* Remove specific by protocol routes from 'table'. */
-static unsigned long rib_score_proto_table(u_char proto, u_short instance,
- struct route_table *table)
+unsigned long rib_score_proto_table(u_char proto, u_short instance,
+ struct route_table *table)
{
struct route_node *rn;
struct route_entry *re;
proto, instance,
zvrf->table[AFI_IP6][SAFI_UNICAST]);
+ cnt += zebra_ns_score_proto(proto, instance);
+
return cnt;
}