summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2015-09-27 17:30:39 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2015-09-27 17:30:39 +0000
commit8198c6fa8a809aebd16cd6936c44c32095b3c6c2 (patch)
treed1eef7d3875cf1f9ecab3b93b28bedc67fcbda79 /usr.sbin
parent0a259b0450e397cec273f6864ce4bb40dabc5a86 (diff)
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')
-rw-r--r--usr.sbin/ldpctl/ldpctl.c24
-rw-r--r--usr.sbin/ldpd/interface.c6
-rw-r--r--usr.sbin/ldpd/kroute.c4
-rw-r--r--usr.sbin/ldpd/ldpd.h8
-rw-r--r--usr.sbin/ldpd/parse.y18
5 files changed, 30 insertions, 30 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);
diff --git a/usr.sbin/ldpd/interface.c b/usr.sbin/ldpd/interface.c
index 135ae0a3a31..f30c073b96c 100644
--- a/usr.sbin/ldpd/interface.c
+++ b/usr.sbin/ldpd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.25 2015/07/21 04:43:28 renato Exp $ */
+/* $OpenBSD: interface.c,v 1.26 2015/09/27 17:30:38 stsp Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -71,7 +71,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;
return (iface);
}
@@ -265,7 +265,7 @@ if_to_ctl(struct iface *iface)
ictl.flags = iface->flags;
ictl.type = iface->type;
ictl.linkstate = iface->linkstate;
- ictl.mediatype = iface->media_type;
+ ictl.if_type = iface->if_type;
gettimeofday(&now, NULL);
if (iface->state != IF_STA_DOWN &&
diff --git a/usr.sbin/ldpd/kroute.c b/usr.sbin/ldpd/kroute.c
index 2f94690fb97..cdff6bab1fb 100644
--- a/usr.sbin/ldpd/kroute.c
+++ b/usr.sbin/ldpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.46 2015/07/21 04:52:29 renato Exp $ */
+/* $OpenBSD: kroute.c,v 1.47 2015/09/27 17:30:38 stsp Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -799,7 +799,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/ldpd/ldpd.h b/usr.sbin/ldpd/ldpd.h
index 98330bc463c..daed15d8c0f 100644
--- a/usr.sbin/ldpd/ldpd.h
+++ b/usr.sbin/ldpd/ldpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.h,v 1.55 2015/07/21 05:01:46 renato Exp $ */
+/* $OpenBSD: ldpd.h,v 1.56 2015/09/27 17:30:38 stsp Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -230,7 +230,7 @@ struct iface {
u_int16_t hello_interval;
u_int16_t flags;
enum iface_type type;
- u_int8_t media_type;
+ u_int8_t if_type;
u_int8_t linkstate;
};
@@ -375,7 +375,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;
};
@@ -391,7 +391,7 @@ struct ctl_iface {
u_int16_t hello_interval;
enum iface_type type;
u_int8_t linkstate;
- u_int8_t mediatype;
+ u_int8_t if_type;
};
struct ctl_adj {
diff --git a/usr.sbin/ldpd/parse.y b/usr.sbin/ldpd/parse.y
index c148934f203..4613bdbdd17 100644
--- a/usr.sbin/ldpd/parse.y
+++ b/usr.sbin/ldpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.30 2015/07/21 04:56:44 renato Exp $ */
+/* $OpenBSD: parse.y,v 1.31 2015/09/27 17:30:38 stsp Exp $ */
/*
* Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
@@ -350,7 +350,7 @@ pseudowire : PSEUDOWIRE STRING {
}
free($2);
- if (kif->media_type != IFT_MPLSTUNNEL) {
+ if (kif->if_type != IFT_MPLSTUNNEL) {
yyerror("unsupported interface type on "
"interface %s", kif->ifname);
YYERROR;
@@ -422,7 +422,7 @@ l2vpnopts : PWTYPE pw_type {
YYERROR;
}
- if (kif->media_type != IFT_BRIDGE) {
+ if (kif->if_type != IFT_BRIDGE) {
yyerror("unsupported interface type on "
"interface %s", kif->ifname);
YYERROR;
@@ -452,9 +452,9 @@ l2vpnopts : PWTYPE pw_type {
}
free($2);
- if (kif->media_type == IFT_BRIDGE
- || kif->media_type == IFT_LOOP
- || kif->media_type == IFT_CARP) {
+ if (kif->if_type == IFT_BRIDGE
+ || kif->if_type == IFT_LOOP
+ || kif->if_type == IFT_CARP) {
yyerror("unsupported interface type on "
"interface %s", kif->ifname);
YYERROR;
@@ -487,9 +487,9 @@ interface : INTERFACE STRING {
iface = conf_get_if(kif);
if (iface == NULL)
YYERROR;
- if (iface->media_type == IFT_LOOP ||
- iface->media_type == IFT_CARP ||
- iface->media_type == IFT_MPLSTUNNEL) {
+ if (iface->if_type == IFT_LOOP ||
+ iface->if_type == IFT_CARP ||
+ iface->if_type == IFT_MPLSTUNNEL) {
yyerror("unsupported interface type on "
"interface %s", iface->name);
YYERROR;