diff options
| author | 2015-09-27 17:30:38 +0000 | |
|---|---|---|
| committer | 2015-09-27 17:30:38 +0000 | |
| commit | 0f882be74cab1f6206a79c3276d152edd722a263 (patch) | |
| tree | 3ce73756e81d3bbe98c6eae61b24f79e288f052c /usr.sbin/ldpctl/ldpctl.c | |
| parent | As done for bgpd recently, rename if_mediatype to if_type in dvrmpd. (diff) | |
| download | wireguard-openbsd-0f882be74cab1f6206a79c3276d152edd722a263.tar.xz wireguard-openbsd-0f882be74cab1f6206a79c3276d152edd722a263.zip | |
As done for bgpd recently, rename if_mediatype to if_type in ldpd.
And some ifmedia64 fixes.
"move forward" deraadt@
Diffstat (limited to 'usr.sbin/ldpctl/ldpctl.c')
| -rw-r--r-- | usr.sbin/ldpctl/ldpctl.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.sbin/ldpctl/ldpctl.c b/usr.sbin/ldpctl/ldpctl.c index f7892970aa9..ebd67ef3657 100644 --- a/usr.sbin/ldpctl/ldpctl.c +++ b/usr.sbin/ldpctl/ldpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpctl.c,v 1.22 2015/09/13 11:13:12 deraadt Exp $ +/* $OpenBSD: ldpctl.c,v 1.23 2015/09/27 17:30:38 stsp Exp $ * * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -42,10 +42,10 @@ __dead void usage(void); const char *fmt_timeframe_core(time_t); -const char *get_linkstate(uint64_t, int); +const char *get_linkstate(uint8_t, int); int show_interface_msg(struct imsg *); int show_discovery_msg(struct imsg *); -int get_ifms_type(int); +uint64_t get_ifms_type(uint8_t); int show_lib_msg(struct imsg *); int show_nbr_msg(struct imsg *); void show_fib_head(void); @@ -247,10 +247,10 @@ main(int argc, char *argv[]) return (0); } -int -get_ifms_type(int mediatype) +uint64_t +get_ifms_type(uint8_t if_type) { - switch (mediatype) { + switch (if_type) { case IFT_ETHER: return (IFM_ETHER); break; @@ -331,7 +331,7 @@ show_interface_msg(struct imsg *imsg) printf("%-11s %-10s %-10s %-8s %12s %3u\n", iface->name, if_state_name(iface->state), - get_linkstate(iface->mediatype, iface->linkstate), + get_linkstate(iface->if_type, iface->linkstate), iface->uptime == 0 ? "00:00:00" : fmt_timeframe_core(iface->uptime), timers, iface->adj_cnt); @@ -522,18 +522,18 @@ int show_fib_interface_msg(struct imsg *imsg) { struct kif *k; - int ifms_type; + uint64_t ifms_type; switch (imsg->hdr.type) { case IMSG_CTL_IFINFO: k = imsg->data; printf("%-15s", k->ifname); printf("%-15s", k->flags & IFF_UP ? "UP" : ""); - ifms_type = get_ifms_type(k->media_type); + ifms_type = get_ifms_type(k->if_type); if (ifms_type) printf("%s, ", get_media_descr(ifms_type)); - printf("%s", get_linkstate(k->media_type, k->link_state)); + printf("%s", get_linkstate(k->if_type, k->link_state)); if (k->link_state != LINK_STATE_DOWN && k->baudrate > 0) { printf(", "); @@ -630,13 +630,13 @@ get_media_descr(uint64_t media_type) } const char * -get_linkstate(uint64_t media_type, int link_state) +get_linkstate(uint8_t if_type, int link_state) { const struct if_status_description *p; static char buf[8]; for (p = if_status_descriptions; p->ifs_string != NULL; p++) { - if (LINK_STATE_DESC_MATCH(p, media_type, link_state)) + if (LINK_STATE_DESC_MATCH(p, if_type, link_state)) return (p->ifs_string); } snprintf(buf, sizeof(buf), "[#%d]", link_state); |
