diff options
-rw-r--r-- | usr.sbin/ospf6ctl/ospf6ctl.c | 22 | ||||
-rw-r--r-- | usr.sbin/ospf6d/interface.c | 8 | ||||
-rw-r--r-- | usr.sbin/ospf6d/ospf6d.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospf6d/ospf6d.h | 6 | ||||
-rw-r--r-- | usr.sbin/ospf6d/ospfe.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospf6d/rde.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospfctl/ospfctl.c | 24 | ||||
-rw-r--r-- | usr.sbin/ospfd/interface.c | 10 | ||||
-rw-r--r-- | usr.sbin/ospfd/kroute.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospfd/ospfd.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospfd/ospfd.h | 8 | ||||
-rw-r--r-- | usr.sbin/ospfd/ospfe.c | 6 |
12 files changed, 52 insertions, 52 deletions
diff --git a/usr.sbin/ospf6ctl/ospf6ctl.c b/usr.sbin/ospf6ctl/ospf6ctl.c index e90c5499212..d6fa077ba43 100644 --- a/usr.sbin/ospf6ctl/ospf6ctl.c +++ b/usr.sbin/ospf6ctl/ospf6ctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf6ctl.c,v 1.39 2015/09/13 11:13:12 deraadt Exp $ */ +/* $OpenBSD: ospf6ctl.c,v 1.40 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -41,7 +41,7 @@ __dead void usage(void); int show_summary_msg(struct imsg *); -int get_ifms_type(int); +uint64_t get_ifms_type(uint8_t); int show_interface_msg(struct imsg *); int show_interface_detail_msg(struct imsg *); const char *print_link(int); @@ -68,7 +68,7 @@ int show_rib_detail_msg(struct imsg *); void show_fib_head(void); int show_fib_msg(struct imsg *); const char * get_media_descr(uint64_t); -const char * get_linkstate(uint64_t, int); +const char * get_linkstate(uint8_t, int); void print_baudrate(u_int64_t); struct imsgbuf *ibuf; @@ -347,10 +347,10 @@ show_summary_msg(struct imsg *imsg) 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); case IFT_FDDI: @@ -379,7 +379,7 @@ show_interface_msg(struct imsg *imsg) printf("%-11s %-29s %-6s %-10s %-10s %s\n", iface->name, netid, if_state_name(iface->state), fmt_timeframe_core(iface->hello_timer), - get_linkstate(iface->mediatype, iface->linkstate), + get_linkstate(iface->if_type, iface->linkstate), fmt_timeframe_core(iface->uptime)); free(netid); break; @@ -407,8 +407,8 @@ show_interface_detail_msg(struct imsg *imsg) printf(" Internet address %s Area %s\n", log_in6addr(&iface->addr), inet_ntoa(iface->area)); printf(" Link type %s, state %s", - get_media_descr(get_ifms_type(iface->mediatype)), - get_linkstate(iface->mediatype, iface->linkstate)); + get_media_descr(get_ifms_type(iface->if_type)), + get_linkstate(iface->if_type, iface->linkstate)); if (iface->linkstate != LINK_STATE_DOWN && iface->baudrate > 0) { printf(", "); @@ -1323,13 +1323,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); diff --git a/usr.sbin/ospf6d/interface.c b/usr.sbin/ospf6d/interface.c index 7d2158b491e..c22bf01d105 100644 --- a/usr.sbin/ospf6d/interface.c +++ b/usr.sbin/ospf6d/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.21 2013/11/01 17:18:29 deraadt Exp $ */ +/* $OpenBSD: interface.c,v 1.22 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -239,7 +239,7 @@ if_update(struct iface *iface, int mtu, int flags, u_int8_t type, { iface->mtu = mtu; iface->flags = flags; - iface->media_type = type; + iface->if_type = type; iface->linkstate = state; iface->baudrate = rate; @@ -376,7 +376,7 @@ if_act_start(struct iface *iface) return (0); } - if (iface->media_type == IFT_CARP && + if (iface->if_type == IFT_CARP && !(iface->cflags & F_IFACE_PASSIVE)) { /* force passive mode on carp interfaces */ log_warnx("if_act_start: forcing interface %s to passive", @@ -678,7 +678,7 @@ if_to_ctl(struct iface *iface) ictl.rxmt_interval = iface->rxmt_interval; ictl.type = iface->type; ictl.linkstate = iface->linkstate; - ictl.mediatype = iface->media_type; + ictl.if_type = iface->if_type; ictl.priority = iface->priority; ictl.passive = (iface->cflags & F_IFACE_PASSIVE) == F_IFACE_PASSIVE; diff --git a/usr.sbin/ospf6d/ospf6d.c b/usr.sbin/ospf6d/ospf6d.c index e4cacc72743..5757590ef92 100644 --- a/usr.sbin/ospf6d/ospf6d.c +++ b/usr.sbin/ospf6d/ospf6d.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf6d.c,v 1.27 2015/02/10 05:39:10 claudio Exp $ */ +/* $OpenBSD: ospf6d.c,v 1.28 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -778,7 +778,7 @@ merge_interfaces(struct area *a, struct area *xa) i->priority = xi->priority; i->flags = xi->flags; /* needed? */ i->type = xi->type; /* needed? */ - i->media_type = xi->media_type; /* needed? */ + i->if_type = xi->if_type; /* needed? */ i->linkstate = xi->linkstate; /* needed? */ #if 0 /* XXX needs some kind of love */ diff --git a/usr.sbin/ospf6d/ospf6d.h b/usr.sbin/ospf6d/ospf6d.h index 5ebddcf22a7..7876995dc0d 100644 --- a/usr.sbin/ospf6d/ospf6d.h +++ b/usr.sbin/ospf6d/ospf6d.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf6d.h,v 1.28 2013/03/25 14:29:35 markus Exp $ */ +/* $OpenBSD: ospf6d.h,v 1.29 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2004, 2007 Esben Norby <norby@openbsd.org> @@ -316,7 +316,7 @@ struct iface { u_int16_t dead_interval; u_int16_t metric; enum iface_type type; - u_int8_t media_type; + u_int8_t if_type; u_int8_t linkstate; u_int8_t priority; u_int8_t cflags; @@ -435,7 +435,7 @@ struct ctl_iface { u_int16_t rxmt_interval; enum iface_type type; u_int8_t linkstate; - u_int8_t mediatype; + u_int8_t if_type; u_int8_t priority; u_int8_t passive; }; diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c index 1d678bae86e..07ab78083b5 100644 --- a/usr.sbin/ospf6d/ospfe.c +++ b/usr.sbin/ospf6d/ospfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.c,v 1.45 2015/02/10 05:39:10 claudio Exp $ */ +/* $OpenBSD: ospfe.c,v 1.46 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -288,7 +288,7 @@ ospfe_dispatch_main(int fd, short event, void *bula) if (iface == NULL) fatalx("interface lost in ospfe"); - if_update(iface, ifp->mtu, ifp->flags, ifp->media_type, + if_update(iface, ifp->mtu, ifp->flags, ifp->if_type, ifp->linkstate, ifp->baudrate); if ((iface->flags & IFF_UP) && diff --git a/usr.sbin/ospf6d/rde.c b/usr.sbin/ospf6d/rde.c index 4e4154c1c20..59804704a95 100644 --- a/usr.sbin/ospf6d/rde.c +++ b/usr.sbin/ospf6d/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.63 2015/01/16 06:40:19 deraadt Exp $ */ +/* $OpenBSD: rde.c,v 1.64 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -720,7 +720,7 @@ rde_dispatch_parent(int fd, short event, void *bula) wasvalid = (iface->flags & IFF_UP) && LINK_STATE_IS_UP(iface->linkstate); - if_update(iface, ifp->mtu, ifp->flags, ifp->media_type, + if_update(iface, ifp->mtu, ifp->flags, ifp->if_type, ifp->linkstate, ifp->baudrate); /* Resend LSAs if interface state changes. */ diff --git a/usr.sbin/ospfctl/ospfctl.c b/usr.sbin/ospfctl/ospfctl.c index 40721a74539..7a4408abd3a 100644 --- a/usr.sbin/ospfctl/ospfctl.c +++ b/usr.sbin/ospfctl/ospfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfctl.c,v 1.59 2015/09/13 11:13:12 deraadt Exp $ */ +/* $OpenBSD: ospfctl.c,v 1.60 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -40,7 +40,7 @@ __dead void usage(void); int show_summary_msg(struct imsg *); -int get_ifms_type(int); +uint64_t get_ifms_type(uint8_t); int show_interface_msg(struct imsg *); int show_interface_detail_msg(struct imsg *); const char *print_link(int); @@ -66,7 +66,7 @@ void show_fib_head(void); int show_fib_msg(struct imsg *); void show_interface_head(void); const char * get_media_descr(uint64_t); -const char * get_linkstate(uint64_t, int); +const char * get_linkstate(uint8_t, int); void print_baudrate(u_int64_t); int show_fib_interface_msg(struct imsg *); @@ -367,10 +367,10 @@ show_summary_msg(struct imsg *imsg) 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); case IFT_FDDI: @@ -401,7 +401,7 @@ show_interface_msg(struct imsg *imsg) iface->name, netid, if_state_name(iface->state), iface->hello_timer.tv_sec < 0 ? "-" : fmt_timeframe_core(iface->hello_timer.tv_sec), - get_linkstate(iface->mediatype, iface->linkstate), + get_linkstate(iface->if_type, iface->linkstate), fmt_timeframe_core(iface->uptime), iface->nbr_cnt, iface->adj_cnt); free(netid); @@ -432,7 +432,7 @@ show_interface_detail_msg(struct imsg *imsg) mask2prefixlen(iface->mask.s_addr)); printf("Area %s\n", inet_ntoa(iface->area)); printf(" Linkstate %s\n", - get_linkstate(iface->mediatype, iface->linkstate)); + get_linkstate(iface->if_type, iface->linkstate)); printf(" Router ID %s, network type %s, cost: %d\n", inet_ntoa(iface->rtr_id), if_type_name(iface->type), iface->metric); @@ -1289,13 +1289,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); @@ -1326,11 +1326,11 @@ show_fib_interface_msg(struct imsg *imsg) 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(", "); diff --git a/usr.sbin/ospfd/interface.c b/usr.sbin/ospfd/interface.c index 8c0849ebc2a..1c8fca2f388 100644 --- a/usr.sbin/ospfd/interface.c +++ b/usr.sbin/ospfd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.78 2015/07/20 23:45:39 benno Exp $ */ +/* $OpenBSD: interface.c,v 1.79 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -198,7 +198,7 @@ if_new(struct kif *kif, struct kif_addr *ka) 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; /* set address, mask and p2p addr */ @@ -340,11 +340,11 @@ if_act_start(struct iface *iface) if (!(iface->flags & IFF_UP) || (!LINK_STATE_IS_UP(iface->linkstate) && - !(iface->media_type == IFT_CARP && + !(iface->if_type == IFT_CARP && iface->linkstate == LINK_STATE_DOWN))) return (0); - if (iface->media_type == IFT_CARP && iface->passive == 0) { + if (iface->if_type == IFT_CARP && iface->passive == 0) { /* force passive mode on carp interfaces */ log_warnx("if_act_start: forcing interface %s to passive", iface->name); @@ -639,7 +639,7 @@ if_to_ctl(struct iface *iface) ictl.rxmt_interval = iface->rxmt_interval; ictl.type = iface->type; ictl.linkstate = iface->linkstate; - ictl.mediatype = iface->media_type; + ictl.if_type = iface->if_type; ictl.priority = iface->priority; ictl.passive = iface->passive; ictl.auth_type = iface->auth_type; diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c index 101d6ca53c3..b8e53405ba2 100644 --- a/usr.sbin/ospfd/kroute.c +++ b/usr.sbin/ospfd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.102 2015/07/20 23:45:39 benno Exp $ */ +/* $OpenBSD: kroute.c,v 1.103 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -883,7 +883,7 @@ kif_update(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; kif->k.mtu = ifd->ifi_mtu; diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c index 7fdf9327826..d821f0a9b35 100644 --- a/usr.sbin/ospfd/ospfd.c +++ b/usr.sbin/ospfd/ospfd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfd.c,v 1.85 2015/07/20 23:45:39 benno Exp $ */ +/* $OpenBSD: ospfd.c,v 1.86 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -862,7 +862,7 @@ merge_interfaces(struct area *a, struct area *xa) i->self->priority = i->priority; i->flags = xi->flags; /* needed? */ i->type = xi->type; /* needed? */ - i->media_type = xi->media_type; /* needed? */ + i->if_type = xi->if_type; /* needed? */ i->linkstate = xi->linkstate; /* needed? */ i->auth_type = xi->auth_type; diff --git a/usr.sbin/ospfd/ospfd.h b/usr.sbin/ospfd/ospfd.h index 617f7abc3d2..7205a65d731 100644 --- a/usr.sbin/ospfd/ospfd.h +++ b/usr.sbin/ospfd/ospfd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfd.h,v 1.91 2013/01/17 10:07:56 markus Exp $ */ +/* $OpenBSD: ospfd.h,v 1.92 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -345,7 +345,7 @@ struct iface { u_int16_t metric; enum iface_type type; enum auth_type auth_type; - u_int8_t media_type; + u_int8_t if_type; u_int8_t auth_keyid; u_int8_t linkstate; u_int8_t priority; @@ -416,7 +416,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 */ }; @@ -461,7 +461,7 @@ struct ctl_iface { u_int16_t rxmt_interval; enum iface_type type; u_int8_t linkstate; - u_int8_t mediatype; + u_int8_t if_type; u_int8_t priority; u_int8_t passive; enum auth_type auth_type; diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c index d04d0975f83..b3c7ac26c9d 100644 --- a/usr.sbin/ospfd/ospfe.c +++ b/usr.sbin/ospfd/ospfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.c,v 1.90 2015/02/10 05:24:48 claudio Exp $ */ +/* $OpenBSD: ospfe.c,v 1.91 2015/09/27 17:31:50 stsp Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -879,7 +879,7 @@ orig_rtr_lsa(struct area *area) */ if (!(iface->flags & IFF_UP) || (!LINK_STATE_IS_UP(iface->linkstate) && - !(iface->media_type == IFT_CARP && + !(iface->if_type == IFT_CARP && iface->linkstate == LINK_STATE_DOWN))) continue; log_debug("orig_rtr_lsa: stub net, " @@ -895,7 +895,7 @@ orig_rtr_lsa(struct area *area) * backup carp interfaces are anounced with high metric * for faster failover. */ - if (iface->media_type == IFT_CARP && + if (iface->if_type == IFT_CARP && iface->linkstate == LINK_STATE_DOWN) rtr_link.metric = MAX_METRIC; else |