diff options
author | 2015-09-27 17:32:36 +0000 | |
---|---|---|
committer | 2015-09-27 17:32:36 +0000 | |
commit | 16530d00b4f6e13c42c3cdf6f50cc6ae887d2296 (patch) | |
tree | 0f248a35b8a3aa4e0e2569e74ef0567224314cd0 | |
parent | As done for bgpd recently, rename if_mediatype to if_type in ospfd/ospf6d. (diff) | |
download | wireguard-openbsd-16530d00b4f6e13c42c3cdf6f50cc6ae887d2296.tar.xz wireguard-openbsd-16530d00b4f6e13c42c3cdf6f50cc6ae887d2296.zip |
As done for bgpd recently, rename if_mediatype to if_type in ripd.
And some ifmedia64 fixes.
"move forward" deraadt@
-rw-r--r-- | usr.sbin/ripctl/ripctl.c | 28 | ||||
-rw-r--r-- | usr.sbin/ripd/interface.c | 6 | ||||
-rw-r--r-- | usr.sbin/ripd/kroute.c | 6 | ||||
-rw-r--r-- | usr.sbin/ripd/ripd.h | 8 |
4 files changed, 24 insertions, 24 deletions
diff --git a/usr.sbin/ripctl/ripctl.c b/usr.sbin/ripctl/ripctl.c index 7291df34804..93ebbc3ac49 100644 --- a/usr.sbin/ripctl/ripctl.c +++ b/usr.sbin/ripctl/ripctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ripctl.c,v 1.13 2015/09/13 11:13:12 deraadt Exp $ +/* $OpenBSD: ripctl.c,v 1.14 2015/09/27 17:32:36 stsp Exp $ * * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -40,9 +40,9 @@ __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 get_ifms_type(int); +uint64_t get_ifms_type(uint8_t); int show_rib_msg(struct imsg *); int show_nbr_msg(struct imsg *); void show_fib_head(void); @@ -50,7 +50,7 @@ int show_fib_msg(struct imsg *); void show_interface_head(void); int show_fib_interface_msg(struct imsg *); const char *get_media_descr(uint64_t); -void print_baudrate(u_int64_t); +void print_baudrate(uint64_t); struct imsgbuf *ibuf; @@ -217,10 +217,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; @@ -301,7 +301,7 @@ show_interface_msg(struct imsg *imsg) err(1, NULL); printf("%-11s %-18s %-10s %-10s %-8s\n", iface->name, netid, 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)); free(netid); @@ -442,18 +442,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(", "); @@ -489,13 +489,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); @@ -503,7 +503,7 @@ get_linkstate(uint64_t media_type, int link_state) } void -print_baudrate(u_int64_t baudrate) +print_baudrate(uint64_t baudrate) { if (baudrate > IF_Gbps(1)) printf("%llu GBit/s", baudrate / IF_Gbps(1)); diff --git a/usr.sbin/ripd/interface.c b/usr.sbin/ripd/interface.c index 65e5667578b..36c60fe2794 100644 --- a/usr.sbin/ripd/interface.c +++ b/usr.sbin/ripd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.12 2015/02/09 12:13:42 claudio Exp $ */ +/* $OpenBSD: interface.c,v 1.13 2015/09/27 17:32:36 stsp Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -425,7 +425,7 @@ if_new(struct kif *kif) iface->ifindex = kif->ifindex; iface->flags = kif->flags; iface->linkstate = kif->link_state; - iface->media_type = kif->media_type; + iface->if_type = kif->if_type; iface->baudrate = kif->baudrate; /* get address */ @@ -494,7 +494,7 @@ if_to_ctl(struct iface *iface) ictl.type = iface->type; ictl.linkstate = iface->linkstate; ictl.passive = iface->passive; - ictl.mediatype = iface->media_type; + ictl.if_type = iface->if_type; gettimeofday(&now, NULL); diff --git a/usr.sbin/ripd/kroute.c b/usr.sbin/ripd/kroute.c index f82126c5897..6a602c6e506 100644 --- a/usr.sbin/ripd/kroute.c +++ b/usr.sbin/ripd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.30 2015/07/17 20:38:33 claudio Exp $ */ +/* $OpenBSD: kroute.c,v 1.31 2015/09/27 17:32:36 stsp Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -665,7 +665,7 @@ if_change(u_short ifindex, int flags, struct if_data *ifd) kif->k.flags = flags; kif->k.link_state = ifd->ifi_link_state; - kif->k.media_type = ifd->ifi_type; + kif->k.if_type = ifd->ifi_type; kif->k.baudrate = ifd->ifi_baudrate; if ((reachable = (flags & IFF_UP) && @@ -993,7 +993,7 @@ fetchifs(int ifindex) kif->k.ifindex = ifm.ifm_index; kif->k.flags = ifm.ifm_flags; kif->k.link_state = ifm.ifm_data.ifi_link_state; - kif->k.media_type = ifm.ifm_data.ifi_type; + kif->k.if_type = ifm.ifm_data.ifi_type; kif->k.baudrate = ifm.ifm_data.ifi_baudrate; kif->k.mtu = ifm.ifm_data.ifi_mtu; kif->k.nh_reachable = (kif->k.flags & IFF_UP) && diff --git a/usr.sbin/ripd/ripd.h b/usr.sbin/ripd/ripd.h index 56db4403643..acaa5cc69b7 100644 --- a/usr.sbin/ripd/ripd.h +++ b/usr.sbin/ripd/ripd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ripd.h,v 1.21 2009/11/02 20:28:49 claudio Exp $ */ +/* $OpenBSD: ripd.h,v 1.22 2015/09/27 17:32:36 stsp Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -181,7 +181,7 @@ struct iface { enum iface_type type; enum auth_type auth_type; u_int8_t linktype; - u_int8_t media_type; + u_int8_t if_type; u_int8_t passive; u_int8_t linkstate; u_int8_t auth_keyid; @@ -259,7 +259,7 @@ struct kif { int flags; int mtu; u_short ifindex; - u_int8_t media_type; + u_int8_t if_type; u_int8_t link_state; u_int8_t nh_reachable; /* for nexthop verification */ }; @@ -282,7 +282,7 @@ struct ctl_iface { u_int16_t metric; enum iface_type type; u_int8_t linkstate; - u_int8_t mediatype; + u_int8_t if_type; u_int8_t passive; }; |