aboutsummaryrefslogtreecommitdiffstats
path: root/network_cmds
diff options
context:
space:
mode:
Diffstat (limited to 'network_cmds')
-rw-r--r--network_cmds/Makefile34
-rw-r--r--network_cmds/Makefile.inc3
-rw-r--r--network_cmds/arp.tproj/Makefile6
-rw-r--r--network_cmds/cfilutil/Makefile6
-rw-r--r--network_cmds/dnctl/Makefile8
-rw-r--r--network_cmds/dnctl/dnctl.c2
-rw-r--r--network_cmds/ecnprobe/Makefile26
-rw-r--r--network_cmds/frame_delay/Makefile6
-rw-r--r--network_cmds/ifconfig.tproj/Makefile18
-rw-r--r--network_cmds/ifconfig.tproj/if6lowpan.c2
-rw-r--r--network_cmds/ifconfig.tproj/ifbridge.c8
-rw-r--r--network_cmds/ifconfig.tproj/ifconfig.c30
-rw-r--r--network_cmds/ifconfig.tproj/ifmedia.c4
-rw-r--r--network_cmds/ifconfig.tproj/nexus.c5
-rw-r--r--network_cmds/ip6addrctl.tproj/Makefile6
-rw-r--r--network_cmds/kdumpd.tproj/Makefile7
-rw-r--r--network_cmds/mnc.tproj/Makefile7
-rw-r--r--network_cmds/mptcp_client/Makefile6
-rw-r--r--network_cmds/mtest.tproj/Makefile6
-rw-r--r--network_cmds/ndp.tproj/Makefile6
-rw-r--r--network_cmds/ndp.tproj/ndp.c2
-rw-r--r--network_cmds/netstat.tproj/Makefile8
-rw-r--r--network_cmds/ping.tproj/Makefile9
-rw-r--r--network_cmds/ping6.tproj/Makefile9
-rw-r--r--network_cmds/pktapctl/Makefile6
-rw-r--r--network_cmds/pktmnglr/Makefile7
-rw-r--r--network_cmds/rarpd.tproj/Makefile6
-rw-r--r--network_cmds/route.tproj/Makefile6
-rw-r--r--network_cmds/rtadvd.tproj/Makefile3
-rw-r--r--network_cmds/rtadvd.tproj/rtadvd_logging.c1
-rw-r--r--network_cmds/rtsol.tproj/Makefile8
-rw-r--r--network_cmds/spray.tproj/Makefile15
-rw-r--r--network_cmds/traceroute.tproj/Makefile8
-rw-r--r--network_cmds/traceroute6.tproj/Makefile6
34 files changed, 290 insertions, 0 deletions
diff --git a/network_cmds/Makefile b/network_cmds/Makefile
new file mode 100644
index 0000000..296ddb4
--- /dev/null
+++ b/network_cmds/Makefile
@@ -0,0 +1,34 @@
+SUBDIR= arp.tproj \
+ cfilutil \
+ dnctl \
+ ecnprobe \
+ frame_delay \
+ ifconfig.tproj \
+ ip6addrctl.tproj \
+ kdumpd.tproj \
+ mnc.tproj \
+ mptcp_client \
+ mtest.tproj \
+ ndp.tproj \
+ ping.tproj \
+ ping6.tproj \
+ pktapctl \
+ pktmnglr \
+ rarpd.tproj \
+ route.tproj \
+ rtadvd.tproj \
+ rtsol.tproj \
+ spray.tproj \
+ traceroute.tproj \
+ traceroute6.tproj
+
+.if !defined(MK_NETSTAT)
+MK_NETSTAT=no
+.endif
+
+# netstat doesnt build on iOS 12, if building for higher set MK_NETSTAT to yes
+.if ${MK_NETSTAT} == "yes"
+SUBDIR+= netstat.tproj
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/network_cmds/Makefile.inc b/network_cmds/Makefile.inc
new file mode 100644
index 0000000..14e30a9
--- /dev/null
+++ b/network_cmds/Makefile.inc
@@ -0,0 +1,3 @@
+CFLAGS+=-DPRIVATE -DINET6 -DPLATFORM_iPhoneOS -D__APPLE_USE_RFC_3542=1 -DUSE_RFC2292BIS=1 -D__APPLE_API_OBSOLETE=1 -DTARGET_OS_EMBEDDED=1
+
+.include "../Makefile.inc"
diff --git a/network_cmds/arp.tproj/Makefile b/network_cmds/arp.tproj/Makefile
new file mode 100644
index 0000000..13711ef
--- /dev/null
+++ b/network_cmds/arp.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= arp
+MAN= arp.8 arp4.4
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/cfilutil/Makefile b/network_cmds/cfilutil/Makefile
new file mode 100644
index 0000000..64ed77c
--- /dev/null
+++ b/network_cmds/cfilutil/Makefile
@@ -0,0 +1,6 @@
+PROG= cfilutil
+SRCS= cfilstat.c cfilutil.c
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/dnctl/Makefile b/network_cmds/dnctl/Makefile
new file mode 100644
index 0000000..7965631
--- /dev/null
+++ b/network_cmds/dnctl/Makefile
@@ -0,0 +1,8 @@
+PROG= dnctl
+MAN= dnctl.8
+
+LDADD+=-liosexec
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/dnctl/dnctl.c b/network_cmds/dnctl/dnctl.c
index 38cffe8..e8443f4 100644
--- a/network_cmds/dnctl/dnctl.c
+++ b/network_cmds/dnctl/dnctl.c
@@ -70,6 +70,8 @@
#include <netinet/ip_dummynet.h>
#include <arpa/inet.h>
+#include <libiosexec.h>
+
/*
* Limit delay to avoid computation overflow
*/
diff --git a/network_cmds/ecnprobe/Makefile b/network_cmds/ecnprobe/Makefile
new file mode 100644
index 0000000..fe02a7f
--- /dev/null
+++ b/network_cmds/ecnprobe/Makefile
@@ -0,0 +1,26 @@
+PROG= ecnprobe
+MAN= ecnprobe.1
+SRCS= capture.c ecn_probe.c ecn.c gmt2local.c \
+ history.c inet.c session.c support.c
+
+# libpcap sources
+SRCS+= pcap.c bpf_filter.c gencode.c grammar.y \
+ scanner.l nametoaddr.c optimize.c pcap-bpf.c \
+ fad-getad.c pcap-darwin.c pcap-common.c \
+ fmtutils.c pcap-util.c pcapng.c sf-pcapng.c \
+ savefile.c sf-pcap.c
+
+CLEANFILES=scanner.h
+YFLAGS+=-p pcap_
+LFLAGS+=-Ppcap_ --header-file=${.OBJDIR}/scanner.h --nounput
+
+CFLAGS+=-I${.CURDIR}/../../lib/libpcap/libpcap/
+CFLAGS+=-I${.OBJDIR} -I${.CURDIR} -DHAVE_CONFIG_H
+
+gencode.o: scanner.c
+
+.PATH: ${.CURDIR}/../../lib/libpcap/libpcap
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/frame_delay/Makefile b/network_cmds/frame_delay/Makefile
new file mode 100644
index 0000000..b9b9744
--- /dev/null
+++ b/network_cmds/frame_delay/Makefile
@@ -0,0 +1,6 @@
+PROG= frame_delay
+MAN= frame_delay.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ifconfig.tproj/Makefile b/network_cmds/ifconfig.tproj/Makefile
new file mode 100644
index 0000000..61a64da
--- /dev/null
+++ b/network_cmds/ifconfig.tproj/Makefile
@@ -0,0 +1,18 @@
+PROG= ifconfig
+MAN= ifconfig.8
+SRCS= af_inet.c \
+ af_inet6.c \
+ af_link.c \
+ if6lowpan.c \
+ ifbond.c \
+ ifbridge.c \
+ ifclone.c \
+ ifconfig.c \
+ iffake.c \
+ ifmedia.c \
+ ifvlan.c \
+ nexus.c
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ifconfig.tproj/if6lowpan.c b/network_cmds/ifconfig.tproj/if6lowpan.c
index f0f4b2e..ee63896 100644
--- a/network_cmds/ifconfig.tproj/if6lowpan.c
+++ b/network_cmds/ifconfig.tproj/if6lowpan.c
@@ -58,6 +58,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
@@ -176,3 +177,4 @@ sixlowpan_ctor(void)
callback_register(sixlowpan_clone_cb, NULL);
#undef N
}
+#endif
diff --git a/network_cmds/ifconfig.tproj/ifbridge.c b/network_cmds/ifconfig.tproj/ifbridge.c
index 951c56b..19ce8ff 100644
--- a/network_cmds/ifconfig.tproj/ifbridge.c
+++ b/network_cmds/ifconfig.tproj/ifbridge.c
@@ -300,6 +300,7 @@ bridge_addresses(int s, const char *prefix)
}
#define MAX_IPv6_STR_LEN INET6_ADDRSTRLEN
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
static void
bridge_mac_nat(int s, const char *prefix)
{
@@ -348,6 +349,7 @@ bridge_mac_nat(int s, const char *prefix)
}
free(buf);
}
+#endif
static void
bridge_status(int s)
@@ -399,7 +401,9 @@ bridge_status(int s)
if (!all || verbose > 1) {
printf("\tAddress cache:\n");
bridge_addresses(s, "\t\t");
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
bridge_mac_nat(s, "\t\t");
+#endif
}
return;
@@ -865,6 +869,7 @@ unsetbridge_hostfilter(const char *ifn, int d, int s, const struct afswtch *afp)
err(1, "BRDGSHOSTFILTER");
}
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
static void
setbridge_macnat(const char *val, int d, int s, const struct afswtch *afp)
{
@@ -878,6 +883,7 @@ unsetbridge_macnat(const char *val, int d, int s, const struct afswtch *afp)
do_bridgeflag(s, val, IFBIF_MAC_NAT, 0);
}
+#endif
static struct cmd bridge_cmds[] = {
DEF_CMD_ARG("addm", setbridge_add),
@@ -930,8 +936,10 @@ static struct cmd bridge_cmds[] = {
#endif
DEF_CMD_ARG2("hostfilter", setbridge_hostfilter),
DEF_CMD_ARG("-hostfilter", unsetbridge_hostfilter),
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
DEF_CMD_ARG("macnat", setbridge_macnat),
DEF_CMD_ARG("-macnat", unsetbridge_macnat),
+#endif
};
static struct afswtch af_bridge = {
.af_name = "af_bridge",
diff --git a/network_cmds/ifconfig.tproj/ifconfig.c b/network_cmds/ifconfig.tproj/ifconfig.c
index 3449301..3acc59c 100644
--- a/network_cmds/ifconfig.tproj/ifconfig.c
+++ b/network_cmds/ifconfig.tproj/ifconfig.c
@@ -109,6 +109,10 @@ __unused static const char copyright[] =
#include <TargetConditionals.h>
#endif
+#ifndef IF_NETEM_PARAMS_PSCALE
+#define IF_NETEM_PARAMS_PSCALE 100000
+#endif
+
/*
* Since "struct ifreq" is composed of various union members, callers
* should pay special attention to interprete the value.
@@ -935,6 +939,7 @@ settbr(const char *val, int dummy __unused, int s, const struct afswtch *afp)
}
}
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
static int
get_int64(uint64_t *i, char const *s)
{
@@ -1255,6 +1260,7 @@ bad_args:
"\t\tnetem\n\n");
return (-1);
}
+#endif
static void
setthrottle(const char *val, int dummy __unused, int s,
@@ -1363,6 +1369,7 @@ setconstrained(const char *vname, int value, int s, const struct afswtch *afp)
}
#endif
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
static void
setifmpklog(const char *vname, int value, int s, const struct afswtch *afp)
{
@@ -1372,6 +1379,7 @@ setifmpklog(const char *vname, int value, int s, const struct afswtch *afp)
if (ioctl(s, SIOCSIFMPKLOG, (caddr_t)&ifr) < 0)
Perror(vname);
}
+#endif
void
settimestamp(const char *vname, int value, int s, const struct afswtch *afp)
@@ -1441,8 +1449,10 @@ setqosmarking(const char *cmd, const char *arg, int s, const struct afswtch *afp
if (strcmp(arg, "fastlane") == 0)
ifr.ifr_qosmarking_mode = IFRTYPE_QOSMARKING_FASTLANE;
+#if defined(IFRTYPE_QOSMARKING_RFC4594)
else if (strcmp(arg, "rfc4594") == 0)
ifr.ifr_qosmarking_mode = IFRTYPE_QOSMARKING_RFC4594;
+#endif
else if (strcasecmp(arg, "none") == 0 || strcasecmp(arg, "off") == 0)
ifr.ifr_qosmarking_mode = IFRTYPE_QOSMARKING_MODE_NONE;
else
@@ -1567,6 +1577,7 @@ setlowpowermode(const char *vname, int value, int s, const struct afswtch *afp)
Perror(vname);
}
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
struct str2num {
const char *str;
uint32_t num;
@@ -1633,6 +1644,7 @@ setifavailability(const char *vname, int value, int s, const struct afswtch *afp
if (ioctl(s, SIOCSIFINTERFACESTATE, (caddr_t)&ifr) < 0)
warn("ioctl(SIOCSIFINTERFACESTATE)");
}
+#endif
static void
show_routermode(int s)
@@ -1750,11 +1762,13 @@ status(const struct afswtch *afp, const struct sockaddr_dl *sdl,
putchar('\n');
}
+#if defined(SIOCGIFXFLAGS)
if (verbose && ioctl(s, SIOCGIFXFLAGS, (caddr_t)&ifr) != -1 &&
(xflags = ifr.ifr_xflags) != 0) {
printb("\txflags", xflags, IFXFBITS);
putchar('\n');
}
+#endif
if (ioctl(s, SIOCGIFCAP, (caddr_t)&ifr) == 0) {
if (ifr.ifr_curcap != 0) {
@@ -2116,9 +2130,11 @@ status(const struct afswtch *afp, const struct sockaddr_dl *sdl,
case IFRTYPE_QOSMARKING_FASTLANE:
printf("fastlane\n");
break;
+#if defined(IFRTYPE_QOSMARKING_RFC4594)
case IFRTYPE_QOSMARKING_RFC4594:
printf("RFC4594\n");
break;
+#endif
case IFRTYPE_QOSMARKING_MODE_NONE:
printf("none\n");
break;
@@ -2134,10 +2150,12 @@ status(const struct afswtch *afp, const struct sockaddr_dl *sdl,
printf("\tlow power mode: %s\n",
(ifr.ifr_low_power_mode != 0) ? "enabled" : "disabled");
}
+#if defined(SIOCGIFMPKLOG)
if (ioctl(s, SIOCGIFMPKLOG, &ifr) != -1) {
printf("\tmulti layer packet logging (mpklog): %s\n",
(ifr.ifr_mpk_log != 0) ? "enabled" : "disabled");
}
+#endif
show_routermode(s);
show_routermode6();
@@ -2424,8 +2442,10 @@ static struct cmd basic_cmds[] = {
DEF_CMD("monitor", IFF_MONITOR:, setifflags),
DEF_CMD("-monitor", -IFF_MONITOR, setifflags),
#endif /* IFF_MONITOR */
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
DEF_CMD("mpklog", 1, setifmpklog),
DEF_CMD("-mpklog", 0, setifmpklog),
+#endif
#ifdef IFF_STATICARP
DEF_CMD("staticarp", IFF_STATICARP, setifflags),
DEF_CMD("-staticarp", -IFF_STATICARP, setifflags),
@@ -2486,7 +2506,9 @@ static struct cmd basic_cmds[] = {
DEF_CMD_VA("routermode", routermode),
DEF_CMD_ARG("desc", setifdesc),
DEF_CMD_ARG("tbr", settbr),
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
DEF_CMD_VA("netem", setnetem),
+#endif
DEF_CMD_ARG("throttle", setthrottle),
DEF_CMD_ARG("log", setlog),
DEF_CMD("cl2k", 1, setcl2k),
@@ -2507,10 +2529,14 @@ static struct cmd basic_cmds[] = {
DEF_CMD("-probe_connectivity", 0, setprobeconnectivity),
DEF_CMD("lowpowermode", 1, setlowpowermode),
DEF_CMD("-lowpowermode", 0, setlowpowermode),
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
DEF_CMD_ARG("subfamily", setifsubfamily),
+#endif
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 135000
DEF_CMD("available", 1, setifavailability),
DEF_CMD("-available", 0, setifavailability),
DEF_CMD("unavailable", 0, setifavailability),
+#endif
};
static __constructor void
@@ -2604,6 +2630,7 @@ ift2str(unsigned int t, unsigned int f, unsigned int sf)
c = "Cellular";
break;
+#if defined(APPLE_IF_FAM_IPSEC)
case IFT_OTHER:
if (ifr.ifr_type.ift_family == APPLE_IF_FAM_IPSEC) {
if (ifr.ifr_type.ift_subfamily == IFRTYPE_SUBFAMILY_BLUETOOTH) {
@@ -2617,6 +2644,7 @@ ift2str(unsigned int t, unsigned int f, unsigned int sf)
}
}
break;
+#endif
case IFT_BRIDGE:
case IFT_PFLOG:
@@ -2681,9 +2709,11 @@ iffunct2str(u_int32_t functional_type)
case IFRTYPE_FUNCTIONAL_INTCOPROC:
break;
+#if defined(IFRTYPE_FUNCTIONAL_COMPANIONLINK)
case IFRTYPE_FUNCTIONAL_COMPANIONLINK:
str = "companionlink";
break;
+#endif
default:
break;
diff --git a/network_cmds/ifconfig.tproj/ifmedia.c b/network_cmds/ifconfig.tproj/ifmedia.c
index 713c136..4f9ade1 100644
--- a/network_cmds/ifconfig.tproj/ifmedia.c
+++ b/network_cmds/ifconfig.tproj/ifmedia.c
@@ -87,6 +87,10 @@
#include <string.h>
#include <unistd.h>
+#ifndef SIOCGIFXMEDIA
+#define SIOCGIFXMEDIA SIOCGIFMEDIA
+#endif
+
#include "ifconfig.h"
static void domediaopt(const char *, int, int);
diff --git a/network_cmds/ifconfig.tproj/nexus.c b/network_cmds/ifconfig.tproj/nexus.c
index 3df9842..3717c15 100644
--- a/network_cmds/ifconfig.tproj/nexus.c
+++ b/network_cmds/ifconfig.tproj/nexus.c
@@ -56,6 +56,11 @@
#include "ifconfig.h"
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 135000
+#define flowswitch multistack
+#define ifnr_flowswitch ifnr_multistack
+#endif
+
static void
nexus_status(int s)
{
diff --git a/network_cmds/ip6addrctl.tproj/Makefile b/network_cmds/ip6addrctl.tproj/Makefile
new file mode 100644
index 0000000..bceb792
--- /dev/null
+++ b/network_cmds/ip6addrctl.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= ip6addrctl
+MAN= ip6addrctl.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/kdumpd.tproj/Makefile b/network_cmds/kdumpd.tproj/Makefile
new file mode 100644
index 0000000..ad84ab0
--- /dev/null
+++ b/network_cmds/kdumpd.tproj/Makefile
@@ -0,0 +1,7 @@
+PROG= kdumpd
+MAN= kdumpd.8
+SRCS= kdumpd.c kdumpsubs.c
+
+BINDIR=/usr/libexec
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/mnc.tproj/Makefile b/network_cmds/mnc.tproj/Makefile
new file mode 100644
index 0000000..146b027
--- /dev/null
+++ b/network_cmds/mnc.tproj/Makefile
@@ -0,0 +1,7 @@
+PROG= mnc
+SRCS= mnc_error.c mnc_main.c \
+ mnc_multicast.c mnc_opts.c
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/mptcp_client/Makefile b/network_cmds/mptcp_client/Makefile
new file mode 100644
index 0000000..a5f71ed
--- /dev/null
+++ b/network_cmds/mptcp_client/Makefile
@@ -0,0 +1,6 @@
+PROG= mptcp_client
+SRCS= conn_lib.c mptcp_client.c
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/mtest.tproj/Makefile b/network_cmds/mtest.tproj/Makefile
new file mode 100644
index 0000000..7390411
--- /dev/null
+++ b/network_cmds/mtest.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= mtest
+MAN= mtest.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ndp.tproj/Makefile b/network_cmds/ndp.tproj/Makefile
new file mode 100644
index 0000000..5eb750d
--- /dev/null
+++ b/network_cmds/ndp.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= ndp
+MAN= ndp.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ndp.tproj/ndp.c b/network_cmds/ndp.tproj/ndp.c
index b485fa1..e3e51b8 100644
--- a/network_cmds/ndp.tproj/ndp.c
+++ b/network_cmds/ndp.tproj/ndp.c
@@ -443,7 +443,9 @@ set(int argc, char **argv)
!(rtm->rtm_flags & RTF_GATEWAY)) switch (sdl->sdl_type) {
case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023:
case IFT_ISO88024: case IFT_ISO88025:
+#if defined(IFT_6LOWPAN)
case IFT_6LOWPAN:
+#endif
goto overwrite;
}
/*
diff --git a/network_cmds/netstat.tproj/Makefile b/network_cmds/netstat.tproj/Makefile
new file mode 100644
index 0000000..454465d
--- /dev/null
+++ b/network_cmds/netstat.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= netstat
+SRCS= data.c if.c inet.c inet6.c ipsec.c main.c \
+ mbuf.c mcast.c misc.c mptcp.c route.c systm.c \
+ tp_astring.c unix.c vsock.c
+
+BINDIR=/usr/bin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ping.tproj/Makefile b/network_cmds/ping.tproj/Makefile
new file mode 100644
index 0000000..e708457
--- /dev/null
+++ b/network_cmds/ping.tproj/Makefile
@@ -0,0 +1,9 @@
+PROG= ping
+MAN= ping.8
+SRCS= ping.c gmt2local.c
+
+BINDIR=/sbin
+
+.PATH: ${.CURDIR}/../ecnprobe
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/ping6.tproj/Makefile b/network_cmds/ping6.tproj/Makefile
new file mode 100644
index 0000000..9a85e6f
--- /dev/null
+++ b/network_cmds/ping6.tproj/Makefile
@@ -0,0 +1,9 @@
+PROG= ping6
+MAN= ping6.8
+SRCS= ping6.c md5.c gmt2local.c
+
+BINDIR=/sbin
+
+.PATH: ${.CURDIR}/../ecnprobe
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/pktapctl/Makefile b/network_cmds/pktapctl/Makefile
new file mode 100644
index 0000000..35b551c
--- /dev/null
+++ b/network_cmds/pktapctl/Makefile
@@ -0,0 +1,6 @@
+PROG= pktapctl
+MAN= pktapctl.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/pktmnglr/Makefile b/network_cmds/pktmnglr/Makefile
new file mode 100644
index 0000000..fbb190c
--- /dev/null
+++ b/network_cmds/pktmnglr/Makefile
@@ -0,0 +1,7 @@
+PROG= pktmnglr
+MAN=
+SRCS= packet_mangler.c
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/rarpd.tproj/Makefile b/network_cmds/rarpd.tproj/Makefile
new file mode 100644
index 0000000..b63f630
--- /dev/null
+++ b/network_cmds/rarpd.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= rarpd
+MAN= rarpd.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/route.tproj/Makefile b/network_cmds/route.tproj/Makefile
new file mode 100644
index 0000000..678ccf3
--- /dev/null
+++ b/network_cmds/route.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= route
+MAN= route.8
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/rtadvd.tproj/Makefile b/network_cmds/rtadvd.tproj/Makefile
new file mode 100644
index 0000000..61fb788
--- /dev/null
+++ b/network_cmds/rtadvd.tproj/Makefile
@@ -0,0 +1,3 @@
+MAN= rtadvd.8 rtadvd.conf.5
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/rtadvd.tproj/rtadvd_logging.c b/network_cmds/rtadvd.tproj/rtadvd_logging.c
index 90dec08..aafb03a 100644
--- a/network_cmds/rtadvd.tproj/rtadvd_logging.c
+++ b/network_cmds/rtadvd.tproj/rtadvd_logging.c
@@ -9,6 +9,7 @@
* Apple Inc.
*/
#include <assert.h>
+#include <stdarg.h>
#include <os/log_private.h>
#define kRtadvdLoggerID "com.apple.rtadvd"
diff --git a/network_cmds/rtsol.tproj/Makefile b/network_cmds/rtsol.tproj/Makefile
new file mode 100644
index 0000000..0fd1e09
--- /dev/null
+++ b/network_cmds/rtsol.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= rtsol
+MAN= rtsol.8
+SRCS= dump.c if.c probe.c rtsock.c \
+ rtsol.c rtsold.c
+
+BINDIR=/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/spray.tproj/Makefile b/network_cmds/spray.tproj/Makefile
new file mode 100644
index 0000000..904e17b
--- /dev/null
+++ b/network_cmds/spray.tproj/Makefile
@@ -0,0 +1,15 @@
+PROG= spray
+MAN= spray.8
+SRCS= spray.c spray_xdr.c spray.h
+RPCSRC= spray.x
+CLEANFILES+= spray_xdr.c spray.h
+
+spray.h: ${RPCSRC}
+ ${RPCGEN} -h -o ${.TARGET} ${RPCSRC}
+
+spray_xdr.c: ${RPCSRC}
+ ${RPCGEN} -c -o ${.TARGET} ${RPCSRC}
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/traceroute.tproj/Makefile b/network_cmds/traceroute.tproj/Makefile
new file mode 100644
index 0000000..706c13c
--- /dev/null
+++ b/network_cmds/traceroute.tproj/Makefile
@@ -0,0 +1,8 @@
+PROG= traceroute
+MAN= traceroute.8
+SRCS= as.c findsaddr-socket.c ifaddrlist.c \
+ traceroute.c version.c
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/network_cmds/traceroute6.tproj/Makefile b/network_cmds/traceroute6.tproj/Makefile
new file mode 100644
index 0000000..5d60f43
--- /dev/null
+++ b/network_cmds/traceroute6.tproj/Makefile
@@ -0,0 +1,6 @@
+PROG= traceroute6
+MAN= traceroute6.8
+
+BINDIR=/usr/sbin
+
+.include <bsd.prog.mk>