-/* $OpenBSD: output.c,v 1.23 2022/06/27 13:27:38 claudio Exp $ */
+/* $OpenBSD: output.c,v 1.24 2022/07/08 16:12:11 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
uint8_t i;
printf(" Multiprotocol extensions: ");
- for (i = 0, comma = 0; i < AID_MAX; i++)
+ for (i = AID_MIN, comma = 0; i < AID_MAX; i++)
if (capa->mp[i]) {
printf("%s%s", comma ? ", " : "", aid2str(i));
comma = 1;
uint8_t i;
printf(" Add-path: ");
- for (i = 0, comma = 0; i < AID_MAX; i++) {
+ for (i = AID_MIN, comma = 0; i < AID_MAX; i++) {
switch (capa->add_path[i]) {
case 0:
default:
printf(" Graceful Restart");
if (capa->grestart.timeout)
printf(": Timeout: %d, ", capa->grestart.timeout);
- for (i = 0, comma = 0; i < AID_MAX; i++)
+ for (i = AID_MIN, comma = 0; i < AID_MAX; i++)
if (capa->grestart.flags[i] & CAPA_GR_PRESENT) {
if (!comma &&
capa->grestart.flags[i] & CAPA_GR_RESTART)
-/* $OpenBSD: output_json.c,v 1.18 2022/07/07 12:17:57 claudio Exp $ */
+/* $OpenBSD: output_json.c,v 1.19 2022/07/08 16:12:11 claudio Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
int hascapamp = 0, hascapaap = 0;
uint8_t i;
- for (i = 0; i < AID_MAX; i++) {
+ for (i = AID_MIN; i < AID_MAX; i++) {
if (capa->mp[i])
hascapamp = 1;
if (capa->add_path[i])
if (hascapamp) {
json_do_array("multiprotocol");
- for (i = 0; i < AID_MAX; i++)
+ for (i = AID_MIN; i < AID_MAX; i++)
if (capa->mp[i])
json_do_printf("mp", "%s", aid2str(i));
json_do_end();
if (capa->grestart.restart) {
int restarted = 0, present = 0;
- for (i = 0; i < AID_MAX; i++)
+ for (i = AID_MIN; i < AID_MAX; i++)
if (capa->grestart.flags[i] & CAPA_GR_PRESENT) {
present = 1;
if (capa->grestart.flags[i] & CAPA_GR_RESTART)
if (present) {
json_do_array("protocols");
- for (i = 0; i < AID_MAX; i++)
+ for (i = AID_MIN; i < AID_MAX; i++)
if (capa->grestart.flags[i] & CAPA_GR_PRESENT) {
json_do_object("family");
json_do_printf("family", "%s",
}
if (hascapaap) {
json_do_array("add-path");
- for (i = 0; i < AID_MAX; i++)
+ for (i = AID_MIN; i < AID_MAX; i++)
if (capa->add_path[i]) {
json_do_object("add-path-elm");
json_do_printf("family", "%s", aid2str(i));