summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypserv
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2005-05-02 11:19:52 +0000
committerume <ume@FreeBSD.org>2005-05-02 11:19:52 +0000
commiteffe5f40ccb1b91c8c0408386c4c0a61ff178df0 (patch)
tree6f3439ac3d20a1fdb281ae6115c6229ac931bfa5 /usr.sbin/ypserv
parent729777db8afd189cfc041d4885e02b727b2e12de (diff)
downloadFreeBSD-src-effe5f40ccb1b91c8c0408386c4c0a61ff178df0.zip
FreeBSD-src-effe5f40ccb1b91c8c0408386c4c0a61ff178df0.tar.gz
add targets for ipnodes.byname and ipnodes.byaddr which carries
IPv6 addresses. these targets are off by default, and these are built when there is /var/yp/ipnodes.
Diffstat (limited to 'usr.sbin/ypserv')
-rw-r--r--usr.sbin/ypserv/Makefile.yp38
1 files changed, 38 insertions, 0 deletions
diff --git a/usr.sbin/ypserv/Makefile.yp b/usr.sbin/ypserv/Makefile.yp
index bd33918..0cb8a21 100644
--- a/usr.sbin/ypserv/Makefile.yp
+++ b/usr.sbin/ypserv/Makefile.yp
@@ -98,6 +98,7 @@ YPMAPDIR = $(YPDIR)/$(DOMAIN)
ETHERS = $(YPSRCDIR)/ethers # ethernet addresses (for rarpd)
BOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd)
HOSTS = $(YPSRCDIR)/hosts
+IPNODES = $(YPDIR)/ipnodes
NETWORKS = $(YPSRCDIR)/networks
PROTOCOLS = $(YPSRCDIR)/protocols
RPC = $(YPSRCDIR)/rpc
@@ -164,6 +165,12 @@ TARGETS+= amd.map
AMDHOST= /dev/null
.endif
+.if exists($(IPNODES))
+TARGETS+= ipnodes
+.else
+IPNODES= /dev/null
+.endif
+
target:
@if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \
cd $(DOMAIN) ; echo "NIS Map update started on `date` for domain $(DOMAIN)" ; \
@@ -174,6 +181,7 @@ all: $(TARGETS)
ethers: ethers.byname ethers.byaddr
bootparam: bootparams
hosts: hosts.byname hosts.byaddr
+ipnodes: ipnodes.byname ipnodes.byaddr
networks: networks.byaddr networks.byname
protocols: protocols.bynumber protocols.byname
rpc: rpc.byname rpc.bynumber
@@ -348,6 +356,36 @@ hosts.byaddr: $(HOSTS)
@$(MAKE) -f ../Makefile netid
+ipnodes.byname: $(IPNODES)
+ @echo "Updating $@..."
+.if ${IPNODES} == "/dev/null"
+ @echo "Ipnodes source file not found -- skipping"
+.else
+ @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \
+ print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \
+ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@
+ @$(DBLOAD) -c
+ @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
+ @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
+ @$(MAKE) -f ../Makefile netid
+.endif
+
+
+ipnodes.byaddr: $(IPNODES)
+ @echo "Updating $@..."
+.if ${IPNODES} == "/dev/null"
+ @echo "Ipnodes source file not found -- skipping"
+.else
+ @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \
+ | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \
+ $(RMV) $(TMP) $@
+ @$(DBLOAD) -c
+ @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
+ @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
+ @$(MAKE) -f ../Makefile netid
+.endif
+
+
networks.byname: $(NETWORKS)
@echo "Updating $@..."
@$(AWK) \
OpenPOWER on IntegriCloud