Customer ASN selection from ASPA tables

Ralph Covelli rcovelli at he.net
Fri Jan 10 04:22:43 CET 2025


Hello Bird Team!

I am able to load my static ASPA tables like normal into the new bird 2.16.

bird> show route table at all
Table at:
50555                 [static1 2024-12-26] * (200)
         Type: static univ
         aspa_providers: 970
270470                [static1 2024-12-26] * (200)
         Type: static univ
         aspa_providers: 53062
47272                 [static1 2024-12-26] * (200)
         Type: static univ
         aspa_providers: 174 835 924 1299 6830 6939 20473 21738 25759 
34927 35133 41051 48605 50391 50917 52025 52210 58057 210667 212514 212895

However I am unable to select individuals or groups:

bird> show route table at all where net.asn = 47272
Table at:
bird> show route table at all where net.asn ~ [ 47272  ]
Table at:
bird>

It looks like a spot was missed in filter/f-inst.c or it might have been 
left out intentionally because net.asn is already used for ROA's.

filter/f-inst.c
   /* Get ROA ASN */
   METHOD(T_NET, asn, 0, [[
         if (!net_is_roa(v1.val.net))
           runtime( "ROA expected" );

         RESULT(T_INT, i, (v1.val.net->type == NET_ROA4) ?
           ((net_addr_roa4 *) v1.val.net)->asn :
           ((net_addr_roa6 *) v1.val.net)->asn);
   ]]);

+  /* Get ASPA ASN */
+  METHOD(T_NET, customer_asn, 0, [[
+        if (!net_is_aspa(v1.val.net))
+          runtime( "ASPA expected" );
+
+        RESULT(T_INT, i, ((net_addr_aspa *) v1.val.net)->asn);
+  ]]);

I named it customer_asn to avoid the collision but use whatever you want.

Everything works great after the small correction:

bird> show route table at all where net.customer_asn = 270470
Table at:
270470                [static1 19:05:34.388] * (200)
         Type: static univ
         aspa_providers: 53062
bird> show route table at all where net.customer_asn ~ [ 270470, 47272, 
19330 ]
Table at:
270470                [static1 19:05:34.388] * (200)
         Type: static univ
         aspa_providers: 53062
47272                 [static1 19:05:34.388] * (200)
         Type: static univ
         aspa_providers: 174 835 924 1299 6830 6939 20473 21738 25759 
34927 35133 41051 48605 50391 50917 52025 52210 58057 210667 212514 212895
19330                 [static1 19:05:34.388] * (200)
         Type: static univ
         aspa_providers: 393577
bird>

Thanks again for all of your hard work!



More information about the Bird-users mailing list