diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2015-09-27 17:29:47 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2015-09-27 17:29:47 +0000 |
commit | 0a259b0450e397cec273f6864ce4bb40dabc5a86 (patch) | |
tree | d82cfb0cd36d081be4482aa7257531b83710591c | |
parent | ef11628f95ffab8452689858bdbb1495f39b8b59 (diff) |
As done for bgpd recently, rename if_mediatype to if_type in dvrmpd.
Remove unused function get_ifms_type(). No ifmedia in here anymore.
"move forward" deraadt@
-rw-r--r-- | usr.sbin/dvmrpctl/dvmrpctl.c | 33 | ||||
-rw-r--r-- | usr.sbin/dvmrpd/dvmrpd.h | 8 | ||||
-rw-r--r-- | usr.sbin/dvmrpd/interface.c | 6 | ||||
-rw-r--r-- | usr.sbin/dvmrpd/kroute.c | 6 |
4 files changed, 16 insertions, 37 deletions
diff --git a/usr.sbin/dvmrpctl/dvmrpctl.c b/usr.sbin/dvmrpctl/dvmrpctl.c index 6b3c90e3f94..1117eecc6ea 100644 --- a/usr.sbin/dvmrpctl/dvmrpctl.c +++ b/usr.sbin/dvmrpctl/dvmrpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dvmrpctl.c,v 1.11 2013/11/14 20:48:51 deraadt Exp $ */ +/* $OpenBSD: dvmrpctl.c,v 1.12 2015/09/27 17:29:45 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -24,7 +24,6 @@ #include <netinet/in.h> #include <netinet/ip_mroute.h> #include <arpa/inet.h> -#include <net/if_media.h> #include <net/if_types.h> #include <err.h> @@ -43,7 +42,6 @@ __dead void usage(void); int show_summary_msg(struct imsg *); -int get_ifms_type(int); int show_interface_msg(struct imsg *); int show_interface_detail_msg(struct imsg *); int show_igmp_msg(struct imsg *); @@ -59,7 +57,7 @@ int show_rib_msg(struct imsg *); int show_rib_detail_msg(struct imsg *); int show_mfc_msg(struct imsg *); int show_mfc_detail_msg(struct imsg *); -const char * get_linkstate(int, int); +const char * get_linkstate(uint8_t, int); struct imsgbuf *ibuf; @@ -256,25 +254,6 @@ show_summary_msg(struct imsg *imsg) } int -get_ifms_type(int mediatype) -{ - switch (mediatype) { - case IFT_ETHER: - return (IFM_ETHER); - break; - case IFT_FDDI: - return (IFM_FDDI); - break; - case IFT_CARP: - return (IFM_CARP); - break; - default: - return (0); - break; - } -} - -int show_interface_msg(struct imsg *imsg) { struct ctl_iface *iface; @@ -291,7 +270,7 @@ show_interface_msg(struct imsg *imsg) iface->name, netid, if_state_name(iface->state), iface->probe_timer == 0 ? "00:00:00" : fmt_timeframe_core(iface->probe_timer), - get_linkstate(iface->mediatype, iface->linkstate), + get_linkstate(iface->if_type, iface->linkstate), iface->uptime == 0 ? "00:00:00" : fmt_timeframe_core(iface->uptime), iface->group_cnt); free(netid); @@ -322,7 +301,7 @@ show_interface_detail_msg(struct imsg *imsg) inet_ntoa(iface->addr), mask2prefixlen(iface->mask.s_addr)); printf(" Linkstate %s\n", - get_linkstate(iface->mediatype, iface->linkstate)); + get_linkstate(iface->if_type, iface->linkstate)); printf(" Network type %s, cost: %d\n", if_type_name(iface->type), iface->metric); printf(" State %s, querier ", if_state_name(iface->state)); @@ -668,13 +647,13 @@ const struct if_status_description if_status_descriptions[] = LINK_STATE_DESCRIPTIONS; const char * -get_linkstate(int 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); diff --git a/usr.sbin/dvmrpd/dvmrpd.h b/usr.sbin/dvmrpd/dvmrpd.h index c326eafaff5..3bfc4f39be9 100644 --- a/usr.sbin/dvmrpd/dvmrpd.h +++ b/usr.sbin/dvmrpd/dvmrpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dvmrpd.h,v 1.20 2009/11/02 20:31:50 claudio Exp $ */ +/* $OpenBSD: dvmrpd.h,v 1.21 2015/09/27 17:29:45 stsp Exp $ */ /* * Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org> @@ -222,7 +222,7 @@ struct iface { u_int8_t robustness; u_int8_t linkstate; - u_int8_t media_type; + u_int8_t if_type; u_int8_t passive; u_int8_t igmp_version; }; @@ -264,7 +264,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 */ }; @@ -310,7 +310,7 @@ struct ctl_iface { enum iface_type type; u_int8_t robustness; u_int8_t linkstate; - u_int8_t mediatype; + u_int8_t if_type; u_int8_t passive; u_int8_t igmp_version; }; diff --git a/usr.sbin/dvmrpd/interface.c b/usr.sbin/dvmrpd/interface.c index 789e21cf936..76bf469d749 100644 --- a/usr.sbin/dvmrpd/interface.c +++ b/usr.sbin/dvmrpd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.10 2011/07/04 04:34:14 claudio Exp $ */ +/* $OpenBSD: interface.c,v 1.11 2015/09/27 17:29:46 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -197,7 +197,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 */ @@ -672,7 +672,7 @@ if_to_ctl(struct iface *iface) ictl.linkstate = iface->linkstate; ictl.passive = iface->passive; ictl.igmp_version = iface->igmp_version; - ictl.mediatype = iface->media_type; + ictl.if_type = iface->if_type; gettimeofday(&now, NULL); if (evtimer_pending(&iface->probe_timer, &tv)) { diff --git a/usr.sbin/dvmrpd/kroute.c b/usr.sbin/dvmrpd/kroute.c index 39faa9255e6..763d0f44693 100644 --- a/usr.sbin/dvmrpd/kroute.c +++ b/usr.sbin/dvmrpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.11 2015/02/11 05:56:27 claudio Exp $ */ +/* $OpenBSD: kroute.c,v 1.12 2015/09/27 17:29:46 stsp Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -237,7 +237,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) && @@ -345,7 +345,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) && |