-/* $OpenBSD: output.c,v 1.36 2023/01/31 14:32:43 job Exp $ */
+/* $OpenBSD: output.c,v 1.37 2023/03/09 13:13:14 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
printf("\n");
if (p->conf.descr[0])
printf(" Description: %s\n", p->conf.descr);
+ if (p->conf.ebgp && p->conf.role != ROLE_NONE)
+ printf(" Role: %s\n", log_policy(p->conf.role));
if (p->conf.max_prefix) {
printf(" Max-prefix: %u", p->conf.max_prefix);
if (p->conf.max_prefix_restart)
}
if (hascapamp || hascapaap || p->capa.peer.grestart.restart ||
p->capa.peer.refresh || p->capa.peer.enhanced_rr ||
- p->capa.peer.as4byte || p->capa.peer.role_ena) {
+ p->capa.peer.as4byte || p->capa.peer.policy) {
printf(" Neighbor capabilities:\n");
if (hascapamp)
show_neighbor_capa_mp(&p->capa.peer);
show_neighbor_capa_restart(&p->capa.peer);
if (hascapaap)
show_neighbor_capa_add_path(&p->capa.peer);
- if (p->capa.peer.role_ena)
+ if (p->capa.peer.policy)
printf(" Open Policy role %s (local %s)\n",
- log_policy(p->capa.peer.role),
- log_policy(p->capa.ann.role));
+ log_policy(p->remote_role),
+ log_policy(p->conf.role));
}
hascapamp = 0;
}
if (hascapamp || hascapaap || p->capa.neg.grestart.restart ||
p->capa.neg.refresh || p->capa.neg.enhanced_rr ||
- p->capa.neg.as4byte || p->capa.neg.role_ena) {
+ p->capa.neg.as4byte || p->capa.neg.policy) {
printf(" Negotiated capabilities:\n");
if (hascapamp)
show_neighbor_capa_mp(&p->capa.neg);
show_neighbor_capa_restart(&p->capa.neg);
if (hascapaap)
show_neighbor_capa_add_path(&p->capa.neg);
- if (p->capa.neg.role_ena)
+ if (p->capa.neg.policy)
printf(" Open Policy role %s (local %s)\n",
- log_policy(p->capa.neg.role),
- log_policy(p->capa.ann.role));
+ log_policy(p->remote_role),
+ log_policy(p->conf.role));
}
printf("\n");
-/* $OpenBSD: output_json.c,v 1.29 2023/01/24 11:29:34 claudio Exp $ */
+/* $OpenBSD: output_json.c,v 1.30 2023/03/09 13:13:14 claudio Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
json_do_end();
}
- if (capa->role_ena) {
- json_do_printf("open_policy_role", "%s%s",
- log_policy(capa->role),
- capa->role_ena == 2 ? " enforce" : "");
+ if (capa->policy) {
+ json_do_printf("open_policy", "%s",
+ capa->policy == 2 ? "enforce" : "present");
}
json_do_end();
json_do_bool("ttl_security", p->conf.ttlsec);
json_do_uint("holdtime", p->conf.holdtime);
json_do_uint("min_holdtime", p->conf.min_holdtime);
+ if (p->conf.ebgp && p->conf.role != ROLE_NONE)
+ json_do_printf("role", "%s",
+ log_policy(p->conf.role));
/* capabilities */
json_do_bool("announce_capabilities", p->conf.announce_capa);
/* capabilities */
json_neighbor_capabilities(&p->capa.neg);
+ if (p->conf.ebgp && p->conf.role != ROLE_NONE) {
+ json_do_printf("remote_role", "%s",
+ log_policy(p->remote_role));
+ json_do_printf("local_role", "%s",
+ log_policy(p->conf.role));
+ }
json_do_end();
}
}