diff --git a/src/Makefile.in b/src/Makefile.in index 6f9700e..43b391d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. +# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,17 +14,57 @@ @SET_MAKE@ -SOURCES = $(ntk_resolv_SOURCES) $(ntkd_SOURCES) - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -36,20 +76,21 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = ntkd$(EXEEXT) ntk-resolv$(EXEEXT) subdir = src -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/config.h.in TODO +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/config.h.in $(top_srcdir)/depcomp TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(mkdir_p) +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_ntk_resolv_OBJECTS = andns_lib.$(OBJEXT) ntkresolv.$(OBJEXT) \ andns_net.$(OBJEXT) crypto.$(OBJEXT) snsd_cache.$(OBJEXT) \ @@ -74,52 +115,111 @@ am_ntkd_OBJECTS = accept.$(OBJEXT) map.$(OBJEXT) misc.$(OBJEXT) \ netsukuku.$(OBJEXT) mark.$(OBJEXT) libip4tc.$(OBJEXT) ntkd_OBJECTS = $(am_ntkd_OBJECTS) ntkd_DEPENDENCIES = -DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/accept.Po ./$(DEPDIR)/andna.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/andna_cache.Po ./$(DEPDIR)/andns.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/andns_lib.Po ./$(DEPDIR)/andns_net.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/andns_snsd.Po ./$(DEPDIR)/bmap.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/buffer.Po ./$(DEPDIR)/conf.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/crypto.Po ./$(DEPDIR)/daemon.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/dns_wrapper.Po ./$(DEPDIR)/dnslib.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/endianness.Po ./$(DEPDIR)/err_errno.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/gmap.Po ./$(DEPDIR)/hash.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/hook.Po ./$(DEPDIR)/if.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/igs.Po ./$(DEPDIR)/inet.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/iptunnel.Po ./$(DEPDIR)/ipv6-gmp.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/krnl_route.Po ./$(DEPDIR)/krnl_rule.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/libip4tc.Po ./$(DEPDIR)/libnetlink.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/libping.Po ./$(DEPDIR)/ll_map.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/llist.Po ./$(DEPDIR)/log.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/map.Po ./$(DEPDIR)/mark.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/misc.Po ./$(DEPDIR)/netsukuku.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/ntkresolv.Po ./$(DEPDIR)/pkts.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/qspn.Po ./$(DEPDIR)/radar.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/rehook.Po ./$(DEPDIR)/request.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/route.Po ./$(DEPDIR)/snsd_cache.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/tracer.Po ./$(DEPDIR)/xmalloc.Po +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(ntk_resolv_SOURCES) $(ntkd_SOURCES) DIST_SOURCES = $(ntk_resolv_SOURCES) $(ntkd_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -142,7 +242,9 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ IF_METHOD = @IF_METHOD@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -153,6 +255,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OTHER_METHOD = @OTHER_METHOD@ PACKAGE = @PACKAGE@ @@ -160,6 +263,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PID_DIR = @PID_DIR@ @@ -168,24 +272,29 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ +datarootdir = @datarootdir@ debug_flags = @debug_flags@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gmp = @gmp@ host = @host@ @@ -193,21 +302,29 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ SUBDIRS = man scripts conf AM_CFLAGS = -g -I. @debug_flags@ -I@gmp@ AM_CXXFLAGS = -g -I. @debug_flags@ -I@gmp@ @@ -236,14 +353,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -261,18 +378,17 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config.h.in: $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -280,33 +396,54 @@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -ntk-resolv$(EXEEXT): $(ntk_resolv_OBJECTS) $(ntk_resolv_DEPENDENCIES) + +ntk-resolv$(EXEEXT): $(ntk_resolv_OBJECTS) $(ntk_resolv_DEPENDENCIES) $(EXTRA_ntk_resolv_DEPENDENCIES) @rm -f ntk-resolv$(EXEEXT) - $(LINK) $(ntk_resolv_LDFLAGS) $(ntk_resolv_OBJECTS) $(ntk_resolv_LDADD) $(LIBS) -ntkd$(EXEEXT): $(ntkd_OBJECTS) $(ntkd_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(ntk_resolv_OBJECTS) $(ntk_resolv_LDADD) $(LIBS) + +ntkd$(EXEEXT): $(ntkd_OBJECTS) $(ntkd_DEPENDENCIES) $(EXTRA_ntkd_DEPENDENCIES) @rm -f ntkd$(EXEEXT) - $(LINK) $(ntkd_LDFLAGS) $(ntkd_OBJECTS) $(ntkd_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(ntkd_OBJECTS) $(ntkd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -362,49 +499,53 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` libip4tc.o: libiptc/libip4tc.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libip4tc.o -MD -MP -MF "$(DEPDIR)/libip4tc.Tpo" -c -o libip4tc.o `test -f 'libiptc/libip4tc.c' || echo '$(srcdir)/'`libiptc/libip4tc.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libip4tc.Tpo" "$(DEPDIR)/libip4tc.Po"; else rm -f "$(DEPDIR)/libip4tc.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libiptc/libip4tc.c' object='libip4tc.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libip4tc.Po' tmpdepfile='$(DEPDIR)/libip4tc.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libip4tc.o `test -f 'libiptc/libip4tc.c' || echo '$(srcdir)/'`libiptc/libip4tc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libip4tc.o -MD -MP -MF $(DEPDIR)/libip4tc.Tpo -c -o libip4tc.o `test -f 'libiptc/libip4tc.c' || echo '$(srcdir)/'`libiptc/libip4tc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libip4tc.Tpo $(DEPDIR)/libip4tc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libiptc/libip4tc.c' object='libip4tc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libip4tc.o `test -f 'libiptc/libip4tc.c' || echo '$(srcdir)/'`libiptc/libip4tc.c libip4tc.obj: libiptc/libip4tc.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libip4tc.obj -MD -MP -MF "$(DEPDIR)/libip4tc.Tpo" -c -o libip4tc.obj `if test -f 'libiptc/libip4tc.c'; then $(CYGPATH_W) 'libiptc/libip4tc.c'; else $(CYGPATH_W) '$(srcdir)/libiptc/libip4tc.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libip4tc.Tpo" "$(DEPDIR)/libip4tc.Po"; else rm -f "$(DEPDIR)/libip4tc.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libiptc/libip4tc.c' object='libip4tc.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libip4tc.Po' tmpdepfile='$(DEPDIR)/libip4tc.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libip4tc.obj `if test -f 'libiptc/libip4tc.c'; then $(CYGPATH_W) 'libiptc/libip4tc.c'; else $(CYGPATH_W) '$(srcdir)/libiptc/libip4tc.c'; fi` -uninstall-info-am: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libip4tc.obj -MD -MP -MF $(DEPDIR)/libip4tc.Tpo -c -o libip4tc.obj `if test -f 'libiptc/libip4tc.c'; then $(CYGPATH_W) 'libiptc/libip4tc.c'; else $(CYGPATH_W) '$(srcdir)/libiptc/libip4tc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libip4tc.Tpo $(DEPDIR)/libip4tc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libiptc/libip4tc.c' object='libip4tc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libip4tc.obj `if test -f 'libiptc/libip4tc.c'; then $(CYGPATH_W) 'libiptc/libip4tc.c'; else $(CYGPATH_W) '$(srcdir)/libiptc/libip4tc.c'; fi` # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -412,60 +553,20 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -477,79 +578,104 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || mkdir "$(distdir)/$$subdir" \ - || exit 1; \ - (cd $$subdir && \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="../$(top_distdir)" \ - distdir="../$(distdir)/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ @@ -560,7 +686,7 @@ all-am: Makefile $(PROGRAMS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive @@ -572,16 +698,22 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -602,18 +734,38 @@ dvi-am: html: html-recursive +html-am: + info: info-recursive info-am: install-data-am: +install-dvi: install-dvi-recursive + +install-dvi-am: + install-exec-am: install-binPROGRAMS +install-html: install-html-recursive + +install-html-am: + install-info: install-info-recursive +install-info-am: + install-man: +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -633,23 +785,24 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-info-am +uninstall-am: uninstall-binPROGRAMS -uninstall-info: uninstall-info-recursive +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-binPROGRAMS clean-generic cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-hdr distclean-tags distdir dvi dvi-am html html-am \ + info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-binPROGRAMS -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-binPROGRAMS clean-generic clean-recursive ctags \ - ctags-recursive distclean distclean-compile distclean-generic \ - distclean-hdr distclean-recursive distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/andna.c b/src/andna.c index 1c74f4e..b6183c1 100644 --- a/src/andna.c +++ b/src/andna.c @@ -2,7 +2,7 @@ * (c) Copyright 2005 Andrea Lo Pumo aka AlpT * * This source code is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published + * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * @@ -18,7 +18,7 @@ * -- * andna.c: * Here there are all the functions that send, receive and exec ANDNA packets. - * All the threads of the ANDNA daemon and the main andna functions are here + * All the threads of the ANDNA daemon and the main andna functions are here * too. */ @@ -47,51 +47,51 @@ /* - * + * * * * * (de)-Initialization functions * * * * */ /* * andna_load_caches - * + * * loads all the ANDNA caches */ int andna_load_caches(void) { int ret=0; - - if(file_exist(server_opt.lclkey_file) && - (!load_lcl_keyring(&lcl_keyring, + + if(file_exist(server_opt.lclkey_file) && + (!load_lcl_keyring(&lcl_keyring, server_opt.lclkey_file))) debug(DBG_NORMAL, "Andna LCL Keyring loaded"); - - if(file_exist(server_opt.lcl_file) && + + if(file_exist(server_opt.lcl_file) && (andna_lcl=load_lcl_cache(server_opt.lcl_file, &lcl_counter))) debug(DBG_NORMAL, "Andna Local Cache loaded"); - if(file_exist(server_opt.andna_cache_file) && + if(file_exist(server_opt.andna_cache_file) && (andna_c=load_andna_cache(server_opt.andna_cache_file, &andna_c_counter))) debug(DBG_NORMAL, "Andna cache loaded"); - if(file_exist(server_opt.counter_c_file) && + if(file_exist(server_opt.counter_c_file) && (andna_counter_c=load_counter_c(server_opt.counter_c_file, &cc_counter))) debug(DBG_NORMAL, "Counter cache loaded"); - if(file_exist(server_opt.rhc_file) && + if(file_exist(server_opt.rhc_file) && (andna_rhc=load_rh_cache(server_opt.rhc_file, &rhc_counter))) debug(DBG_NORMAL, "Resolved hostnames cache loaded"); - if(file_exist(server_opt.andna_hnames_file) && + if(file_exist(server_opt.andna_hnames_file) && !(load_hostnames(server_opt.andna_hnames_file, &andna_lcl, &lcl_counter))) debug(DBG_NORMAL, "Hostnames file loaded"); - - if(file_exist(server_opt.snsd_nodes_file) && + + if(file_exist(server_opt.snsd_nodes_file) && !(ret=load_snsd(server_opt.snsd_nodes_file, andna_lcl))) debug(DBG_NORMAL, "SNSD nodes loaded"); else if(ret == -2) @@ -124,7 +124,7 @@ void andna_resolvconf_modify(void) { int ret; char *my_nameserv; - + if(!server_opt.disable_resolvconf) { loginfo("Modifying /etc/resolv.conf"); @@ -141,7 +141,7 @@ void andna_resolvconf_restore(void) { char *my_nameserv; - /* + /* * If there are valid nameserver in /etc/resolv.conf (excluding * "127.0.0.1", do not restore the backup. Probably /etc/resolv.conf * has been edited manually. Damn you, user! Why can't we code you ;) @@ -177,7 +177,7 @@ void andna_init(void) andna_resolvconf_restore(); pkt_queue_init(); - + andna_caches_init(my_family); snsd_cache_init(my_family); @@ -186,7 +186,7 @@ void andna_init(void) if(!lcl_keyring.priv_rsa) { /* - * No keyring was loaded, generate a new one save it + * No keyring was loaded, generate a new one save it */ lcl_new_keyring(&lcl_keyring); @@ -198,11 +198,11 @@ void andna_init(void) /* Init ANDNS */ if(andns_init(restricted_mode, ETC_RESOLV_CONF,my_family) < 0) if(andns_init(restricted_mode, ETC_RESOLV_CONF_BAK,my_family) < 0) { - error("In %s there isn't a single Internet nameserver.", + error("In %s there isn't a single Internet nameserver.", ETC_RESOLV_CONF); loginfo("Internet hostname resolution is disabled"); } - + setzero(last_reg_pkt_id, sizeof(int)*ANDNA_MAX_FLOODS); setzero(last_counter_pkt_id, sizeof(int)*ANDNA_MAX_FLOODS); setzero(last_spread_acache_pkt_id, sizeof(int)*ANDNA_MAX_FLOODS); @@ -236,16 +236,16 @@ void andna_close(void) * andna_hash_by_family * * If `family' is equal to AF_INET, in `hash' it stores the - * 32bit hash of the `msg', otherwise it just copies `msg' to `hash_ip'. + * 32bit hash of the `msg', otherwise it just copies `msg' to `hash_ip'. * Note that this function is used to hash other hashes, so it operates on the * ANDNA_HASH_SZ fixed length. */ void andna_hash_by_family(int family, void *msg, u_int hash[MAX_IP_INT]) { setzero(hash, ANDNA_HASH_SZ); - + if(family==AF_INET) - hash[0] = fnv_32_buf((u_char *)msg, ANDNA_HASH_SZ, + hash[0] = fnv_32_buf((u_char *)msg, ANDNA_HASH_SZ, FNV1_32_INIT); else memcpy(hash, msg, ANDNA_HASH_SZ); @@ -254,11 +254,11 @@ void andna_hash_by_family(int family, void *msg, u_int hash[MAX_IP_INT]) /* * andna_hash * - * This function makes a digest of `msg' which is `len' bytes big and - * stores it in `hash'. + * This function makes a digest of `msg' which is `len' bytes big and + * stores it in `hash'. * If `family'is equal to AF_INET, in `ip_hash' it stores the 32bit hash * of the `hash', otherwise it just copies `hash' to `ip_hash'. - * + * * Note: `hash' is a single string of `MAX_IP_INT'*4 bytes, it is the MD5 hash * of `msg', therefore do not attempt to convert it to network order. */ @@ -266,7 +266,7 @@ void andna_hash(int family, void *msg, int len, u_int hash[MAX_IP_INT], u_int ip_hash[MAX_IP_INT]) { hash_md5(msg, len, (u_char *)hash); - andna_hash_by_family(family, (u_char *)hash, ip_hash); + andna_hash_by_family(family, (u_char *)hash, ip_hash); } /* @@ -283,7 +283,7 @@ int is_hgnode_excluded(quadro_group *qg, u_int **excluded_hgnode, { int i, e, x, total_levels=FAMILY_LVLS; inet_prefix ip; - + for(e=0; egid %d, ipgid %d", i, + debug(DBG_INSANE, "is_hgnode_excluded: l %d, qg->gid %d, ipgid %d", i, qg->gid[i], iptogid(&ip, i)); #endif if(qg->gid[i] != iptogid(&ip, i)) { @@ -314,7 +314,7 @@ int is_hgnodeip_excluded(inet_prefix *hgnodeip, u_int **excluded_hgnode, int tot_excluded_hgnodes) { quadro_group qg; - + iptoquadg(*hgnodeip, 0, &qg, QUADG_GID); return is_hgnode_excluded(&qg, excluded_hgnode, tot_excluded_hgnodes, 0); } @@ -330,11 +330,11 @@ int random_gid_level_0(quadro_group *qg, inet_prefix *to, int exclude_me) { int x, e, i; - /* + /* * Set `e' and `i' to a rand value from 0 to MAXGROUPNODE-1. * In the first for go from `e' to MAXGROUPNODE-1, if nothing is found * continue in the second for and go from `i' to 0. If nothing is - * found return -1. + * found return -1. */ for(x=0, e=i=rand_range(0, MAXGROUPNODE-1); egid, me.cur_quadg.levels, me.cur_quadg.levels, + gidtoipstart(qg->gid, me.cur_quadg.levels, me.cur_quadg.levels, my_family, to); debug(DBG_NOISE, "find_hashgnode: Internal found: gid0 %d, to " "%s!", qg->gid[0], inet_to_str(*to)); @@ -383,15 +383,15 @@ int find_hash_gnode_recurse(quadro_group qg, int level, inet_prefix *to, /* * This is how the ip nearer to `hash' is found: - * - find_hash_gnode() calls, for the first time, - * find_hash_gnode_recurse(). The hash's ip is converted as a + * - find_hash_gnode() calls, for the first time, + * find_hash_gnode_recurse(). The hash's ip is converted as a * quadro_group and stored in the argv `qg' and the parameter `level' * is set to the number of total levels available minus one. * - if `level' is equal to 0 choose a random gid of level 0 an * convert `qg' in the inet_prefix format, store it in `to' and * return. * loop1: - * - If the gnode `gq'.gid[level] is down increment or decrement + * - If the gnode `gq'.gid[level] is down increment or decrement * (alternatively) `gq'.gid[level] and continue the loop1. * If (it is up) { * if (`gq'.gid[level] is a gnode where we belong) { @@ -401,17 +401,17 @@ int find_hash_gnode_recurse(quadro_group qg, int level, inet_prefix *to, * If (the return value is not an error) { * return now with that value because in * a sub tree, the hash_gnode was already - * found. - * } + * found. + * } * } otherwise { * return and stor into `to' the ip of the - * border_node that will be used to forward the + * border_node that will be used to forward the * pkt to the hash_gnode. * } * } * - return -1 */ - + #if 0 /* TOO NOISY */ debug(DBG_INSANE, "find_hashgnode: lvl %d, start gid %d", level, qg.gid[level]); #endif @@ -427,7 +427,7 @@ int find_hash_gnode_recurse(quadro_group qg, int level, inet_prefix *to, gid=qg.gid[level]+i; else if(qg.gid[level]-i >= 0) gid=qg.gid[level]-i; - else + else continue; gnode=gnode_from_pos(gid, me.ext_map[_EL(level)]); @@ -442,7 +442,7 @@ int find_hash_gnode_recurse(quadro_group qg, int level, inet_prefix *to, if(!quadg_gids_cmp(qg, me.cur_quadg, level)) { /* Is this hash_gnode not wanted ? */ if(excluded_hgnode && level == 1 && - is_hgnode_excluded(&qg, excluded_hgnode, + is_hgnode_excluded(&qg, excluded_hgnode, tot_excluded_hgnodes, 1)) continue; /* yea, exclude it */ @@ -453,11 +453,11 @@ int find_hash_gnode_recurse(quadro_group qg, int level, inet_prefix *to, return ret; } else { /* Check if it is excluded */ - if(excluded_hgnode && + if(excluded_hgnode && is_hgnode_excluded(&qg, excluded_hgnode, tot_excluded_hgnodes, level)) continue; /* Yes, it is */ - + err=get_gw_ips(me.int_map, me.ext_map, me.bnode_map, me.bmap_nodes, &me.cur_quadg, gnode, level, 0, to, 0, 1); @@ -465,7 +465,7 @@ int find_hash_gnode_recurse(quadro_group qg, int level, inet_prefix *to, err, inet_to_str(*to)); if(err >= 0) - /* + /* * Forward the pkt to the found * border_node, which will forward it * to the hash_gnode @@ -487,7 +487,7 @@ int find_hash_gnode_recurse(quadro_group qg, int level, inet_prefix *to, /* * find_hash_gnode: It stores in `to' the ip of the node nearer to the - * `hash'_gnode and returns 0. If we aren't part of the hash_gnode, it sets in + * `hash'_gnode and returns 0. If we aren't part of the hash_gnode, it sets in * `to' the ip of the bnode_gnode that will route the pkt and returns 1. * If the found hash_gnode is the MAP_ME node itself then 2 is returned. * If either a hash_gnode and a bnode_gnode aren't found, -1 is returned. @@ -495,21 +495,21 @@ int find_hash_gnode_recurse(quadro_group qg, int level, inet_prefix *to, * algorithm. * If `exclude_me' is set to 1, it will not return ourself as the hash_gnode. */ -int find_hash_gnode(u_int hash[MAX_IP_INT], inet_prefix *to, +int find_hash_gnode(u_int hash[MAX_IP_INT], inet_prefix *to, u_int **excluded_hgnode, int tot_excluded_hgnodes, int exclude_me) { int total_levels; quadro_group qg; - + total_levels=FAMILY_LVLS; /* Hash to ip and quadro_group conversion */ inet_setip(to, hash, my_family); inet_htonl(to->data, to->family); iptoquadg(*to, me.ext_map, &qg, QUADG_GID|QUADG_GNODE); - - + + return find_hash_gnode_recurse(qg, total_levels-1, to, excluded_hgnode, tot_excluded_hgnodes, exclude_me); } @@ -537,7 +537,7 @@ int andna_flood_pkt(PACKET *rpkt, int exclude_rfrom) /* be sure that the other nodes don't reply to rfrom again */ flood_pkt.hdr.flags&=~ASYNC_REPLY; flood_pkt.hdr.flags|=BCAST_PKT; - + /* If the pkt was sent from an our rnode, ignore it while flooding */ if(exclude_rfrom) real_from_rpos=ip_to_rfrom(flood_pkt.from, 0, 0, 0); @@ -551,7 +551,7 @@ int andna_flood_pkt(PACKET *rpkt, int exclude_rfrom) return ret; } -/* +/* * andna_find_flood_pkt_id: Search in the `ids_array' a member which is equal * to `pkt_id', if it is found its array position is returned otherwise -1 * will be the return value @@ -559,7 +559,7 @@ int andna_flood_pkt(PACKET *rpkt, int exclude_rfrom) int andna_find_flood_pkt_id(int *ids_array, int pkt_id) { int i; - + for(i=0; i < ANDNA_MAX_FLOODS; i++) if(ids_array[i] == pkt_id) return i; @@ -578,7 +578,7 @@ int andna_add_flood_pkt_id(int *ids_array, int pkt_id) if((i=andna_find_flood_pkt_id(ids_array, pkt_id)) < 0) { int tmp_array[ANDNA_MAX_FLOODS-1]; - + /* Shift the array of one position to free the position 0 * where the new id will be added */ memcpy(tmp_array, ids_array, sizeof(int)*(ANDNA_MAX_FLOODS-1)); @@ -600,10 +600,10 @@ int andna_add_flood_pkt_id(int *ids_array, int pkt_id) /* * andna_register_hname - * + * * Registers or updates the `alcl->hostname' hostname. It also registers the * snsd records present in `alcl->service'. - * + * * If `snsd_delete' is not null, the registration request becomes a deletion * request: it will ask to andna to delete all the snsd records equal to * `snsd_delete'. @@ -614,10 +614,10 @@ int andna_register_hname(lcl_cache *alcl, snsd_service *snsd_delete) struct andna_reg_pkt req; u_int hash_gnode[MAX_IP_INT]; inet_prefix to; - + snsd_service *snsd; char *sign=0, *buf; - const char *ntop; + const char *ntop; int ret=0; ssize_t err, pkt_sz=0; time_t cur_t; @@ -627,14 +627,14 @@ int andna_register_hname(lcl_cache *alcl, snsd_service *snsd_delete) setzero(&rpkt, sizeof(rpkt)); cur_t=time(0); - if(alcl->flags & ANDNA_UPDATING) + if(alcl->flags & ANDNA_UPDATING) /* we are already updating this node! */ return 0; alcl->flags|=ANDNA_UPDATING; - + if(alcl->timestamp) { - if(cur_t > alcl->timestamp && + if(cur_t > alcl->timestamp && (cur_t - alcl->timestamp) < ANDNA_MIN_UPDATE_TIME) /* We have too wait a little more before sending an * update */ @@ -644,28 +644,28 @@ int andna_register_hname(lcl_cache *alcl, snsd_service *snsd_delete) req.hname_updates = ++alcl->hname_updates; } - /* Don't register the hname while we are (re)-hooking, + /* Don't register the hname while we are (re)-hooking, * our IP might change */ while(me.cur_node->flags & MAP_HNODE) sleep(1); - - /* - * Filling the request structure + + /* + * Filling the request structure */ - inet_copy_ipdata(req.rip, &me.cur_ip); + inet_copy_ipdata(req.rip, &me.cur_ip); andna_hash(my_family, alcl->hostname, strlen(alcl->hostname), req.hash, hash_gnode); memcpy(req.pubkey, lcl_keyring.pubkey, ANDNA_PKEY_LEN); /* Convert the pkt from host to network order */ ints_host_to_network((void *)&req, andna_reg_pkt_iinfo); - + /* Sign the packet */ - sign=(char*)rsa_sign((u_char *)&req, ANDNA_REG_SIGNED_BLOCK_SZ, + sign=(char*)rsa_sign((u_char *)&req, ANDNA_REG_SIGNED_BLOCK_SZ, lcl_keyring.priv_rsa, 0); memcpy(req.sign, sign, ANDNA_SIGNATURE_LEN); - + /* Find the hash_gnode that corresponds to the hash `hash_gnode'*/ if((err=find_hash_gnode(hash_gnode, &to, 0, 0, 1)) < 0) { debug(DBG_SOFT, "andna_register_hname: hash_gnode not found ;("); @@ -678,27 +678,27 @@ int andna_register_hname(lcl_cache *alcl, snsd_service *snsd_delete) req.flags|=ANDNA_PKT_SNSD_DEL; } else snsd=alcl->service; - + ntop=inet_to_str(to); debug(DBG_INSANE, "Quest %s to %s", rq_to_str(ANDNA_REGISTER_HNAME), ntop); - + /* Fill the packet and send the request */ pkt_sz=ANDNA_REG_PKT_SZ+SNSD_SERVICE_LLIST_PACK_SZ(alcl->service); pkt_addto(&pkt, &to); pkt_addcompress(&pkt); pkt_fill_hdr(&pkt.hdr, ASYNC_REPLY, 0, ANDNA_REGISTER_HNAME, pkt_sz); - + pkt.msg=buf=xmalloc(pkt_sz); - + memcpy(pkt.msg, &req, ANDNA_REG_PKT_SZ); buf+=ANDNA_REG_PKT_SZ; - + if(snsd_pack_all_services(buf, pkt_sz-ANDNA_REG_PKT_SZ, snsd) < 0) { debug(DBG_SOFT, "andna_register_hname: couldn't pack " "alcl->service"); ERROR_FINISH(ret, -1, finish); } - + err=send_rq(&pkt, 0, ANDNA_REGISTER_HNAME, 0, ACK_AFFERMATIVE, 1, &rpkt); if(err < 0) { error("andna_register_hname(): Registration of \"%s\" to %s " @@ -718,7 +718,7 @@ finish: return ret; } -/* +/* * andna_recv_reg_rq * * It takes care of a registration request. If we aren't @@ -732,13 +732,13 @@ int andna_recv_reg_rq(PACKET rpkt) struct andna_reg_pkt *req; u_int hash_gnode[MAX_IP_INT], *excluded_hgnode[1]; inet_prefix rfrom, to; - + RSA *pubkey=0; andna_cache_queue *acq=0; andna_cache *ac=0; snsd_service *snsd_unpacked=0; snsd_node *snd=0; - + time_t cur_t; u_short snsd_counter; int ret=0, err; @@ -750,10 +750,10 @@ int andna_recv_reg_rq(PACKET rpkt) pkt_copy(&rpkt_local_copy, &rpkt); req=(struct andna_reg_pkt *)rpkt_local_copy.msg; - if(rpkt.hdr.sz < ANDNA_REG_PKT_SZ || + if(rpkt.hdr.sz < ANDNA_REG_PKT_SZ || rpkt.hdr.sz > SNSD_SERVICE_MAX_LLIST_PACK_SZ) ERROR_FINISH(ret, -1, finish); - + packed_sz=rpkt.hdr.sz - ANDNA_REG_PKT_SZ; snsd_pack=rpkt_local_copy.msg+ANDNA_REG_PKT_SZ; @@ -762,7 +762,7 @@ int andna_recv_reg_rq(PACKET rpkt) forwarded_pkt=1; /* Check if we already received this pkt during the flood */ - if(forwarded_pkt && + if(forwarded_pkt && andna_add_flood_pkt_id(last_reg_pkt_id, rpkt.hdr.id)) { debug(DBG_INSANE, "Dropped 0x%0x andna pkt, we already " "received it", rpkt.hdr.id); @@ -782,14 +782,14 @@ int andna_recv_reg_rq(PACKET rpkt) /* Send the replies in UDP, they are so tiny */ pkt_addsk(&pkt, my_family, 0, SKT_UDP); - + /* Verify the signature */ pk=(const u_char*)req->pubkey; pubkey=get_rsa_pub(&pk, ANDNA_PKEY_LEN); if(!pubkey || !verify_sign((u_char *)req, ANDNA_REG_SIGNED_BLOCK_SZ, (u_char*)req->sign, ANDNA_SIGNATURE_LEN, pubkey)) { /* Bad, bad signature */ - debug(DBG_SOFT, "Invalid signature of the 0x%x reg request", + debug(DBG_SOFT, "Invalid signature of the 0x%x reg request", rpkt.hdr.id); if(!forwarded_pkt) pkt_err(pkt, E_INVALID_SIGNATURE, 0); @@ -800,13 +800,13 @@ int andna_recv_reg_rq(PACKET rpkt) ints_network_to_host((void *)req, andna_reg_pkt_iinfo); /* If we don't belong to the gnode of `rfrom', then we have to exclude - * it from the find_hash_gnode search, since we have received the - * pkt from that gnode and it is likely that `rfrom' is the only node + * it from the find_hash_gnode search, since we have received the + * pkt from that gnode and it is likely that `rfrom' is the only node * of that gnode. */ excluded_hgnode[0] = ip_gids_cmp(rfrom, me.cur_ip, 1) ? rfrom.data : 0; - /* + /* * Are we the hash_gnode for req->hash? Check also if we have to * continue to forward the pkt to make it reach the real hash_gnode */ @@ -833,7 +833,7 @@ int andna_recv_reg_rq(PACKET rpkt) } /* Are we a new hash_gnode ? */ - if(time(0)-me.uptime < (ANDNA_EXPIRATION_TIME/3) && + if(time(0)-me.uptime < (ANDNA_EXPIRATION_TIME/3) && !(ac=andna_cache_findhash((int*)req->hash))) { /* * We are a new hash_gnode and we haven't this hostname in our @@ -841,12 +841,12 @@ int andna_recv_reg_rq(PACKET rpkt) * old hash_gnode which has already registered this hostname. */ if((ac=get_single_andna_c(req->hash, hash_gnode))) { - /* + /* * The hostname was already registered, so we save it * in our andna_cache. */ clist_add(&andna_c, &andna_c_counter, ac); - + /* Spread it in our gnode */ spread_single_acache(req->hash); } @@ -855,7 +855,7 @@ int andna_recv_reg_rq(PACKET rpkt) /* Ask the counter_node if it is ok to register/update the hname */ if(!(req->flags & ANDNA_PKT_SNSD_DEL)) { if(andna_check_counter(rpkt) == -1) { - debug(DBG_SOFT, "Registration rq 0x%x rejected: %s", + debug(DBG_SOFT, "Registration rq 0x%x rejected: %s", rpkt.hdr.id, rq_strerror(E_ANDNA_CHECK_COUNTER)); if(!forwarded_pkt) @@ -865,13 +865,13 @@ int andna_recv_reg_rq(PACKET rpkt) } /*** - * Finally, let's register/update the hname + * Finally, let's register/update the hname */ - cur_t=time(0); + cur_t=time(0); ac=andna_cache_addhash((int*)req->hash); acq=ac_queue_add(ac, req->pubkey); if(!acq) { - debug(DBG_SOFT, "Registration rq 0x%x rejected: %s", + debug(DBG_SOFT, "Registration rq 0x%x rejected: %s", rpkt.hdr.id, rq_strerror(E_ANDNA_QUEUE_FULL)); if(!forwarded_pkt) pkt_err(pkt, E_ANDNA_QUEUE_FULL, 0); @@ -883,7 +883,7 @@ int andna_recv_reg_rq(PACKET rpkt) * Check if the counter of number of updates matches with the pkt */ if(acq->hname_updates > req->hname_updates) { debug(DBG_SOFT, "Registration rq 0x%x rejected: hname_updates" - " mismatch %d > %d", rpkt.hdr.id, + " mismatch %d > %d", rpkt.hdr.id, acq->hname_updates, req->hname_updates); if(!forwarded_pkt) pkt_err(pkt, E_ANDNA_HUPDATE_MISMATCH, 0); @@ -893,9 +893,9 @@ int andna_recv_reg_rq(PACKET rpkt) /** * Has the registration request been sent too early ? */ - if(cur_t > acq->timestamp && + if(cur_t > acq->timestamp && (cur_t - acq->timestamp) < ANDNA_MIN_UPDATE_TIME) { - debug(DBG_SOFT, "Registration rq 0x%x rejected: %s", + debug(DBG_SOFT, "Registration rq 0x%x rejected: %s", rpkt.hdr.id, rq_strerror(E_ANDNA_UPDATE_TOO_EARLY)); if(!forwarded_pkt) pkt_err(pkt, E_ANDNA_UPDATE_TOO_EARLY, 0); @@ -909,21 +909,21 @@ int andna_recv_reg_rq(PACKET rpkt) */ if(acq != ac->acq) { - /* + /* * This request has been queued in the acq. We store the main - * ip and discard the rest of the snsd records + * ip and discard the rest of the snsd records */ snsd_add_mainip(&snsd_unpacked, &snsd_counter, SNSD_MAX_QUEUE_RECORDS, rfrom.data); } else { - /* - * Register the snsd records + /* + * Register the snsd records */ /* unpack the snsd services */ - snsd_unpacked=snsd_unpack_all_service(snsd_pack, packed_sz, + snsd_unpacked=snsd_unpack_all_service(snsd_pack, packed_sz, &unpacked_sz, &snsd_counter); - + if((!snsd_unpacked && req->flags & ANDNA_PKT_SNSD_DEL) || (snsd_counter > SNSD_MAX_RECORDS-1)) { @@ -937,14 +937,14 @@ int andna_recv_reg_rq(PACKET rpkt) if(req->flags & ANDNA_PKT_SNSD_DEL) { /* * Delete, from the andna_cache, all the snsd records - * which are equal to those included in the + * which are equal to those included in the * registration pkt. */ snsd_record_del_selected(&acq->service, &acq->snsd_counter, snsd_unpacked); } else { /* - * Register the snsd services in our andna_cache + * Register the snsd services in our andna_cache */ /* Add the mainip and update its IP */ @@ -958,18 +958,18 @@ int andna_recv_reg_rq(PACKET rpkt) snsd_unset_all_flags(snsd_unpacked, SNSD_NODE_MAIN_IP); snd->flags|=SNSD_NODE_MAIN_IP; /**/ - + } } /* - * substitute the old snsd records with the new ones + * substitute the old snsd records with the new ones */ snsd_service_llist_del(&acq->service); acq->service=snsd_unpacked; acq->snsd_counter=snsd_counter; - /* + /* * Final registration step: touch the hname timestamp */ acq->hname_updates=req->hname_updates+1; @@ -982,7 +982,7 @@ int andna_recv_reg_rq(PACKET rpkt) pkt_fill_hdr(&pkt.hdr, ASYNC_REPLIED, rpkt.hdr.id, ACK_AFFERMATIVE, 0); ret=forward_pkt(pkt, rfrom); } - + /** * Broadcast the request to the entire gnode of level 1 to let the * other nodes register the hname. @@ -991,7 +991,7 @@ int andna_recv_reg_rq(PACKET rpkt) andna_add_flood_pkt_id(last_reg_pkt_id, rpkt.hdr.id); andna_flood_pkt(&rpkt, 1); /**/ - + finish: if(ntop) xfree(ntop); @@ -1000,14 +1000,14 @@ finish: if(pubkey) RSA_free(pubkey); pkt_free(&rpkt_local_copy, 0); - + return ret; } /* * andna_check_counter * - * asks the counter_node if it is ok to accept the registration request in + * asks the counter_node if it is ok to accept the registration request in * `pkt' and register the requested hname. * * If -1 is returned the answer is no. @@ -1027,11 +1027,11 @@ int andna_check_counter(PACKET pkt) if(pkt.hdr.flags & BCAST_PKT) forwarded_pkt=1; - + /* Calculate the hash of the IP of the sender node. This hash will * be used to reach its counter node. */ andna_hash(my_family, req->rip, MAX_IP_SZ, rip_hash, hash_gnode); - + /* Find a hash_gnode for the rip_hash */ req->flags&=~ANDNA_PKT_FORWARD; @@ -1041,18 +1041,18 @@ int andna_check_counter(PACKET pkt) ERROR_FINISH(ret, -1, finish); } else if(err == 1) req->flags|=ANDNA_PKT_FORWARD; - + ntop=inet_to_str(pkt.to); debug(DBG_INSANE, "Quest %s to %s", rq_to_str(ANDNA_CHECK_COUNTER), ntop); - + pkt.hdr.flags|=ASYNC_REPLY; - + /* Append our ip in the pkt */ pkt.hdr.sz=ANDNA_REG_PKT_SZ+MAX_IP_SZ; pkt.msg=xmalloc(pkt.hdr.sz); memcpy(pkt.msg, req, ANDNA_REG_PKT_SZ); inet_copy_ipdata((u_int *)(pkt.msg+ANDNA_REG_PKT_SZ), &me.cur_ip); - + /* If we are checking a registration pkt which has been only * forwarded to us (and already registered), we tell the counter_node * to just check the request. We don't want it to update its @@ -1060,9 +1060,9 @@ int andna_check_counter(PACKET pkt) if(forwarded_pkt) { req=(struct andna_reg_pkt *)pkt.msg; req->flags|=ANDNA_PKT_JUST_CHECK; - + /* Adjust the flags */ - pkt.hdr.flags&=~BCAST_PKT; + pkt.hdr.flags&=~BCAST_PKT; } /* Throw it */ @@ -1093,14 +1093,14 @@ int andna_recv_check_counter(PACKET rpkt) pkt_copy(&rpkt_local_copy, &rpkt); ntop=xstrdup(inet_to_str(rpkt.from)); - + req=(struct andna_reg_pkt *)rpkt_local_copy.msg; if(rpkt.hdr.sz != ANDNA_REG_PKT_SZ+MAX_IP_SZ) { - debug(DBG_SOFT, ERROR_MSG "Malformed check_counter pkt from %s: %d != %d", + debug(DBG_SOFT, ERROR_MSG "Malformed check_counter pkt from %s: %d != %d", ERROR_FUNC, ntop, rpkt.hdr.sz, ANDNA_REG_PKT_SZ+MAX_IP_SZ); ERROR_FINISH(ret, -1, finish); } - + if(rpkt.hdr.flags & BCAST_PKT) /* The pkt we received has been only forwarded to us */ forwarded_pkt=1; @@ -1109,7 +1109,7 @@ int andna_recv_check_counter(PACKET rpkt) just_check=1; /* Check if we already received this pkt during the flood */ - if(forwarded_pkt && + if(forwarded_pkt && andna_add_flood_pkt_id(last_counter_pkt_id, rpkt.hdr.id)) { debug(DBG_INSANE, "Dropped 0x%0x andna pkt, we already " "received it", rpkt.hdr.id); @@ -1123,17 +1123,17 @@ int andna_recv_check_counter(PACKET rpkt) rfrom_ntop=xstrdup(inet_to_str(rfrom)); debug(DBG_SOFT, "Received %s%sfrom %s, rfrom %s", rq_to_str(rpkt.hdr.op), forwarded_pkt ? " (forwarded) " : " ", ntop, rfrom_ntop); - + memcpy(&pkt, &rpkt, sizeof(PACKET)); inet_copy(&pkt.from, &rfrom); /* Reply to rfrom using a UDP sk, since the replies are very small */ pkt_addsk(&pkt, my_family, 0, SKT_UDP); - + /* Verify the signature */ pk=(const u_char*)req->pubkey; pubkey=get_rsa_pub(&pk, ANDNA_PKEY_LEN); - if(!pubkey || !verify_sign((u_char *)req, ANDNA_REG_SIGNED_BLOCK_SZ, + if(!pubkey || !verify_sign((u_char *)req, ANDNA_REG_SIGNED_BLOCK_SZ, (u_char*)req->sign, ANDNA_SIGNATURE_LEN, pubkey)) { /* Bad signature */ debug(DBG_SOFT, "Invalid signature of the 0x%x check " @@ -1147,16 +1147,16 @@ int andna_recv_check_counter(PACKET rpkt) ints_network_to_host((void *)req, andna_reg_pkt_iinfo); /* If don't belong to the gnode of `rfrom', then we have to exclude - * it from the find_hash_gnode search, since we have received the - * pkt from that gnode and it is likely that `rfrom' is the only node + * it from the find_hash_gnode search, since we have received the + * pkt from that gnode and it is likely that `rfrom' is the only node * of that gnode. */ excluded_hgnode[0] = ip_gids_cmp(rfrom, me.cur_ip, 1) ? rfrom.data : 0; debug(DBG_INSANE, "excluded_hgnode: %x ", excluded_hgnode[0]); - /* - * Check if we are the real counter node or if we have to continue to - * forward the pkt + /* + * Check if we are the real counter node or if we have to continue to + * forward the pkt */ andna_hash(my_family, req->rip, MAX_IP_SZ, rip_hash, hash_gnode); @@ -1188,8 +1188,8 @@ int andna_recv_check_counter(PACKET rpkt) else cch=cc_findhash(cc, (int*)req->hash); if(!cch) { - debug(DBG_SOFT, "Request %s (0x%x) rejected: %s", - rq_to_str(rpkt.hdr.op), rpkt.hdr.id, + debug(DBG_SOFT, "Request %s (0x%x) rejected: %s", + rq_to_str(rpkt.hdr.op), rpkt.hdr.id, rq_strerror(E_ANDNA_TOO_MANY_HNAME)); if(!forwarded_pkt) pkt_err(pkt, E_ANDNA_TOO_MANY_HNAME, 0); @@ -1210,7 +1210,7 @@ int andna_recv_check_counter(PACKET rpkt) cch->hname_updates=req->hname_updates+1; cch->timestamp=time(0); } - + /* Report the successful result to rfrom */ if(!forwarded_pkt || just_check) { debug(DBG_SOFT, "Check_counter rq 0x%x accepted.", @@ -1221,7 +1221,7 @@ int andna_recv_check_counter(PACKET rpkt) ret=forward_pkt(pkt, rfrom); } - /* + /* * Broadcast the request to the entire gnode of level 1 to let the * other counter_nodes register the hname. */ @@ -1231,7 +1231,7 @@ int andna_recv_check_counter(PACKET rpkt) andna_flood_pkt(&rpkt, forwarded_pkt); } -finish: +finish: if(ntop) xfree(ntop); if(rfrom_ntop) @@ -1239,13 +1239,13 @@ finish: if(pubkey) RSA_free(pubkey); pkt_free(&rpkt_local_copy, 0); - + return ret; } /* - * + * * * * * Hostname/IP resolution * * * * */ @@ -1257,7 +1257,7 @@ finish: * local andna caches. * It uses the same arguments of `andna_resolve_hash' see below). */ -snsd_service *andna_resolve_hash_locally(u_int hname_hash[MAX_IP_INT], int service, +snsd_service *andna_resolve_hash_locally(u_int hname_hash[MAX_IP_INT], int service, u_char proto,int *records) { struct andna_resolve_rq_pkt req; @@ -1268,7 +1268,7 @@ snsd_service *andna_resolve_hash_locally(u_int hname_hash[MAX_IP_INT], int servi u_int hash; setzero(&req, sizeof(req)); - + hash = fnv_32_buf(hname_hash, ANDNA_HASH_SZ, FNV1_32_INIT); #ifndef ANDNA_DEBUG @@ -1284,13 +1284,13 @@ snsd_service *andna_resolve_hash_locally(u_int hname_hash[MAX_IP_INT], int servi ret=snsd_service_llist_copy(lcl->service, service, proto); /* Add our current main ip */ - if(service == SNSD_ALL_SERVICE || + if(service == SNSD_ALL_SERVICE || service == SNSD_DEFAULT_SERVICE || !ret) snsd_add_mainip(&ret, &fake_counter, SNSD_MAX_RECORDS, me.cur_ip.data); return ret; } - + /* * Last try before asking to ANDNA: let's see if we have it in * the resolved_hnames cache @@ -1299,17 +1299,17 @@ snsd_service *andna_resolve_hash_locally(u_int hname_hash[MAX_IP_INT], int servi *records=rhc->snsd_counter; ret=snsd_service_llist_copy(rhc->service, service, proto); - if(!ret && (service != SNSD_ALL_SERVICE) && + if(!ret && (service != SNSD_ALL_SERVICE) && (service != SNSD_DEFAULT_SERVICE)) /* The specific service hasn't been found, fallback to * SNSD_DEFAULT_SERVICE */ - ret=snsd_service_llist_copy(rhc->service, - SNSD_DEFAULT_SERVICE, + ret=snsd_service_llist_copy(rhc->service, + SNSD_DEFAULT_SERVICE, 0); if(ret) return ret; } - + #endif /* @@ -1317,15 +1317,15 @@ snsd_service *andna_resolve_hash_locally(u_int hname_hash[MAX_IP_INT], int servi */ if((ac=andna_cache_gethash((int*)hname_hash))) { *records=ac->acq->snsd_counter; - + ret=snsd_service_llist_copy(ac->acq->service, service, proto); - if(!ret && (service != SNSD_ALL_SERVICE) && + if(!ret && (service != SNSD_ALL_SERVICE) && (service != SNSD_DEFAULT_SERVICE)) /* The specific service hasn't been found, fallback to * SNSD_DEFAULT_SERVICE */ - ret=snsd_service_llist_copy(ac->acq->service, - SNSD_DEFAULT_SERVICE, + ret=snsd_service_llist_copy(ac->acq->service, + SNSD_DEFAULT_SERVICE, 0); if(ret) return ret; @@ -1336,7 +1336,7 @@ snsd_service *andna_resolve_hash_locally(u_int hname_hash[MAX_IP_INT], int servi /* * andna_resolve_hash - * + * * It returns a snsd_service llist (see snsd.h) which contains the snsd * records of the resolved hostname. Among them there's at least the mainip * record which can be found using snsd_find_mainip(). @@ -1348,13 +1348,13 @@ snsd_service *andna_resolve_hash_locally(u_int hname_hash[MAX_IP_INT], int servi * * `proto' is the protocol of the `service', it must be specified in the * proto_to_8bit() format. - * + * * In `*records' the number of records stored in the returned snsd_service * llist is written. - * + * * It returns 0 on error */ -snsd_service *andna_resolve_hash(u_int hname_hash[MAX_IP_INT], int service, +snsd_service *andna_resolve_hash(u_int hname_hash[MAX_IP_INT], int service, u_char proto, int *records) { PACKET pkt, rpkt; @@ -1385,7 +1385,7 @@ snsd_service *andna_resolve_hash(u_int hname_hash[MAX_IP_INT], int service, if(sns) return sns; - /* + /* * Fill the request structure. */ req.service=service; @@ -1393,34 +1393,34 @@ snsd_service *andna_resolve_hash(u_int hname_hash[MAX_IP_INT], int service, inet_copy_ipdata(req.rip, &me.cur_ip); memcpy(req.hash, hname_hash, ANDNA_HASH_SZ); andna_hash_by_family(my_family, hname_hash, hash_gnode); - - /* + + /* * Ok, we have to ask to someone for the resolution. - * Let's see to whom we have to send the pkt + * Let's see to whom we have to send the pkt */ if((err=find_hash_gnode(hash_gnode, &to, 0, 0, 1)) < 0) ERROR_FINISH(ret, 0, finish); else if(err == 1) req.flags|=ANDNA_PKT_FORWARD; - + ntop=inet_to_str(to); debug(DBG_INSANE, "Quest %s to %s", rq_to_str(ANDNA_RESOLVE_HNAME), ntop); - - /* - * Fill the packet and send the request + + /* + * Fill the packet and send the request */ - + /* host -> network order */ ints_host_to_network(&req, andna_resolve_rq_pkt_iinfo); - + pkt_addto(&pkt, &to); pkt.pkt_flags|=PKT_SET_LOWDELAY; pkt.hdr.flags|=ASYNC_REPLY; pkt.hdr.sz=ANDNA_RESOLVE_RQ_PKT_SZ; pkt.msg=xmalloc(pkt.hdr.sz); memcpy(pkt.msg, &req, pkt.hdr.sz); - + setzero(&rpkt, sizeof(PACKET)); err=send_rq(&pkt, 0, ANDNA_RESOLVE_HNAME, 0, ANDNA_RESOLVE_REPLY, 1, &rpkt); if(err < 0) { @@ -1429,16 +1429,16 @@ snsd_service *andna_resolve_hash(u_int hname_hash[MAX_IP_INT], int service, ERROR_FINISH(ret, 0, finish); } - if(rpkt.hdr.sz <= ANDNA_RESOLVE_REPLY_PKT_SZ || + if(rpkt.hdr.sz <= ANDNA_RESOLVE_REPLY_PKT_SZ || rpkt.hdr.sz > (SNSD_SERVICE_MAX_PACK_SZ + ANDNA_RESOLVE_REPLY_PKT_SZ)) ERROR_FINISH(ret, 0, finish); - /* - * Take the ip we need from the replied pkt + /* + * Take the ip we need from the replied pkt */ reply=(struct andna_resolve_reply_pkt *)rpkt.msg; - + /* network -> host order */ ints_network_to_host(reply, andna_resolve_reply_pkt_iinfo); @@ -1447,15 +1447,15 @@ snsd_service *andna_resolve_hash(u_int hname_hash[MAX_IP_INT], int service, packed_sz=rpkt.hdr.sz-sizeof(struct andna_resolve_reply_pkt); if(service == -1) snsd_unpacked=snsd_unpack_all_service(snsd_packed, packed_sz, - &unpacked_sz, + &unpacked_sz, &snsd_counter); else snsd_unpacked=snsd_unpack_service(snsd_packed, packed_sz, &unpacked_sz, &snsd_counter); - + if(!snsd_unpacked || - ((service == SNSD_ALL_SERVICE || + ((service == SNSD_ALL_SERVICE || service == SNSD_DEFAULT_SERVICE) && !snsd_find_mainip(snsd_unpacked))) { debug(DBG_SOFT, ERROR_MSG "Malformed resolution reply (0x%x)", @@ -1464,8 +1464,8 @@ snsd_service *andna_resolve_hash(u_int hname_hash[MAX_IP_INT], int service, } *records=snsd_counter; ret=snsd_unpacked; - - /* + + /* * Add the hostname in the resolved_hnames cache since it was * successful resolved ;) */ @@ -1473,7 +1473,7 @@ snsd_service *andna_resolve_hash(u_int hname_hash[MAX_IP_INT], int service, rhc=rh_cache_add_hash(hash32, reply->timestamp); sns_dup=snsd_service_llist_copy(snsd_unpacked, SNSD_ALL_SERVICE, 0); snsd_service_llist_merge(&rhc->service, &rhc->snsd_counter, sns_dup); - + finish: pkt_free(&pkt, 1); pkt_free(&rpkt, 0); @@ -1482,13 +1482,13 @@ finish: /* * andna_resolve_hname - * + * * It is a wrapper to andna_resolve_hash() (see above): it hashes the given * `hname' string and calls andna_resolve_hash. - * + * * It returns 0 on error */ -snsd_service *andna_resolve_hname(char *hname, int service, u_char proto, +snsd_service *andna_resolve_hname(char *hname, int service, u_char proto, int *records) { u_int hname_hash[MAX_IP_INT]; @@ -1500,8 +1500,8 @@ snsd_service *andna_resolve_hname(char *hname, int service, u_char proto, /* * andna_recv_resolve_rq - * - * replies to a hostname resolve request by giving the snsd records associated + * + * replies to a hostname resolve request by giving the snsd records associated * to the hostname. */ int andna_recv_resolve_rq(PACKET rpkt) @@ -1509,7 +1509,7 @@ int andna_recv_resolve_rq(PACKET rpkt) PACKET pkt, rpkt_local_copy; struct andna_resolve_rq_pkt *req; struct andna_resolve_reply_pkt reply; - + andna_cache *ac; snsd_service *sns; @@ -1521,13 +1521,13 @@ int andna_recv_resolve_rq(PACKET rpkt) char *ntop=0, *rfrom_ntop=0, *buf; u_char spread_the_acache=0; - + if(rpkt.hdr.sz != ANDNA_RESOLVE_RQ_PKT_SZ) ERROR_FINISH(ret, -1, finish); - + pkt_copy(&rpkt_local_copy, &rpkt); req=(struct andna_resolve_rq_pkt *)rpkt_local_copy.msg; - + /* Save the real sender of the request */ inet_setip(&rfrom, req->rip, my_family); @@ -1535,7 +1535,7 @@ int andna_recv_resolve_rq(PACKET rpkt) rfrom_ntop=xstrdup(inet_to_str(rfrom)); debug(DBG_NOISE, "Andna Resolve request 0x%x from: %s, real from: %s", rpkt.hdr.id, ntop, rfrom_ntop); - + memcpy(&pkt, &rpkt, sizeof(PACKET)); inet_copy(&pkt.from, &rfrom); pkt_addsk(&pkt, my_family, 0, SKT_UDP); @@ -1569,20 +1569,20 @@ int andna_recv_resolve_rq(PACKET rpkt) goto finish; } - /* - * Search the hostname to resolve in the andna_cache + /* + * Search the hostname to resolve in the andna_cache */ if(!(ac=andna_cache_gethash((int*)req->hash))) { /* We don't have that hname in our andna_cache */ - + if(time(0)-me.uptime < (ANDNA_EXPIRATION_TIME/2)) { /* * We are a new hash_gnode, let's see if there is * an old hash_gnode which has this hostname. */ if((ac=get_single_andna_c(req->hash, hash_gnode))) { - /* + /* * We got the andna_cache from the old * hash_gnode. Save it in our andna_cache, then * reply to `rfrom' and diffuse it in our gnode @@ -1596,19 +1596,19 @@ int andna_recv_resolve_rq(PACKET rpkt) /* Nothing to do, there isn't it, bye. */ - debug(DBG_SOFT, "Request %s (0x%x) rejected: %s", - rq_to_str(rpkt.hdr.op), rpkt.hdr.id, + debug(DBG_SOFT, "Request %s (0x%x) rejected: %s", + rq_to_str(rpkt.hdr.op), rpkt.hdr.id, rq_strerror(E_ANDNA_NO_HNAME)); pkt_err(pkt, E_ANDNA_NO_HNAME, 0); ERROR_FINISH(ret, -1, finish); } - + reply_resolve_rq: - /* - * Send back the ip associated to the hname + /* + * Send back the ip associated to the hname */ debug(DBG_SOFT, "Resolve request 0x%x accepted", rpkt.hdr.id); - + /* Write the reply */ setzero(&reply, sizeof(reply)); reply.timestamp=time(0) - ac->acq->timestamp; @@ -1618,16 +1618,16 @@ reply_resolve_rq: pack_sz=sizeof(reply); pack_sz+=req->service == SNSD_ALL_SERVICE ? - SNSD_SERVICE_LLIST_PACK_SZ(ac->acq->service) : + SNSD_SERVICE_LLIST_PACK_SZ(ac->acq->service) : SNSD_SERVICE_SINGLE_PACK_SZ(ac->acq->service); pkt_fill_hdr(&pkt.hdr, ASYNC_REPLIED, rpkt.hdr.id, ANDNA_RESOLVE_REPLY, pack_sz); - + pkt.msg=buf=xmalloc(pkt.hdr.sz); memcpy(pkt.msg, &reply, sizeof(reply)); buf+=sizeof(reply); pack_sz-=sizeof(reply); - + if(req->service == SNSD_ALL_SERVICE) /* Pack all the registered snsd records */ ret=snsd_pack_all_services(buf, pack_sz, ac->acq->service); @@ -1639,9 +1639,9 @@ reply_resolve_rq: if(!sns && service != SNSD_DEFAULT_SERVICE) { /* * The specified service and proto record hasn't been - * found, fallback to SNSD_DEFAULT_SERVICE + * found, fallback to SNSD_DEFAULT_SERVICE */ - sns=snsd_find_service(ac->acq->service, + sns=snsd_find_service(ac->acq->service, SNSD_DEFAULT_SERVICE, 0); } @@ -1662,7 +1662,7 @@ reply_resolve_rq: /* Spread the received andna_cache in our gnode */ spread_single_acache(req->hash); } - + finish: if(ntop) xfree(ntop); @@ -1686,30 +1686,30 @@ lcl_cache *andna_reverse_resolve(inet_prefix ip) PACKET pkt, rpkt; lcl_cache *unpacked_lcl=0, *ret=0; inet_prefix to; - - const char *ntop; + + const char *ntop; int tmp_counter; ssize_t err; setzero(&pkt, sizeof(PACKET)); setzero(&rpkt, sizeof(PACKET)); inet_copy(&to, &ip); - + ntop=inet_to_str(to); debug(DBG_INSANE, "Quest %s to %s", rq_to_str(ANDNA_RESOLVE_IP), ntop); /* We have been asked to reverse resolve our same IP */ - if(!memcmp(to.data, me.cur_ip.data, MAX_IP_SZ) || + if(!memcmp(to.data, me.cur_ip.data, MAX_IP_SZ) || LOOPBACK(htonl(to.data[0]))) return lcl_get_registered_hnames(andna_lcl); - - /* - * Fill the packet and send the request + + /* + * Fill the packet and send the request */ pkt_addto(&pkt, &to); pkt_addfrom(&rpkt, &to); pkt_addtimeout(&pkt, ANDNA_REV_RESOLVE_RQ_TIMEOUT, 1, 1); - + err=send_rq(&pkt, 0, ANDNA_RESOLVE_IP, 0, ANDNA_REV_RESOLVE_REPLY, 1, &rpkt); if(err < 0) { error(ERROR_MSG "Reverse resolution of the %s " @@ -1731,7 +1731,7 @@ finish: /* * andna_recv_rev_resolve_rq * - * It replies to a reverse hostname resolve request which asks all the + * It replies to a reverse hostname resolve request which asks all the * hostnames associated with a given ip. */ int andna_recv_rev_resolve_rq(PACKET rpkt) @@ -1740,7 +1740,7 @@ int andna_recv_rev_resolve_rq(PACKET rpkt) const char *ntop; int ret=0, err; - + lcl_cache *alcl=andna_lcl; setzero(&pkt, sizeof(PACKET)); @@ -1748,11 +1748,11 @@ int andna_recv_rev_resolve_rq(PACKET rpkt) ntop=inet_to_str(rpkt.from); debug(DBG_INSANE, "Andna reverse resolve request received 0x%x from %s", rpkt.hdr.id, ntop); - + /* * Build the reply pkt */ - + pkt_fill_hdr(&pkt.hdr, 0, rpkt.hdr.id, ANDNA_REV_RESOLVE_REPLY, 0); /* Build the list of registered hnames */ @@ -1762,7 +1762,7 @@ int andna_recv_rev_resolve_rq(PACKET rpkt) } debug(DBG_INSANE, "Reverse resolve request 0x%x accepted", rpkt.hdr.id); - + /* * Send it. */ @@ -1782,12 +1782,12 @@ finish: /* * * * * * Andna caches transfer * * * - * + * */ /* * get_single_andna_c - * + * * It sends the ANDNA_GET_SINGLE_ACACHE request to the old `hash_gnode' of `hash' * to retrieve the andna_cache that contains the information about `hash'. */ @@ -1796,17 +1796,17 @@ andna_cache *get_single_andna_c(u_int hash[MAX_IP_INT], { PACKET pkt, rpkt; struct single_acache_hdr req_hdr; - andna_cache *andna_cache, *ret=0; + andna_cache *ret=0; u_int *new_hgnodes[1]; size_t pack_sz; int err, counter; const char *ntop; char *pack; - + setzero(&pkt, sizeof(PACKET)); setzero(&rpkt, sizeof(PACKET)); setzero(&req_hdr, sizeof(struct single_acache_hdr)); - + /* * Find the old hash_gnode that corresponds to the hash `hash_gnode', * but exclude from the search ourself 'cause we are a new hash_gnode @@ -1818,14 +1818,14 @@ andna_cache *get_single_andna_c(u_int hash[MAX_IP_INT], ERROR_FINISH(ret, 0, finish); } else if(err == 1) req_hdr.flags|=ANDNA_PKT_FORWARD; - + req_hdr.hgnodes=1; inet_copy_ipdata(req_hdr.rip, &me.cur_ip); memcpy(req_hdr.hash, hash, MAX_IP_SZ); /* host -> network order */ ints_host_to_network((void *)&req_hdr, single_acache_hdr_iinfo); - + /* Pack the request */ pkt.hdr.flags|=ASYNC_REPLY; pkt.hdr.sz=SINGLE_ACACHE_PKT_SZ(1); @@ -1833,9 +1833,9 @@ andna_cache *get_single_andna_c(u_int hash[MAX_IP_INT], memcpy(pkt.msg, &req_hdr, pkt.hdr.sz); /* Append our ip at the end of the pkt */ - inet_copy_ipdata((u_int *)(pkt.msg+sizeof(struct single_acache_hdr)), + inet_copy_ipdata((u_int *)(pkt.msg+sizeof(struct single_acache_hdr)), &me.cur_ip); - + ntop=inet_to_str(pkt.to); debug(DBG_INSANE, "Quest %s to %s", rq_to_str(ANDNA_GET_SINGLE_ACACHE), ntop); err=send_rq(&pkt, 0, ANDNA_GET_SINGLE_ACACHE, 0, ACK_AFFERMATIVE, 1, &rpkt); @@ -1845,13 +1845,13 @@ andna_cache *get_single_andna_c(u_int hash[MAX_IP_INT], /* Unpack the waited reply */ pack_sz=rpkt.hdr.sz; pack=rpkt.msg; - ret=andna_cache=unpack_andna_cache(pack, pack_sz, &counter, + ret=unpack_andna_cache(pack, pack_sz, &counter, ACACHE_PACK_PKT); - if(!andna_cache && counter < 0) { + if(!ret && counter < 0) { error("get_single_acache(): Malformed andna_cache."); ERROR_FINISH(ret, 0, finish); } - + finish: pkt_free(&pkt, 1); pkt_free(&rpkt, 0); @@ -1860,7 +1860,7 @@ finish: /* * put_single_acache - * + * * It replies to a get_single_acache request as described * in andna.h (near the single_acache_hdr struct). */ @@ -1876,11 +1876,11 @@ int put_single_acache(PACKET rpkt) int ret=0, i; ssize_t err=0; size_t pkt_sz=0; - - + + pkt_copy(&rpkt_local_copy, &rpkt); req_hdr=(struct single_acache_hdr *)rpkt_local_copy.msg; - + /* Save the real sender of the request */ inet_setip(&rfrom, req_hdr->rip, my_family); @@ -1888,7 +1888,7 @@ int put_single_acache(PACKET rpkt) rfrom_ntop=xstrdup(inet_to_str(rfrom)); debug(DBG_NOISE, "Andna get single cache request 0x%x from: %s, real " "from: %s", rpkt.hdr.id, ntop, rfrom_ntop); - + memcpy(&pkt, &rpkt, sizeof(PACKET)); inet_copy(&pkt.from, &rfrom); pkt_addsk(&pkt, my_family, 0, SKT_UDP); @@ -1916,13 +1916,13 @@ int put_single_acache(PACKET rpkt) buf+=MAX_IP_SZ; } - /* + /* * Check if we are the destined old hash_gnode or if we have to still - * forward the pkt + * forward the pkt */ - + andna_hash_by_family(my_family, (u_char *)req_hdr->hash, hash_gnode); - if((err=find_hash_gnode(hash_gnode, &to, new_hgnodes, + if((err=find_hash_gnode(hash_gnode, &to, new_hgnodes, req_hdr->hgnodes, 0)) < 0) { debug(DBG_SOFT, "We are not the real (rounded)hash_gnode. " "Rejecting the 0x%x get_single_acache request", @@ -1937,7 +1937,7 @@ int put_single_acache(PACKET rpkt) goto finish; } - + /* * Search in our andna_cache if we have what `rfrom' wants. */ @@ -1945,12 +1945,12 @@ int put_single_acache(PACKET rpkt) /* * Nothing found! Maybe it's because we have an uptime less than - * (ANDNA_EXPIRATION_TIME/2) and so we are a new hash_gnode, + * (ANDNA_EXPIRATION_TIME/2) and so we are a new hash_gnode, * therefore we have to forward the pkt to an older hash_gnode. - */ + */ if(time(0)-me.uptime < (ANDNA_EXPIRATION_TIME/2)) { new_hgnodes[req_hdr->hgnodes]=me.cur_ip.data; - if((err=find_hash_gnode(hash_gnode, &to, new_hgnodes, + if((err=find_hash_gnode(hash_gnode, &to, new_hgnodes, req_hdr->hgnodes+1, 1)) < 0) { /* An older hash_gnode doesn't exist */ debug(DBG_SOFT, "put_single_andna_c: old hash_gnode not found"); @@ -1980,20 +1980,20 @@ int put_single_acache(PACKET rpkt) /* * We are neither a new hash_gnode so the * get_andna_single_cache propagation ends here and we reply to - * `rfrom': <> + * `rfrom': <> */ - debug(DBG_SOFT, "Request %s (0x%x) rejected: %s", - rq_to_str(rpkt.hdr.op), rpkt.hdr.id, + debug(DBG_SOFT, "Request %s (0x%x) rejected: %s", + rq_to_str(rpkt.hdr.op), rpkt.hdr.id, rq_strerror(E_ANDNA_NO_HNAME)); pkt_err(pkt, E_ANDNA_NO_HNAME, 0); ERROR_FINISH(ret, -1, finish); } - + /* * We found the andna_cache! Let's reply. - * Pack the `ac' andna_cache and send it to `rfrom' + * Pack the `ac' andna_cache and send it to `rfrom' */ - + setzero(&pkt, sizeof(PACKET)); pkt_fill_hdr(&pkt.hdr, ASYNC_REPLIED, rpkt.hdr.id, ACK_AFFERMATIVE, 0); pkt_addto(&pkt, &rfrom); @@ -2030,8 +2030,8 @@ finish: /* * spread_single_acache - * - * It tells to all the rnodes to get the single andna_cache of `hash' + * + * It tells to all the rnodes to get the single andna_cache of `hash' * using get_single_andna_c() */ int spread_single_acache(u_int hash[MAX_IP_INT]) @@ -2041,14 +2041,14 @@ int spread_single_acache(u_int hash[MAX_IP_INT]) setzero(&pkt, sizeof(PACKET)); memcpy(req.hash, hash, MAX_IP_SZ); - + ints_host_to_network(&req, spread_acache_pkt_info); - pkt_fill_hdr(&pkt.hdr, 0, 0, ANDNA_SPREAD_SACACHE, + pkt_fill_hdr(&pkt.hdr, 0, 0, ANDNA_SPREAD_SACACHE, SPREAD_ACACHE_PKT_SZ); pkt.msg=xmalloc(pkt.hdr.sz); memcpy(pkt.msg, &req, pkt.hdr.sz); - + debug(DBG_NOISE, "Spreading the single andna_cache 0x%x", pkt.hdr.id); andna_add_flood_pkt_id(last_spread_acache_pkt_id, pkt.hdr.id); return andna_flood_pkt(&pkt, 0); @@ -2056,7 +2056,7 @@ int spread_single_acache(u_int hash[MAX_IP_INT]) /* * recv_spread_single_acache - * + * * It receives and execute the ANDNA_SPREAD_SACACHE request. */ int recv_spread_single_acache(PACKET rpkt) @@ -2069,13 +2069,13 @@ int recv_spread_single_acache(PACKET rpkt) pkt_copy(&rpkt_local_copy, &rpkt); req=(struct spread_acache_pkt *)rpkt_local_copy.msg; - + if(rpkt.hdr.sz != SPREAD_ACACHE_PKT_SZ) ERROR_FINISH(ret, -1, finish); - + /* network -> host order */ ints_network_to_host(req, spread_acache_pkt_info); - + /* Check if we already received this pkt during the flood */ if(andna_add_flood_pkt_id(last_spread_acache_pkt_id, rpkt.hdr.id)) { debug(DBG_INSANE, "Dropped 0x%0x andna pkt, we already " @@ -2091,10 +2091,10 @@ int recv_spread_single_acache(PACKET rpkt) "hash_gnode, dropping 0x%x", rpkt.hdr.id); ERROR_FINISH(ret, -1, finish); } - + debug(DBG_NOISE, "Received the spreaded andna_cache 0x%x", rpkt.hdr.id); - - /* + + /* * Do as the rpkt tells us to do: retrieve the andna_hash for * req->hash from the old hash_gnode and store it. */ @@ -2104,7 +2104,7 @@ int recv_spread_single_acache(PACKET rpkt) clist_add(&andna_c, &andna_c_counter, ac); } else { debug(DBG_NOISE, "recv_spread_single_acache: (0x%x) " - "get_single_andna_c request failed", + "get_single_andna_c request failed", rpkt.hdr.id); ERROR_FINISH(ret, -1, finish); } @@ -2126,11 +2126,11 @@ finish: andna_cache *get_andna_cache(map_node *dst_rnode, int *counter) { PACKET pkt, rpkt; - andna_cache *andna_cache, *ret=0; + andna_cache *ret=0; size_t pack_sz; int err; char *pack; - + setzero(&pkt, sizeof(PACKET)); setzero(&rpkt, sizeof(PACKET)); @@ -2139,26 +2139,26 @@ andna_cache *get_andna_cache(map_node *dst_rnode, int *counter) if(server_opt.dbg_lvl) { const char *ntop; ntop=inet_to_str(pkt.to); - debug(DBG_INSANE, "Quest %s to %s", + debug(DBG_INSANE, "Quest %s to %s", rq_to_str(ANDNA_GET_ANDNA_CACHE), ntop); } pkt_addtimeout(&pkt, ANDNA_HOOK_TIMEOUT, 1, 1); - err=send_rq(&pkt, 0, ANDNA_GET_ANDNA_CACHE, 0, + err=send_rq(&pkt, 0, ANDNA_GET_ANDNA_CACHE, 0, ANDNA_PUT_ANDNA_CACHE, 1, &rpkt); if(err < 0) { ret=0; goto finish; } - + pack_sz=rpkt.hdr.sz; pack=rpkt.msg; - ret=andna_cache=unpack_andna_cache(pack, pack_sz, counter, + ret=unpack_andna_cache(pack, pack_sz, counter, ACACHE_PACK_PKT); - if(!andna_cache && counter < 0) + if(!ret && counter < 0) error("get_andna_cache(): Malformed or empty andna_cache. " "Cannot load it"); - + finish: pkt_free(&pkt, 0); pkt_free(&rpkt, 0); @@ -2168,19 +2168,19 @@ finish: /* * put_andna_cache * - * replies to a ANDNA_GET_ANDNA_CACHE request, sending back the complete + * replies to a ANDNA_GET_ANDNA_CACHE request, sending back the complete * andna cache */ int put_andna_cache(PACKET rq_pkt) { PACKET pkt; - const char *ntop; + const char *ntop; int ret=0; ssize_t err=0; size_t pkt_sz=0; - + ntop=inet_to_str(rq_pkt.from); - + setzero(&pkt, sizeof(PACKET)); pkt_addto(&pkt, &rq_pkt.from); pkt_addsk(&pkt, my_family, rq_pkt.sk, rq_pkt.sk_type); @@ -2202,7 +2202,7 @@ finish: /* * get_counter_cache - * + * * sends the ANDNA_GET_COUNT_CACHE request to rnode `dst_rnode' to retrieve its * counter_cache. */ @@ -2213,7 +2213,7 @@ counter_c *get_counter_cache(map_node *dst_rnode, int *counter) size_t pack_sz; int err; char *pack; - + setzero(&pkt, sizeof(PACKET)); setzero(&rpkt, sizeof(PACKET)); @@ -2222,7 +2222,7 @@ counter_c *get_counter_cache(map_node *dst_rnode, int *counter) if(server_opt.dbg_lvl) { const char *ntop; ntop=inet_to_str(pkt.to); - debug(DBG_INSANE, "Quest %s to %s", + debug(DBG_INSANE, "Quest %s to %s", rq_to_str(ANDNA_GET_COUNT_CACHE), ntop); } pkt_addtimeout(&pkt, ANDNA_HOOK_TIMEOUT, 1, 1); @@ -2233,14 +2233,14 @@ counter_c *get_counter_cache(map_node *dst_rnode, int *counter) ret=0; goto finish; } - + pack_sz=rpkt.hdr.sz; pack=rpkt.msg; ret=ccache=unpack_counter_cache(pack, pack_sz, counter); if(!ccache && counter < 0) error(ERROR_MSG "Malformed counter_cache. Cannot load it", ERROR_FUNC); - + finish: pkt_free(&pkt, 0); pkt_free(&rpkt, 0); @@ -2249,20 +2249,20 @@ finish: /* * put_counter_cache - * + * * replies to a ANDNA_GET_COUNT_CACHE request, sending back the * complete andna cache. */ int put_counter_cache(PACKET rq_pkt) { PACKET pkt; - const char *ntop; + const char *ntop; int ret=0; ssize_t err=0; size_t pkt_sz=0; - + ntop=inet_to_str(rq_pkt.from); - + setzero(&pkt, sizeof(PACKET)); pkt_addto(&pkt, &rq_pkt.from); pkt_addsk(&pkt, my_family, rq_pkt.sk, rq_pkt.sk_type); @@ -2285,12 +2285,12 @@ finish: /* * * * * * ANDNA threads * * * - * + * */ /* * andna_hook - * + * * The andna_hook gets the andna_cache and the counter_node cache from * the nearest rnodes. */ @@ -2299,21 +2299,21 @@ void *andna_hook(void *null) inet_prefix to; map_node *node; int e=0, i; - + setzero(&to, sizeof(inet_prefix)); /* Block these requests */ op_filter_set(ANDNA_SPREAD_SACACHE); loginfo("Starting the ANDNA hook."); - + if(!me.cur_node->links) { /* nothing to do */ - debug(DBG_NORMAL, "There are no nodes, skipping the ANDNA hook."); + debug(DBG_NORMAL, "There are no nodes, skipping the ANDNA hook."); goto finish; } - /* + /* * Send the GET_ANDNA_CACHE request to the nearest rnode we have, if it * fails send it to the second rnode and so on... */ @@ -2331,7 +2331,7 @@ void *andna_hook(void *null) if(!e) loginfo("None of the rnodes in this area gave me the andna_cache."); - /* + /* * Send the GET_COUNT_CACHE request to the nearest rnode we have, if it * fails send it to the second rnode and so on... */ @@ -2339,7 +2339,7 @@ void *andna_hook(void *null) node=(map_node *)me.cur_node->r_node[i].r_node; if(!node || node->flags & MAP_ERNODE) continue; - + andna_counter_c=get_counter_cache(node, &cc_counter); if(andna_counter_c) { e=1; @@ -2381,7 +2381,7 @@ void *andna_min_update_retry(void *void_alcl) /* * andna_update_hnames * - * updates/registers all the hostnames present in the local cache. + * updates/registers all the hostnames present in the local cache. * If `only_new_hname' is not zero, it registers only the new hostnames * added in the local cache. */ @@ -2395,7 +2395,7 @@ void andna_update_hnames(int only_new_hname) if(only_new_hname && alcl->timestamp) /* don't register old hnames */ continue; - + ret=andna_register_hname(alcl, 0); if(!ret) { loginfo("Hostname \"%s\" registered/updated " @@ -2414,7 +2414,7 @@ void andna_update_hnames(int only_new_hname) /* * andna_maintain_hnames_active - * + * * periodically registers and keep up to date the hostnames of the local cache. */ void *andna_maintain_hnames_active(void *null) @@ -2445,7 +2445,7 @@ void *andna_maintain_hnames_active(void *null) updates++; } } - + if(updates) save_lcl_cache(andna_lcl, server_opt.lcl_file); @@ -2461,7 +2461,7 @@ void *andna_main(void *null) u_short *port; pthread_t thread; pthread_attr_t t_attr; - + pthread_attr_init(&t_attr); pthread_attr_setdetachstate(&t_attr, PTHREAD_CREATE_DETACHED); @@ -2487,7 +2487,7 @@ void *andna_main(void *null) pthread_mutex_unlock(&tcp_daemon_lock); /* - * Start the ANDNA hook + * Start the ANDNA hook */ pthread_create(&thread, &t_attr, andna_hook, 0); @@ -2497,11 +2497,11 @@ void *andna_main(void *null) debug(DBG_SOFT, "Evoking the DNS wrapper daemon."); pthread_create(&thread, &t_attr, dns_wrapper_thread, 0); - /* - * Start the hostnames updater and register + /* + * Start the hostnames updater and register */ andna_maintain_hnames_active(0); - + xfree(port); return 0; } diff --git a/src/andns_lib.c b/src/andns_lib.c index 78e9ff8..f771b4f 100644 --- a/src/andns_lib.c +++ b/src/andns_lib.c @@ -31,7 +31,7 @@ int andns_compress(char *src,int srclen) { int res; uLongf space; - + src+=ANDNS_HDR_SZ; srclen-=ANDNS_HDR_SZ; space=compressBound(srclen); @@ -42,11 +42,11 @@ int andns_compress(char *src,int srclen) * the uncompressed size */ res=compress2(dst+ANDNS_HDR_Z, &space,(u_char *) src, srclen, ANDNS_COMPR_LEVEL); - if (res!=Z_OK) + if (res!=Z_OK) err_ret(ERR_ZLIBCP,-1); - if (space >= srclen-ANDNS_HDR_Z) /* We have to consider the four + if (space >= srclen-ANDNS_HDR_Z) /* We have to consider the four bytes too */ - err_ret(ERR_ZLIBNU,-1); /* This is a + err_ret(ERR_ZLIBNU,-1); /* This is a silent return */ res=htonl(srclen); memcpy(dst,&res,ANDNS_HDR_Z); @@ -54,7 +54,7 @@ int andns_compress(char *src,int srclen) return (int)space; } -char* andns_uncompress(char *src,int srclen,int *dstlen) +char* andns_uncompress(char *src,int srclen,int *dstlen) { unsigned char *dst; uLongf space; @@ -64,7 +64,7 @@ char* andns_uncompress(char *src,int srclen,int *dstlen) memcpy(&c_len,src+ANDNS_HDR_SZ,ANDNS_HDR_Z); c_len=ntohl(c_len); - dst=xmalloc(c_len+ANDNS_HDR_SZ); + dst=xmalloc(c_len+ANDNS_HDR_SZ); space=c_len; @@ -79,7 +79,7 @@ char* andns_uncompress(char *src,int srclen,int *dstlen) } memcpy(dst, src, ANDNS_HDR_SZ); - *dstlen=c_len+ANDNS_HDR_SZ; + *dstlen=c_len+ANDNS_HDR_SZ; return (char*)dst; } @@ -104,7 +104,7 @@ int a_hdr_u(char *buf,andns_pkt *ap) ap->id>>=1; buf+=2; - memcpy(&c,buf,2); + memcpy(&c,buf,sizeof(uint8_t)); ap->qr=(c>>7)&0x01; ap->p=c&0x40?ANDNS_PROTO_UDP:ANDNS_PROTO_TCP; ap->z=c&0x20; @@ -150,7 +150,7 @@ int a_qst_u(char *buf,andns_pkt *ap,int limitlen) memcpy(&s,buf,2); ap->qstlength=ntohs(s); buf+=2; - if (ap->qstlength>=ANDNS_MAX_QST_LEN || + if (ap->qstlength>=ANDNS_MAX_QST_LEN || ap->qstlength>limitlen-4) err_ret(ERR_ANDPLB,-1); AP_ALIGN(ap); @@ -243,7 +243,7 @@ int a_answ_u(char *buf,andns_pkt *ap,int limitlen) memcpy(&alen,buf,2); apd->service=ntohs(alen); buf+=2; - if (apd->m&APD_IP) + if (apd->m&APD_IP) apd->rdlength=(ap->ipv?16:4); else apd->rdlength=ANDNS_HASH_H; @@ -268,7 +268,7 @@ int a_answs_u(char *buf,andns_pkt *ap,int limitlen) memcpy(&alen,buf,sizeof(uint16_t)); ap->ancount=ntohs(alen); offset+=2; - } + } ancount=ap->ancount; for (i=0;iz) { /* Controls the space to read + if (ap->z) { /* Controls the space to read uncompressed size */ if (pktlenancount) /*No answers */ return offset; buf+=res; limitlen-=res; - if ((res=a_answs_u(buf,ap,limitlen))==-1) + if ((res=a_answs_u(buf,ap,limitlen))==-1) goto andmap; offset+=res; if (offset!=pktlen) @@ -342,13 +342,13 @@ int a_hdr_p(andns_pkt *ap,char *buf) { uint16_t s; uint8_t an; - + ap->id<<=1; s=htons(ap->id); memcpy(buf,&s,sizeof(uint16_t)); if (ap->r) *(buf+1)|=0x01; - else + else *(buf+1)&=0xfe; buf+=2; if (ap->qr) @@ -387,7 +387,7 @@ int a_qst_p(andns_pkt *ap,char *buf,int limitlen) } else if (ap->nk==INET_REALM) { s=htons(ap->qstlength); memcpy(buf,&s,2); - buf+=2; + buf+=2; memcpy(buf,ap->qstdata,ap->qstlength); ret=ap->qstlength+4; } else @@ -419,7 +419,7 @@ int a_answ_p(andns_pkt *ap,andns_pkt_data *apd,char *buf,int limitlen) uint16_t s; int limit; int ret; - + switch(ap->qtype) { case AT_A: limit=ap->ipv?16:4; @@ -489,7 +489,7 @@ int a_answs_p(andns_pkt *ap,char *buf, int limitlen) s=htons(ap->ancount); memcpy(buf,&s,2); offset+=2; - } + } apd=ap->pkt_answ; for (i=0;iancount && apd;i++) { if((res=a_answ_p(ap,apd,buf+offset,limitlen-offset))==-1) { diff --git a/src/conf/Makefile.in b/src/conf/Makefile.in index 9d2cea6..79ad6e4 100644 --- a/src/conf/Makefile.in +++ b/src/conf/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. +# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,15 +14,57 @@ @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -34,27 +76,72 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ subdir = src/conf -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/netsukuku.conf.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(mkdir_p) +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = netsukuku.conf +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(sysconfdir)" -sysconfDATA_INSTALL = $(INSTALL_DATA) DATA = $(sysconf_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -77,7 +164,9 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ IF_METHOD = @IF_METHOD@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -88,6 +177,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OTHER_METHOD = @OTHER_METHOD@ PACKAGE = @PACKAGE@ @@ -95,6 +185,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PID_DIR = @PID_DIR@ @@ -103,24 +194,29 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ +datarootdir = @datarootdir@ debug_flags = @debug_flags@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gmp = @gmp@ host = @host@ @@ -128,21 +224,29 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ sysconf_DATA = netsukuku.conf andna_hostnames snsd_nodes all: all-am @@ -151,14 +255,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/conf/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/conf/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/conf/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/conf/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -176,57 +280,64 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): netsukuku.conf: $(top_builddir)/config.status $(srcdir)/netsukuku.conf.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -uninstall-info-am: install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) - test -z "$(sysconfdir)" || $(mkdir_p) "$(DESTDIR)$(sysconfdir)" - @list='$(sysconf_DATA)'; for p in $$list; do \ + @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \ - $(sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ done uninstall-sysconfDATA: @$(NORMAL_UNINSTALL) - @list='$(sysconf_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \ - rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \ - done -tags: TAGS -TAGS: + @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir) +tags TAGS: -ctags: CTAGS -CTAGS: +ctags CTAGS: + +cscope cscopelist: distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -235,7 +346,7 @@ check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(sysconfdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -247,16 +358,22 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -275,18 +392,38 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: install-data-am: +install-dvi: install-dvi-am + +install-dvi-am: + install-exec-am: install-sysconfDATA +install-html: install-html-am + +install-html-am: + install-info: install-info-am +install-info-am: + install-man: +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -305,16 +442,22 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am uninstall-sysconfDATA +uninstall-am: uninstall-sysconfDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip install-sysconfDATA \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am \ + uninstall-sysconfDATA -.PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip install-sysconfDATA installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ - uninstall-am uninstall-info-am uninstall-sysconfDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/config.h.in b/src/config.h.in index be3de57..d295dc7 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -90,6 +90,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION diff --git a/src/gmap.c b/src/gmap.c index ae0de3d..8055ec7 100644 --- a/src/gmap.c +++ b/src/gmap.c @@ -2,7 +2,7 @@ * (c) Copyright 2005 Andrea Lo Pumo aka AlpT * * This source code is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published + * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * @@ -26,19 +26,19 @@ #include "common.h" -/* +/* * get_groups - * + * * It returns how many groups there are in the given level. */ inline int get_groups(int max_levels, int lvl) -{ +{ return lvl == max_levels ? 1 : MAXGROUPNODE; } -/* +/* * is_group_invalid - * + * * returns 1 if the `gid' of level `lvl' is invalid and * cannot be used in a regular IP. */ @@ -47,15 +47,15 @@ int is_group_invalid(int *gids, int gid, int lvl, int family) if(family == AF_INET) { if(lvl == GET_LEVELS(family)-1) { if(!gid) /* ZERONET */ - return 1; - + return 1; + if(gid >= 224 && gid <= 255) /* MULTICAST and BADCLASS */ return 1; - + if(gid == 127) /* LOOPBACK */ return 1; - + if(gid == 192 && gids[lvl-1] == 168) /* 192.168.x.x is private, we cannot use IP of * that range */ @@ -68,11 +68,11 @@ int is_group_invalid(int *gids, int gid, int lvl, int family) * class */ return 1; - if(restricted_mode && + if(restricted_mode && ( (restricted_class == RESTRICTED_10 && gid != 10) || ( - restricted_class == RESTRICTED_172 && + restricted_class == RESTRICTED_172 && !(gid == 172 && (gids[lvl-1] >= 16 || gids[lvl-1] <= 31)) ) @@ -96,7 +96,7 @@ int is_group_invalid(int *gids, int gid, int lvl, int family) /* TODO: nothing ? */ return 0; } - + return 0; } @@ -121,13 +121,13 @@ map_gnode *gnode_from_pos(int pos, map_gnode *map) return (map_gnode *)((pos*sizeof(map_gnode))+(char *)map); } -/* +/* * rnodetoip - * + * * converts the node `maprnode', which is a rnode of the root_node, * to the relative ip. */ -void rnodetoip(u_int mapstart, u_int maprnode, inet_prefix ipstart, +void rnodetoip(u_int mapstart, u_int maprnode, inet_prefix ipstart, inet_prefix *ret) { ext_rnode *e_rnode; @@ -137,22 +137,22 @@ void rnodetoip(u_int mapstart, u_int maprnode, inet_prefix ipstart, if(rnode->flags & MAP_ERNODE) { e_rnode=(ext_rnode *)rnode; inet_copy(ret, &e_rnode->quadg.ipstart[0]); - } else + } else maptoip(mapstart, maprnode, ipstart, ret); } const char *rnode_to_ipstr(u_int mapstart, u_int maprnode, inet_prefix ipstart) { inet_prefix ip; - + rnodetoip(mapstart, maprnode, ipstart, &ip); return inet_to_str(ip); } -/* +/* * iptogid - * + * * ip to gnode id, of the specified `level', conversion function. * Note: this function cannot fail! So be sure to pass a valid `level'. */ @@ -161,7 +161,7 @@ int iptogid(inet_prefix *ip, int level) u_char *h_ip=(u_char *)ip->data; int gid; - /* + /* * The formula is: * gid=(ip/MAXGROUPNODE^level) - (ip/MAXGROUPNODE^(level+1) * MAXGROUPNODE); * but since we have a MAXGROUPNODE equal to 2^8 we can just return @@ -173,10 +173,10 @@ int iptogid(inet_prefix *ip, int level) gid=(int)h_ip[GET_LEVELS(ip->family)-level-1]; #endif - return gid; + return gid; } -/* +/* * iptogids * * it fills the `gid' array which has `levels'# members with @@ -189,18 +189,18 @@ void iptogids(inet_prefix *ip, int *gid, int levels) gid[i]=iptogid(ip, i); } -/* +/* * gidtoipstart - * + * * It sets in `*ip' the ipstart of the gnode using the `gid[x]' for * each level x. - * `total_levels' is the total number of levels and the `gid' array + * `total_levels' is the total number of levels and the `gid' array * has `total_levels' elements. * `levels' is the number of array elements considered, gidtoipstart() will use * only the elements going from gid[total_levels-levels] to gid[total_levels-1]. * `family' is used to fill the inet_prefix of ipstart. */ -void gidtoipstart(int *gid, u_char total_levels, u_char levels, int family, +void gidtoipstart(int *gid, u_char total_levels, u_char levels, int family, inet_prefix *ip) { int i, h_ip[MAX_IP_INT]; @@ -211,7 +211,7 @@ void gidtoipstart(int *gid, u_char total_levels, u_char levels, int family, for(i=total_levels-ZERO_LEVEL; i >= total_levels-levels; i--) { /* The formula is: - * ipstart += MAXGROUPNODE^i * gid[i]; + * ipstart += MAXGROUPNODE^i * gid[i]; * but since MAXGROUPNODE is equal to 2^8 we just set each * single byte of ipstart. */ #if BYTE_ORDER == LITTLE_ENDIAN @@ -219,18 +219,18 @@ void gidtoipstart(int *gid, u_char total_levels, u_char levels, int family, #else ipstart[GET_LEVELS(family)-i-1]=(u_char)gid[i]; #endif - + } - + memcpy(ip->data, h_ip, MAX_IP_SZ); ip->family=family; ip->len = (family == AF_INET) ? 4 : 16; ip->bits=ip->len*8; } -/* +/* * iptoquadg - * + * * Using the given `ip' it fills the `qg' quadro_group struct. The `flags' * given specify what element fill in the struct (the flags are in gmap.h). */ @@ -241,14 +241,14 @@ void iptoquadg(inet_prefix ip, map_gnode **ext_map, quadro_group *qg, char flags int gid[MAX_LEVELS]; setzero(qg, sizeof(quadro_group)); - + levels=GET_LEVELS(ip.family); qg->levels=levels; if(flags & QUADG_GID) { iptogids(&ip, qg->gid, levels); memcpy(gid, qg->gid, sizeof(gid)); - + if(flags & QUADG_IPSTART) for(i=0; ignode[_EL(`level'-1)] gnode, * setting the appropriate flag if the gnodes is full. */ @@ -292,7 +292,7 @@ void gnode_inc_seeds(quadro_group *qg, int level) { if(level >= qg->levels-1) return; - + if(qg->gnode[_EL(level+1)]->seeds == MAXGROUPNODE-1) qg->gnode[_EL(level+1)]->flags|=GMAP_FULL; else @@ -301,23 +301,23 @@ void gnode_inc_seeds(quadro_group *qg, int level) /* * gnode_dec_seeds - * + * * the same of gnode_inc_seeds, but it decrements instead. */ void gnode_dec_seeds(quadro_group *qg, int level) { if(level >= qg->levels-1) return; - - if(qg->gnode[_EL(level+1)]->seeds-1 >= 0) + + if(qg->gnode[_EL(level+1)]->seeds-1 >= 0) qg->gnode[_EL(level+1)]->seeds--; qg->gnode[_EL(level+1)]->flags&=~GMAP_FULL; } - + /* * pack_quadro_group - * - * packs the `qg' quadro_group struct and stores it in `pack', which must be + * + * packs the `qg' quadro_group struct and stores it in `pack', which must be * QUADRO_GROUP_PACK_SZ bytes big. `pack' will be in network order. */ void pack_quadro_group(quadro_group *qg, char *pack) @@ -343,7 +343,7 @@ void pack_quadro_group(quadro_group *qg, char *pack) /* * unpack_quadro_group - * + * * restores in `qg' the quadro_group struct contained in `pack'. * Note that `pack' will be modified during the restoration. */ @@ -394,25 +394,25 @@ int isnot_gmap_void_flag_set(map_gnode *gnode) /* * increment_gids - * - * It increments the members of the `qg'->gid array until all its + * + * It increments the members of the `qg'->gid array until all its * gids point to gnodes present in the ext_map, which don't have * a particular gnode->flag or node->flag set. - * + * * In order to verify that a gnode doesn't have the flag set the * `is_gnode_flag_set' function is called, the same is done for the nodes with - * the `is_node_flag_set' function. + * the `is_node_flag_set' function. * `is_gnode_flag_set' returns 1 if the flag is set. - * - * increment_gids() starts from the qg->gid[`level'] member and finishes to + * + * increment_gids() starts from the qg->gid[`level'] member and finishes to * qg->gid[qg->levels-1]. * If all the gids point to gnodes, which have the gnode->flag set, -1 is * returned. * It's assumed that `ext_map' and `int_map' are the maps relative to the * `qg' quadro_group. */ -int increment_gids(quadro_group *qg, int level, map_gnode **ext_map, - map_node *int_map, int(*is_gnode_flag_set)(map_gnode *gnode), +int increment_gids(quadro_group *qg, int level, map_gnode **ext_map, + map_node *int_map, int(*is_gnode_flag_set)(map_gnode *gnode), int(*is_node_flag_set)(map_node *node)) { int g, groups, gid, i, e=0, family; @@ -421,13 +421,13 @@ int increment_gids(quadro_group *qg, int level, map_gnode **ext_map, return -1; family = qg->ipstart[level].family; - + g = level == qg->levels ? 0 : qg->gid[level]; groups=get_groups(qg->levels, level); gid=qg->gid[level]; - + if((!level && !is_node_flag_set(&int_map[gid])) || - (level && is_gnode_flag_set(&ext_map[_EL(level)][g]))) { + (level && is_gnode_flag_set(&ext_map[_EL(level)][g]))) { /* * find a gid in this `level' which isn't full @@ -437,7 +437,7 @@ int increment_gids(quadro_group *qg, int level, map_gnode **ext_map, if(is_group_invalid(qg->gid, qg->gid[level], level, family)) continue; - + if((!level && is_node_flag_set(&int_map[qg->gid[level]])) || (level && !is_gnode_flag_set(&ext_map[_EL(level)][qg->gid[level]]))) { e=1; @@ -451,9 +451,9 @@ int increment_gids(quadro_group *qg, int level, map_gnode **ext_map, if(!e) { g = level+1 == qg->levels ? 0 : qg->gid[level+1]; - if((is_gmap_full_flag_set == is_gnode_flag_set) && + if((is_gmap_full_flag_set == is_gnode_flag_set) && !(ext_map[_EL(level+1)][g].flags & GMAP_FULL)) { - /* + /* * There is a logical contradiction here: * we didn't find any free (g)nodes in this * level, but the upper gnode at level+1, @@ -470,9 +470,9 @@ int increment_gids(quadro_group *qg, int level, map_gnode **ext_map, /* * Recurse by leveling up */ - if(!increment_gids(qg, level+1, ext_map, int_map, + if(!increment_gids(qg, level+1, ext_map, int_map, is_gnode_flag_set, is_node_flag_set)) - /* + /* * We changed one of our upper gid, we can * retake the old gid we had at this `level' */ @@ -490,32 +490,32 @@ int increment_gids(quadro_group *qg, int level, map_gnode **ext_map, /* * free_gids - * + * * it uses increment_gids() to choose gids which don't point to FULL gnodes. */ int free_gids(quadro_group *qg, int level, map_gnode **ext_map, map_node *int_map) { - return increment_gids(qg, level, ext_map, int_map, + return increment_gids(qg, level, ext_map, int_map, is_gmap_full_flag_set, is_map_void_flag_set); } /* * void_gids - * + * * it uses increment_gids() to choose gids which point to VOID gnodes. */ int void_gids(quadro_group *qg, int level, map_gnode **ext_map, map_node *int_map) { - return increment_gids(qg, level, ext_map, int_map, + return increment_gids(qg, level, ext_map, int_map, isnot_gmap_void_flag_set, is_map_void_flag_set); } /* * random_ip - * - * It generates a new random ip. + * + * It generates a new random ip. * If `ipstart' is not NULL the new ip is restricted in the `final_gid' of * `final_level', so it'll be taken inside this range: * A=ipstart + (MAXGROUPNODE^( final_level + 1)) * final_gid; @@ -528,8 +528,8 @@ int void_gids(quadro_group *qg, int level, map_gnode **ext_map, * In this case -1 may be returned if there aren't any free gnode to choose. * The new ip is stored in `new_ip' and on success 0 is returned. */ -int random_ip(inet_prefix *ipstart, int final_level, int final_gid, - int total_levels, map_gnode **ext_map, int only_free_gnode, +int random_ip(inet_prefix *ipstart, int final_level, int final_gid, + int total_levels, map_gnode **ext_map, int only_free_gnode, inet_prefix *new_ip, int my_family) { int i, e, x, level, levels; @@ -537,12 +537,12 @@ int random_ip(inet_prefix *ipstart, int final_level, int final_gid, quadro_group qg; setzero(new_ip, sizeof(inet_prefix)); - + if(!ipstart || final_level==total_levels) { u_int idata[MAX_IP_INT]={0,0,0,0}; - - for(;;) { - /* + + for(;;) { + /* * Let's choose a completely random ip. */ levels=total_levels; @@ -560,7 +560,7 @@ int random_ip(inet_prefix *ipstart, int final_level, int final_gid, } return 0; } - + /* * We can choose only a random ip which is inside the final_gid. * `final_gid' is a gnode of the `final_level' level. @@ -592,23 +592,23 @@ int random_ip(inet_prefix *ipstart, int final_level, int final_gid, gid[level]=rand_range(0, MAXGROUPNODE-1); if(level && only_free_gnode) { - /* - * We have to be sure that we're not picking a gnode + /* + * We have to be sure that we're not picking a gnode * already used in the ext_map. Generally when we hook * we have loaded the old ext_map, so skipping the * taken gnodes we increase the possibility to create a * brand new, and not already used, gnode. */ if(!(ext_map[_EL(level)][gid[level]].flags & GMAP_VOID)) { - + /* Take a random position and loop trough the * map */ i=rand_range(0, MAXGROUPNODE-1); - + for(x=0, e=i; e=0; i--) { if(is_group_invalid(gid, i, level, my_family)) continue; - + if(ext_map[_EL(level)][i].flags & GMAP_VOID) { gid[level]=i; x=1; @@ -627,14 +627,14 @@ int random_ip(inet_prefix *ipstart, int final_level, int final_gid, } } } - if(!x) + if(!x) /* not a single free gnode was found */ return -1; } } } - /* + /* * Ok, we've set the gids of each level so we recompose them in the * new_ip. */ @@ -645,25 +645,25 @@ int random_ip(inet_prefix *ipstart, int final_level, int final_gid, /* * gnodetoip - * + * * It converts the gnode which has the given `gnodeid' at `level' * to its corresponding ipstart. The `quadg' struct must refer to the given * gnode. - * The ip is stored in `ip', and the ip->bits are choosen carefully in the - * CIDR blocks format, in this way the `ip' includes also the ranges of the + * The ip is stored in `ip', and the ip->bits are choosen carefully in the + * CIDR blocks format, in this way the `ip' includes also the ranges of the * gnode's level: ip <= x <= ip+MAXGROUPNODE^(level+1). */ void gnodetoip(quadro_group *quadg, int gnodeid, u_char level, inet_prefix *ip) { int gid[quadg->levels]; - + if(level > quadg->levels || !level) return; - + memcpy(gid, quadg->gid, sizeof(int)*quadg->levels); gid[level]=gnodeid; - - gidtoipstart(gid, quadg->levels, quadg->levels-level, + + gidtoipstart(gid, quadg->levels, quadg->levels-level, quadg->ipstart[0].family, ip); ip->bits-=(level*MAXGROUPNODE_BITS); @@ -671,7 +671,7 @@ void gnodetoip(quadro_group *quadg, int gnodeid, u_char level, inet_prefix *ip) /* * gids_cmp - * + * * compares the two `gids_a' and `gids_b' arrays starting from the * `lvl'th member to the `max_lvl-1'th. If the gids compared are the same, * zero is returned. @@ -687,9 +687,9 @@ int gids_cmp(int *gids_a, int *gids_b, int lvl, int max_lvl) } -/* +/* * quadg_gids_cmp - * + * * compares the gids of `a' and `b' starting from the `lvl'th * level. If the gids compared are the same, zero is returned. */ @@ -703,7 +703,7 @@ int quadg_gids_cmp(quadro_group a, quadro_group b, int lvl) /* * ip_gids_cmp - * + * * a wrapper to quadg_gids_cmp() that takes inet_prefixes as argvs. */ int ip_gids_cmp(inet_prefix a, inet_prefix b, int lvl) @@ -716,7 +716,7 @@ int ip_gids_cmp(inet_prefix a, inet_prefix b, int lvl) return quadg_gids_cmp(qa, qb, lvl); } -/* +/* * * * External rnodes functions * * * */ @@ -737,9 +737,9 @@ void e_rnode_free(ext_rnode_cache **erc, u_int *counter) *erc=0; } -/* +/* * e_rnode_add - * + * * adds an external node in the ext_rnode_cache list. */ void e_rnode_add(ext_rnode_cache **erc, ext_rnode *e_rnode, int rnode_pos, u_int *counter) @@ -768,9 +768,9 @@ void e_rnode_del(ext_rnode_cache **erc_head, u_int *counter, ext_rnode_cache *er /* * erc_update_rnodepos - * + * * When a rnode is deleted from the root_node all the - * erc->rnode_pos vars must be updated. For example if there's + * erc->rnode_pos vars must be updated. For example if there's * an erc->rnode_pos == 5 and the 4th rnode is deleted, than the 5th rnode * doesn't exist anymore because it is swapped in the 4th position. * The `old_rnode_pos' holds the deleted rnode position. @@ -802,9 +802,9 @@ void erc_update_rnodepos(ext_rnode_cache *erc, map_node *root_node, int old_rnod /* * erc_reorder_rnodepos - * + * * adjusts the erc->rnode_pos value contained in each ext_rnode_cache struct - * of the `*erc' list. It checks if the rnode of `root_node' at + * of the `*erc' list. It checks if the rnode of `root_node' at * the erc->rnode_pos position points to erc->e->node, if not * it finds the right rnode and it updates the erc->rnode_pos value. * If an adequate rnode isn't find, the relative erc struct is removed. @@ -815,14 +815,14 @@ void erc_reorder_rnodepos(ext_rnode_cache **erc, u_int *erc_counter, map_node *r if(!erc || !*erc) return; - + list_safe_for(p, next) { - if(p->rnode_pos >= root_node->links || + if(p->rnode_pos >= root_node->links || root_node->r_node[p->rnode_pos].r_node != (int *)&p->e->node) { /* Search the right rnode_pos */ p->rnode_pos = rnode_find(root_node, &p->e->node); - + if(p->rnode_pos < 0) { debug(DBG_NOISE, "erc_reorder_rnodepos: Warning erc 0x%x delete. " "Something strange is happening", p); @@ -832,9 +832,9 @@ void erc_reorder_rnodepos(ext_rnode_cache **erc, u_int *erc_counter, map_node *r } } -/* +/* * erc_find - * + * * Searches in the `erc' ext_rnode_cache list a struct which has the * erc->e == e_rnode and returns it. */ @@ -854,9 +854,9 @@ erc_find(ext_rnode_cache *erc, ext_rnode *e_rnode) return 0; } -/* +/* * e_rnode_find - * + * * It searches in the `erc' list a quadro_group struct equal to `qg', by * comparing their gids that goes from gid[`level'] to gid[`qg->levels']. * If an ext_rnode which has such struct is found it returns the pointer to the @@ -880,8 +880,8 @@ e_rnode_find(ext_rnode_cache *erc, quadro_group *qg, int level) return 0; } -/* - * erc_find_gnode; Returns the first ext_rnode_cache having +/* + * erc_find_gnode; Returns the first ext_rnode_cache having * erc->e->quadg.gnode[_EL( `level' )] == `gnode' */ ext_rnode_cache * @@ -899,11 +899,11 @@ erc_find_gnode(ext_rnode_cache *erc, map_gnode *gnode, u_char level) if(p->e->quadg.gnode[_EL(level)] == gnode) return p; } - + return 0; } -/* +/* * * * External map functions * * * */ @@ -911,7 +911,7 @@ map_gnode *init_gmap(int groups) { map_gnode *gmap; size_t len; - + if(!groups) groups=MAXGROUPNODE; len=sizeof(map_gnode) * groups; @@ -919,7 +919,7 @@ map_gnode *init_gmap(int groups) setzero(gmap, len); reset_gmap(gmap, groups); - + return gmap; } @@ -931,7 +931,7 @@ void reset_gmap(map_gnode *gmap, int groups) if(!groups) groups=MAXGROUPNODE; len=sizeof(map_gnode)*groups; - + for(i=0; ig, (map_node *)n); } -/* extmap_find_level: It returns the position of the gnode map which contains +/* extmap_find_level: It returns the position of the gnode map which contains * the 'gnode`. This position corresponds to the level of that gmap. - * The ext_map is given in `ext_map`. `max_level' is the maximum number of level + * The ext_map is given in `ext_map`. `max_level' is the maximum number of level * present in the `ext_map'. - * ex: if gnode is in ext_map[i] it will return i; + * ex: if gnode is in ext_map[i] it will return i; * On failure -1 is returned.*/ int extmap_find_level(map_gnode **ext_map, map_gnode *gnode, u_char max_level) { int i, a, b, c; - + for(i=1; i= b && a <= c) return i; } @@ -1030,7 +1030,7 @@ void gmap_node_del(map_gnode *gnode) /* * merge_lvl_ext_maps - * + * * merges two ext_maps of a specific `level'. It is used by merge_ext_maps(), * see below. * This function is the exact replica of merge_maps() in map.c, that's why it @@ -1049,37 +1049,37 @@ int merge_lvl_ext_maps(map_gnode *base, map_gnode *new, quadro_group base_root, for(i=0; i= base[i].g.links) { rnode_add(&base[i].g, &new[i].g.r_node[e]); rnode_trtt_order(&base[i].g); base[i].g.flags|=MAP_UPDATE; continue; } - + base_trtt = get_route_trtt(&base[i].g, base[i].g.links-1); new_trtt = get_route_trtt(&new[i].g, e); if(base_trtt < new_trtt) continue; - + for(x=0; x= 0; level--) { - + if(base_root.gid[level] != base_root.gid[level]) break; @@ -1124,20 +1124,20 @@ int merge_ext_maps(map_gnode **base, map_gnode **new, quadro_group base_root, /* The two maps are of the same quadro_group */ return -1; } - + for(i=level; i < base_root.levels; i++) - merge_lvl_ext_maps(base[_EL(i)], new[_EL(i)], base_root, + merge_lvl_ext_maps(base[_EL(i)], new[_EL(i)], base_root, new_root, i); return 0; } -/* +/* * gmap_get_rblock - * + * * It uses get_rnode_block to pack all the ext_map's rnodes * `maxgroupnode' is the number of nodes present in the map. - * It returns a pointer to the start of the rnode block and stores in "count" + * It returns a pointer to the start of the rnode block and stores in "count" * the number of rnode structs packed. */ map_rnode *gmap_get_rblock(map_gnode *map, int maxgroupnode, int *count) @@ -1145,7 +1145,7 @@ map_rnode *gmap_get_rblock(map_gnode *map, int maxgroupnode, int *count) int i, c=0, tot=0; map_rnode *rblock; *count=0; - + for(i=0; iquadg quadro_group. */ @@ -1230,10 +1230,10 @@ int verify_ext_map_hdr(struct ext_map_hdr *emap_hdr, quadro_group *quadg) { u_char levels; int maxgroupnode, i; - + levels=quadg->levels-UNITY_LEVEL; maxgroupnode=emap_hdr->ext_map_sz/(MAP_GNODE_PACK_SZ*levels); - if(levels > MAX_LEVELS || maxgroupnode > MAXGROUPNODE || + if(levels > MAX_LEVELS || maxgroupnode > MAXGROUPNODE || emap_hdr->total_rblock_sz > MAXRNODEBLOCK_PACK_SZ*levels || emap_hdr->ext_map_sz > maxgroupnode*MAP_GNODE_PACK_SZ*levels) return 1; @@ -1256,7 +1256,7 @@ void free_extmap_rblock(map_rnode **rblock, u_char levels) /* * pack_map_gnode - * + * * packs the `qg' map_gnode struct and stores it in * `pack', which must be MAP_GNODE_PACK_SZ bytes big. `pack' will be in * network order. @@ -1284,7 +1284,7 @@ void pack_map_gnode(map_gnode *gnode, char *pack) /* * unpack_map_gnode - * + * * restores in `qg' the map_gnode struct contained in `pack'. * Note that `pack' will be modified during the restoration. */ @@ -1295,7 +1295,7 @@ void unpack_map_gnode(map_gnode *gnode, char *pack) buf=pack; ints_network_to_host(pack, map_gnode_iinfo); - + unpack_map_node(&gnode->g, buf); buf+=MAP_NODE_PACK_SZ; @@ -1309,13 +1309,13 @@ void unpack_map_gnode(map_gnode *gnode, char *pack) buf+=sizeof(u_int); } -/* +/* * pack_extmap - * - * It returns the packed `ext_map', ready to be saved or sent. It stores - * in `pack_sz' the size of the package. Each gmaps, present in the `ext_map', has - * `maxgroupnode' nodes. `quadg' must be a valid quadro_group struct filled with - * valid values. + * + * It returns the packed `ext_map', ready to be saved or sent. It stores + * in `pack_sz' the size of the package. Each gmaps, present in the `ext_map', has + * `maxgroupnode' nodes. `quadg' must be a valid quadro_group struct filled with + * valid values. */ char *pack_extmap(map_gnode **ext_map, int maxgroupnode, quadro_group *quadg, size_t *pack_sz) { @@ -1335,13 +1335,13 @@ char *pack_extmap(map_gnode **ext_map, int maxgroupnode, quadro_group *quadg, si emap_hdr.rblock_sz[i]=count[i]*MAP_RNODE_PACK_SZ; emap_hdr.total_rblock_sz+=emap_hdr.rblock_sz[i]; } - + pack_quadro_group(quadg, emap_hdr.quadg); /*Let's fuse all in one*/ *pack_sz=EXT_MAP_BLOCK_SZ(emap_hdr.ext_map_sz, emap_hdr.total_rblock_sz); package=xmalloc(*pack_sz); - + memcpy(package, &emap_hdr, sizeof(struct ext_map_hdr)); ints_host_to_network(package, ext_map_hdr_iinfo); @@ -1352,7 +1352,7 @@ char *pack_extmap(map_gnode **ext_map, int maxgroupnode, quadro_group *quadg, si p+=MAP_GNODE_PACK_SZ; } } - + /* If the rblock is not null copy it in the `package' */ if(rblock) { for(i=0; iquadg); - + levels=quadg->levels-UNITY_LEVEL; maxgroupnode=emap_hdr->ext_map_sz/(MAP_GNODE_PACK_SZ*levels); - + if(verify_ext_map_hdr(emap_hdr, quadg)) { error("Malformed ext_map_hdr. Aborting unpack_map()."); return 0; } - + /*Unpacking the ext_map*/ p=package+sizeof(struct ext_map_hdr); ext_map=init_extmap(quadg->levels, maxgroupnode); @@ -1421,7 +1421,7 @@ map_gnode **unpack_extmap(char *package, quadro_group *quadg) return 0; } } - + /* We restore the quadro_group struct */ for(i=0; ignode[i]=gnode_from_pos(quadg->gid[i+1], ext_map[i]); @@ -1435,12 +1435,12 @@ int save_extmap(map_gnode **ext_map, int maxgroupnode, quadro_group *quadg, char FILE *fd; size_t pack_sz; char *pack; - + /*Pack!*/ pack=pack_extmap(ext_map, maxgroupnode, quadg, &pack_sz); if(!pack || !pack_sz) return 0; - + if((fd=fopen(file, "w"))==NULL) { error("Cannot save the map in %s: %s", file, strerror(errno)); return -1; @@ -1460,7 +1460,7 @@ map_gnode **load_extmap(char *file, quadro_group *quadg) struct ext_map_hdr emap_hdr; size_t pack_sz; char *pack; - + if((fd=fopen(file, "r"))==NULL) { error("Cannot load the map from %s: %s", file, strerror(errno)); return 0; @@ -1488,6 +1488,7 @@ map_gnode **load_extmap(char *file, quadro_group *quadg) fclose(fd); return ext_map; error: + fclose(fd); error("Malformed ext_map file. Aborting load_extmap()."); return 0; } diff --git a/src/inet.c b/src/inet.c index 6d8b0bd..158d2b4 100644 --- a/src/inet.c +++ b/src/inet.c @@ -2,7 +2,7 @@ * (c) Copyright 2005 Andrea Lo Pumo aka AlpT * * This source code is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published + * modify it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * @@ -26,7 +26,7 @@ #include "endianness.h" -/* +/* * inet_ntohl: Converts each element of `data' from network to host order. If * `family' is equal to AF_INET6, the array is swapped too (on big endian * machine). @@ -45,7 +45,7 @@ void inet_ntohl(u_int *data, int family) #endif } -/* +/* * inet_htonl: Converts each element of `data' from host to network order. If * `family' is equal to AF_INET6, the array is swapped too (on big endian * machine). @@ -71,18 +71,18 @@ int inet_setip_raw(inet_prefix *ip, u_int *data, int family) { ip->family=family; setzero(ip->data, sizeof(ip->data)); - + if(family==AF_INET) { ip->data[0]=data[0]; ip->len=4; } else if(family==AF_INET6) { memcpy(ip->data, data, sizeof(ip->data)); ip->len=16; - } else + } else fatal(ERROR_MSG "family not supported", ERROR_POS); ip->bits=ip->len<<3; /* bits=len*8 */ - + return 0; } @@ -107,7 +107,7 @@ int inet_setip_bcast(inet_prefix *ip, int family) } else if(family==AF_INET6) { u_int data[MAX_IP_INT]=IPV6_ADDR_BROADCAST; inet_setip(ip, data, family); - } else + } else fatal(ERROR_MSG "family not supported", ERROR_POS); return 0; @@ -117,13 +117,13 @@ int inet_setip_anyaddr(inet_prefix *ip, int family) { if(family==AF_INET) { u_int data[MAX_IP_INT]={0, 0, 0, 0}; - + data[0]=INADDR_ANY; inet_setip(ip, data, family); } else if(family==AF_INET6) { struct in6_addr ipv6=IN6ADDR_ANY_INIT; inet_setip(ip, (u_int *)(&ipv6), family); - } else + } else fatal(ERROR_MSG "family not supported", ERROR_POS); return 0; @@ -133,22 +133,22 @@ int inet_setip_loopback(inet_prefix *ip, int family) { if(family==AF_INET) { u_int data[MAX_IP_INT]={0, 0, 0, 0}; - + data[0]=LOOPBACK_IP; inet_setip(ip, data, family); inet_htonl(ip->data, ip->family); } else if(family==AF_INET6) { u_int data[MAX_IP_INT]=LOOPBACK_IPV6; inet_setip(ip, data, family); - } else + } else fatal(ERROR_MSG "family not supported", ERROR_POS); return 0; } -/* +/* * inet_setip_localaddr: Restrict the `ip' to a local private class changing the - * first byte of the `ip'. `class' specifies what restricted class is currently + * first byte of the `ip'. `class' specifies what restricted class is currently * being used (10.x.x.x or 172.16.x.x). In ipv6 the site local class is the * default. */ @@ -157,11 +157,11 @@ int inet_setip_localaddr(inet_prefix *ip, int family, int class) if(family==AF_INET) { if(class == RESTRICTED_10) ip->data[0] = NTK_RESTRICTED_10_MASK(ip->data[0]); - else + else ip->data[0] = NTK_RESTRICTED_172_MASK(ip->data[0]); } else if(family==AF_INET6) { ip->data[0] = NTK_RESTRICTED_IPV6_MASK(ip->data[0]); - } else + } else fatal(ERROR_MSG "family not supported", ERROR_POS); return 0; @@ -169,7 +169,7 @@ int inet_setip_localaddr(inet_prefix *ip, int family, int class) /* * inet_is_ip_local: verifies if `ip' is a local address. If it is, 1 is - * returned. `class' specifies what restricted class is currently + * returned. `class' specifies what restricted class is currently * being used (10.x.x.x or 172.16.x.x). In ipv6 the site local class is the * default. */ @@ -236,7 +236,7 @@ void pack_inet_prefix(inet_prefix *ip, char *pack) memcpy(buf, ip->data, MAX_IP_SZ); inet_htonl((u_int *)buf, ip->family); buf+=MAX_IP_SZ; - + ints_host_to_network(pack, inet_prefix_iinfo); } @@ -249,7 +249,7 @@ void unpack_inet_prefix(inet_prefix *ip, char *pack) char *buf; buf=pack; - + ints_network_to_host(pack, inet_prefix_iinfo); memcpy(&ip->family, buf, sizeof(u_char)); @@ -266,18 +266,18 @@ void unpack_inet_prefix(inet_prefix *ip, char *pack) buf+=MAX_IP_SZ; } -/* +/* * inet_addr_match: without hesitating this function was robbed from iproute2. * It compares a->data wih b->data matching `bits'# bits. */ int inet_addr_match(const inet_prefix *a, const inet_prefix *b, int bits) { - uint32_t *a1 = a->data; - uint32_t *a2 = b->data; + const uint32_t *a1 = a->data; + const uint32_t *a2 = b->data; int words = bits >> 0x05; - + bits &= 0x1f; - + if (words) if (memcmp(a1, a2, words << 2)) return -1; @@ -332,7 +332,7 @@ int ipv6_addr_type(inet_prefix addr) if ((st & htonl(0xE0000000)) != htonl(0x00000000) && (st & htonl(0xE0000000)) != htonl(0xE0000000)) return type; - + if ((st & htonl(0xFFC00000)) == htonl(0xFE800000)) return (IPV6_ADDR_LINKLOCAL | type); @@ -375,14 +375,14 @@ int inet_validate_ip(inet_prefix ip) if(ip.family==AF_INET) { ipv4=htonl(ip.data[0]); - if(MULTICAST(ipv4) || BADCLASS(ipv4) || ZERONET(ipv4) + if(MULTICAST(ipv4) || BADCLASS(ipv4) || ZERONET(ipv4) || LOOPBACK(ipv4) || NTK_PRIVATE_C(ipv4) || (!restricted_mode && NTK_PRIVATE_B(ipv4))) return -EINVAL; } else if(ip.family==AF_INET6) { type=ipv6_addr_type(ip); - if( (type & IPV6_ADDR_MULTICAST) || (type & IPV6_ADDR_RESERVED) || + if( (type & IPV6_ADDR_MULTICAST) || (type & IPV6_ADDR_RESERVED) || (type & IPV6_ADDR_LOOPBACK)) return -EINVAL; } @@ -396,8 +396,8 @@ int inet_validate_ip(inet_prefix ip) /*\ * - * * * Conversion functions... * * - * + * * * Conversion functions... * * + * \*/ /* @@ -413,7 +413,7 @@ const char *ipraw_to_str(u_int ip[MAX_IP_INT], int family) if(family==AF_INET) { src.s_addr=htonl(ip[0]); inet_ntop(family, &src, dst, INET_ADDRSTRLEN); - + return dst; } else if(family==AF_INET6) { inet_htonl(ip, family); @@ -457,7 +457,7 @@ int str_to_inet(const char *src, inet_prefix *ip) } if((res=inet_pton(family, src, (void *)data)) < 0) { - debug(DBG_NORMAL, ERROR_MSG "error -> %s.", + debug(DBG_NORMAL, ERROR_MSG "error -> %s.", ERROR_FUNC, strerror(errno)); return -1; } @@ -478,27 +478,27 @@ int inet_to_sockaddr(inet_prefix *ip, u_short port, struct sockaddr *dst, socklen_t *dstlen) { port=htons(port); - + if(ip->family==AF_INET) { struct sockaddr_in sin; setzero(&sin, sizeof(struct sockaddr_in)); - + sin.sin_family = ip->family; sin.sin_port = port; sin.sin_addr.s_addr = htonl(ip->data[0]); memcpy(dst, &sin, sizeof(struct sockaddr_in)); - + if(dstlen) *dstlen=sizeof(struct sockaddr_in); } else if(ip->family==AF_INET6) { struct sockaddr_in6 sin6; setzero(&sin6, sizeof(struct sockaddr_in6)); - + sin6.sin6_family = ip->family; sin6.sin6_port = port; sin6.sin6_flowinfo = 0; - + memcpy(&sin6.sin6_addr, ip->data, MAX_IP_SZ); inet_htonl((u_int *)&sin6.sin6_addr, ip->family); @@ -516,14 +516,14 @@ int sockaddr_to_inet(struct sockaddr *ip, inet_prefix *dst, u_short *port) { u_short po; char *p; - + setzero(dst, sizeof(inet_prefix)); - + dst->family=ip->sa_family; memcpy(&po, &ip->sa_data, sizeof(u_short)); if(port) *port=ntohs(po); - + if(ip->sa_family==AF_INET) p=(char *)ip->sa_data+sizeof(u_short); else if(ip->sa_family==AF_INET6) @@ -532,7 +532,7 @@ int sockaddr_to_inet(struct sockaddr *ip, inet_prefix *dst, u_short *port) error(ERROR_MSG "family not supported", ERROR_POS); return -1; } - + inet_setip(dst, (u_int *)p, ip->sa_family); return 0; @@ -566,7 +566,7 @@ int new_dgram_socket(int sock_type) return sockfd; } -/* +/* * inet_close * * It closes the `*sk' socket and sets it to zero. @@ -594,20 +594,20 @@ int inet_getpeername(int sk, inet_prefix *ip, short *port) return sockaddr_to_inet(sa, ip, port); } -/* +/* * join_ipv6_multicast: It adds the membership to the IPV6_ADDR_BROADCAST - * multicast group. The device with index `idx' will be used. + * multicast group. The device with index `idx' will be used. */ int join_ipv6_multicast(int socket, int idx) { struct ipv6_mreq mreq6; const int addr[MAX_IP_INT]=IPV6_ADDR_BROADCAST; - + setzero(&mreq6, sizeof(struct ipv6_mreq)); memcpy(&mreq6.ipv6mr_multiaddr, addr, sizeof(struct in6_addr)); mreq6.ipv6mr_interface=idx; - - if(setsockopt(socket, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq6, + + if(setsockopt(socket, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq6, sizeof(mreq6)) < 0) { error("Cannot set IPV6_JOIN_GROUP: %s", strerror(errno)); close(socket); @@ -631,11 +631,11 @@ int set_multicast_if(int socket, int idx) return 0; } - + int set_nonblock_sk(int fd) { if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) { - error("set_nonblock_sk(): cannot set O_NONBLOCK: %s", + error("set_nonblock_sk(): cannot set O_NONBLOCK: %s", strerror(errno)); close(fd); return -1; @@ -646,7 +646,7 @@ int set_nonblock_sk(int fd) int unset_nonblock_sk(int fd) { if (fcntl(fd, F_SETFL, 0) < 0) { - error("unset_nonblock_sk(): cannot unset O_NONBLOCK: %s", + error("unset_nonblock_sk(): cannot unset O_NONBLOCK: %s", strerror(errno)); close(fd); return -1; @@ -671,10 +671,10 @@ int set_bindtodevice_sk(int socket, char *dev) { struct ifreq ifr; int ret=0; - + setzero(&ifr, sizeof(ifr)); strncpy(ifr.ifr_name, dev, IFNAMSIZ-1); - + ret=setsockopt(socket, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1); if(ret < 0) error("setsockopt SO_BINDTODEVICE: %s", strerror(errno)); @@ -683,7 +683,7 @@ int set_bindtodevice_sk(int socket, char *dev) } /* - * `loop': 0 = disable, 1 = enable (default) + * `loop': 0 = disable, 1 = enable (default) */ int set_multicast_loop_sk(int family, int socket, u_char loop) { @@ -707,7 +707,7 @@ int set_broadcast_sk(int socket, int family, inet_prefix *host, short port, struct sockaddr *sa=(struct sockaddr *)&saddr_sto; socklen_t alen; int broadcast=1; - + if(family == AF_INET) { if (setsockopt(socket, SOL_SOCKET, SO_BROADCAST, &broadcast, sizeof(broadcast)) < 0) { @@ -723,7 +723,7 @@ int set_broadcast_sk(int socket, int family, inet_prefix *host, short port, set_multicast_if(socket, dev_idx); } else fatal(ERROR_MSG "family not supported", ERROR_POS); - + /* What's my name ? */ alen = sizeof(saddr_sto); setzero(sa, alen); @@ -732,14 +732,14 @@ int set_broadcast_sk(int socket, int family, inet_prefix *host, short port, close(socket); return -1; } - + /* Let's bind it! */ if(bind(socket, sa, alen) < 0) { error("Cannot bind the broadcast socket: %s", strerror(errno)); close(socket); return -1; } - + return socket; } @@ -759,7 +759,7 @@ int set_keepalive_sk(int socket) { int on=1; - if(setsockopt(socket, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, + if(setsockopt(socket, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on)) < 0){ error("Cannot set keepalive socket: %s", strerror(errno)); return -1; @@ -771,7 +771,7 @@ int unset_keepalive_sk(int socket) { int off=0; - if(setsockopt(socket, SOL_SOCKET, SO_KEEPALIVE, (void *)&off, + if(setsockopt(socket, SOL_SOCKET, SO_KEEPALIVE, (void *)&off, sizeof(off)) < 0){ error("Cannot unset keepalive socket: %s", strerror(errno)); return -1; @@ -794,7 +794,7 @@ int set_tos_sk(int socket, int lowdelay) /*\ * - * * * Connection functions * * + * * * Connection functions * * * \*/ @@ -806,19 +806,19 @@ int new_tcp_conn(inet_prefix *host, short port, char *dev) struct sockaddr *sa=(struct sockaddr *)&saddr_sto; const char *ntop; ntop=inet_to_str(*host); - + if(inet_to_sockaddr(host, port, sa, &sa_len)) { error("Cannot new_tcp_connect(): %d Family not supported", host->family); ERROR_FINISH(sk, -1, finish); } - + if((sk = new_socket(host->family)) == -1) ERROR_FINISH(sk, -1, finish); if(dev) /* if `dev' is not null bind the socket to it */ if(set_bindtodevice_sk(sk, dev) < 0) ERROR_FINISH(sk, -1, finish); - + if (connect(sk, sa, sa_len) == -1) { error("Cannot tcp_connect() to %s: %s", ntop, strerror(errno)); ERROR_FINISH(sk, -1, finish); @@ -828,7 +828,7 @@ finish: } int new_udp_conn(inet_prefix *host, short port, char *dev) -{ +{ int sk; socklen_t sa_len; struct sockaddr_storage saddr_sto; @@ -841,9 +841,9 @@ int new_udp_conn(inet_prefix *host, short port, char *dev) ERROR_FINISH(sk, -1, finish); } - if((sk = new_dgram_socket(host->family)) == -1) + if((sk = new_dgram_socket(host->family)) == -1) ERROR_FINISH(sk, -1, finish); - + if(dev) /* if `dev' is not null bind the socket to it */ if(set_bindtodevice_sk(sk, dev) < 0) ERROR_FINISH(sk, -1, finish); @@ -852,13 +852,13 @@ int new_udp_conn(inet_prefix *host, short port, char *dev) error("Cannot connect to %s: %s", ntop, strerror(errno)); ERROR_FINISH(sk, -1, finish); } - + finish: return sk; } - + int new_bcast_conn(inet_prefix *host, short port, int dev_idx) -{ +{ struct sockaddr_storage saddr_sto; struct sockaddr *sa=(struct sockaddr *)&saddr_sto; socklen_t alen; @@ -868,26 +868,26 @@ int new_bcast_conn(inet_prefix *host, short port, int dev_idx) if((sk = new_dgram_socket(host->family)) == -1) return -1; sk=set_broadcast_sk(sk, host->family, host, port, dev_idx); - + /* - * Connect + * Connect */ if(inet_to_sockaddr(host, port, sa, &alen)) { error("set_broadcast_sk: %d Family not supported", host->family); return -1; } - + if(host->family == AF_INET6) { struct sockaddr_in6 *sin6=(struct sockaddr_in6 *)sa; sin6->sin6_scope_id = dev_idx; } - + if(set_bindtodevice_sk(sk, (char *)ll_index_to_name(dev_idx)) < 0) return -1; - + if(connect(sk, sa, alen) == -1) { ntop=inet_to_str(*host); - error("Cannot connect to the broadcast (%s): %s", ntop, + error("Cannot connect to the broadcast (%s): %s", ntop, strerror(errno)); return -1; } @@ -909,7 +909,7 @@ ssize_t inet_recv(int s, void *buf, size_t len, int flags) int ret; if((err=recv(s, buf, len, flags))==-1) { - switch(errno) + switch(errno) { default: /* Probably connection was closed */ @@ -922,9 +922,9 @@ ssize_t inet_recv(int s, void *buf, size_t len, int flags) return err; } -/* +/* * inet_recv_timeout - * + * * is the same as inet_recv() but if no reply is received for `timeout' * seconds it returns -1. */ @@ -955,7 +955,7 @@ ssize_t inet_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr * int ret; if((err=recvfrom(s, buf, len, flags, from, fromlen)) < 0) { - switch(errno) + switch(errno) { default: error("inet_recvfrom: Cannot recv(): %s", strerror(errno)); @@ -966,11 +966,11 @@ ssize_t inet_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr * return err; } -/* +/* * inet_recvfrom_timeout: is the same as inet_recvfrom() but if no reply is * received for `timeout' seconds it returns -1. */ -ssize_t inet_recvfrom_timeout(int s, void *buf, size_t len, int flags, +ssize_t inet_recvfrom_timeout(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen, u_int timeout) { struct timeval timeout_t; @@ -990,10 +990,10 @@ ssize_t inet_recvfrom_timeout(int s, void *buf, size_t len, int flags, if(FD_ISSET(s, &fdset)) return inet_recvfrom(s, buf, len, flags, from, fromlen); - + return -1; } - + ssize_t inet_send(int s, const void *msg, size_t len, int flags) { ssize_t err; @@ -1001,11 +1001,11 @@ ssize_t inet_send(int s, const void *msg, size_t len, int flags) int ret; if((err=send(s, msg, len, flags)) < 0) { - switch(errno) + switch(errno) { case EMSGSIZE: inet_send(s, msg, len/2, flags); - err=inet_send(s, (const char *)msg+(len/2), + err=inet_send(s, (const char *)msg+(len/2), len-(len/2), flags); break; @@ -1029,7 +1029,7 @@ ssize_t inet_send_timeout(int s, const void *msg, size_t len, int flags, u_int t int ret; MILLISEC_TO_TV(timeout*1000, timeout_t); - + FD_ZERO(&fdset); FD_SET(s, &fdset); @@ -1047,14 +1047,14 @@ ssize_t inet_send_timeout(int s, const void *msg, size_t len, int flags, u_int t -ssize_t inet_sendto(int s, const void *msg, size_t len, int flags, +ssize_t inet_sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) { ssize_t err; fd_set fdset; int ret; int errno_int; - + if((err=sendto(s, msg, len, flags, to, tolen))==-1) { errno_int = errno; error("sendto errno: %d err is: %d", errno, err); @@ -1063,7 +1063,7 @@ ssize_t inet_sendto(int s, const void *msg, size_t len, int flags, case EMSGSIZE: error("Packet artificially fragmented: %d", stderr); inet_sendto(s, msg, len/2, flags, to, tolen); - err=inet_sendto(s, ((const char *)msg+(len/2)), + err=inet_sendto(s, ((const char *)msg+(len/2)), len-(len/2), flags, to, tolen); break; case EFAULT: @@ -1081,7 +1081,7 @@ ssize_t inet_sendto(int s, const void *msg, size_t len, int flags, * inet_sendto_timeout: is the same as inet_sendto() but if the packet isn't sent * in `timeout' seconds it timeouts and returns -1. */ -ssize_t inet_sendto_timeout(int s, const void *msg, size_t len, int flags, +ssize_t inet_sendto_timeout(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen, u_int timeout) { struct timeval timeout_t; @@ -1089,7 +1089,7 @@ ssize_t inet_sendto_timeout(int s, const void *msg, size_t len, int flags, int ret; MILLISEC_TO_TV(timeout*1000, timeout_t); - + FD_ZERO(&fdset); FD_SET(s, &fdset); diff --git a/src/libiptc/libiptc.c b/src/libiptc/libiptc.c index 6a09d72..f4d2feb 100644 --- a/src/libiptc/libiptc.c +++ b/src/libiptc/libiptc.c @@ -509,6 +509,7 @@ new_rule: t = (STRUCT_STANDARD_TARGET *)GET_TARGET(e); if (t->target.u.target_size != ALIGN(sizeof(STRUCT_STANDARD_TARGET))) { + free(r); errno = EINVAL; return -1; } @@ -2120,6 +2121,7 @@ TC_COMMIT(TC_HANDLE_T *handle) errno = ret; free(repl->counters); free(repl); + free(newcounters); return 0; } diff --git a/src/man/Makefile.in b/src/man/Makefile.in index 61b66b0..c64f510 100644 --- a/src/man/Makefile.in +++ b/src/man/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. +# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,15 +13,57 @@ # PARTICULAR PURPOSE. @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -33,28 +75,74 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ subdir = src/man -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(mkdir_p) +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } man5dir = $(mandir)/man5 am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man5_MANS) $(man8_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -77,7 +165,9 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ IF_METHOD = @IF_METHOD@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -88,6 +178,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OTHER_METHOD = @OTHER_METHOD@ PACKAGE = @PACKAGE@ @@ -95,6 +186,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PID_DIR = @PID_DIR@ @@ -103,24 +195,29 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ +datarootdir = @datarootdir@ debug_flags = @debug_flags@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gmp = @gmp@ host = @host@ @@ -128,21 +225,29 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ man8_MANS = andna.8 ntkd.8 ntk-wifi.8 ntk-resolv.8 netsukuku.conf.5 man5_MANS = netsukuku.conf.5 all: all-am @@ -152,14 +257,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/man/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/man/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/man/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -177,128 +282,123 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -uninstall-info-am: -install-man5: $(man5_MANS) $(man_MANS) +$(am__aclocal_m4_deps): +install-man5: $(man5_MANS) @$(NORMAL_INSTALL) - test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)" - @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.5*) list="$$list $$i" ;; \ - esac; \ + @list1='$(man5_MANS)'; \ + list2=''; \ + test -n "$(man5dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.5[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ + fi; \ done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 5*) ;; \ - *) ext='5' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ - done + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ + done; } + uninstall-man5: @$(NORMAL_UNINSTALL) - @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.5*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 5*) ;; \ - *) ext='5' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ - done -install-man8: $(man8_MANS) $(man_MANS) + @list='$(man5_MANS)'; test -n "$(man5dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) +install-man8: $(man8_MANS) @$(NORMAL_INSTALL) - test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)" - @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.8*) list="$$list $$i" ;; \ - esac; \ + @list1='$(man8_MANS)'; \ + list2=''; \ + test -n "$(man8dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.8[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ + fi; \ done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 8*) ;; \ - *) ext='8' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ - done + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ + done; } + uninstall-man8: @$(NORMAL_UNINSTALL) - @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.8*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 8*) ;; \ - *) ext='8' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ - done -tags: TAGS -TAGS: + @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) +tags TAGS: -ctags: CTAGS -CTAGS: +ctags CTAGS: + +cscope cscopelist: distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -307,7 +407,7 @@ check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -319,16 +419,22 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -347,18 +453,38 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: install-data-am: install-man +install-dvi: install-dvi-am + +install-dvi-am: + install-exec-am: +install-html: install-html-am + +install-html-am: + install-info: install-info-am +install-info-am: + install-man: install-man5 install-man8 +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -377,19 +503,24 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am uninstall-man +uninstall-am: uninstall-man uninstall-man: uninstall-man5 uninstall-man8 -.PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-man5 install-man8 install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \ - uninstall-man uninstall-man5 uninstall-man8 +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-man5 install-man8 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-man uninstall-man5 uninstall-man8 + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/scripts/Makefile.in b/src/scripts/Makefile.in index 1ebad33..0df01f9 100644 --- a/src/scripts/Makefile.in +++ b/src/scripts/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.8.5 from Makefile.am. +# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,15 +14,57 @@ @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -34,27 +76,71 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_triplet = @build@ host_triplet = @host@ subdir = src/scripts -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(mkdir_p) +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(scriptconfdir)" -binSCRIPT_INSTALL = $(INSTALL_SCRIPT) -scriptconfSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) $(scriptconf_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -77,7 +163,9 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ IF_METHOD = @IF_METHOD@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -88,6 +176,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OTHER_METHOD = @OTHER_METHOD@ PACKAGE = @PACKAGE@ @@ -95,6 +184,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PID_DIR = @PID_DIR@ @@ -103,24 +193,29 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ +datarootdir = @datarootdir@ debug_flags = @debug_flags@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gmp = @gmp@ host = @host@ @@ -128,21 +223,29 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ bin_SCRIPTS = ntk-wifi scriptconfdir = $(sysconfdir) scriptconf_SCRIPTS = ip_masquerade.sh tc_shaper.sh rc.ntk @@ -153,14 +256,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/scripts/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/scripts/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/scripts/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -178,76 +281,111 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" - @list='$(bin_SCRIPTS)'; for p in $$list; do \ + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f $$d$$p; then \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ - else :; fi; \ - done + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done + @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-scriptconfSCRIPTS: $(scriptconf_SCRIPTS) @$(NORMAL_INSTALL) - test -z "$(scriptconfdir)" || $(mkdir_p) "$(DESTDIR)$(scriptconfdir)" - @list='$(scriptconf_SCRIPTS)'; for p in $$list; do \ + @list='$(scriptconf_SCRIPTS)'; test -n "$(scriptconfdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(scriptconfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(scriptconfdir)" || exit 1; \ + fi; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f $$d$$p; then \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " $(scriptconfSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(scriptconfdir)/$$f'"; \ - $(scriptconfSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(scriptconfdir)/$$f"; \ - else :; fi; \ - done + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(scriptconfdir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(scriptconfdir)$$dir" || exit $$?; \ + } \ + ; done uninstall-scriptconfSCRIPTS: @$(NORMAL_UNINSTALL) - @list='$(scriptconf_SCRIPTS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " rm -f '$(DESTDIR)$(scriptconfdir)/$$f'"; \ - rm -f "$(DESTDIR)$(scriptconfdir)/$$f"; \ - done -uninstall-info-am: -tags: TAGS -TAGS: + @list='$(scriptconf_SCRIPTS)'; test -n "$(scriptconfdir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(scriptconfdir)'; $(am__uninstall_files_from_dir) +tags TAGS: -ctags: CTAGS -CTAGS: +ctags CTAGS: + +cscope cscopelist: distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -256,7 +394,7 @@ check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(scriptconfdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -268,16 +406,22 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -296,18 +440,38 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: install-data-am: install-scriptconfSCRIPTS +install-dvi: install-dvi-am + +install-dvi-am: + install-exec-am: install-binSCRIPTS +install-html: install-html-am + +install-html-am: + install-info: install-info-am +install-info-am: + install-man: +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -326,19 +490,23 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binSCRIPTS uninstall-info-am \ - uninstall-scriptconfSCRIPTS +uninstall-am: uninstall-binSCRIPTS uninstall-scriptconfSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic cscopelist-am \ + ctags-am distclean distclean-generic distdir dvi dvi-am html \ + html-am info info-am install install-am install-binSCRIPTS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am \ + install-scriptconfSCRIPTS install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am \ + uninstall-binSCRIPTS uninstall-scriptconfSCRIPTS -.PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-binSCRIPTS install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-scriptconfSCRIPTS \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-binSCRIPTS uninstall-info-am \ - uninstall-scriptconfSCRIPTS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.