]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Removing the route scope attribute. Use custom attributes instead.
authorMaria Matejka <mq@ucw.cz>
Wed, 4 May 2022 10:41:54 +0000 (12:41 +0200)
committerMaria Matejka <mq@ucw.cz>
Wed, 4 May 2022 13:39:21 +0000 (15:39 +0200)
The route scope attribute was used for simple user route marking. As
there is a better tool for this (custom attributes), the old and limited
way can be dropped.

17 files changed:
doc/bird.sgml
filter/config.Y
filter/data.h
filter/f-inst.c
filter/test.conf2
lib/route.h
nest/rt-attr.c
nest/rt-dev.c
proto/babel/babel.c
proto/bgp/packets.c
proto/ospf/rt.c
proto/perf/perf.c
proto/rip/rip.c
proto/rpki/rpki.c
proto/static/static.c
sysdep/bsd/krt-sock.c
sysdep/linux/netlink.c

index a71624aae24e3cbd696cc3e688e971695f4df46f..aa058b37ab28a8e0ffa5f675c7c7841573e54710 100644 (file)
@@ -1723,14 +1723,6 @@ Common route attributes are:
        primary key of the routing table. Read-only. (See the <ref id="routes"
        name="chapter about routes">.)
 
-       <tag><label id="rta-scope"><m/enum/ scope</tag>
-       The scope of the route. Possible values: <cf/SCOPE_HOST/ for routes
-       local to this host, <cf/SCOPE_LINK/ for those specific for a physical
-       link, <cf/SCOPE_SITE/ and <cf/SCOPE_ORGANIZATION/ for private routes and
-       <cf/SCOPE_UNIVERSE/ for globally visible routes. This attribute is not
-       interpreted by BIRD and can be used to mark routes in filters. The
-       default value for new routes is <cf/SCOPE_UNIVERSE/.
-
        <tag><label id="rta-preference"><m/int/ preference</tag>
        Preference of the route.
 
index 7dcdb7794cb780dff3b6df52f2a2b2e61676b66f..6af39c10e85380fe13ff24feddf71d9195e93cd3 100644 (file)
@@ -766,7 +766,6 @@ static_attr:
  | NET     { $$ = f_new_static_attr(T_NET,       SA_NET,       1); }
  | PROTO   { $$ = f_new_static_attr(T_STRING,     SA_PROTO,    1); }
  | SOURCE  { $$ = f_new_static_attr(T_ENUM_RTS,   SA_SOURCE,   1); }
- | SCOPE   { $$ = f_new_static_attr(T_ENUM_SCOPE, SA_SCOPE,    0); }
  | DEST    { $$ = f_new_static_attr(T_ENUM_RTD,   SA_DEST,     0); }
  | IFNAME  { $$ = f_new_static_attr(T_STRING,     SA_IFNAME,   0); }
  | IFINDEX { $$ = f_new_static_attr(T_INT,        SA_IFINDEX,  1); }
index a0a164ed0f9de8c8be3b0b3c3209ec40527c06d9..49b29499f895f9ccdc0e1ddac82ca4f99bd283a3 100644 (file)
@@ -26,7 +26,6 @@ enum f_sa_code {
   SA_NET,
   SA_PROTO,
   SA_SOURCE,
-  SA_SCOPE,
   SA_DEST,
   SA_IFNAME,
   SA_IFINDEX,
index 7158d22e6eddcf151d79887880616e0490a0ac3d..5eacc7169a3cddebd38d159b80e17a7f94656e28 100644 (file)
       case SA_NET:     RESULT(sa.type, net, (*fs->rte)->net->n.addr); break;
       case SA_PROTO:   RESULT(sa.type, s, (*fs->rte)->src->proto->name); break;
       case SA_SOURCE:  RESULT(sa.type, i, rta->source); break;
-      case SA_SCOPE:   RESULT(sa.type, i, rta->scope); break;
       case SA_DEST:    RESULT(sa.type, i, rta->dest); break;
       case SA_IFNAME:  RESULT(sa.type, s, rta->nh.iface ? rta->nh.iface->name : ""); break;
       case SA_IFINDEX: RESULT(sa.type, i, rta->nh.iface ? rta->nh.iface->index : 0); break;
        }
        break;
 
-      case SA_SCOPE:
-       rta->scope = v1.val.i;
-       break;
-
       case SA_DEST:
        {
          int i = v1.val.i;
index e95f9563471d26bd5f286ba112faa2dcf6a2ea25..9fc8330fa687f0f411a00061d98a523eb77a488e 100644 (file)
@@ -38,12 +38,6 @@ protocol static {
                        print from;
                        from = 1.2.3.4;
                        print from;
-                       print scope;
-                       scope = SCOPE_HOST;
-                       print scope;
-                       if !(scope ~ [ SCOPE_HOST, SCOPE_SITE ]) then {
-                               print "Failed in test";
-                       }
 
                        preference = 15;
                        print preference;
index e02c63b30bca9d00c2dd517c9a482c07b1757543..40ba150dc8a96ffbfc6edcc19a75dd1ce37ba6d8 100644 (file)
@@ -86,7 +86,6 @@ typedef struct rta {
   struct hostentry *hostentry;         /* Hostentry for recursive next-hops */
   u16 cached:1;                                /* Are attributes cached? */
   u16 source:7;                                /* Route source (RTS_...) */
-  u16 scope:4;                         /* Route scope (SCOPE_... -- see ip.h) */
   u16 dest:4;                          /* Route destination type (RTD_...) */
   struct nexthop nh;                   /* Next hop */
 } rta;
index 87f54b0d27efbd917999e1fb13f4baf9c9633926..a892bfd510167ad5d5bfb74d38722118b9377c6d 100644 (file)
@@ -1235,7 +1235,6 @@ rta_hash(rta *a)
 #define BMIX(f) mem_hash_mix_num(&h, a->f);
   MIX(hostentry);
   BMIX(source);
-  BMIX(scope);
   BMIX(dest);
 #undef MIX
 
@@ -1246,7 +1245,6 @@ static inline int
 rta_same(rta *x, rta *y)
 {
   return (x->source == y->source &&
-         x->scope == y->scope &&
          x->dest == y->dest &&
          x->hostentry == y->hostentry &&
          nexthop_same(&(x->nh), &(y->nh)) &&
@@ -1396,8 +1394,8 @@ rta_dump(rta *a)
                         "RTS_OSPF_EXT2", "RTS_BGP", "RTS_PIPE", "RTS_BABEL" };
   static char *rtd[] = { "", " DEV", " HOLE", " UNREACH", " PROHIBIT" };
 
-  debug("uc=%d %s %s%s h=%04x",
-       a->uc, rts[a->source], ip_scope_text(a->scope),
+  debug("uc=%d %s %s h=%04x",
+       a->uc, rts[a->source],
        rtd[a->dest], a->hash_key);
   if (!a->cached)
     debug(" !CACHED");
@@ -1443,7 +1441,7 @@ rta_dump_all(void)
 void
 rta_show(struct cli *c, rta *a)
 {
-  cli_printf(c, -1008, "\tType: %s %s", rta_src_names[a->source], ip_scope_text(a->scope));
+  cli_printf(c, -1008, "\tType: %s", rta_src_names[a->source]);
 
   for(ea_list *eal = a->eattrs; eal; eal=eal->next)
     for(int i=0; i<eal->count; i++)
index 696b37b8da4e491c4acda36b6b7a6b9d648c589a..ffd5afd5973e74bfadd4a7d6c216bc57714d0982 100644 (file)
@@ -84,7 +84,6 @@ dev_ifa_notify(struct proto *P, uint flags, struct ifa *ad)
 
       rta a0 = {
        .source = RTS_DEVICE,
-       .scope = SCOPE_UNIVERSE,
        .dest = RTD_UNICAST,
        .nh.iface = ad->iface,
       };
index f4503b99048986b3822cf3db8a7f6af214f85627..cd221c7b9fc964da49109fccba05703b13d1e3ec 100644 (file)
@@ -659,7 +659,6 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e)
 
     rta a0 = {
       .source = RTS_BABEL,
-      .scope = SCOPE_UNIVERSE,
       .dest = RTD_UNICAST,
       .nh.gw = r->next_hop,
       .nh.iface = r->neigh->ifa->iface,
@@ -685,7 +684,6 @@ babel_announce_rte(struct babel_proto *p, struct babel_entry *e)
     /* Unreachable */
     rta a0 = {
       .source = RTS_BABEL,
-      .scope = SCOPE_UNIVERSE,
       .dest = RTD_UNREACHABLE,
     };
 
index 9760ebeedef767d949909ad285b6a575afaedf48..62d60e9a7a6deb40a7acf83908a55c70fe88f3ad 100644 (file)
@@ -2475,7 +2475,6 @@ bgp_decode_nlri(struct bgp_parse_state *s, u32 afi, byte *nlri, uint len, ea_lis
     a = allocz(RTA_MAX_SIZE);
 
     a->source = RTS_BGP;
-    a->scope = SCOPE_UNIVERSE;
     a->eattrs = ea;
 
     ea_set_attr_data(&a->eattrs, &ea_gen_from, 0, &s->proto->remote_ip, sizeof(ip_addr));
index 3d8cf22cc0ddaeee09aab0af2358e3059a51160f..ddc5b1625c65d6ad5809eac930a6f063e1f07d83 100644 (file)
@@ -2054,7 +2054,6 @@ again1:
     {
       rta a0 = {
        .source = nf->n.type,
-       .scope = SCOPE_UNIVERSE,
        .dest = RTD_UNICAST,
        .nh = *(nf->n.nhs),
       };
index 7b18866ced5207431e7f60ca0ab186c69933070a..47a2867d3a4147f4fcbb772776d13085c253e806 100644 (file)
@@ -144,7 +144,6 @@ perf_loop(void *data)
     if (!p->attrs_per_rte || !(i % p->attrs_per_rte)) {
       struct rta a0 = {
        .source = RTS_PERF,
-       .scope = SCOPE_UNIVERSE,
        .dest = RTD_UNICAST,
        .nh.iface = p->ifa->iface,
        .nh.gw = gw,
index 7c097a92579ccac58b7b0768ccf8b3a2e63151c3..f54426061577bf0cb35d114414b0103a1fb6375d 100644 (file)
@@ -153,7 +153,6 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en)
     /* Update */
     rta a0 = {
       .source = RTS_RIP,
-      .scope = SCOPE_UNIVERSE,
       .dest = RTD_UNICAST,
     };
 
index 710764e2a78fd010affb4e23290f675c74eaf412..af963f49875889ddecf42ff5bfa531162e2e87c8 100644 (file)
@@ -122,7 +122,6 @@ rpki_table_add_roa(struct rpki_cache *cache, struct channel *channel, const net_
 
   rta a0 = {
     .source = RTS_RPKI,
-    .scope = SCOPE_UNIVERSE,
     .dest = RTD_NONE,
   };
 
index d4b1c5f3876d430370ca20d8cabeb363de99c701..ff833b1608698384272fec6cdb38108a4d75f93c 100644 (file)
@@ -56,7 +56,6 @@ static_announce_rte(struct static_proto *p, struct static_route *r)
   rta *a = allocz(RTA_MAX_SIZE);
   struct rte_src *src = static_get_source(p, r->index);
   a->source = RTS_STATIC;
-  a->scope = SCOPE_UNIVERSE;
   a->dest = r->dest;
   ea_set_attr_u32(&a->eattrs, &ea_gen_preference, 0, p->p.main_channel->preference);
 
index 844b9f83b455c86a1b4cabd0db36b59cbc60e1cf..bc6b1839a5f8c24683512fe70b39c5e14017f30e 100644 (file)
@@ -521,7 +521,6 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan)
   rta a = {
     .src = p->p.main_source,
     .source = RTS_INHERIT,
-    .scope = SCOPE_UNIVERSE,
   };
 
   /* reject/blackhole routes have also set RTF_GATEWAY,
index 23d41b56c17342b54e2c628c77f68e28dd4d6777..c506c71cd50a2fc3800973e655d23b352625168f 100644 (file)
@@ -1855,7 +1855,6 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h)
 
   rta *ra = lp_allocz(s->pool, RTA_MAX_SIZE);
   ra->source = RTS_INHERIT;
-  ra->scope = SCOPE_UNIVERSE;
 
   if (a[RTA_FLOW])
     s->rta_flow = rta_get_u32(a[RTA_FLOW]);