Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/ifconfig Convert from the .ifdef RUMP_ACTION stuff to R...
details: https://anonhg.NetBSD.org/src/rev/7ae3f1d2dbae
branches: trunk
changeset: 759600:7ae3f1d2dbae
user: pooka <pooka%NetBSD.org@localhost>
date: Mon Dec 13 17:35:08 2010 +0000
description:
Convert from the .ifdef RUMP_ACTION stuff to RUMPPRG.
diffstat:
sbin/ifconfig/Makefile | 20 +++---------
sbin/ifconfig/Makefile.inc | 4 +-
sbin/ifconfig/af_atalk.c | 9 +++--
sbin/ifconfig/af_inet.c | 9 +++--
sbin/ifconfig/af_inet6.c | 13 ++++---
sbin/ifconfig/af_inetany.c | 17 +++++-----
sbin/ifconfig/af_iso.c | 11 +++---
sbin/ifconfig/env.c | 7 ++-
sbin/ifconfig/ieee80211.c | 11 +++---
sbin/ifconfig/ifconfig.c | 26 ++++++++--------
sbin/ifconfig/ifconfig_hostops.c | 47 ++++++++++++++++++++++++++++++
sbin/ifconfig/ifconfig_rumpops.c | 52 ++++++++++++++++++++++++++++++++++
sbin/ifconfig/media.c | 7 ++-
sbin/ifconfig/prog_ops.h | 61 ++++++++++++++++++++++++++++++++++++++++
sbin/ifconfig/util.c | 15 +++++----
15 files changed, 234 insertions(+), 75 deletions(-)
diffs (truncated from 802 to 300 lines):
diff -r d0e4f35955ff -r 7ae3f1d2dbae sbin/ifconfig/Makefile
--- a/sbin/ifconfig/Makefile Mon Dec 13 17:22:26 2010 +0000
+++ b/sbin/ifconfig/Makefile Mon Dec 13 17:35:08 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.49 2010/11/05 16:23:56 pooka Exp $
+# $NetBSD: Makefile,v 1.50 2010/12/13 17:35:08 pooka Exp $
# @(#)Makefile 8.1 (Berkeley) 6/5/93
# when making a change to this file, please check if the change is
@@ -7,6 +7,7 @@
.include <bsd.own.mk>
+RUMPPRG=ifconfig
MAN= ifconfig.8
#DBG+=-g
@@ -18,6 +19,10 @@
.include "Makefile.inc"
+.PATH: ${.CURDIR}/../../lib/libc/net
+RUMPSRCS= getifaddrs.c
+CPPFLAGS+= -DRUMP_ACTION
+
CPPFLAGS+=-I${NETBSDSRCDIR}/sys/dist/pf/
SRCS+= pfsync.c
@@ -26,17 +31,4 @@
COPTS.ifconfig.c+= -fno-loop-optimize
.endif
-#
-# Compile-time debug flag. If compiled with "make RUMP_ACTION=1",
-# make rump system calls to a server in another process.
-#
-.ifdef RUMP_ACTION
-.PATH: ${.CURDIR}/../../lib/libc/net
-CPPFLAGS+= -DRUMP_SYS_NETWORKING -DRUMP_SYS_IOCTL -DRUMP_SYS_CLOSE
-CPPFLAGS+= -DRUMP_ACTION
-LDADD+= -lrumpclient
-DBG= -g
-SRCS+= getifaddrs.c
-.endif
-
.include <bsd.prog.mk>
diff -r d0e4f35955ff -r 7ae3f1d2dbae sbin/ifconfig/Makefile.inc
--- a/sbin/ifconfig/Makefile.inc Mon Dec 13 17:22:26 2010 +0000
+++ b/sbin/ifconfig/Makefile.inc Mon Dec 13 17:35:08 2010 +0000
@@ -1,10 +1,8 @@
-# $NetBSD: Makefile.inc,v 1.7 2009/09/16 14:59:45 tsutsui Exp $
+# $NetBSD: Makefile.inc,v 1.8 2010/12/13 17:35:08 pooka Exp $
# shared stuff with src/distrib/utils/x_ifconfig for install media.
# stuff not required by install media should be into Makefile.
-PROG= ifconfig
-
DPADD+=${LIBUTIL}
DPADD+=${LIBPROP}
LDADD+=-lutil
diff -r d0e4f35955ff -r 7ae3f1d2dbae sbin/ifconfig/af_atalk.c
--- a/sbin/ifconfig/af_atalk.c Mon Dec 13 17:22:26 2010 +0000
+++ b/sbin/ifconfig/af_atalk.c Mon Dec 13 17:35:08 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: af_atalk.c,v 1.16 2010/01/30 18:30:33 is Exp $ */
+/* $NetBSD: af_atalk.c,v 1.17 2010/12/13 17:35:08 pooka Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: af_atalk.c,v 1.16 2010/01/30 18:30:33 is Exp $");
+__RCSID("$NetBSD: af_atalk.c,v 1.17 2010/12/13 17:35:08 pooka Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -56,6 +56,7 @@
#include "af_inetany.h"
#include "parse.h"
#include "extern.h"
+#include "prog_ops.h"
#ifndef satocsat
#define satocsat(__sa) ((const struct sockaddr_at *)(__sa))
@@ -209,7 +210,7 @@
memset(&ifr, 0, sizeof(ifr));
estrlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
ifr.ifr_addr.sa_family = AF_APPLETALK;
- if (ioctl(s, SIOCGIFADDR, &ifr) != -1)
+ if (prog_ioctl(s, SIOCGIFADDR, &ifr) != -1)
;
else if (errno == EADDRNOTAVAIL || errno == EAFNOSUPPORT) {
if (!force)
@@ -223,7 +224,7 @@
if (flags & IFF_POINTOPOINT) {
estrlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
- if (ioctl(s, SIOCGIFDSTADDR, &ifr) == -1) {
+ if (prog_ioctl(s, SIOCGIFDSTADDR, &ifr) == -1) {
if (errno == EADDRNOTAVAIL)
memset(&ifr.ifr_addr, 0, sizeof(ifr.ifr_addr));
else
diff -r d0e4f35955ff -r 7ae3f1d2dbae sbin/ifconfig/af_inet.c
--- a/sbin/ifconfig/af_inet.c Mon Dec 13 17:22:26 2010 +0000
+++ b/sbin/ifconfig/af_inet.c Mon Dec 13 17:35:08 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: af_inet.c,v 1.14 2009/09/11 22:06:29 dyoung Exp $ */
+/* $NetBSD: af_inet.c,v 1.15 2010/12/13 17:35:08 pooka Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: af_inet.c,v 1.14 2009/09/11 22:06:29 dyoung Exp $");
+__RCSID("$NetBSD: af_inet.c,v 1.15 2010/12/13 17:35:08 pooka Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -57,6 +57,7 @@
#include "env.h"
#include "extern.h"
#include "af_inetany.h"
+#include "prog_ops.h"
static void in_constructor(void) __attribute__((constructor));
static void in_status(prop_dictionary_t, prop_dictionary_t, bool);
@@ -97,7 +98,7 @@
}
memset(&ifr, 0, sizeof(ifr));
estrlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
- if (ioctl(s, SIOCGIFADDR, &ifr) == -1) {
+ if (prog_ioctl(s, SIOCGIFADDR, &ifr) == -1) {
if (errno == EADDRNOTAVAIL || errno == EAFNOSUPPORT)
return;
warn("SIOCGIFADDR");
@@ -106,7 +107,7 @@
if (memcmp(&ifr.ifr_addr, &creq->ifra_addr, sizeof(ifr.ifr_addr)) == 0)
alias = false;
in_addreq = *creq;
- if (ioctl(s, SIOCGIFALIAS, &in_addreq) == -1) {
+ if (prog_ioctl(s, SIOCGIFALIAS, &in_addreq) == -1) {
if (errno == EADDRNOTAVAIL || errno == EAFNOSUPPORT) {
return;
} else
diff -r d0e4f35955ff -r 7ae3f1d2dbae sbin/ifconfig/af_inet6.c
--- a/sbin/ifconfig/af_inet6.c Mon Dec 13 17:22:26 2010 +0000
+++ b/sbin/ifconfig/af_inet6.c Mon Dec 13 17:35:08 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: af_inet6.c,v 1.26 2010/01/22 23:50:07 dyoung Exp $ */
+/* $NetBSD: af_inet6.c,v 1.27 2010/12/13 17:35:08 pooka Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: af_inet6.c,v 1.26 2010/01/22 23:50:07 dyoung Exp $");
+__RCSID("$NetBSD: af_inet6.c,v 1.27 2010/12/13 17:35:08 pooka Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -57,6 +57,7 @@
#include "parse.h"
#include "extern.h"
#include "af_inetany.h"
+#include "prog_ops.h"
static void in6_constructor(void) __attribute__((constructor));
static void in6_alias(const char *, prop_dictionary_t, prop_dictionary_t,
@@ -302,7 +303,7 @@
if (flags & IFF_POINTOPOINT) {
ifr6 = *creq;
- if (ioctl(s, SIOCGIFDSTADDR_IN6, &ifr6) == -1) {
+ if (prog_ioctl(s, SIOCGIFDSTADDR_IN6, &ifr6) == -1) {
if (errno != EADDRNOTAVAIL)
warn("SIOCGIFDSTADDR_IN6");
memset(&ifr6.ifr_addr, 0, sizeof(ifr6.ifr_addr));
@@ -319,7 +320,7 @@
}
ifr6 = *creq;
- if (ioctl(s, SIOCGIFNETMASK_IN6, &ifr6) == -1) {
+ if (prog_ioctl(s, SIOCGIFNETMASK_IN6, &ifr6) == -1) {
if (errno != EADDRNOTAVAIL)
warn("SIOCGIFNETMASK_IN6");
} else {
@@ -329,7 +330,7 @@
}
ifr6 = *creq;
- if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) == -1) {
+ if (prog_ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) == -1) {
if (errno != EADDRNOTAVAIL)
warn("SIOCGIFAFLAG_IN6");
} else {
@@ -352,7 +353,7 @@
struct in6_addrlifetime *lifetime;
ifr6 = *creq;
lifetime = &ifr6.ifr_ifru.ifru_lifetime;
- if (ioctl(s, SIOCGIFALIFETIME_IN6, &ifr6) == -1) {
+ if (prog_ioctl(s, SIOCGIFALIFETIME_IN6, &ifr6) == -1) {
if (errno != EADDRNOTAVAIL)
warn("SIOCGIFALIFETIME_IN6");
} else if (lifetime->ia6t_preferred || lifetime->ia6t_expire) {
diff -r d0e4f35955ff -r 7ae3f1d2dbae sbin/ifconfig/af_inetany.c
--- a/sbin/ifconfig/af_inetany.c Mon Dec 13 17:22:26 2010 +0000
+++ b/sbin/ifconfig/af_inetany.c Mon Dec 13 17:35:08 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: af_inetany.c,v 1.12 2008/07/02 07:44:14 dyoung Exp $ */
+/* $NetBSD: af_inetany.c,v 1.13 2010/12/13 17:35:08 pooka Exp $ */
/*-
* Copyright (c) 2008 David Young. All rights reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: af_inetany.c,v 1.12 2008/07/02 07:44:14 dyoung Exp $");
+__RCSID("$NetBSD: af_inetany.c,v 1.13 2010/12/13 17:35:08 pooka Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -54,6 +54,7 @@
#include "env.h"
#include "extern.h"
#include "af_inetany.h"
+#include "prog_ops.h"
static void *
loadbuf(const struct apbuf *b, const struct paddr_prefix *pfx)
@@ -90,9 +91,9 @@
else if (!prop_dictionary_get_bool(env, "alias", &alias) || alias ||
param->gifaddr.cmd == 0)
return;
- else if (ioctl(s, param->gifaddr.cmd, param->dgreq.buf) == -1)
+ else if (prog_ioctl(s, param->gifaddr.cmd, param->dgreq.buf) == -1)
err(EXIT_FAILURE, param->gifaddr.desc);
- else if (ioctl(s, param->difaddr.cmd, param->dgreq.buf) == -1)
+ else if (prog_ioctl(s, param->difaddr.cmd, param->dgreq.buf) == -1)
err(EXIT_FAILURE, param->difaddr.desc);
else
return;
@@ -153,8 +154,8 @@
MIN(param->mask.buflen, param->defmask.buflen));
}
if (replace) {
- if (ioctl(s, param->gifaddr.cmd, param->dgreq.buf) == 0) {
- rc = ioctl(s, param->difaddr.cmd, param->dgreq.buf);
+ if (prog_ioctl(s, param->gifaddr.cmd, param->dgreq.buf) == 0) {
+ rc = prog_ioctl(s, param->difaddr.cmd, param->dgreq.buf);
if (rc == -1)
err(EXIT_FAILURE, param->difaddr.desc);
} else if (errno == EADDRNOTAVAIL)
@@ -163,13 +164,13 @@
err(EXIT_FAILURE, param->gifaddr.desc);
} else if (delete) {
loadbuf(¶m->dgaddr, addr);
- if (ioctl(s, param->difaddr.cmd, param->dgreq.buf) == -1)
+ if (prog_ioctl(s, param->difaddr.cmd, param->dgreq.buf) == -1)
err(EXIT_FAILURE, param->difaddr.desc);
return;
}
if (param->pre_aifaddr != NULL &&
(*param->pre_aifaddr)(env, param) == -1)
err(EXIT_FAILURE, "pre-%s", param->aifaddr.desc);
- if (ioctl(s, param->aifaddr.cmd, param->req.buf) == -1)
+ if (prog_ioctl(s, param->aifaddr.cmd, param->req.buf) == -1)
err(EXIT_FAILURE, param->aifaddr.desc);
}
diff -r d0e4f35955ff -r 7ae3f1d2dbae sbin/ifconfig/af_iso.c
--- a/sbin/ifconfig/af_iso.c Mon Dec 13 17:22:26 2010 +0000
+++ b/sbin/ifconfig/af_iso.c Mon Dec 13 17:35:08 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: af_iso.c,v 1.13 2008/07/15 21:27:58 dyoung Exp $ */
+/* $NetBSD: af_iso.c,v 1.14 2010/12/13 17:35:08 pooka Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: af_iso.c,v 1.13 2008/07/15 21:27:58 dyoung Exp $");
+__RCSID("$NetBSD: af_iso.c,v 1.14 2010/12/13 17:35:08 pooka Exp $");
#endif /* not lint */
#include <err.h>
@@ -56,6 +56,7 @@
#include "parse.h"
#include "extern.h"
#include "af_inetany.h"
+#include "prog_ops.h"
Home |
Main Index |
Thread Index |
Old Index