Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/bouyer-socketcan]: src/external/bsd/dhcpcd/dist 2552819



details:   https://anonhg.NetBSD.org/src/rev/398bfc126fb4
branches:  bouyer-socketcan
changeset: 820868:398bfc126fb4
user:      roy <roy%NetBSD.org@localhost>
date:      Fri Apr 14 09:53:07 2017 +0000

description:
2552819

diffstat:

 external/bsd/dhcpcd/dist/compat/dprintf.c                |    64 +
 external/bsd/dhcpcd/dist/compat/dprintf.h                |    43 +
 external/bsd/dhcpcd/dist/src/Makefile                    |   135 +
 external/bsd/dhcpcd/dist/src/arp.c                       |   507 +
 external/bsd/dhcpcd/dist/src/bpf.h                       |    45 +
 external/bsd/dhcpcd/dist/src/common.c                    |   255 +
 external/bsd/dhcpcd/dist/src/control.c                   |   423 +
 external/bsd/dhcpcd/dist/src/defs.h                      |    76 +
 external/bsd/dhcpcd/dist/src/dev.c                       |   190 +
 external/bsd/dhcpcd/dist/src/dhcp-common.c               |  1091 ++++
 external/bsd/dhcpcd/dist/src/dhcp.c                      |  3788 ++++++++++++++
 external/bsd/dhcpcd/dist/src/dhcp6.c                     |  3735 +++++++++++++
 external/bsd/dhcpcd/dist/src/dhcpcd.8.in                 |   810 ++
 external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in            |   912 +++
 external/bsd/dhcpcd/dist/src/dhcpcd.h                    |   243 +
 external/bsd/dhcpcd/dist/src/duid.c                      |   159 +
 external/bsd/dhcpcd/dist/src/eloop.c                     |   999 +++
 external/bsd/dhcpcd/dist/src/if-bsd.c                    |  1462 +++++
 external/bsd/dhcpcd/dist/src/if-linux.c                  |  1726 ++++++
 external/bsd/dhcpcd/dist/src/if-options.h                |   232 +
 external/bsd/dhcpcd/dist/src/if.c                        |   770 ++
 external/bsd/dhcpcd/dist/src/ipv4.c                      |   933 +++
 external/bsd/dhcpcd/dist/src/ipv4ll.c                    |   508 +
 external/bsd/dhcpcd/dist/src/ipv6.c                      |  2286 ++++++++
 external/bsd/dhcpcd/dist/src/ipv6nd.c                    |  1664 ++++++
 external/bsd/dhcpcd/dist/src/logerr.c                    |   368 +
 external/bsd/dhcpcd/dist/src/logerr.h                    |    77 +
 external/bsd/dhcpcd/dist/src/route.c                     |   529 +
 external/bsd/dhcpcd/dist/src/script.c                    |   792 ++
 external/bsd/dhcpcd/dist/tests/Makefile                  |    16 +
 external/bsd/dhcpcd/dist/tests/crypt/.gitignore          |     1 +
 external/bsd/dhcpcd/dist/tests/crypt/GNUmakefile         |     7 +
 external/bsd/dhcpcd/dist/tests/crypt/Makefile            |    38 +
 external/bsd/dhcpcd/dist/tests/crypt/README.md           |     8 +
 external/bsd/dhcpcd/dist/tests/crypt/run-test.c          |    38 +
 external/bsd/dhcpcd/dist/tests/crypt/test.h              |    32 +
 external/bsd/dhcpcd/dist/tests/crypt/test_hmac_md5.c     |   207 +
 external/bsd/dhcpcd/dist/tests/eloop-bench/.gitignore    |     1 +
 external/bsd/dhcpcd/dist/tests/eloop-bench/Makefile      |    42 +
 external/bsd/dhcpcd/dist/tests/eloop-bench/README.md     |    53 +
 external/bsd/dhcpcd/dist/tests/eloop-bench/eloop-bench.c |   166 +
 41 files changed, 25431 insertions(+), 0 deletions(-)

diffs (truncated from 25595 to 300 lines):

diff -r 072998791284 -r 398bfc126fb4 external/bsd/dhcpcd/dist/compat/dprintf.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/dhcpcd/dist/compat/dprintf.c Fri Apr 14 09:53:07 2017 +0000
@@ -0,0 +1,64 @@
+/*
+ * dhcpcd - DHCP client daemon
+ * Copyright (c) 2006-2017 Roy Marples <roy%marples.name@localhost>
+ * All rights reserved
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <unistd.h>
+
+#include "dprintf.h"
+
+int
+vdprintf(int fd, const char * __restrict fmt, va_list va)
+{
+       int e;
+       FILE *fp;
+
+       if ((e = dup(fd)) == -1)
+               return -1;
+
+       if ((fp = fdopen(e, "a")) == NULL) {
+               close(e);
+               return -1;
+       }
+
+       e = vfprintf(fp, fmt, va);
+       fclose(fp);
+       return e;
+}
+
+int
+dprintf(int fd, const char * __restrict fmt, ...)
+{
+       int e;
+       va_list va;
+
+       va_start(va, fmt);
+       e = vdprintf(fd, fmt, va);
+       va_end(va);
+       return e;
+}
diff -r 072998791284 -r 398bfc126fb4 external/bsd/dhcpcd/dist/compat/dprintf.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/dhcpcd/dist/compat/dprintf.h Fri Apr 14 09:53:07 2017 +0000
@@ -0,0 +1,43 @@
+/*
+ * dhcpcd - DHCP client daemon
+ * Copyright (c) 2006-2017 Roy Marples <roy%marples.name@localhost>
+ * All rights reserved
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef DPRINTF_H
+#define DPRINTF_H
+
+#include <stdarg.h>
+
+#ifndef __printflike
+# if __GNUC__ > 2 || defined(__INTEL_COMPILER)
+#  define __printflike(a, b) __attribute__((format(printf, a, b)))
+# else
+#  define __printflike(a, b)
+# endif
+#endif
+
+__printflike(2, 0) int vdprintf(int, const char * __restrict, va_list);
+__printflike(2, 3) int dprintf(int, const char * __restrict, ...);
+#endif
diff -r 072998791284 -r 398bfc126fb4 external/bsd/dhcpcd/dist/src/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/dhcpcd/dist/src/Makefile     Fri Apr 14 09:53:07 2017 +0000
@@ -0,0 +1,135 @@
+# dhcpcd Makefile
+
+PROG=          dhcpcd
+SRCS=          common.c control.c dhcpcd.c duid.c eloop.c logerr.c
+SRCS+=         if.c if-options.c sa.c route.c
+SRCS+=         dhcp-common.c script.c
+
+CFLAGS?=       -O2
+SUBDIRS+=      ${MKDIRS}
+
+TOP?=          ..
+include ${TOP}/iconfig.mk
+
+CSTD?=         c99
+CFLAGS+=       -std=${CSTD}
+CPPFLAGS+=     -I${TOP} -I${TOP}/src -I./crypt
+
+SRCS+=         ${DHCPCD_SRCS}
+DHCPCD_DEFS?=  dhcpcd-definitions.conf
+
+PCOMPAT_SRCS=  ${COMPAT_SRCS:compat/%=${TOP}/compat/%}
+PCRYPT_SRCS=   ${CRYPT_SRCS:compat/%=${TOP}/compat/%}
+OBJS+=         ${SRCS:.c=.o} ${PCRYPT_SRCS:.c=.o} ${PCOMPAT_SRCS:.c=.o}
+
+MAN5=          dhcpcd.conf.5
+MAN8=          dhcpcd.8
+CLEANFILES=    dhcpcd.conf.5 dhcpcd.8
+
+FILES=         dhcpcd.conf
+FILESDIR=      ${SYSCONFDIR}
+
+DEPEND!=       test -e .depend && echo ".depend" || echo ""
+
+CLEANFILES+=   *.tar.xz
+
+.PHONY:                import import-bsd dev test
+
+.SUFFIXES:     .in
+
+.in: Makefile ${TOP}/config.mk
+       ${SED} ${SED_RUNDIR} ${SED_DBDIR} ${SED_LIBDIR} ${SED_HOOKDIR} \
+               ${SED_SYS} ${SED_SCRIPT} ${SED_DATADIR} \
+               ${SED_SERVICEEXISTS} ${SED_SERVICECMD} ${SED_SERVICESTATUS} \
+               ${SED_STATUSARG} \
+               $< > $@
+
+all: ${TOP}/config.h ${PROG} ${SCRIPTS} ${MAN5} ${MAN8}
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+
+dev:
+       cd dev && ${MAKE}
+
+.c.o: Makefile ${TOP}/config.mk
+       ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
+
+CLEANFILES+=   dhcpcd-embedded.h dhcpcd-embedded.c
+
+dhcpcd-embedded.h: genembedh ${DHCPCD_DEFS} dhcpcd-embedded.h.in
+       ${HOST_SH} ${.ALLSRC} $^ > $@
+
+dhcpcd-embedded.c: genembedc ${DHCPCD_DEFS} dhcpcd-embedded.c.in
+       ${HOST_SH} ${.ALLSRC} $^ > $@
+
+if-options.c: dhcpcd-embedded.h
+
+.depend: ${SRCS} ${COMPAT_SRCS} ${CRYPT_SRCS}
+       ${CC} ${CPPFLAGS} -MM ${SRCS} ${COMPAT_SRCS} ${CRYPT_SRCS} > .depend
+
+depend: .depend
+
+${PROG}: ${DEPEND} ${OBJS}
+       ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
+
+_embeddedinstall: ${DHCPCD_DEFS}
+       ${INSTALL} -d ${DESTDIR}${SCRIPTSDIR}
+       ${INSTALL} -m ${CONFMODE} ${DHCPCD_DEFS} ${DESTDIR}${SCRIPTSDIR}
+
+_proginstall: ${PROG}
+       ${INSTALL} -d ${DESTDIR}${SBINDIR}
+       ${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${SBINDIR}
+       ${INSTALL} -d ${DESTDIR}${DBDIR}
+
+proginstall: _proginstall ${EMBEDDEDINSTALL}
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+
+_maninstall: ${MAN5} ${MAN8}
+       ${INSTALL} -d ${DESTDIR}${MANDIR}/man5
+       ${INSTALL} -m ${MANMODE} ${MAN5} ${DESTDIR}${MANDIR}/man5
+       ${INSTALL} -d ${DESTDIR}${MANDIR}/man8
+       ${INSTALL} -m ${MANMODE} ${MAN8} ${DESTDIR}${MANDIR}/man8
+
+_confinstall:
+       ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
+       # Install a new default config if not present
+       test -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.conf || \
+               ${INSTALL} -m ${CONFMODE} dhcpcd.conf ${DESTDIR}${SYSCONFDIR}
+       # Attempt to move files from sysconfig to dbdir
+       if [ ! -e ${DESTDIR}${DBDIR}/duid -a \
+           -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid ]; \
+       then \
+               mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid \
+                       ${DESTDIR}${DBDIR}/duid; \
+       fi
+       if [ ! -e ${DESTDIR}${DBDIR}/secret -a \
+           -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret ]; \
+       then \
+               mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret \
+                       ${DESTDIR}${DBDIR}/secret; \
+       fi
+       # Move leases to new location
+       for lease in ${DESTDIR}${DBDIR}/../dhcpcd-*.lease*; do \
+               [ -f "$$lease" ] || continue; \
+               newlease=$$(basename "$$lease" | ${SED} -e "s/dhcpcd-//"); \
+               mv "$$lease" ${DESTDIR}${DBDIR}/"$$newlease"; \
+       done
+       # Move RDM monotonic to new location
+       if [ ! -e ${DESTDIR}${DBDIR}/rdm_monotonic -a \
+           -e ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic ]; \
+       then \
+               mv ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic \
+                       ${DESTDIR}${DBDIR}/rdm_monotonic; \
+       fi
+       
+eginstall:
+
+install: proginstall _maninstall _confinstall eginstall
+
+clean:
+       rm -f ${OBJS} ${PROG} ${PROG}.core ${CLEANFILES}
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+
+distclean: clean
+       rm -f .depend
+
+include ${TOP}/Makefile.inc
diff -r 072998791284 -r 398bfc126fb4 external/bsd/dhcpcd/dist/src/arp.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/dhcpcd/dist/src/arp.c        Fri Apr 14 09:53:07 2017 +0000
@@ -0,0 +1,507 @@
+/*
+ * dhcpcd - ARP handler
+ * Copyright (c) 2006-2017 Roy Marples <roy%marples.name@localhost>
+ * All rights reserved
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/socket.h>
+#include <sys/types.h>
+
+#include <arpa/inet.h>
+
+#include <net/if.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+



Home | Main Index | Thread Index | Old Index