On Thu, Jun 29, 2023 at 04:16:32PM +0200, Theo Buehler wrote:
> A thinko slipped through review in aspa.c which broke the ASPA counters.
> Use only one counter and call it STYPE_PROVIDERS.
> 
> Is it ok to switch from "both" to "valid" in output-ometric.c for
> consistency with the other products or do we need to maintain compat for
> some parsers?

No, I think renaming is fine. It is just the value of the label that is
changing. Now I would not use "valid" but instead "total" since we use
"total" for roa and aspa as well.

Apart from that the diff is OK claudio
 
> output before and after my diff:
> 
> -rpki_client_objects{type="vap providers",state="both"} 0
> -rpki_client_objects{type="vap providers",state="IPv4 only"} 0
> -rpki_client_objects{type="vap providers",state="IPv6 only"} 0
> +rpki_client_objects{type="vap providers",state="valid"} 4
> 
> Index: aspa.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/rpki-client/aspa.c,v
> retrieving revision 1.20
> diff -u -p -r1.20 aspa.c
> --- aspa.c    28 Jun 2023 17:24:20 -0000      1.20
> +++ aspa.c    29 Jun 2023 14:11:46 -0000
> @@ -369,7 +369,7 @@ aspa_insert_vaps(struct vap_tree *tree, 
>                   aspa->providers[i] < v->providers[j]) {
>                       /* merge provider from aspa into v */
>                       repo_stat_inc(rp, v->talid, RTYPE_ASPA,
> -                         STYPE_BOTH + aspa->providers[i]);
> +                         STYPE_PROVIDERS);
>                       insert_vap(v, j, &aspa->providers[i]);
>                       i++;
>               } else if (aspa->providers[i] == v->providers[j])
> Index: extern.h
> ===================================================================
> RCS file: /cvs/src/usr.sbin/rpki-client/extern.h,v
> retrieving revision 1.187
> diff -u -p -r1.187 extern.h
> --- extern.h  29 Jun 2023 10:28:25 -0000      1.187
> +++ extern.h  29 Jun 2023 14:11:47 -0000
> @@ -530,9 +530,7 @@ enum stype {
>       STYPE_TOTAL,
>       STYPE_UNIQUE,
>       STYPE_DEC_UNIQUE,
> -     STYPE_BOTH,
> -     STYPE_ONLY_IPV4,
> -     STYPE_ONLY_IPV6,
> +     STYPE_PROVIDERS,
>  };
>  
>  struct repo;
> @@ -562,8 +560,6 @@ struct repotalstats {
>       uint32_t         vaps; /* total number of Validated ASPA Payloads */
>       uint32_t         vaps_uniqs; /* total number of unique VAPs */
>       uint32_t         vaps_pas; /* total number of providers */
> -     uint32_t         vaps_pas4; /* total number of IPv4 only providers */
> -     uint32_t         vaps_pas6; /* total number of IPv6 only providers */
>       uint32_t         vrps; /* total number of Validated ROA Payloads */
>       uint32_t         vrps_uniqs; /* number of unique vrps */
>  };
> Index: main.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/rpki-client/main.c,v
> retrieving revision 1.243
> diff -u -p -r1.243 main.c
> --- main.c    23 Jun 2023 11:36:24 -0000      1.243
> +++ main.c    29 Jun 2023 14:11:47 -0000
> @@ -750,8 +750,6 @@ sum_stats(const struct repo *rp, const s
>       out->vaps += in->vaps;
>       out->vaps_uniqs += in->vaps_uniqs;
>       out->vaps_pas += in->vaps_pas;
> -     out->vaps_pas4 += in->vaps_pas4;
> -     out->vaps_pas6 += in->vaps_pas6;
>  }
>  
>  static void
> Index: output-ometric.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/rpki-client/output-ometric.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 output-ometric.c
> --- output-ometric.c  5 Jun 2023 14:19:13 -0000       1.4
> +++ output-ometric.c  29 Jun 2023 14:11:47 -0000
> @@ -83,11 +83,7 @@ set_common_stats(const struct repotalsta
>       ometric_set_int_with_labels(metric, in->vaps_uniqs,
>           OKV("type", "state"), OKV("vap", "unique"), ol);
>       ometric_set_int_with_labels(metric, in->vaps_pas,
> -         OKV("type", "state"), OKV("vap providers", "both"), ol);
> -     ometric_set_int_with_labels(metric, in->vaps_pas4,
> -         OKV("type", "state"), OKV("vap providers", "IPv4 only"), ol);
> -     ometric_set_int_with_labels(metric, in->vaps_pas6,
> -         OKV("type", "state"), OKV("vap providers", "IPv6 only"), ol);
> +         OKV("type", "state"), OKV("vap providers", "valid"), ol);
>  }
>  
>  static void
> Index: repo.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/rpki-client/repo.c,v
> retrieving revision 1.49
> diff -u -p -r1.49 repo.c
> --- repo.c    29 Jun 2023 14:09:42 -0000      1.49
> +++ repo.c    29 Jun 2023 14:11:47 -0000
> @@ -1473,14 +1473,8 @@ repo_stat_inc(struct repo *rp, int talid
>               case STYPE_DEC_UNIQUE:
>                       rp->stats[talid].vaps_uniqs--;
>                       break;
> -             case STYPE_BOTH:
> +             case STYPE_PROVIDERS:
>                       rp->stats[talid].vaps_pas++;
> -                     break;
> -             case STYPE_ONLY_IPV4:
> -                     rp->stats[talid].vaps_pas4++;
> -                     break;
> -             case STYPE_ONLY_IPV6:
> -                     rp->stats[talid].vaps_pas6++;
>                       break;
>               default:
>                       break;
> 

-- 
:wq Claudio

Reply via email to