diff options
| author | Brooks Davis <brooks@FreeBSD.org> | 2002-09-24 17:35:08 +0000 |
|---|---|---|
| committer | Brooks Davis <brooks@FreeBSD.org> | 2002-09-24 17:35:08 +0000 |
| commit | fa882e87a5c1810999947ef22360f8974394d1a5 (patch) | |
| tree | 6bb2592d60be2179dc1f63ed27c053dfced72616 /sys | |
| parent | be6180cf890af77b5242777bbaade2f330c42036 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/net/if.c | 14 | ||||
| -rw-r--r-- | sys/net/if_var.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 25b8dc8169ad2..699278bd5f898 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -55,6 +55,7 @@ #include <sys/syslog.h> #include <sys/sysctl.h> #include <sys/jail.h> +#include <machine/stdarg.h> #include <net/if.h> #include <net/if_arp.h> @@ -1972,5 +1973,18 @@ ifmaof_ifpforaddr(sa, ifp) return ifma; } +int +if_printf(struct ifnet *ifp, const char * fmt, ...) +{ + va_list ap; + int retval; + + retval = printf("%s%d: ", ifp->if_name, ifp->if_unit); + va_start(ap, fmt); + retval += vprintf(fmt, ap); + va_end(ap); + return (retval); +} + SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); diff --git a/sys/net/if_var.h b/sys/net/if_var.h index bd9ebfd9f989a..a54ab5ba1a9b3 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -422,6 +422,7 @@ void if_attach(struct ifnet *); int if_delmulti(struct ifnet *, struct sockaddr *); void if_detach(struct ifnet *); void if_down(struct ifnet *); +int if_printf(struct ifnet *, const char *, ...) __printflike(2, 3); void if_route(struct ifnet *, int flag, int fam); int if_setlladdr(struct ifnet *, const u_char *, int); void if_unroute(struct ifnet *, int flag, int fam); |
