From 2f6483cd312ffd7ef055099ce801fb8f437d9abe Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 23 Jul 2009 16:06:25 +0200 Subject: Adds %R printf directive for Router ID. --- nest/a-set.c | 4 +--- nest/cmds.c | 1 + nest/rt-attr.c | 6 +----- 3 files changed, 3 insertions(+), 8 deletions(-) (limited to 'nest') diff --git a/nest/a-set.c b/nest/a-set.c index 505c0e5..fad4481 100644 --- a/nest/a-set.c +++ b/nest/a-set.c @@ -34,9 +34,7 @@ int_set_format(struct adata *set, int way, byte *buf, unsigned int size) if (way) buf += bsprintf(buf, "(%d,%d)", *z >> 16, *z & 0xffff); else - buf += bsprintf(buf, "%d.%d.%d.%d", - (*z >> 24) & 0xff, (*z >> 16) & 0xff, - (*z >> 8) & 0xff, *z & 0xff); + buf += bsprintf(buf, "%R", *z); z++; sp = 0; diff --git a/nest/cmds.c b/nest/cmds.c index ac537c8..faed870 100644 --- a/nest/cmds.c +++ b/nest/cmds.c @@ -19,6 +19,7 @@ cmd_show_status(void) cli_msg(-1000, "BIRD " BIRD_VERSION); tm_format_datetime(tim, now); + cli_msg(-1011, "Router ID is %R", config->router_id); cli_msg(-1011, "Current server time is %s", tim); tm_format_datetime(tim, boot_time); cli_msg(-1011, "Last reboot on %s", tim); diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 2318f80..de63198 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -419,11 +419,7 @@ ea_format(eattr *e, byte *buf) bsprintf(buf, "%I", *(ip_addr *) ad->data); break; case EAF_TYPE_ROUTER_ID: - bsprintf(buf, "%d.%d.%d.%d", - (e->u.data >> 24) & 0xff, - (e->u.data >> 16) & 0xff, - (e->u.data >> 8) & 0xff, - e->u.data & 0xff); + bsprintf(buf, "%R", e->u.data); break; case EAF_TYPE_AS_PATH: as_path_format(ad, buf, end - buf); -- cgit v1.2.3