]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fixup build system to create hierarchical header files from the protocols
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 16 Oct 2018 19:47:26 +0000 (15:47 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 10 Dec 2018 16:20:03 +0000 (11:20 -0500)
Fixup dictionary directory arguments to test utilities
Fix includes to use new paths

57 files changed:
Makefile
configure
configure.ac
src/bin/unit_test_module.c
src/include/.gitignore
src/include/all.mk
src/lib/server/auth.c
src/lib/server/client.c
src/lib/server/cond_tokenize.c
src/lib/server/exec.c
src/lib/server/exfile.c
src/lib/server/map.c
src/lib/server/paircmp.c
src/lib/server/pairmove.c
src/lib/server/snmp.c
src/lib/server/stats.c
src/lib/server/trigger.c
src/lib/server/virtual_servers.c
src/lib/server/xlat_eval.c
src/lib/tls/session.c
src/lib/util/dict.c
src/lib/util/pair.c
src/modules/proto_dhcpv4/proto_dhcpv4_base.c
src/modules/proto_radius/proto_radius_auth.c
src/modules/proto_tacacs/proto_tacacs.c
src/modules/proto_vmps/proto_vmps.c
src/modules/proto_vmps/proto_vmps_all.c
src/modules/proto_vmps/proto_vmps_udp.c
src/modules/rlm_eap/lib/sim/crypto.c
src/modules/rlm_eap/lib/sim/eap_aka_common.h
src/modules/rlm_eap/lib/sim/eap_sim_common.h
src/modules/rlm_eap/lib/sim/sim_attrs.h
src/modules/rlm_eap/rlm_eap.c
src/modules/rlm_eap/types/rlm_eap_aka/rlm_eap_aka.c
src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c
src/modules/rlm_sigtran/client.c
src/modules/rlm_stats/rlm_stats.c
src/protocols/dhcpv4/decode.c
src/protocols/dhcpv4/dhcpv4.h
src/protocols/dhcpv4/packet.c
src/protocols/dhcpv6/dhcpv6.h
src/protocols/radius/defs.h
src/protocols/tacacs/base.c
src/protocols/tacacs/decode.c
src/protocols/tacacs/encode.c
src/protocols/vqp/vqp.c
src/tests/.gitignore
src/tests/Makefile
src/tests/auth/all.mk
src/tests/daemon/all.mk
src/tests/dict/all.mk
src/tests/eapol_test/all.mk
src/tests/keywords/all.mk
src/tests/map/all.mk
src/tests/runtests.sh
src/tests/unit/all.mk
src/tests/xlat/all.mk

index 1a0e967b8903b58308cb8bb2a276168f2925039c..1d8509418b6951f5d5148809d835f3f2cb6256d1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,8 @@ raddb/test.conf:
 # Don't molest STDERR as this may be used to receive output from a debugger.
 $(BUILD_DIR)/tests/radiusd-c: raddb/test.conf ${BUILD_DIR}/bin/radiusd $(GENERATED_CERT_FILES) | build.raddb
        @printf "radiusd -C... "
-       @if ! FR_LIBRARY_PATH=./build/lib/local/.libs/ ./build/make/jlibtool --mode=execute ./build/bin/local/radiusd -XCd ./raddb -n debug -D ./share -n test > $(BUILD_DIR)/tests/radiusd.config.log; then \
+       @if ! FR_LIBRARY_PATH=./build/lib/local/.libs/ ./build/make/jlibtool --mode=execute ./build/bin/local/radiusd -XCMd ./raddb -n debug -D ./share/dictionary -n test > $(BUILD_DIR)/tests/radiusd.config.log; then \
+               rm -f raddb/test.conf; \
                cat $(BUILD_DIR)/tests/radiusd.config.log; \
                echo "fail"; \
                echo "FR_LIBRARY_PATH=./build/lib/local/.libs/ ./build/make/jlibtool --mode=execute ./build/bin/local/radiusd -XCd ./raddb -n debug -D ./share -n test"; \
@@ -108,11 +109,11 @@ endif
 #
 export DESTDIR := $(R)
 
-DICTIONARIES := $(wildcard share/dictionary*)
-install.share: $(addprefix $(R)$(dictdir)/,$(notdir $(DICTIONARIES)))
+DICTIONARIES := $(shell find share/dictionary -type f -name dictionary*)
+install.share: $(addprefix $(R)$(dictdir)/,$(patsubst share/dictionary/%,%,$(DICTIONARIES)))
 
-$(R)$(dictdir)/%: share/%
-       @echo INSTALL $(notdir $<)
+$(R)$(dictdir)/%: share/dictionary/%
+       @echo INSTALL $(patsubst share/dictionary/%,%,$<)
        @$(INSTALL) -m 644 $< $@
 
 MANFILES := $(wildcard man/man*/*.?)
index 093d3af27183ef7e808b5d26038411070c029c30..ca19724e5d6925bb93c6681b7c89c18ee08749b9 100755 (executable)
--- a/configure
+++ b/configure
@@ -5606,7 +5606,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $raddbdir" >&5
 $as_echo "$raddbdir" >&6; }
 
-dictdir='${datarootdir}/freeradius'
+dictdir='${datarootdir}/freeradius/dictionary'
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dictdir" >&5
 $as_echo_n "checking dictdir... " >&6; }
 
index 3998694f645faf287aa153e6a11361cd57395c46..662c21894e3e576e5f2c70366e7148053ef4b449 100644 (file)
@@ -515,7 +515,7 @@ AC_MSG_RESULT($raddbdir)
 dnl #
 dnl #  extra argument: --with-dictdir
 dnl #
-dictdir='${datarootdir}/freeradius'
+dictdir='${datarootdir}/freeradius/dictionary'
 AC_MSG_CHECKING(dictdir)
 AC_ARG_WITH(dictdir,
 [  --with-dictdir=DIR      directory for dictionary files [DATAROOTDIR/freeradius] ],
index 6b9cdad47e58c84e38f72a59f3fbf4e9fd4ea234..1e922abd1ccac5e8996f5f79968e286b24ddc645 100644 (file)
@@ -40,6 +40,8 @@ RCSID("$Id$")
 
 #include <freeradius-devel/unlang/base.h>
 
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
+
 #ifdef HAVE_GETOPT_H
 #  include <getopt.h>
 #endif
@@ -960,11 +962,11 @@ int main(int argc, char *argv[])
        if (!vp) goto done;
 
        switch (vp->vp_int32) {
-       case FR_AUTH_TYPE_ACCEPT:
+       case FR_AUTH_TYPE_VALUE_ACCEPT:
                request->reply->code = FR_CODE_ACCESS_ACCEPT;
                goto done;
 
-       case FR_AUTH_TYPE_REJECT:
+       case FR_AUTH_TYPE_VALUE_REJECT:
                request->reply->code = FR_CODE_ACCESS_REJECT;
                goto done;
 
index 3462b5c45bc2e06c63005e2d3722d095268031eb..899248e1302167b95b6aa9f707db30eb32de26c6 100644 (file)
@@ -3,18 +3,14 @@ autoconf.h
 autoconf.sed
 
 # Dynamically generated headers
-attributes.h
 features.h
-freeradius.h
-freeradius.snmp.h
 missing.h
 radpaths.h
-eap.sim.h
-eap.aka.h
-tacacs.h
-rfc*.h
 tls.h
-vqp.h
+protocol/*
+
+# Symlinks
+util
 
 # Build scripts
 build-radpaths-h
index 20a15e721286e56018dfb424e0a180f13e11fa65..0395c76bd2be3419e492bb3638854c07e6c46f43 100644 (file)
 #
 #  The rest of the headers are static.
 #
-
-HEADERS_DY     := attributes.h features.h missing.h radpaths.h
+HEADERS_DY     := features.h missing.h radpaths.h
 
 HEADERS        = \
        build.h \
        $(HEADERS_DY)
 
+
 #
 #  Solaris awk doesn't recognise [[:blank:]] hence [\t ]
 #
@@ -37,39 +37,38 @@ src/include/autoconf.sed: src/include/autoconf.h
 #  Create the header files from the dictionaries.
 #
 
-RFC_DICTS := $(filter-out %~,$(wildcard share/dictionary.rfc*)) \
-    share/dictionary.vqp share/dictionary.freeradius \
-    share/dictionary.freeradius.snmp \
-    share/dictionary.dhcpv4 \
-    share/dictionary.dhcpv6 \
-    share/dictionary.eap.aka \
-    share/dictionary.eap.sim \
-    share/dictionary.tacacs
+# Find the RFC dictionaries, and add them to the list to be converted
+DICT := $(shell find share/dictionary -type f -name *dictionary.rfc*)
 
-HEADERS_RFC := $(patsubst share/dictionary.%,src/include/%.h,$(RFC_DICTS))
-HEADERS        += $(notdir ${HEADERS_RFC})
+# Find internal dictionaries and add them to the list to be converted
+DICT += $(shell find share/dictionary -type f -name *dictionary.freeradius*)
 
-.PRECIOUS: $(HEADERS_RFC)
+# These contain the protocol number definitions
+DICT += $(shell find share/dictionary -type f -name *dictionary)
 
-NORMALIZE      := tr -- '[:lower:]/.-' '[:upper:]___' | sed 's/^/\#define /;s/241_//;'
-HEADER         := "/* AUTO_GENERATED FILE.  DO NOT EDIT */"
+# Add in protocol specific dictionaries (should be done in proto_* modules?)
+DICT += share/dictionary/vqp/dictionary.vqp
 
-src/include/attributes.h: share/dictionary.freeradius.internal
-       ${Q}$(ECHO) HEADER $@
-       ${Q}echo ${HEADER} > $@
-       ${Q}echo "#pragma once" >> $@
-       ${Q}grep ^ATTRIBUTE $<  | awk '{print "FR_"$$2 " " $$3 }' | ${NORMALIZE}  >> $@
-       ${Q}echo " " >> $@
-       ${Q}grep -- 'Auth-Type' $< | grep ^VALUE | awk '{print "FR_"$$2 "_" $$3 " " $$4 }' | ${NORMALIZE}  >> $@
+NORMALIZE      := tr -- '[:lower:]/.-+' '[:upper:]____' | sed 's/241_//;'
+HEADER         := "/* AUTO_GENERATED FILE.  DO NOT EDIT */"
 
-src/include/%.h: share/dictionary.% share/dictionary.vqp share/dictionary.freeradius.snmp
-       ${Q}$(ECHO) HEADER $@
-       ${Q}echo ${HEADER} > $@
-       ${Q}echo "#pragma once" >> $@
-       ${Q}grep ^ATTRIBUTE $<  | awk '{print "FR_"$$2 " " $$3 }' | ${NORMALIZE} >> $@
-       ${Q}grep ^VALUE $<  | awk '{print "FR_"$$2"_VALUE_"$$3 " " $$4 }' | ${NORMALIZE} >> $@
+#  Build targets dynamically
+define DICT_TO_HEADER
+HEADERS_DY += $(1)
+src/include/$(1): $(2)
+       ${Q}$$(ECHO) HEADER $$(patsubst src/include/%,%,$$@)
+       ${Q}test -e $$@ || mkdir -p $$(dir $$@)
+       ${Q}echo "#pragma once" >> $$@
+       ${Q}grep ^PROTOCOL $$< | ${NORMALIZE} | awk '{print "#define PROTOCOL_"$$$$2" " $$$$3 " //!< AUTOGENERATED PROTOCOL NUMBER DEFINITION"}' > $$@
+       ${Q}grep ^ATTRIBUTE $$< | ${NORMALIZE} | awk '{print "#define FR_"$$$$2 " " $$$$3 "     //!< AUTOGENERATED ATTRIBUTE DEFINITION"}' >> $$@
+       ${Q}grep ^VALUE $$< | ${NORMALIZE} | awk '{print "#define FR_"$$$$2"_VALUE_"$$$$3 " " $$$$4 "   //!< AUTOGENERATED VALUE DEFINITION"}' >> $$@
+endef
+$(foreach x,$(DICT),$(eval $(call DICT_TO_HEADER,$(addsuffix .h,$(subst dictionary.,,$(patsubst share/dictionary/%,protocol/%,$(x)))),$(x))))
+
+#  Add our dynamic headers to the header manifest so they get
+#  installed.
+#HEADERS += $(HEADERS_DY)
 
-#
 #  Build features.h by copying over WITH_* and RADIUSD_VERSION_*
 #  preprocessor macros from autoconf.h
 #  This means we don't need to include autoconf.h in installed headers.
@@ -113,18 +112,45 @@ scan: $(BOOTSTRAP_BUILD)
 #  This is to that changes to the build rules (e.g. PW_FOO -> FR_FOO)
 #  result in the headers being rebuilt.
 #
-$(BOOTSTRAP_BUILD): src/include/autoconf.h
+
+# define the installation directory
+SRC_INCLUDE_DIR := ${R}${includedir}/freeradius
+
+$(SRC_INCLUDE_DIR):
+       ${Q}$(INSTALL) -d -m 755 ${SRC_INCLUDE_DIR}
+
+#
+#  install the headers by re-writing the local files
+#
+#  install-sh function for creating directories gets confused
+#  if there's a trailing slash, tries to create a directory
+#  it already created, and fails...
+#
+${SRC_INCLUDE_DIR}/%.h: src/include/%.h | $(SRC_INCLUDE_DIR)
+       ${Q}echo INSTALL $(notdir $<)
+       ${Q}$(INSTALL) -d -m 755 `echo $(dir $@) | sed 's/\/$$//'`
+# Expression must deal with indentation after the hash and copy it to the substitution string.
+# Hash not anchored to allow substitution in function documentation.
+       ${Q}sed -e 's/#\([\\t ]*\)include <freeradius-devel\/\([^>]*\)>/#\1include <freeradius\/\2>/g' < $< > $@
+       ${Q}chmod 644 $@
+
+all: $(addprefix src/include/,$(HEADERS_DY))
+
+install.src.include: $(addprefix ${SRC_INCLUDE_DIR}/,${HEADERS})
+install: install.src.include
 
 #
 #  Cleaning
 #
 .PHONY: clean.src.include distclean.src.include
 clean.src.include:
-       ${Q}rm -f $(addprefix src/include/,$(HEADERS_DY)) $(HEADERS_RFC)
+       ${Q}rm -rf $(addprefix src/include/,$(HEADERS_DY))
 
 clean: clean.src.include
 
 distclean.src.include: clean.src.include
        ${Q}rm -f autoconf.sed
+       ${Q}rm -rf src/include/protocol
 
 distclean: distclean.src.include
+
index 09b5e90646d6ea00363ebf5d8fb704f762de8f2d..3ba463b231eee919b373a2a906cbc89a59692a51 100644 (file)
@@ -37,7 +37,7 @@ RCSID("$Id$")
 
 #include <freeradius-devel/radius/defs.h>
 
-#include <freeradius-devel/attributes.h>
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
 
 #include <ctype.h>
 
index bdcfc74c92c712f0278a57ebfbd1b02765aaa53b..6701fcd26b2de2b2e47b6deb04b0ff3ade71edfe 100644 (file)
@@ -33,7 +33,7 @@ RCSID("$Id$")
 #include <freeradius-devel/util/trie.h>
 #include <freeradius-devel/util/misc.h>
 
-#include <freeradius-devel/attributes.h>
+
 
 #include <ctype.h>
 #include <fcntl.h>
index 072772035d4275798d248ac174c7496daa212dcc..a9fcb38e160a42bc8e5c52c6109003426b61fa60 100644 (file)
@@ -29,7 +29,7 @@ RCSID("$Id$")
 #include <freeradius-devel/server/parser.h>
 #include <freeradius-devel/server/rad_assert.h>
 
-#include <freeradius-devel/attributes.h>
+
 
 #include <ctype.h>
 
index 3e28dad248c819b970ca8d2535fd09a77725bd47..70b29dc1a1163404ab687e59e1f5e578f39d96e7 100644 (file)
@@ -34,7 +34,7 @@ RCSID("$Id$")
 #include <freeradius-devel/util/syserror.h>
 #include <freeradius-devel/util/thread_local.h>
 
-#include <freeradius-devel/attributes.h>
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
 
 #include <sys/file.h>
 
index da7147d550622aa27507f73aa763d62507583a65..25a20b1d9a4438c7bbba47b1b8faa202c9607bd6 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <freeradius-devel/util/misc.h>
 
-#include <freeradius-devel/attributes.h>
+
 
 #include <sys/stat.h>
 #include <fcntl.h>
index da99cdd1b519b18e69c2eae3e7b3d59342f6fc44..1e6f34b50b85cac5735f1252a09925a66db30c25 100644 (file)
@@ -36,8 +36,8 @@ RCSID("$Id$")
 #include <freeradius-devel/util/pair_cursor.h>
 #include <freeradius-devel/util/misc.h>
 
-#include <freeradius-devel/rfc2865.h>
-#include <freeradius-devel/attributes.h>
+#include <freeradius-devel/protocol/radius/rfc2865.h>
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
 
 #include <ctype.h>
 
index ebdb18f485812d1ef71ff1735c5424a2e47f4964..58290cf062844065b17d899b673f778d15470e91 100644 (file)
@@ -34,7 +34,7 @@ RCSID("$Id$")
 #include <freeradius-devel/server/regex.h>
 #include <freeradius-devel/server/request.h>
 
-#include <freeradius-devel/rfc2865.h>
+#include <freeradius-devel/protocol/radius/rfc2865.h>
 
 #include <ctype.h>
 
index c86457eae9bde6180ef5622a03e5a2ca9f6bdfd7..18f50af6155edb410fa8035a296812ca838c7587 100644 (file)
@@ -29,8 +29,8 @@ RCSID("$Id$")
 #include <freeradius-devel/server/rad_assert.h>
 #include <freeradius-devel/server/pairmove.h>
 
-#include <freeradius-devel/rfc2865.h>
-#include <freeradius-devel/attributes.h>
+#include <freeradius-devel/protocol/radius/rfc2865.h>
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
 
 #include <ctype.h>
 
index 3e077fca66a5ee93d5228cc5648f1fc7a7cd5a16..e654ea9ff8a0935809ed6bc0c35d6372fffaf008 100644 (file)
@@ -33,7 +33,7 @@ RCSID("$Id$")
 #include <freeradius-devel/util/misc.h>
 #include <freeradius-devel/util/proto.h>
 
-#include <freeradius-devel/freeradius.snmp.h>
+#include <freeradius-devel/protocol/snmp/freeradius.h>
 
 #define FR_FREERADIUS_SNMP_TYPE_OBJECT 0
 
index 39e707004c1db31df3432797de3652a6b79493dc..4f8df8df211863ddad47458c590574f74d83bea0 100644 (file)
@@ -29,7 +29,7 @@ RCSID("$Id$")
 #include <freeradius-devel/util/misc.h>
 
 #include <freeradius-devel/radius/defs.h>
-#include <freeradius-devel/attributes.h>
+
 
 #ifdef WITH_STATS
 
index 6f03d2e920e175a755bce0d6bae5a0dc5ffc6598..a78586db5e79c0abd059a0773ac1aa61684f0187 100644 (file)
@@ -29,7 +29,7 @@ RCSID("$Id$")
 #include <freeradius-devel/server/cf_parse.h>
 #include <freeradius-devel/server/rad_assert.h>
 
-#include <freeradius-devel/attributes.h>
+
 
 static CONF_SECTION const      *trigger_exec_main, *trigger_exec_subcs;
 static rbtree_t                        *trigger_last_fired_tree;
index 71fe6d9922f93ff24d886b941d79c43da1c648a7..de5c3dadc3e2173603b6249fbfe844d3bc559a2d 100644 (file)
@@ -39,7 +39,7 @@ RCSID("$Id$")
 
 #include <freeradius-devel/unlang/base.h>
 
-#include <freeradius-devel/attributes.h>
+
 
 /*
  *     Ordered by component
index ba5dfc68fac32bc25b22085a9f9a208c33d2ae5d..cdeb080dd7b9cae2a19c9c028583bcf392ce7ae9 100644 (file)
@@ -36,7 +36,7 @@ RCSID("$Id$")
 #include <freeradius-devel/unlang/base.h>
 #include <freeradius-devel/unlang/unlang_priv.h>       /* Remove when everything uses new xlat API */
 
-#include <freeradius-devel/attributes.h>
+
 
 #include <ctype.h>
 #include "xlat_priv.h"
index 9cbd5f85cd397e148598417454ad94219dd63b60..e99aa047617b30992ba18680866eed6b71143f88 100644 (file)
@@ -32,7 +32,8 @@
 #include <freeradius-devel/server/pair.h>
 
 #include <freeradius-devel/util/misc.h>
-#include <freeradius-devel/attributes.h>
+
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
 
 #include <openssl/x509v3.h>
 #include <ctype.h>
index 89d492227d8f9b29e54826405f8145654713365f..6dbe9ba8509b41dfe6ec677fc66aab2a8ff87ead 100644 (file)
@@ -29,7 +29,7 @@ RCSID("$Id$")
 #endif
 #include <freeradius-devel/radius/defs.h>
 #include <freeradius-devel/radius/radius.h>
-#include <freeradius-devel/rfc2865.h>
+#include <freeradius-devel/protocol/radius/rfc2865.h>
 #include <freeradius-devel/util/conf.h>
 #include <freeradius-devel/util/hash.h>
 #include <freeradius-devel/util/misc.h>
@@ -4502,11 +4502,10 @@ static int _dict_from_file(dict_from_file_ctx_t *ctx,
 
        if ((fp = fopen(fn, "r")) == NULL) {
                if (!src_file) {
-                       fr_strerror_printf_push("%s: Couldn't open dictionary '%s': %s",
-                                               "Error reading dictionary", fn, fr_syserror(errno));
+                       fr_strerror_printf_push("Couldn't open dictionary %s: %s", fr_syserror(errno), fn);
                } else {
-                       fr_strerror_printf_push("%s: %s[%d]: Couldn't open dictionary '%s': %s",
-                                               "Error reading dictionary", src_file, src_line, fn,
+                       fr_strerror_printf_push("Error reading dictionary: %s[%d]: Couldn't open dictionary '%s': %s",
+                                               src_file, src_line, fn,
                                                fr_syserror(errno));
                }
                return -2;
@@ -4522,7 +4521,7 @@ static int _dict_from_file(dict_from_file_ctx_t *ctx,
 
        if (!S_ISREG(statbuf.st_mode)) {
                fclose(fp);
-               fr_strerror_printf_push("%s: Dictionary '%s' is not a regular file", "Error reading dictionary", fn);
+               fr_strerror_printf_push("Dictionary is not a regular file: %s", fn);
                return -1;
        }
 
@@ -4533,8 +4532,8 @@ static int _dict_from_file(dict_from_file_ctx_t *ctx,
 #ifdef S_IWOTH
        if ((statbuf.st_mode & S_IWOTH) != 0) {
                fclose(fp);
-               fr_strerror_printf_push("%s: Dictionary '%s' is globally writable.  Refusing to start "
-                                  "due to insecure configuration", "Error reading dictionary", fn);
+               fr_strerror_printf_push("Dictionary is globally writable: %s. "
+                                       "Refusing to start due to insecure configuration", fn);
                return -1;
        }
 #endif
@@ -5394,14 +5393,7 @@ int fr_dict_autoload(fr_dict_autoload_t const *to_load)
                if (strcmp(p->proto, "freeradius") == 0) {
                        if (fr_dict_from_file(&dict, FR_DICTIONARY_FILE) < 0) return -1;
                } else {
-                       /*
-                        *      FIXME - Temporarily disabled
-                        */
-#if 0
                        if (fr_dict_protocol_afrom_file(&dict, p->proto) < 0) return -1;
-#else
-                       continue;
-#endif
                }
 
                if (p->out) *(p->out) = dict;
index acf9e3aaf1c024b79120f06f97e605bbeed58a63..15ee3325230539e54347bcff2f763139352cdf6c 100644 (file)
  */
 RCSID("$Id$")
 
-#include "pair.h"
-
-#include <freeradius-devel/rfc2865.h>
-#include <freeradius-devel/attributes.h>
 #include <freeradius-devel/util/regex.h>
 #include <freeradius-devel/util/talloc.h>
 #include <freeradius-devel/util/misc.h>
@@ -33,8 +29,13 @@ RCSID("$Id$")
 #include <freeradius-devel/util/print.h>
 #include <freeradius-devel/util/pair_cursor.h>
 
+#include <freeradius-devel/protocol/radius/rfc2865.h>
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
+
 #include <ctype.h>
 
+#include "pair.h"
+
 #ifndef NDEBUG
 #  define FREE_MAGIC (0xF4EEF4EE)
 #endif
index f3bf0abcf50602cd9c568308ac4e712e6b0e1e0a..89de421dbdb2cf1b91a77d470835b7e477073c68 100644 (file)
@@ -29,7 +29,7 @@
 #include <freeradius-devel/util/dict.h>
 #include <freeradius-devel/server/rad_assert.h>
 #include <freeradius-devel/dhcpv4/dhcpv4.h>
-#include <freeradius-devel/dhcpv4.h>
+#include <freeradius-devel/protocol/dhcpv4/rfc2131.h>
 
 static fr_dict_t *dict_dhcpv4;
 
index 9bf9eb4af453b3c3a23b8384d068e555fc149f6d..171dadddb77885d78f667523735aa9ae899f8067 100644 (file)
@@ -30,6 +30,8 @@
 #include <freeradius-devel/server/state.h>
 #include <freeradius-devel/server/rad_assert.h>
 
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
+
 #ifndef USEC
 #define USEC (1000000)
 #endif
@@ -380,13 +382,13 @@ static fr_io_final_t mod_process(void const *instance, REQUEST *request, fr_io_a
                /*
                 *      Handle hard-coded Accept and Reject.
                 */
-               if (auth_type->vp_uint32 == FR_AUTH_TYPE_ACCEPT) {
+               if (auth_type->vp_uint32 == FR_AUTH_TYPE_VALUE_ACCEPT) {
                        RDEBUG2("%pP, allowing user", auth_type);
                        request->reply->code = FR_CODE_ACCESS_ACCEPT;
                        goto setup_send;
                }
 
-               if (auth_type->vp_uint32 == FR_AUTH_TYPE_REJECT) {
+               if (auth_type->vp_uint32 == FR_AUTH_TYPE_VALUE_REJECT) {
                        RDEBUG2("%pP, rejecting user", auth_type);
                        request->reply->code = FR_CODE_ACCESS_REJECT;
                        goto setup_send;
index b4f4ab742ac09b519bc2d019ed7aa5abfa26be89..b25f3d829dbc40aa6dfb7e5e90811aa27857ca64 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <freeradius-devel/tacacs/tacacs.h>
 
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
+
 typedef struct {
        uint32_t        session_timeout;                //!< Maximum time between rounds.
        uint32_t        max_sessions;                   //!< Maximum ongoing sessions.
@@ -337,13 +339,13 @@ stop_processing:
                /*
                 *      Handle hard-coded Accept and Reject.
                 */
-               if (auth_type->vp_uint32 == FR_AUTH_TYPE_ACCEPT) {
+               if (auth_type->vp_uint32 == FR_AUTH_TYPE_VALUE_ACCEPT) {
                        RDEBUG2("Auth-Type = Accept, allowing user");
                        tacacs_status(request, RLM_MODULE_OK);
                        goto setup_send;
                }
 
-               if (auth_type->vp_uint32 == FR_AUTH_TYPE_REJECT) {
+               if (auth_type->vp_uint32 == FR_AUTH_TYPE_VALUE_REJECT) {
                        RDEBUG2("Auth-Type = Reject, rejecting user");
                        tacacs_status(request, RLM_MODULE_REJECT);
                        goto setup_send;
index bccc8f1a7c710d312927805838b14488807e8eb2..47fbd784f8c50dca116a3bf8d415ce4c9c1b6fb1 100644 (file)
@@ -28,6 +28,9 @@
 #include <freeradius-devel/server/module.h>
 #include <freeradius-devel/unlang/base.h>
 #include <freeradius-devel/server/rad_assert.h>
+
+#include <freeradius-devel/protocol/vqp/vqp.h>
+
 #include "proto_vmps.h"
 
 extern fr_app_t proto_vmps;
index 0b7c0b878f1d8491ca4af50c2461b5aa78e8e51e..968907968e9693eab9bfc0a45a7c4383d4680a41 100644 (file)
@@ -30,6 +30,8 @@
 #include <freeradius-devel/server/rad_assert.h>
 #include <freeradius-devel/vqp/vqp.h>
 
+#include <freeradius-devel/protocol/vqp/vqp.h>
+
 static fr_dict_t *dict_vmps;
 
 extern fr_dict_autoload_t proto_vmps_all_dict[];
index 7ec34bac4e91b8d1251ffcc99d877e33d8888eb6..bc127b849f15a8760c57665cb85d9370d2e42f71 100644 (file)
@@ -33,6 +33,9 @@
 #include <freeradius-devel/io/listen.h>
 #include <freeradius-devel/io/schedule.h>
 #include <freeradius-devel/server/rad_assert.h>
+
+#include <freeradius-devel/protocol/vqp/vqp.h>
+
 #include "proto_vmps.h"
 
 extern fr_app_io_t proto_vmps_udp;
index d2752f5bdc8a63140f6832d5e092ab7fd2781755..ccee5d5d68041b7bcb00723447d1613761a7e1e3 100644 (file)
@@ -33,7 +33,7 @@ RCSID("$Id$")
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <freeradius-devel/eap.sim.h>
+#include <freeradius-devel/protocol/eap/sim/dictionary.h>
 
 #include "eap_types.h"
 #include "sim_proto.h"
index 917a88ff7fa8514e0d2149bf8e4201ee3fb0578c..e149c2068cb1e00bc45e7bf5a24986d842a7d7f1 100644 (file)
@@ -26,7 +26,7 @@
  *
  * @copyright 2016 The FreeRADIUS server project
  */
-#include <freeradius-devel/eap.aka.h>
+#include <freeradius-devel/protocol/eap/aka/dictionary.h>
 
 #define EAP_AKA_AUTS_SIZE              14      //!< Server sequence number.  SIM checks this
                                                //!< is within the correct range.
index 8e0bd9697cddec0fc80435dc39e5a0cac665af36..1a988545d7940b861e444f8b51e3d667d751aa45 100644 (file)
@@ -26,7 +26,7 @@
  *
  * @copyright 2016 The FreeRADIUS server project
  */
-#include <freeradius-devel/eap.sim.h>
+#include <freeradius-devel/protocol/eap/sim/dictionary.h>
 
 #define EAP_SIM_VERSION                        1
 #define EAP_SIM_NONCE_MT_SIZE          16      //!< Length of challenge from SIM client.
index e0a9a78bc6c73bb9ed0597a16407d162755c437b..85181949311c101c0004113791ad44e96e2e7326 100644 (file)
  */
 #include <freeradius-devel/server/rad_assert.h>
 #include <freeradius-devel/util/dict.h>
-#include <freeradius-devel/eap.sim.h>
-#include <freeradius-devel/eap.aka.h>
+#include <freeradius-devel/protocol/eap/sim/dictionary.h>
+#include <freeradius-devel/protocol/eap/sim/rfc4187.h>
+#include <freeradius-devel/protocol/eap/aka/dictionary.h>
+#include <freeradius-devel/protocol/eap/aka/rfc4187.h>
 
 /*
  *     Sanity check on dictionaries...
index 5cada39f69e38c7670469578f7752a97b399b93d..259e5b4067893bd884a0f7f35817ae1b1fb51914 100644 (file)
@@ -31,6 +31,8 @@ RCSID("$Id$")
 #include <freeradius-devel/server/base.h>
 #include <freeradius-devel/server/module.h>
 #include <freeradius-devel/server/dl.h>
+#include <freeradius-devel/server/dl.h>
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
 #include "rlm_eap.h"
 
 extern rad_module_t rlm_eap;
index 0ddaa9fa105bfd08a3ea45d5f2ee38c780bcca8a..62ce4a310f04c19932b434b62e806bd1d4944c27 100644 (file)
@@ -32,6 +32,7 @@ RCSID("$Id$")
 #include "sim_proto.h"
 
 #include <freeradius-devel/server/rad_assert.h>
+#include <freeradius-devel/protocol/eap/aka/rfc4187.h>
 
 #ifndef EAP_TLS_MPPE_KEY_LEN
 #  define EAP_TLS_MPPE_KEY_LEN     32
index 4f8934f36ef4f473afe29ccf02fec3ec1ab4d2f9..e3a9afa76405e77adea5eba6a9935affc8ff839f 100644 (file)
@@ -34,6 +34,7 @@ RCSID("$Id$")
 #include "sim_proto.h"
 
 #include <freeradius-devel/server/rad_assert.h>
+#include <freeradius-devel/protocol/eap/sim/rfc4187.h>
 
 #ifndef EAP_TLS_MPPE_KEY_LEN
 #  define EAP_TLS_MPPE_KEY_LEN     32
index 1b8462e506077f7d7c1fc589da702d595429f017..2e2d9d25ce023561f1e8e163f244a0357fb6f6ca 100644 (file)
@@ -28,8 +28,8 @@
 
 #include <freeradius-devel/server/base.h>
 #include <freeradius-devel/server/rad_assert.h>
-#include <freeradius-devel/eap.aka.h>
-#include <freeradius-devel/eap.sim.h>
+#include <freeradius-devel/protocol/eap/aka/dictionary.h>
+#include <freeradius-devel/protocol/eap/sim/dictionary.h>
 #include <freeradius-devel/unlang/base.h>
 #include <freeradius-devel/server/module.h>
 #include "sigtran.h"
index b879037b1cf6feead5c68754d902dcf4ef3d9d7d..f4a353a556c32ebe5bfc16297bdb817cde401ab4 100644 (file)
@@ -29,6 +29,8 @@ RCSID("$Id$")
 #include <freeradius-devel/util/dlist.h>
 #include <freeradius-devel/server/rad_assert.h>
 
+#include <freeradius-devel/protocol/radius/freeradius.h>
+
 /*
  *     @todo - also get the statistics from the network side for
  *             that, though, we need a way to find other network
index ba24169e1afe22ccc23d660408fc5203b205bdd8..8616b63c0bee4b882f64ceb6963a89b4d5967d28 100644 (file)
@@ -31,7 +31,7 @@
 #include <freeradius-devel/util/types.h>
 #include <freeradius-devel/util/proto.h>
 #include <freeradius-devel/dhcpv4/dhcpv4.h>
-#include <freeradius-devel/rfc2865.h>
+#include <freeradius-devel/protocol/radius/rfc2865.h>
 #include <freeradius-devel/io/test_point.h>
 
 static ssize_t decode_tlv(TALLOC_CTX *ctx, fr_cursor_t *cursor, fr_dict_attr_t const *parent,
index e1cab8ffdbc8fc77edbdc1faaad319ecfb8b6221..8233420d0df50be9732c14a85638b546b67af05c 100644 (file)
@@ -32,7 +32,7 @@ extern "C" {
 
 #include <freeradius-devel/util/pcap.h>
 #include <freeradius-devel/util/packet.h>
-#include <freeradius-devel/dhcpv4.h>
+#include <freeradius-devel/protocol/dhcpv4/rfc2131.h>
 
 #define DHCP_CHADDR_LEN        (16)
 #define DHCP_SNAME_LEN (64)
index 247b4c4ce84c9993d194295e5da1ba8954ebb236..aad510ce256ae946a38b74fcc365bdf79bb1e8ed 100644 (file)
@@ -29,7 +29,7 @@
 #include <freeradius-devel/util/base.h>
 #include <freeradius-devel/util/pair.h>
 #include <freeradius-devel/util/types.h>
-#include <freeradius-devel/dhcpv4.h>
+#include <freeradius-devel/protocol/dhcpv4/rfc2131.h>
 #include "dhcpv4.h"
 #include "attrs.h"
 
index 73312615a4809e59d86fb2685c339841e784468a..e1cc9ba6dd164800b0cb66dce18e926a1bd91051 100644 (file)
@@ -29,8 +29,8 @@
 RCSIDH(dhcpv6_h, "$Id$")
 
 #include <freeradius-devel/util/dict.h>
-#include <freeradius-devel/attributes.h>
-#include <freeradius-devel/dhcpv6.h>
+
+#include <freeradius-devel/protocol/dhcpv6/dictionary.h>
 
 extern size_t const fr_dhcpv6_attr_sizes[FR_TYPE_MAX + 1][2];
 extern fr_dict_attr_t const *dhcpv6_root;
index eb49215bd03c8daa60eb14108b058fb023a18331..68d50dcbb376259b49fd8047fd14a55588709ee0 100644 (file)
@@ -68,48 +68,44 @@ typedef enum {
  */
 #define MAX_PACKET_LEN 4096
 
-#include <freeradius-devel/rfc2865.h>
-#include <freeradius-devel/rfc2866.h>
-#include <freeradius-devel/rfc2867.h>
-#include <freeradius-devel/rfc2868.h>
-#include <freeradius-devel/rfc2869.h>
+#include <freeradius-devel/protocol/radius/rfc2865.h>
+#include <freeradius-devel/protocol/radius/rfc2866.h>
+#include <freeradius-devel/protocol/radius/rfc2867.h>
+#include <freeradius-devel/protocol/radius/rfc2868.h>
+#include <freeradius-devel/protocol/radius/rfc2869.h>
 
-#include <freeradius-devel/rfc3162.h>
-#include <freeradius-devel/rfc3576.h>
-#include <freeradius-devel/rfc3580.h>
+#include <freeradius-devel/protocol/radius/rfc3162.h>
+#include <freeradius-devel/protocol/radius/rfc3576.h>
+#include <freeradius-devel/protocol/radius/rfc3580.h>
 
-#include <freeradius-devel/rfc4072.h>
-#include <freeradius-devel/rfc4372.h>
+#include <freeradius-devel/protocol/radius/rfc4072.h>
+#include <freeradius-devel/protocol/radius/rfc4372.h>
 
 #define FR_CUI FR_CHARGEABLE_USER_IDENTITY
 
-#include <freeradius-devel/rfc4675.h>
-#include <freeradius-devel/rfc4818.h>
-#include <freeradius-devel/rfc4849.h>
+#include <freeradius-devel/protocol/radius/rfc4675.h>
+#include <freeradius-devel/protocol/radius/rfc4818.h>
+#include <freeradius-devel/protocol/radius/rfc4849.h>
 
-#include <freeradius-devel/rfc5580.h>
-#include <freeradius-devel/rfc5607.h>
-#include <freeradius-devel/rfc5904.h>
+#include <freeradius-devel/protocol/radius/rfc5580.h>
+#include <freeradius-devel/protocol/radius/rfc5607.h>
+#include <freeradius-devel/protocol/radius/rfc5904.h>
 
-#include <freeradius-devel/rfc6572.h>
-#include <freeradius-devel/rfc6677.h>
-#include <freeradius-devel/rfc6911.h>
-#include <freeradius-devel/rfc6929.h>
-#include <freeradius-devel/rfc6930.h>
+#include <freeradius-devel/protocol/radius/rfc6572.h>
+#include <freeradius-devel/protocol/radius/rfc6677.h>
+#include <freeradius-devel/protocol/radius/rfc6911.h>
+#include <freeradius-devel/protocol/radius/rfc6929.h>
+#include <freeradius-devel/protocol/radius/rfc6930.h>
 
-#include <freeradius-devel/rfc7055.h>
-#include <freeradius-devel/rfc7155.h>
-#include <freeradius-devel/rfc7268.h>
-#include <freeradius-devel/rfc7930.h>
+#include <freeradius-devel/protocol/radius/rfc7055.h>
+#include <freeradius-devel/protocol/radius/rfc7155.h>
+#include <freeradius-devel/protocol/radius/rfc7268.h>
+#include <freeradius-devel/protocol/radius/rfc7930.h>
 
 /*
  *     All internal attributes are now defined in this file.
  */
-#include <freeradius-devel/attributes.h>
-
-#include <freeradius-devel/freeradius.h>
-
-#include <freeradius-devel/vqp.h>
+#include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
 
 #define FR_DIGEST_RESPONSE             206
 #define FR_DIGEST_ATTRIBUTES           207
index f19a805f5aed38dc8cb9abcd9d95bdaef7753ce8..74924213d6235c4f42a81911372ee1918e0eca7b 100644 (file)
@@ -29,7 +29,7 @@
 #include <freeradius-devel/server/log.h>
 #include <freeradius-devel/util/md5.h>
 #include <freeradius-devel/server/rad_assert.h>
-#include <freeradius-devel/tacacs.h>
+#include <freeradius-devel/protocol/tacacs/dictionary.h>
 
 #include "tacacs.h"
 #include "attrs.h"
index 965d4a7295c803e727a553a1baa7ef29c0c4c4a8..13ddcd051b75a639a2ce49434eb2aa43b2d1bc36 100644 (file)
@@ -28,7 +28,7 @@
 #include <freeradius-devel/server/base.h>
 #include <freeradius-devel/server/log.h>
 #include <freeradius-devel/server/rad_assert.h>
-#include <freeradius-devel/tacacs.h>
+#include <freeradius-devel/protocol/tacacs/dictionary.h>
 
 #include "tacacs.h"
 #include "attrs.h"
index 3077bdeeaa9bc76f1f3c724c91d4348e9f4c91fa..5f90d9135b857e319295434cced115a968386054 100644 (file)
@@ -28,7 +28,7 @@
 #include <freeradius-devel/server/base.h>
 #include <freeradius-devel/server/log.h>
 #include <freeradius-devel/server/rad_assert.h>
-#include <freeradius-devel/tacacs.h>
+#include <freeradius-devel/protocol/tacacs/dictionary.h>
 
 #include "tacacs.h"
 #include "attrs.h"
index 37ac2fec55edeb22f0ab726e73c2fefd81a126cf..0550003fe154affec5405588f5e2821fd0ad758c 100644 (file)
@@ -27,7 +27,7 @@ RCSID("$Id$")
 
 #include <freeradius-devel/server/base.h>
 #include <freeradius-devel/util/udp.h>
-#include <freeradius-devel/vqp.h>
+#include <freeradius-devel/protocol/vqp/vqp.h>
 
 #include "vqp.h"
 
index 9b95b1cfe676b388ad33e480eca386aa8e54adca..febd9e3cf9484e33cc2e524187a6c377ec7ff8cc 100644 (file)
@@ -3,7 +3,6 @@
 .bar
 .request
 *.ok
-dictionary
 test.conf
 radius.log
 radiusd.pid
index cc63e9dcb9dcd6e9e0bf812d6f4620ff548d93bf..713ebe59652e4cf8a528c2b70d959f6f2bdd5822 100644 (file)
@@ -25,7 +25,7 @@ PORT := 12340
 #      example.com stripped.example.com
 SECRET := testing123
 
-.PHONY: all eap dictionary clean
+.PHONY: all eap clean
 
 #
 #      Build the directory for testing the server
@@ -33,14 +33,15 @@ SECRET := testing123
 all: parse tests
 
 clean:
-       @rm -f test.conf dictionary *.ok *.log
+       @rm -f test.conf *.ok *.log
 
 dictionary:
-       @echo "# test dictionary not install.  Delete at any time." > dictionary
-       @echo '$$INCLUDE ' $(top_builddir)/share/dictionary >> dictionary
-       @echo '$$INCLUDE ' $(top_builddir)/src/tests/dictionary.test >> dictionary
-       @echo '$$INCLUDE ' $(top_builddir)/share/dictionary.dhcpv4 >> dictionary
-       @echo '$$INCLUDE ' $(top_builddir)/share/dictionary.vqp >> dictionary
+       ${Q}echo "# test dictionary not install.  Delete at any time." > $@
+       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary/freeradius/dictionary >> $@
+       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary/radius/dictionary >> $@
+       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary/dhcpv4/dictionary >> $@
+       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary/vqp/dictionary >> $@
+       ${Q}echo '$$INCLUDE ' $(top_builddir)/src/tests/dictionary.test >> $@
 
 test.conf: dictionary
        @echo "# test configuration file.  Do not install.  Delete at any time." > $@
@@ -59,11 +60,10 @@ test.conf: dictionary
        @echo 'cadir   = $${maindir}/certs' >> $@
        @echo '$$INCLUDE $${testdir}/config/' >> $@
 
-
 radiusd.pid: test.conf
        @rm -f $(TEST_PATH)/gdb.log $(TEST_PATH)/radius.log
        @printf "TEST-SERVER Starting server... "
-       @if ! TEST_PORT=$(PORT) $(BIN_PATH)/radiusd -Pxxxxl $(TEST_PATH)/radius.log -d ${top_builddir}/src/tests -n test -D $(TEST_PATH); then\
+       @if ! TEST_PORT=$(PORT) $(BIN_PATH)/radiusd -Pxxxxl $(TEST_PATH)/radius.log -d ${top_builddir}/src/tests -n test -D "${top_builddir}/share/dictionary/"; then\
                echo "failed"; \
                echo "Last log entries were:"; \
                tail -n 20 "$(TEST_PATH)/radius.log"; \
@@ -104,5 +104,5 @@ radiusd.kill:
 tests: test.conf | radiusd.kill radiusd.pid
        @chmod a+x runtests.sh
        @echo BIN_PATH="$(BIN_PATH)" PORT="$(PORT)" ./runtests.sh $(TESTS)
-       @BIN_PATH="$(BIN_PATH)" PORT="$(PORT)" ./runtests.sh $(TESTS)
+       @BIN_PATH="$(BIN_PATH)" PORT="$(PORT)" TOP_BUILDDIR="${top_builddir}" ./runtests.sh $(TESTS)
        @$(MAKE) radiusd.kill
index 7bbac39b57b2f59291ef89592519add2005d27cf..1ad027bf9c5887118c8ed26d16c95aa236e6f6c4 100644 (file)
@@ -84,11 +84,11 @@ AUTH_LIBS   := $(addsuffix .la,$(addprefix rlm_,$(AUTH_MODULES)))
 #
 $(BUILD_DIR)/tests/auth/%: $(DIR)/% $(BUILD_DIR)/tests/auth/%.attrs $(TESTBINDIR)/unit_test_module | $(BUILD_DIR)/tests/auth $(AUTH_RADDB) $(AUTH_LIBS) build.raddb
        ${Q}echo UNIT-TEST $(notdir $@)
-       ${Q}if ! TESTDIR=$(notdir $@) $(TESTBIN)/unit_test_module -D share -d src/tests/auth/ -i $@.attrs -f $@.attrs -xx > $@.log 2>&1; then \
+       ${Q}if ! TESTDIR=$(notdir $@) $(TESTBIN)/unit_test_module -D share/dictionary -d src/tests/auth/ -i $@.attrs -f $@.attrs -xx > $@.log 2>&1; then \
                if ! grep ERROR $< 2>&1 > /dev/null; then \
                        cat $@.log; \
                        echo "# $@.log"; \
-                       echo "TESTDIR=$(notdir $@) $(TESTBIN)/unit_test_module -D share -d src/tests/auth/ -i $@.attrs -f $@.attrs -xxx > $@.log 2>&1"; \
+                       echo "TESTDIR=$(notdir $@) $(TESTBIN)/unit_test_module -D share/dictionary -d src/tests/auth/ -i $@.attrs -f $@.attrs -xxx > $@.log 2>&1"; \
                        exit 1; \
                fi; \
                FOUND=$$(grep ^$< $@.log | head -1 | sed 's/:.*//;s/.*\[//;s/\].*//'); \
@@ -96,7 +96,7 @@ $(BUILD_DIR)/tests/auth/%: $(DIR)/% $(BUILD_DIR)/tests/auth/%.attrs $(TESTBINDIR
                if [ "$$EXPECTED" != "$$FOUND" ]; then \
                        cat $@.log; \
                        echo "# $@.log"; \
-                       echo "TESTDIR=$(notdir $@) $(TESTBIN)/unit_test_module -D share -d src/tests/auth/ -i $@.attrs -f $@.attrs -xxx > $@.log 2>&1"; \
+                       echo "TESTDIR=$(notdir $@) $(TESTBIN)/unit_test_module -D share/dictionary -d src/tests/auth/ -i $@.attrs -f $@.attrs -xxx > $@.log 2>&1"; \
                        exit 1; \
                fi \
        fi
index f857abc0ef398485b0ab85c4d1e143c4f2a89f02..f8c2f12be04b697a7329dfec12e1790ee90c9442 100644 (file)
@@ -68,7 +68,7 @@ $(BUILD_DIR)/tests/daemon/radiusd.version: $(TESTBINDIR)/radiusd
 #
 $(BUILD_DIR)/tests/daemon/radiusd.log: $(BUILD_DIR)/tests/daemon/radiusd.version
        ${Q}rm -f $@
-       ${Q}tmux -L $(TMUX_KEY) new-session -d './$(TESTBIN)/radiusd -i 127.0.0.1 -p $(TMUX_PORT) -fxx -d ./raddb -D share -l $@'
+       ${Q}tmux -L $(TMUX_KEY) new-session -d './$(TESTBIN)/radiusd -i 127.0.0.1 -p $(TMUX_PORT) -fxx -d ./raddb -D share/dictionary -l $@'
 
 radiusd.start: $(BUILD_DIR)/tests/daemon/radiusd.log
 
index 21f470dda825f0ceef5ddef2f0e50aa7f9608b53..4019caeac0c3edeb99e918525158d1fca06536f8 100644 (file)
@@ -2,7 +2,7 @@
 #  Create the output directory
 #
 .PHONY: $(BUILD_DIR)/tests/dict
-$(BUILD_DIR)/tests/dict:
+$(BUILD_DIR)/tests/dict/radius:
        ${Q}mkdir -p $@
 
 FILES := $(wildcard $(DIR)/*.dict)
@@ -17,6 +17,8 @@ $(BUILD_DIR)/tests/dict/%: $(DIR)/% $(BUILD_DIR)/bin/unit_test_attribute $(TESTB
        ${Q}echo UNIT-TEST $(notdir $@)
        ${Q}mkdir -p $@_dir
        ${Q}cp $< $@_dir/dictionary
+       ${Q}ln -sf ${top_srcdir}/share/dictionary/radius $@_dir/
+       ${Q}ln -sf ${top_srcdir}/share/dictionary/dhcp $@_dir/
        ${Q}if ! $(TESTBIN)/unit_test_attribute -D $@_dir $(dir $<)/empty.txt; then \
                echo "$(TESTBIN)/unit_test_attribute -D $@_dir $(dir $<)/empty.txt"; \
                exit 1; \
index 21c1dccfd13fe1076ad4787054d4e565bf42deab..fd5ddd78bcd734adfd2b699ddae0baa30a317fa5 100644 (file)
@@ -47,7 +47,7 @@ $(CONFIG_PATH)/methods-enabled:
 $(CONFIG_PATH)/methods-enabled/%: $(BUILD_DIR)/lib/rlm_eap_%.la | $(CONFIG_PATH)/methods-enabled
        ${Q}ln -sf $(CONFIG_PATH)/methods-available/$(notdir $@) $(CONFIG_PATH)/methods-enabled/
 
-.PHONY: eap dictionary clean clean.tests.eap
+.PHONY: eap clean clean.tests.eap
 clean: clean.tests.eap
 
 #
@@ -83,16 +83,16 @@ radiusd.kill: | $(OUTPUT_DIR)
 clean.tests.eap:
        ${Q}rm -f $(OUTPUT_DIR)/*.ok $(OUTPUT_DIR)/*.log $(OUTPUT_DIR)/eapol_test.skip
        ${Q}rm -f "$(CONFIG_PATH)/test.conf"
-       ${Q}rm -f "$(CONFIG_PATH)/dictionary"
        ${Q}rm -rf "$(CONFIG_PATH)/methods-enabled"
 
 ifneq "$(EAPOL_TEST)" ""
 $(CONFIG_PATH)/dictionary:
        ${Q}echo "# test dictionary not install.  Delete at any time." > $@
-       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary >> $@
+       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary/freeradius/dictionary >> $@
+       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary/radius/dictionary >> $@
+       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary/dhcpv4/dictionary >> $@
+       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary/vqp/dictionary >> $@
        ${Q}echo '$$INCLUDE ' $(top_builddir)/src/tests/dictionary.test >> $@
-       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary.dhcpv4 >> $@
-       ${Q}echo '$$INCLUDE ' $(top_builddir)/share/dictionary.vqp >> $@
 
 $(CONFIG_PATH)/test.conf: $(CONFIG_PATH)/dictionary src/tests/eapol_test/all.mk
        ${Q}echo "# test configuration file.  Do not install.  Delete at any time." > $@
@@ -121,7 +121,7 @@ $(CONFIG_PATH)/radiusd.pid: $(CONFIG_PATH)/test.conf $(RADDB_PATH)/certs/server.
        ${Q}make -C src/tests/certs verify
        ${Q}rm -f $(GDB_LOG) $(RADIUS_LOG)
        ${Q}printf "Starting EAP test server... "
-       ${Q}if ! TEST_PORT=$(PORT) $(JLIBTOOL) --mode=execute $(BIN_PATH)/radiusd -Pxxxl $(RADIUS_LOG) -d $(CONFIG_PATH) -n test -D $(CONFIG_PATH); then\
+       ${Q}if ! TEST_PORT=$(PORT) $(JLIBTOOL) --mode=execute $(BIN_PATH)/radiusd -Pxxxl $(RADIUS_LOG) -d $(CONFIG_PATH) -n test -D "${top_builddir}/share/dictionary/"; then\
                echo "FAILED STARTING RADIUSD"; \
                tail -n 40 "$(RADIUS_LOG)"; \
                echo "Last entries in server log ($(RADIUS_LOG)):"; \
@@ -153,13 +153,13 @@ $(OUTPUT_DIR)/%.ok: $(DIR)/%.conf | radiusd.kill $(CONFIG_PATH)/radiusd.pid
                $(EAPOL_TEST) -t 2 -c $< -p $(PORT) -s $(SECRET) > $(patsubst %.conf,%.log,$@) 2>&1; then\
                touch $@; \
        else \
-               echo "Last entries in supplicant log ($(patsubst %.conf,%.log,$<)):"; \
-               tail -n 40 "$(patsubst %.conf,%.log,$<)"; \
+               echo "Last entries in supplicant log ($(patsubst %.conf,%.log,$@)):"; \
+               tail -n 40 "$(patsubst %.conf,%.log,$@)"; \
                echo "--------------------------------------------------"; \
                tail -n 40 "$(RADIUS_LOG)"; \
                echo "Last entries in server log ($(RADIUS_LOG)):"; \
                echo "--------------------------------------------------"; \
-               echo "TEST_PORT=$(PORT) $(JLIBTOOL) --mode=execute $(BIN_PATH)/radiusd -PX -d \"$(CONFIG_PATH)\" -n test -D \"$(CONFIG_PATH)\""; \
+               echo "TEST_PORT=$(PORT) $(JLIBTOOL) --mode=execute $(BIN_PATH)/radiusd -PXxx -d \"$(CONFIG_PATH)\" -n test -D \"${top_builddir}/share/dictionary/\""; \
                echo "$(EAPOL_TEST) -c \"$<\" -p $(PORT) -s $(SECRET)"; \
                $(MAKE) radiusd.kill; \
                exit 1;\
index fb2cd18889b2d98ae89d258724dd050c924d288f..5cadf1cc05af627bc82cb50b380833b903425b77 100644 (file)
@@ -92,7 +92,7 @@ $(BUILD_DIR)/tests/keywords/%: $(DIR)/% $(BUILD_DIR)/tests/keywords/%.attrs $(TE
                if ! grep ERROR $< 2>&1 > /dev/null; then \
                        cat $@.log; \
                        echo "# $@.log"; \
-                       echo KEYWORD=$(notdir $@) $(TESTBIN)/unit_test_module -D share -d src/tests/keywords/ -i $@.attrs -f $@.attrs -xx; \
+                       echo KEYWORD=$(notdir $@) $(TESTBIN)/unit_test_module -D share/dictionary -d src/tests/keywords/ -i $@.attrs -f $@.attrs -xx; \
                        exit 1; \
                fi; \
                FOUND=$$(grep -E '^(Error : )?$<' $@.log | head -1 | sed 's/.*\[//;s/\].*//'); \
@@ -100,7 +100,7 @@ $(BUILD_DIR)/tests/keywords/%: $(DIR)/% $(BUILD_DIR)/tests/keywords/%.attrs $(TE
                if [ "$$EXPECTED" != "$$FOUND" ]; then \
                        cat $@.log; \
                        echo "# $@.log"; \
-                       echo KEYWORD=$(notdir $@) $(TESTBIN)/unit_test_module -D share -d src/tests/keywords/ -i $@.attrs -f $@.attrs -xx; \
+                       echo KEYWORD=$(notdir $@) $(TESTBIN)/unit_test_module -D share/dictionary -d src/tests/keywords/ -i $@.attrs -f $@.attrs -xx; \
                        exit 1; \
                fi \
        fi
index ec9f5de8aa042f2e8fb8739f6e44ade1f54c7d80..ead68180438177e7ada1e383c4d6ffb2f309a291 100644 (file)
@@ -19,7 +19,7 @@ $(MAP_OUTPUT): $(MAP_UNIT_BIN) | $(BUILD_DIR)/tests/map/
 #
 $(BUILD_DIR)/tests/map/%.out: $(top_srcdir)/src/tests/map/%
        ${Q}echo MAP_TEST $(notdir $<)
-       ${Q}if ! $(MAP_UNIT) -d $(top_srcdir)/raddb -D $(top_srcdir)/share $< > $@ 2>&1; then \
+       ${Q}if ! $(MAP_UNIT) -d $(top_srcdir)/raddb -D $(top_srcdir)/share/dictionary $< > $@ 2>&1; then \
                if ! grep ERROR $< 2>&1 > /dev/null; then \
                        cat $@; \
                        echo "# $@"; \
@@ -32,13 +32,13 @@ $(BUILD_DIR)/tests/map/%.out: $(top_srcdir)/src/tests/map/%
                        cat $@; \
                        echo "# $@"; \
                        echo "E $$EXPECTED F $$FOUND"; \
-                       echo UNEXPECTED ERROR: "$(MAP_UNIT) -d $(top_srcdir)/raddb -D $(top_srcdir)/share $<"; \
+                       echo UNEXPECTED ERROR: "$(MAP_UNIT) -d $(top_srcdir)/raddb -D $(top_srcdir)/share/dictionary $<"; \
                        exit 1; \
                fi; \
        else \
                if ! diff $<.out $@; then \
                        echo FAILED: " diff $<.out $@"; \
-                       echo FAILED: "$(MAP_UNIT) -d $(top_srcdir)/raddb -D $(top_srcdir)/share $<"; \
+                       echo FAILED: "$(MAP_UNIT) -d $(top_srcdir)/raddb -D $(top_srcdir)/share/dictionary $<"; \
                        exit 1; \
                fi; \
        fi
index cc403c6b0b61f06134b78a5848c9cc8799e44d58..bb653346590ff6b3a27c89a4a0b3951be435e880 100755 (executable)
@@ -28,11 +28,12 @@ do
     echo 'Test-Number = ' $NUMBER >> .request
 
     rm ./radclient.log > /dev/null 2>&1
-    $BIN_PATH/radclient -f .request -xF -D ./ 127.0.0.1:$PORT auth $SECRET 1> ./radclient.log
+    $BIN_PATH/radclient -f .request -xF -d "${TOP_BUILDDIR}/src/tests" -D "${TOP_BUILDDIR}/share/dictionary" 127.0.0.1:$PORT auth $SECRET 1> ./radclient.log
     if [ "$?" = "0" ]; then
       echo "${BASE}_${NUMBER} : Success"
     else
       echo "${BASE}_${NUMBER} : FAILED"
+      echo "$BIN_PATH/radclient -f .request -xF -d "${TOP_BUILDDIR}/src/tests" -D "${TOP_BUILDDIR}/share/dictionary" 127.0.0.1:$PORT auth $SECRET"
       cat ./radclient.log
       RCODE=1
     fi
index 76231571bc48c6371913a8655df762f56de545c4..41f2b609a0c1ab4565adbf608f4dea4acc4bb86f 100644 (file)
@@ -47,7 +47,7 @@ $(BUILD_DIR)/share:
 #  We need $INCLUDE in the output file, so we pass 2 parameters to 'echo'
 #  No idea how portable that is...
 #
-$(BUILD_DIR)/share/dictionary: $(top_srcdir)/share/dictionary $(top_srcdir)/share/dictionary.dhcpv4 $(top_srcdir)/src/tests/unit/dictionary.unit | $(BUILD_DIR)/share
+$(BUILD_DIR)/share/dictionary: $(top_srcdir)/share/dictionary $(top_srcdir)/share/dictionary/dhcpv4/dictionary $(top_srcdir)/src/tests/unit/dictionary.unit | $(BUILD_DIR)/share
        ${Q}rm -f $@
        ${Q}for x in $^; do \
                echo '$$INCLUDE ' "$$x" >> $@; \
index 3fd83efeb57c371828a38f03401407c3a2019e3f..7f070e3fa6b661ee5a1e3adccdfa3e2cb95815be 100644 (file)
@@ -34,9 +34,9 @@ $(BUILD_DIR)/tests/xlat:
 #
 $(BUILD_DIR)/tests/xlat/%: $(DIR)/% $(TESTBINDIR)/unit_test_module | $(BUILD_DIR)/tests/xlat build.raddb
        ${Q}echo XLAT-TEST $(notdir $@)
-       ${Q}if ! $(TESTBIN)/unit_test_module -D share -d src/tests/xlat/ -i $< -xx -O xlat_only > $@.log 2>&1; then \
+       ${Q}if ! $(TESTBIN)/unit_test_module -D share/dictionary -d src/tests/xlat/ -i $< -xx -O xlat_only > $@.log 2>&1; then \
                cat $@.log; \
-               echo "./$(TESTBIN)/unit_test_module -D share -d src/tests/xlat/ -i $< -xx -O xlat_only"; \
+               echo "./$(TESTBIN)/unit_test_module -D share/dictionary -d src/tests/xlat/ -i $< -xx -O xlat_only"; \
                exit 1; \
        fi
        ${Q}touch $@