This commit is contained in:
Graeme Walker 2022-04-03 12:00:00 +00:00
parent 4ef1c64564
commit 27c01949fa
155 changed files with 7815 additions and 3549 deletions

View File

@ -1,6 +1,13 @@
E-MailRelay Change Log
======================
2.2 -> 2.2.1
------------
* Unix domain sockets supported (eg. "--interface=/tmp/smtp.s").
* Windows event log not used for verbose logging (prefer "--log-file").
* New admin 'forward' command to trigger forwarding without waiting.
* Support for MbedTLS version 3.
2.1 -> 2.2
----------
* Connections from IPv4 'private use' addresses are allowed by default (see "--remote-clients").
@ -24,7 +31,7 @@ E-MailRelay Change Log
* New "--idle-timeout" option for server-side connections.
* Support for RFC-5782 DNSBL blocking ("--dnsbl").
* Filter scripts are given the path of the envelope file in argv2.
* Message files can be editied by "--client-filter" scripts.
* Message files can be edited by "--client-filter" scripts.
* Better support for CRAM-SHAx authentication.
* New "--client-auth-config" and "--server-auth-config" options.
* New "--show" option on windows to better control the user interface style.

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -134,7 +134,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@ -200,9 +200,8 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)gconfig_defs.h.in
cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
@ -223,9 +222,8 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/gconfig_defs.h.in \
AUTHORS COPYING ChangeLog INSTALL NEWS README compile \
install-sh missing
am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS COPYING ChangeLog \
INSTALL NEWS README compile depcomp install-sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@ -330,6 +328,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -366,6 +365,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -414,8 +414,7 @@ e_doc_DATA = COPYING AUTHORS INSTALL NEWS README ChangeLog
RPM = $(RPM_ROOT)/RPMS/$(ARCH)/emailrelay-$(VERSION)-1.$(ARCH).rpm
TAR = emailrelay-$(VERSION).tar.gz
DEB = emailrelay_$(VERSION)_$(ARCH).deb
all: gconfig_defs.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
all: all-recursive
.SUFFIXES:
am--refresh: Makefile
@ -439,8 +438,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -451,21 +450,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
gconfig_defs.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/gconfig_defs.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status gconfig_defs.h
$(srcdir)/gconfig_defs.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f gconfig_defs.h stamp-h1
install-e_docDATA: $(e_doc_DATA)
@$(NORMAL_INSTALL)
@list='$(e_doc_DATA)'; test -n "$(e_docdir)" || list=; \
@ -594,7 +578,10 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@ -659,7 +646,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@ -685,7 +672,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@ -703,7 +690,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@ -713,7 +700,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
@ -784,7 +771,7 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(DATA) gconfig_defs.h
all-am: Makefile $(DATA)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(e_docdir)"; do \
@ -827,7 +814,7 @@ clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
@ -889,24 +876,23 @@ ps-am:
uninstall-am: uninstall-e_docDATA uninstall-local
.MAKE: $(am__recursive_targets) all install-am install-strip
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-e_docDATA 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-generic pdf pdf-am ps ps-am tags \
tags-am uninstall uninstall-am uninstall-e_docDATA \
uninstall-local
distcheck distclean distclean-generic distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-e_docDATA \
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-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-e_docDATA uninstall-local
.PRECIOUS: Makefile

4
NEWS
View File

@ -22,3 +22,7 @@ as an "examples" file. Use "e_systemddir=/usr/lib/systemd/system" on the
This release has a new "make tidy" option that runs "clang-tidy" over the
code and also "make cmake" to generate simple cmake files for a unix build.
Version 2.2.1 adds support for unix-domain sockets.
Thanks to Per-Arne Christensen for the Norwegian translation of the GUI.

View File

@ -1 +1 @@
2.2
2.2.1

191
aclocal.m4 vendored
View File

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
# Copyright (C) 2002-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.15], [],
m4_if([$1], [1.16.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.15])dnl
[AM_AUTOMAKE_VERSION([1.16.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file 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.
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@ -346,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
AS_CASE([$CONFIG_FILES],
[*\'*], [eval set x "$CONFIG_FILES"],
[*], [set x $CONFIG_FILES])
shift
for mf
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`AS_DIRNAME(["$am_mf"])`
am_filepart=`AS_BASENAME(["$am_mf"])`
AM_RUN_LOG([cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles]) || am_rc=$?
done
if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).])
fi
AS_UNSET([am_dirpart])
AS_UNSET([am_filepart])
AS_UNSET([am_mf])
AS_UNSET([am_rc])
rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@ -397,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each '.P' file that we will
# need in order to bootstrap the dependency handling code.
# This code is only required when automatic dependency tracking is enabled.
# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
[AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -495,8 +485,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
@ -563,7 +553,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: <http://www.gnu.org/software/coreutils/>.
that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@ -605,7 +595,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -626,7 +616,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2014 Free Software Foundation, Inc.
# Copyright (C) 2003-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -648,7 +638,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -683,7 +673,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -691,49 +681,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
# Check whether make has an 'include' directive that can support all
# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
cat > confinc.mk << 'END'
am__doit:
@echo this is the am__doit target
@echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# BSD make does it like this.
echo '.include "confinc.mk" # ignored' > confmf.BSD
# Other make implementations (GNU, Solaris 10, AIX) do it like this.
echo 'include confinc.mk # ignored' > confmf.GNU
_am_result=no
for s in GNU BSD; do
AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
AS_CASE([$?:`cat confinc.out 2>/dev/null`],
['0:this is the am__doit target'],
[AS_CASE([$s],
[BSD], [am__include='.include' am__quote='"'],
[am__include='include' am__quote=''])])
if test "$am__include" != "#"; then
_am_result="yes ($s style)"
break
fi
done
rm -f confinc.* confmf.*
AC_MSG_RESULT([${_am_result}])
AC_SUBST([am__include])])
AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -772,7 +755,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -801,7 +784,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -848,7 +831,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -867,7 +850,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -948,7 +931,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# Copyright (C) 2009-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1008,7 +991,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1036,7 +1019,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2014 Free Software Foundation, Inc.
# Copyright (C) 2006-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1055,7 +1038,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
# Copyright (C) 2004-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

0
autogen.sh Executable file → Normal file
View File

View File

@ -35,6 +35,7 @@
# $makefile->libraries() ;
# $makefile->includes() ;
# $makefile->definitions() ;
# $makefile->compile_options() ;
# $makefile->sources('foo') ;
# $makefile->our_libs('foo') ;
# $makefile->sys_libs('foo') ;
@ -51,19 +52,20 @@ our $debug = 0 ;
sub new
{
my ( $classname , $path , $switches , $ro_vars ) = @_ ;
my ( $classname , $path , $switches , $vars_in ) = @_ ;
my %me = (
m_path => simplepath($path) ,
m_switches => $switches ,
m_vars => {} ,
m_depth => undef , # from readall()
m_lines => [] ,
m_vars => {} ,
m_switches => $switches ,
m_stack => [] ,
) ;
my $this = bless \%me , $classname ;
$this->read( $path ) ;
$this->parse( $path ) ;
$this->expand_all( $ro_vars ) ;
$this->expand_all( $vars_in ) ;
$this->copy( $vars_in ) ;
return $this ;
}
@ -74,22 +76,23 @@ sub path
sub readall
{
my ( $base_dir , $switches , $vars , $verbose ) = @_ ;
my ( $base_dir , $switches , $vars , $verbose , $verbose_prefix ) = @_ ;
my @makefiles = () ;
_readall_imp( \@makefiles , 0 , $base_dir , $switches , $vars , $verbose ) ; # recursive
_readall_imp( \@makefiles , 0 , $base_dir , $switches , $vars , $verbose , $verbose_prefix ) ; # recursive
return @makefiles ;
}
sub _readall_imp
{
my ( $makefiles , $depth , $dir , $switches , $vars , $verbose ) = @_ ;
my ( $makefiles , $depth , $dir , $switches , $vars , $verbose , $verbose_prefix ) = @_ ;
$verbose_prefix ||= "" ;
my $m = new AutoMakeParser( "$dir/Makefile.am" , $switches , $vars ) ;
$m->{m_depth} = $depth ;
print "makefile=[" , $m->path() , "] ($depth)\n" if $verbose ;
print "${verbose_prefix}makefile=[" , $m->path() , "] ($depth)\n" if $verbose ;
push @$makefiles , $m ;
for my $subdir ( $m->value("SUBDIRS") )
{
_readall_imp( $makefiles , $depth+1 , "$dir/$subdir" , $switches , $vars , $verbose ) ;
_readall_imp( $makefiles , $depth+1 , "$dir/$subdir" , $switches , $vars , $verbose , $verbose_prefix ) ;
}
}
@ -159,10 +162,15 @@ sub sys_libs
{
my ( $this , $program ) = @_ ;
( my $prefix = $program ) =~ s/[-.]/_/g ;
return
my @a =
map { s/-l// ; $_ }
grep { m/^-l/ }
$this->value( "LIBS" ) ;
my @b =
map { s/-l// ; $_ }
grep { m/^-l/ }
$this->value( "${prefix}_LDADD" ) ;
return ( @a , @b ) ;
}
sub sources
@ -174,11 +182,51 @@ sub sources
$this->value( "${prefix}_SOURCES" ) ;
}
sub link_options
{
my ( $this ) = @_ ;
my @a = $this->value( "AM_LDFLAGS" ) ;
my @b = $this->value( "LDFLAGS" ) ;
my @options = ( @a , @b ) ;
return wantarray ? @options : join(" ",@options) ;
}
sub compile_options
{
my ( $this ) = @_ ;
my @a = $this->_compile_options_imp( "AM_CPPFLAGS" , $this->{m_vars} ) ;
my @b = $this->_compile_options_imp( "CXXFLAGS" , $this->{m_vars} ) ;
my @options = ( @a , @b ) ;
return wantarray ? @options : join(" ",@options) ;
}
sub _compile_options_imp
{
my ( $this , $var , $vars ) = @_ ;
$vars ||= $this->{m_vars} ;
my $s = protect_quoted_spaces( simple_spaces( $vars->{$var} ) ) ;
$s =~ s/-D /-D/g ;
$s =~ s/-I /-I/g ;
return
map { s/\t/ /g ; $_ }
grep { !m/-I/ }
grep { !m/-D/ }
split( " " , $s ) ;
}
sub definitions
{
my ( $this , $am_cppflags ) = @_ ;
$am_cppflags ||= "AM_CPPFLAGS" ;
my $s = protect_quoted_spaces( simple_spaces( $this->{m_vars}->{$am_cppflags} ) ) ;
my ( $this ) = @_ ;
my @a = $this->_definitions_imp( "AM_CPPFLAGS" , $this->{m_vars} ) ;
my @b = $this->_definitions_imp( "CXXFLAGS" , $this->{m_vars} ) ;
my @defs = ( @a , @b ) ;
return wantarray ? @defs : join(" ",@defs) ;
}
sub _definitions_imp
{
my ( $this , $var , $vars ) = @_ ;
my $s = protect_quoted_spaces( simple_spaces( $vars->{$var} ) ) ;
$s =~ s/-D /-D/g ;
return
map { s/\t/ /g ; $_ }
@ -194,29 +242,41 @@ sub includes
# with the 'top_srcdir' variable defined as "." gives
# ("./one/two","./three").
#
# However, since the 'top_srcdir' expansion is fixed, and the
# However, since the 'top_srcdir' expansion is fixed, and
# relative include paths need to vary through the source
# tree, a prefix parameter ('top') can be passed in here.
# So then "-I$(top_srcdir)/one/two" becomes "<top>/./one/two".
# tree, a prefix parameter ('top') should be passed in as
# the current value for expanding "$(top_srcdir)". So then
# "-I$(top_srcdir)/one/two" becomes "<top>/./one/two".
# (Absolute paths do not get the 'top' prefixed by 'top'.)
#
# The 'top' parameter can be from top() as long as readall()
# started at the 'top_srcdir' directory and the 'top_srcdir'
# variable is defined as ".". Otherwise, a simple approach
# is to still use top() for the 'top' parameter but define
# the 'top_srcdir' variable as the difference between the
# readall() base and the actual 'top_srcdir' directory.
# The "top()" method provides a candidate for the 'top'
# parameter but will only work if readall() started at the
# 'top_srcdir' directory and the 'top_srcdir' variable is
# defined as ".". Otherwise, a simple approach is to still
# use top() for the 'top' parameter but define the 'top_srcdir'
# variable as the difference between the readall() base and
# the actual 'top_srcdir' directory.
#
my ( $this , $top , $am_cppflags , $extra_includes , $full_paths ) = @_ ;
my ( $this , $top , $full_paths , $no_top_dir ) = @_ ;
$top ||= "" ;
$am_cppflags ||= "AM_CPPFLAGS" ;
$extra_includes ||= "" ;
my $cppflags = join( " " , $extra_includes , $this->{m_vars}->{$am_cppflags} ) ;
my $s = protect_quoted_spaces( simple_spaces( $cppflags ) ) ;
my $add_top = !$no_top_dir ;
my $real_top = simplepath( join( "/" , $this->value("top_srcdir") , $top ) ) ;
my @a = $this->_includes_imp( $top , "AM_CPPFLAGS" , $this->{m_vars} , $full_paths ) ;
my @b = $this->_includes_imp( $top , "CXXFLAGS" , $this->{m_vars} , $full_paths ) ;
my @c = ( $real_top && $add_top ) ? ( $real_top ) : () ;
my @incs = ( @c , @a , @b ) ;
return wantarray ? @incs : join(" ",@incs) ;
}
sub _includes_imp
{
my ( $this , $top , $var , $vars , $full_paths ) = @_ ;
my $s = protect_quoted_spaces( simple_spaces( $vars->{$var} ) ) ;
$s =~ s/-I /-I/g ;
return
map { $full_paths?$this->fullpath($_):$_ }
map { simplepath($_) }
map { $top?join("/",$top,$_):$_ }
map { my $p=$_ ; ($top&&($p!~m;^/;))?join("/",$top,$p):$p }
map { s/\t/ /g ; $_ }
map { s:-I:: ; $_ } grep { m/-I\S+/ }
split( " " , $s ) ;
@ -319,6 +379,19 @@ sub add
push @{$this->{m_lines}} , $line ;
}
sub copy
{
my ( $this , $vars_in ) = @_ ;
return if !defined($vars_in) ;
for my $k ( keys %$vars_in )
{
if( !exists($this->{m_vars}->{$k}) )
{
$this->{m_vars}->{$k} = $vars_in->{$k} ;
}
}
}
sub read
{
my ( $this , $path ) = @_ ;
@ -357,7 +430,7 @@ sub parse
last ; # (new)
}
}
debug_( "$$this{m_path}($n): " , $this->enabled() ? $line : "..." ) ;
debug_( "$$this{m_path}($n): " , $line ) if ( $this->enabled() && ( $line =~ m/\S/ ) && ( $line !~ m/^#/ ) ) ;
}
for my $k ( sort keys %{$this->{m_vars}} )
{
@ -469,7 +542,9 @@ sub do_assign_more
sub debug_
{
print @_ , "\n" if $debug ;
my $line = join( " " , @_ ) ;
$line =~ s/ *\t */ /g ;
print $line , "\n" if $debug ;
}
1 ;

View File

@ -26,8 +26,7 @@
# Synopsis:
#
# use CompilationDatabase ;
# my $cdb = new CompilationDatabase( $src_dir ,
# ["-DFOO=BAR",...] , ["-I_TOP_"] , ["-Wall"] , {WINDOWS=>0,...} , {top_srcdir=>'..'} ) ;
# my $cdb = new CompilationDatabase( $src_dir , {WINDOWS=>0,...} , {top_srcdir=>'..'} , {} ) ;
# my @files = $cdb->list() ;
# my @stanzas = $cdb->stanzas() ;
# $cdb->print() ;
@ -42,16 +41,16 @@ our $debug = 0 ;
sub new
{
my ( $classname , $base_makefile_dir , $dflags , $iflags , $cxxflags , $switches , $ro_vars ) = @_ ;
my ( $classname , $base_makefile_dir , $switches , $ro_vars , $config ) = @_ ;
$AutoMakeParser::debug = 1 if $debug > 1 ;
$config ||= {} ;
$config->{test_mode} ||= 0 ;
$config->{full_paths} ||= 0 ;
my %me = (
m_base_dir => $base_makefile_dir ,
m_dflags => $dflags ,
m_iflags => $iflags ,
m_cxxflags => $cxxflags ,
m_switches => $switches ,
m_ro_vars => $ro_vars ,
m_full_paths => 0 ,
m_config => $config ,
) ;
return bless \%me , $classname ;
}
@ -95,26 +94,28 @@ sub stanzas
for my $m ( @makefiles )
{
my $dir = File::Basename::dirname( $m->path() ) ;
my @includes = map { "-I$_" } $m->includes( $m->top() , undef , join(" ",@{$this->{m_iflags}}) , $this->{m_full_paths} ) ;
my @includes = map { "-I$_" } $m->includes( $m->top() , undef , undef , $this->{m_config}->{full_paths} ) ;
my @definitions = map { "-D$_" } $m->definitions() ;
push @definitions , @{$this->{m_dflags}} ;
my @compile_options = $m->compile_options() ;
my @link_options = $m->link_options() ;
if( $debug )
{
print "cdb: makefile=" , $m->path() , "\n" ;
print "cdb: AM_CPPFLAGS=[",join("|",$m->value("AM_CPPFLAGS")),"]\n" ;
print "cdb: top=",$m->top(),"\n" ;
print "cdb: \@includes=" , join("|",@includes) , "\n" ;
print "cdb: \@definitions=" , join("|",@definitions) , "\n" ;
print "cdb: \@compile_options=" , join("|",@compile_options) , "\n" ;
print "cdb: \@link_options=" , join("|",@link_options) , "\n" ;
}
for my $library ( $m->libraries() )
{
map { push @output , $this->_stanza($dir,$_,\@includes,\@definitions) } $m->sources($library) ;
map { push @output , $this->_stanza($dir,$_,\@includes,\@definitions,\@compile_options) } $m->sources($library) ;
}
for my $program ( $m->programs() )
{
map { push @output , $this->_stanza($dir,$_,\@includes,\@definitions) } $m->sources($program) ;
map { push @output , $this->_stanza($dir,$_,\@includes,\@definitions,\@compile_options) } $m->sources($program) ;
}
}
return @output ;
@ -122,15 +123,20 @@ sub stanzas
sub _stanza
{
my ( $this , $dir , $source , $includes , $definitions ) = @_ ;
my ( $this , $dir , $source , $includes , $definitions , $options ) = @_ ;
my @all_flags = ( @{$this->{m_cxxflags}} , @$definitions , @$includes ) ;
my @all_flags = ( @$definitions , @$includes , @$options ) ;
my $directory = Cwd::realpath( $dir ) ;
$source = join("/",$directory,$source) if $this->{m_full_paths} ;
$source = join("/",$directory,$source) if $this->{m_config}->{full_paths} ;
my $command = "/usr/bin/c++ @all_flags -c $source" ;
$command =~ s/"/\\"/g ;
$command =~ s/"/\\"/g unless $this->{m_config}->{test_mode} ;
if( $this->{m_config}->{test_mode} )
{
return "cd $directory && $command\n" ;
}
return
"{\n" .

124
bin/ConfigStatus.pm Normal file
View File

@ -0,0 +1,124 @@
#!/usr/bin/perl
#
# Copyright (C) 2001-2021 Graeme Walker <graeme_walker@users.sourceforge.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ===
#
# ConfigStatus.pm
#
# Provides 'switches' and 'vars' parsed out of a "config.status"
# file (as generated by an autoconf configure script).
#
# Synopsis:
# use ConfigStatus ;
# my $cs = new ConfigStatus( "config.status" ) ;
# my %vars = $cs->vars() ;
# my %switches = $cs->switches() ;
#
# See also: AutoMakeParser
#
use strict ;
use FileHandle ;
package ConfigStatus ;
sub new
{
my ( $classname , $filename ) = @_ ;
my $this = bless {
m_vars => {} ,
m_switches => {} ,
} , $classname ;
$this->parse( $filename ) if $filename ;
return $this ;
}
sub vars
{
my ( $this ) = @_ ;
return %{$this->{m_vars}} ;
}
sub switches
{
my ( $this ) = @_ ;
return %{$this->{m_switches}} ;
}
sub parse
{
my ( $this , $filename ) = @_ ;
$filename ||= "config.status" ;
$this->{m_vars} = {} ;
$this->{m_switches} = {} ;
my $fh = new FileHandle( $filename , "r" ) or die "error: cannot open [$filename]: " . lc($!) . "\n" ;
while(<$fh>)
{
chomp( my $line = $_ ) ;
while( $line =~ m/\\$/ )
{
$line = substr( $line , 0 , length($line)-2 ) ; # remove doublequote-backslash
my $next = <$fh> ;
chomp( $next ) ;
$next =~ s/^"// ;
$line .= $next ;
}
my ( $k , $v ) = ( $line =~ m/^S\["([^"]+)"\]="([^"]*)"\s*$/ ) ;
if( $k && defined($v) )
{
if( $k =~ m/_TRUE$/ )
{
( my $kk = $k ) =~ s/_TRUE$// ;
my $vv = ( $v eq "" ? 1 : 0 ) ;
$this->{m_switches}->{$kk} = $vv ;
}
elsif( $k =~ m/_FALSE$/ )
{
( my $kk = $k ) =~ s/_FALSE$// ;
my $vv = ( $v eq "" ? 0 : 1 ) ;
$this->{m_switches}->{$kk} = $vv ;
}
else
{
$this->{m_vars}->{$k} = $v ;
}
}
}
$this->_expand() ;
return $this ;
}
sub _expand
{
my ( $this ) = @_ ;
for my $k ( sort keys %{$this->{m_vars}} )
{
my $v = $this->{m_vars}->{$k} ;
for my $i ( 0 .. 10 )
{
my ( $subkey ) = ( $v =~ m/\$\{([^}]*)\}/ ) ;
if( $subkey && exists($this->{m_vars}->{$subkey}) )
{
my $new = $this->{m_vars}->{$subkey} ;
$v =~ s/\$\{$subkey\}/$new/ ;
}
}
$this->{m_vars}->{$k} = $v ;
}
return $this ;
}
1 ;

View File

@ -52,6 +52,7 @@ work_scripts = \
make2cdb \
AutoMakeParser.pm \
CompilationDatabase.pm \
ConfigStatus.pm \
winbuild.pm
js_scripts = \

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -100,7 +100,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@ -218,6 +218,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -254,6 +255,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -317,6 +319,7 @@ work_scripts = \
make2cdb \
AutoMakeParser.pm \
CompilationDatabase.pm \
ConfigStatus.pm \
winbuild.pm
js_scripts = \
@ -369,8 +372,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -479,7 +482,10 @@ ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \

0
bin/emailrelay-deliver.sh.in Executable file → Normal file
View File

0
bin/emailrelay-notify.sh.in Executable file → Normal file
View File

0
bin/emailrelay-resubmit.sh.in Executable file → Normal file
View File

View File

@ -15,15 +15,61 @@
#
use strict ;
use FileHandle ;
use Getopt::Std ;
# parse and mostly ignore sendmail command-line options
my $usage = "usage: emailrelay-sendmail [-intUv] [-BbCdFhNOopqRrVX <arg>] [-f <from>] <to> [<to> ...]" ;
my %opt = () ;
getopts( 'B:b:C:d:F:f:h:iN:nO:o:p:q:R:r:tUV:vX:' , \%opt ) or die "$usage\n" ;
# submit into the emailrelay spool directory
my $from = defined($opt{f}) ? $opt{f} : $ENV{USER} ;
my $exe = "/usr/sbin/emailrelay-submit" ;
my @args = ( $exe , "-f" , $from , @ARGV ) ; # also consider using "--copy" and "--content-date"
exec { $exe } @args ;
# parse and mostly ignore sendmail command-line options
my $usage = "usage: emailrelay-sendmail [-intUv] [-ABbCDdFfGhiLNnOopqRrtUVvX <arg>] [-f <from>] <to> [<to> ...]" ;
my %opt = () ;
getopts( 'A:B:b:C:D:d:F:f:Gh:iL:N:nO:o:p:q:R:r:tUV:vX:' , \%opt ) or die "$usage\n" ;
my $from = defined($opt{f}) ? $opt{f} : $ENV{USER} ;
my @submit_args = ( "--content-date" , @ARGV ) ; # also consider using "--copy"
# if "-t" read envelope 'to' addresses from content headers
if( $opt{t} )
{
# read content headers
my %h = () ;
my @h = () ;
my $k = "" ;
while(<STDIN>)
{
chomp( my $line = $_ ) ;
$line =~ s/\r$// ;
last if ( $line eq "" ) ;
my ( $a , $b , $c , $d ) = ( $line =~ m/^(\S*):\s*(.*)|^(\s)(.*)/ ) ;
if( $a ) { $k = lc($a) ; $h{$k} = $b }
if( $k && $d ) { $h{$k} .= "$c$d" } # folding
push @h , $line unless ( lc($k) eq 'bcc' ) ; # remove Bcc
}
# extract 'to' addresses
my @to = () ;
push @to , split(" ",$h{to}) if exists($h{to}) ;
push @to , split(" ",$h{cc}) if exists($h{cc}) ;
push @to , split(" ",$h{bcc}) if exists($h{bcc}) ;
# write headers and copy body into temp file
my $tmp = "/tmp/emailrelay-sendmail.$$.tmp" ;
my $fh = new FileHandle( $tmp , "w" ) or die ;
map { print $fh $_ , "\r\n" } @h ;
print $fh "\r\n" ;
while(<STDIN>) { print $fh $_ }
$fh->close() or die ;
# make stdin read from the temp file
open STDIN , '<' , $tmp or die ;
unlink $tmp or die ;
# run emailrelay-submit
my @args = ( $exe , "-f" , $from , @to ) ;
exec { $exe } @args ;
}
else
{
# run emailrelay-submit
my @args = ( $exe , "-f" , $from , @submit_args ) ;
exec { $exe } @args ;
}

View File

@ -83,7 +83,7 @@ try
WScript.Quit( 0 ) ;
}
catch
catch( e )
{
WScript.StdOut.WriteLine( "<<edit failed>>" ) ;
WScript.StdOut.WriteLine( "<<" + e + ">>" ) ;

0
bin/emailrelay-submit.sh.in Executable file → Normal file
View File

View File

@ -38,74 +38,38 @@ use File::Find ;
use File::Basename ;
use File::Spec ;
use File::Copy ;
use Getopt::Long ;
use lib dirname($0) ;
use ConfigStatus ;
use CompilationDatabase ;
$CompilationDatabase::debug = 0 ;
my $show_list = $ARGV[0] eq "--list" ;
shift @ARGV if $show_list ;
my %opt = () ;
GetOptions( \%opt , "list" , "test" , "debug" ) or die "$0: usage error\n" ;
my $cfg_show_list = exists( $opt{list} ) ;
my $cfg_test_mode = exists( $opt{test} ) ;
my $cfg_debug = exists( $opt{debug} ) ;
$CompilationDatabase::debug = $cfg_debug ;
$AutoMakeParser::debug = $cfg_debug ;
my $src_dir = @ARGV ? $ARGV[0] : dirname($0)."/../src" ;
my $top_dir = @ARGV >= 1 ? $ARGV[1] : "$src_dir/.." ;
my $src_to_top = @ARGV >= 2 ? $ARGV[2] : ".." ;
my @dflags = (
"-DG_UNIX=1" ,
) ;
my $cs = new ConfigStatus( "$top_dir/config.status" ) ;
my %switches = $cs->switches() ;
my %vars = $cs->vars() ;
$vars{top_srcdir} = $src_to_top ;
$vars{top_builddir} = "." ;
# makefile conditionals
my %switches = (
GCONFIG_BSD => 0 ,
GCONFIG_GUI => 0 ,
GCONFIG_ICONV => 0 ,
GCONFIG_INSTALL_HOOK => 0 ,
GCONFIG_INTERFACE_NAMES => 1 ,
GCONFIG_MAC => 0 ,
GCONFIG_PAM => 0 ,
GCONFIG_TESTING => 0 ,
GCONFIG_TLS_USE_BOTH => 0 ,
GCONFIG_TLS_USE_MBEDTLS => 0 ,
GCONFIG_TLS_USE_NONE => 0 ,
GCONFIG_TLS_USE_OPENSSL => 1 ,
GCONFIG_WINDOWS => 0 ,
) ;
# makefile expansion variables -- many are required but not relevant
my %vars = (
top_srcdir => $src_to_top ,
top_builddir => "." ,
sbindir => "." ,
mandir => "." ,
localedir => "." ,
e_spooldir => "/var/spool/emailrelay" ,
e_docdir => "." ,
e_initdir => "." ,
e_bsdinitdir => "." ,
e_rundir => "." ,
e_icondir => "." ,
e_examplesdir => "." ,
e_libexecdir => "." ,
e_pamdir => "." ,
e_sysconfdir => "/etc" ,
GCONFIG_WINDRES => "" ,
GCONFIG_WINDMC => "" ,
GCONFIG_QT_LIBS => "" ,
GCONFIG_QT_CFLAGS => "" ,
GCONFIG_QT_MOC => "" ,
GCONFIG_TLS_LIBS => "" ,
GCONFIG_STATIC_START => "" ,
GCONFIG_STATIC_END => "" ,
RPM_ARCH => "x86" ,
RPM_ROOT => "rpm" ,
) ;
my $cdb = new CompilationDatabase( $src_dir , ["-DG_UNIX=1"], ["-I$src_to_top"] , ["-std=c++11","-pthread"] , \%switches , \%vars ) ;
$cdb->{m_full_paths} = 1 ; # grr
if( $show_list )
my $cdb = new CompilationDatabase( $src_dir , \%switches , \%vars , {test_mode=>$cfg_test_mode,full_paths=>1} ) ;
if( $cfg_show_list )
{
print join( "\n" , $cdb->list() , "" ) ;
}
elsif( $cfg_test_mode )
{
print join( "" , $cdb->stanzas() ) ;
}
else
{
print "[\n" ;

View File

@ -18,16 +18,21 @@
#
# make2cmake
#
# Parses automake files throughout the source tree and generates
# simplistic cmake files for a unix build.
# Parses the autoconf/automake artifacts throughout the source tree
# in order to generates simplistic 'cmake' files.
#
# Eg:
# $ ./make2cmake
# $ CXXFLAGS="-X" ./configure --with-whatever
# $ bin/make2cmake
# $ mkdir build
# $ cd build
# $ cmake -DCMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make ..
# $ cmake ..
# $ make VERBOSE=1
#
# The autoconf CXXFLAGS flow through to 'target_compile_options()' (etc)
# directives in the 'CMakeLists' files; other autoconf options flow
# through the 'config.status' file.
#
# See also: winbuild.pl
#
@ -39,87 +44,62 @@ use File::Basename ;
use File::Spec ;
use File::Copy ;
use lib dirname($0) ;
use ConfigStatus ;
use AutoMakeParser ;
$AutoMakeParser::debug = 0 ;
my $cfg_verbose = 1 ;
my $cfg_project = "emailrelay" ;
# makefile conditionals
my %switches = (
GCONFIG_BSD => 0 ,
GCONFIG_GUI => 0 ,
GCONFIG_ICONV => 0 ,
GCONFIG_INSTALL_HOOK => 0 ,
GCONFIG_INTERFACE_NAMES => 1 ,
GCONFIG_MAC => 0 ,
GCONFIG_PAM => 0 ,
GCONFIG_TESTING => 0 ,
GCONFIG_TLS_USE_BOTH => 0 ,
GCONFIG_TLS_USE_MBEDTLS => 0 ,
GCONFIG_TLS_USE_NONE => 0 ,
GCONFIG_TLS_USE_OPENSSL => 1 ,
GCONFIG_WINDOWS => 0 ,
my $cs = new ConfigStatus( "config.status" ) ;
my %switches = $cs->switches() ;
my %vars = $cs->vars() ;
my %qt_config = (
dirs => { "gui" => 1 } ,
targets => { "emailrelay-gui.real" => 1 } ,
) ;
# makefile expansion variables -- many are required but not relevant
my %vars = (
top_srcdir => "." ,
top_builddir => "." ,
sbindir => "." ,
mandir => "." ,
localedir => "." ,
e_spooldir => "/var/spool/emailrelay" ,
e_docdir => "." ,
e_initdir => "." ,
e_bsdinitdir => "." ,
e_rundir => "." ,
e_icondir => "." ,
e_examplesdir => "." ,
e_libexecdir => "." ,
e_pamdir => "." ,
e_sysconfdir => "/etc" ,
GCONFIG_WINDRES => "" ,
GCONFIG_WINDMC => "" ,
GCONFIG_QT_LIBS => "" ,
GCONFIG_QT_CFLAGS => "" ,
GCONFIG_QT_MOC => "" ,
GCONFIG_TLS_LIBS => "-lssl -lcrypto" ,
GCONFIG_STATIC_START => "" ,
GCONFIG_STATIC_END => "" ,
RPM_ARCH => "x86" ,
RPM_ROOT => "rpm" ,
VERSION => FileHandle->new("VERSION")->gets() ,
) ;
$vars{top_srcdir} = "." ;
$vars{top_builddir} = "." ;
run_generate( "emailrelay" , \%switches , \%vars ) ;
create_cmake_files( $cfg_project , \%switches , \%vars , \%qt_config ) ;
create_empty_gconfig_header() ;
# ==
sub create_cmake_file
{
my ( $project , $m , $switches ) = @_ ;
my ( $project , $m , $switches , $vars , $qt_config ) = @_ ;
my $path = join( "/" , dirname($m->path()) , "CMakeLists.txt" ) ;
print "cmake-file=[$path]\n" ;
_log( "cmake-file=[$path]" ) ;
my $fh = new FileHandle( $path , "w" ) or die ;
my $compile_options = "-std=c++11 -pthread" ;
my $link_options = "-pthread" ;
my $link_options = $m->link_options() ;
my $compile_options = $m->compile_options() ;
$compile_options = join(" ",$compile_options,"-std=c++11") if( $compile_options !~ m/std=c++/ ) ;
print $fh "# $path -- generated by $0\n" ;
if( $project )
{
print $fh "cmake_minimum_required(VERSION 2.8.11)\n" ;
print $fh "cmake_minimum_required(VERSION 3.12)\n" ;
print $fh "project($project)\n" ;
print $fh "add_compile_options($compile_options)\n" ;
}
print $fh "\n" ;
if( exists $qt_config->{dirs}->{basename(dirname($m->path()))} )
{
print $fh "\n" ;
print $fh "find_package(Qt5 REQUIRED COMPONENTS Widgets Gui Core)\n" ;
}
print $fh "\n" if $m->subdirs() ;
for my $subdir ( $m->subdirs() )
{
print $fh "add_subdirectory($subdir)\n" ;
}
my $definitions = join( " " , "G_UNIX=1" , $m->definitions() ) ;
my $definitions = join( " " , $m->definitions() ) ;
my $includes = join( " " , "." , ".." , $m->includes($m->top()) ) ;
my @libraries = $m->libraries() ;
@ -130,8 +110,10 @@ sub create_cmake_file
( my $library_key = $library ) =~ s/\.a$// ; $library_key =~ s/^lib// ;
print $fh "\n" ;
print $fh "add_library($library_key $sources)\n" ;
print $fh "target_compile_options($library_key PUBLIC $compile_options)\n" ;
print $fh "target_include_directories($library_key PUBLIC $includes)\n" ;
print $fh "target_compile_definitions($library_key PUBLIC $definitions)\n" ;
print $fh "set_target_properties($library_key PROPERTIES AUTOMOC ON)\n" if exists $qt_config->{targets}->{$library_key} ;
}
my @programs = $m->programs() ;
@ -147,9 +129,11 @@ sub create_cmake_file
print $fh "\n" ;
print $fh "add_executable($program $program_sources)\n" ;
print $fh "target_link_options($program PUBLIC $link_options)\n" ; # cmake 3.13
print $fh "target_include_directories($program PUBLIC $program_includes)\n" ;
print $fh "target_compile_definitions($program PUBLIC $definitions)\n" ;
print $fh "target_link_libraries($program $link_options $program_libs)\n" ;
print $fh "target_link_libraries($program $program_libs)\n" ;
print $fh "set_target_properties($program PROPERTIES AUTOMOC ON)\n" if exists $qt_config->{targets}->{$program} ;
}
$fh->close() or die ;
@ -157,25 +141,18 @@ sub create_cmake_file
sub create_cmake_files
{
my ( $project , $switches , $vars ) = @_ ;
my ( $project , $switches , $vars , $qt_config ) = @_ ;
my @makefiles = AutoMakeParser::readall( "." , $switches , $vars , 1 ) ;
my @makefiles = AutoMakeParser::readall( "." , $switches , $vars , $cfg_verbose , "make2cmake: " ) ;
my $first = 1 ;
for my $m ( @makefiles )
{
create_cmake_file( $first?$project:undef , $m , $switches ) ;
create_cmake_file( $first?$project:undef , $m , $switches , $vars , $qt_config ) ;
$first = 0 ;
}
}
sub run_generate
{
my ( $project , $switches , $vars ) = @_ ;
create_cmake_files( $project , $switches , $vars ) ;
create_gconfig_header() ;
}
sub create_gconfig_header
sub create_empty_gconfig_header
{
my $path = "src/gconfig_defs.h" ;
if( ! -f $path )
@ -185,3 +162,8 @@ sub create_gconfig_header
}
}
sub _log
{
print "make2cmake: " , @_ , "\n" if $cfg_verbose ;
}

View File

@ -34,6 +34,7 @@
# winbuild::clean_cmake_cache_files(...) ;
# winbuild::deltree(...) ;
# winbuild::run_msbuild(...) ;
# winbuild::translate(...) ;
# winbuild::create_touchfile(...) ;
# winbuild::read_makefiles(...) ;
# winbuild::read_makefiles_imp(...) ;
@ -145,7 +146,9 @@ sub default_touchfile
sub _path_dirs
{
return split( ";" , $ENV{PATH} ) ;
my $path = $ENV{PATH} ;
my $sep = ( $path =~ m/;/ ) ? ";" : ":" ;
return split( $sep , $path ) ;
}
sub _sanepath
@ -175,6 +178,7 @@ sub _find_under
my $result ;
for my $dir ( map {_sanepath($_)} @dirs )
{
next if !$dir ;
my @find_list = () ;
File::Find::find( sub { push @find_list , $File::Find::name if lc($_) eq $fname } , $dir ) ;
if( @find_list ) { $result = Cwd::realpath($find_list[0]) ; last }
@ -326,6 +330,19 @@ sub run_msbuild
die unless $rc == 0 ;
}
sub translate
{
my ( $arch , $qt_dirs , $xx_XX , $xx ) = @_ ;
my $dir = $qt_dirs->{$arch} ;
$dir = File::Basename::dirname( $dir ) ;
$dir = File::Basename::dirname( $dir ) ;
$dir = File::Basename::dirname( $dir ) ;
my $tool = join( "/" , $dir , "bin" , "lrelease.exe" ) ;
my $rc = system( $tool , "src/gui/emailrelay_tr.$xx_XX.ts" , "-qm" , "src/gui/emailrelay.$xx.qm" ) ;
print "lrelease-exit=[$rc]\n" ;
die unless $rc == 0 ;
}
sub create_touchfile
{
my ( $touchfile ) = @_ ;

0
bootstrap Executable file → Normal file
View File

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -99,7 +99,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@ -215,6 +215,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -251,6 +252,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -304,8 +306,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -358,7 +360,10 @@ ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \

1335
configure vendored

File diff suppressed because it is too large Load Diff

19
configure.ac Normal file → Executable file
View File

@ -19,11 +19,11 @@ dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT([E-MailRelay],[2.2],[],[emailrelay])
AC_INIT([E-MailRelay],[2.2.1],[],[emailrelay])
AC_CONFIG_SRCDIR([src/glib/gdef.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([no-define])
AC_CONFIG_HEADERS([gconfig_defs.h])
AC_CONFIG_HEADERS([src/gconfig_defs.h])
AM_MAINTAINER_MODE
AC_DISABLE_OPTION_CHECKING
@ -59,17 +59,18 @@ GCONFIG_FN_CHECK_CXX
GCONFIG_FN_CHECK_NET
GCONFIG_FN_CHECK_FUNCTIONS
dnl check for packages
dnl
GCONFIG_FN_QT
GCONFIG_FN_TLS_OPENSSL
GCONFIG_FN_TLS_MBEDTLS
dnl initialise aclocal/pkg.m4
dnl
# if the configure script fails in this area then you are probably missing pkg.m4
PKG_PROG_PKG_CONFIG([0.9.0])
dnl check for packages
dnl
GCONFIG_FN_QT
GCONFIG_FN_QT_BUILD
GCONFIG_FN_TLS_OPENSSL
GCONFIG_FN_TLS_MBEDTLS
dnl possibly enable full gettext support -- uncomment this after running
dnl 'gettextize' and remove the other gettext lines below
dnl
@ -115,6 +116,8 @@ AC_ARG_WITH([mbedtls],AS_HELP_STRING([--with-mbedtls],[use mbedtls for tls layer
GCONFIG_FN_TLS
AC_ARG_WITH([pam],AS_HELP_STRING([--with-pam],[use linux pam for authentication (default auto)]))
GCONFIG_FN_WITH_PAM
AC_ARG_WITH([uds],AS_HELP_STRING([--with-uds],[enable unix domain sockets (default auto)]))
GCONFIG_FN_WITH_UDS
dnl directory tweaking -- define e_ prefixed directory variables
dnl

View File

@ -22,13 +22,15 @@
# directories depending on the host environment and simplifies
# cross-compilation.
#
# usage: configure.sh [-g] [{-d|-s <>}] [{-o|-m|-p}] -- [<configure-options>]
# -d add debug compiler flags
# -s add sanitiser compiler flags (eg. -s address)
# -o cross-compile for openwrt (edit as required)
# -m cross-compile for windows with mingw-w64
# -p cross-compile for rpi
# -g git-clone mbedtls
# usage: configure.sh [-g] [{-d|-s <>}] [{-o|-w|-p}] -- [<configure-options>]
# -d add debug compiler flags
# -s add sanitiser compiler flags (eg. -s address)
# -o cross-compile for openwrt (edit as required)
# -w cross-compile for windows 32-bit with mingw-w64
# -w32 cross-compile for windows 32-bit with mingw-w64
# -w64 cross-compile for windows 64-bit with mingw-w64
# -p cross-compile for rpi
# -g git-clone mbedtls and exit
#
# For systemd add "e_systemddir=/usr/lib/systemd/system".
#
@ -39,16 +41,18 @@
thisdir="`cd \`dirname $0\` && pwd`"
usage="[-g] [{-d|-s <>}] [{-o|-m|-p}] -- <configure-args>"
usage="[-g] [{-d|-s <>}] [{-o|-w|-p}] -- <configure-args>"
while expr "x$1" : "x-" >/dev/null
do
valued=0
case "`echo \"$1\" | sed 's/^-//'`" in
case "`echo \"$1\" | sed 's/^--*//'`" in
g) opt_git=1 ;;
d) opt_debug=1 ;;
s) opt_sanitise="$2" ; valued=1 ;;
o) opt_openwrt=1 ;;
m) opt_mingw=1 ;;
w) opt_mingw=1 ; opt_win=32 ;;
w32) opt_mingw=1 ; opt_win=32 ;;
w64) opt_mingw=1 ; opt_win=64 ;;
p) opt_rpi=1 ;;
h) echo usage: `basename $0` $usage "..." ; $thisdir/configure --help=short ; exit 0 ;;
#\?) echo usage: `basename $0` $usage >&2 ; exit 2 ;;
@ -71,6 +75,14 @@ fi
if test "0$opt_git" -eq 1
then
git clone https://salsa.debian.org/debian/mbedtls.git
e="$?"
sed -i 's/defined._TRUNCATE./0/' mbedtls/library/platform.c
if test "$e" -eq 0 -a "0$opt_mingw" -eq 0
then
echo build with...
echo " make -C mbedtls/library WINDOWS=0"
fi
exit "$e"
fi
enable_debug=""
@ -114,7 +126,12 @@ fi
if test "0$opt_mingw" -eq 1
then
TARGET="i686-w64-mingw32"
if test "$opt_win" -eq 32
then
TARGET="i686-w64-mingw32" # 32-bit binaries
else
TARGET="x86_64-w64-mingw32" # 64-bit binaries
fi
export CXX="$TARGET-g++-posix"
export CC="$TARGET-gcc-posix"
export AR="$TARGET-ar"

17
debian/Makefile.in vendored
View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -98,7 +98,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@ -185,6 +185,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -221,6 +222,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -281,8 +283,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -300,7 +302,10 @@ ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \

7
debian/changelog vendored
View File

@ -1,3 +1,10 @@
emailrelay (2.2.1) unstable; urgency=low
* Unix domain sockets supported (eg. "--interface=/tmp/smtp.s").
* Windows event log not used for verbose logging (prefer "--log-file").
* New admin 'forward' command to trigger forwarding without waiting.
* Support for MbedTLS version 3.
-- maintainer graeme_walker <graeme_walker@users.sourceforge.net> Tue, 14 Feb 2022 00:00:00 +0000
emailrelay (2.2) unstable; urgency=low
* Connections from IPv4 'private use' addresses are allowed by default (see "--remote-clients").
* Interface names can be used with "--interface" (eg. "--interface=eth0").

View File

@ -12,3 +12,7 @@ ExecStart=/etc/init.d/emailrelay start
ExecStop=/etc/init.d/emailrelay stop
PIDFile=/run/emailrelay/emailrelay.pid
SuccessExitStatus=0 143
[Install]
WantedBy=multi-user.target

0
debian/postinst vendored Executable file → Normal file
View File

0
debian/postrm vendored Executable file → Normal file
View File

0
debian/preinst vendored Executable file → Normal file
View File

0
debian/prerm vendored Executable file → Normal file
View File

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -100,7 +100,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SCRIPTS = $(noinst_SCRIPTS)
@ -220,6 +220,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -256,6 +257,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -372,8 +374,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -453,7 +455,10 @@ ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \

View File

@ -8,8 +8,15 @@
<body>
<!-- index:0::::E-MailRelay Change Log -->
<div class="div-main">
<h1><a class="a-header" name="H_1">E-MailRelay Change Log</a></h1> <!-- index:1:H:1::E-MailRelay Change Log -->
<h2><a class="a-header" name="SH_1_1">2.1 -> 2.2</a></h2> <!-- index:2:SH:1:1:2.1 -> 2.2 -->
<h1><a class="a-header" name="H_1">E-MailRelay Change Log</a></h1> <!-- index:1:H:E-MailRelay Change Log -->
<h2><a class="a-header" name="SH_1_1">2.2 -> 2.2.1</a></h2> <!-- index:2:SH:1:1:2.2 -> 2.2.1 -->
<ul>
<li>Unix domain sockets supported (eg. <em>--interface=/tmp/smtp.s</em>.</li>
<li>Windows event log not used for verbose logging (prefer <em>--log-file</em>).</li>
<li>New admin <em>forward</em> command to trigger forwarding without waiting.</li>
<li>Support for MbedTLS version 3.</li>
</ul>
<h2><a class="a-header" name="SH_1_2">2.1 -> 2.2</a></h2> <!-- index:2:SH:1:2:2.1 -> 2.2 -->
<ul>
<li>Connections from IPv4 'private use' addresses are allowed by default (see <em>--remote-clients</em>).</li>
<li>Interface names can be used with <em>--interface</em> (eg. <em>--interface=eth0</em>).</li>
@ -25,14 +32,14 @@
<li>Support for Windows XP restored when built with mingw-w64.</li>
<li>C++ 2011 compiler is required.</li>
</ul>
<h2><a class="a-header" name="SH_1_2">2.0.1 -> 2.1</a></h2> <!-- index:2:SH:1:2:2.0.1 -> 2.1 -->
<h2><a class="a-header" name="SH_1_3">2.0.1 -> 2.1</a></h2> <!-- index:2:SH:1:3:2.0.1 -> 2.1 -->
<ul>
<li>Backwards compatibility features for 1.9-to-2.0 transition removed.</li>
<li>Better handling of too-many-connections on Windows.</li>
<li>New <em>--idle-timeout</em> option for server-side connections.</li>
<li>Support for RFC-5782 DNSBL blocking (<em>--dnsbl</em>).</li>
<li>Filter scripts are given the path of the envelope file in argv2.</li>
<li>Message files can be editied by <em>--client-filter</em> scripts.</li>
<li>Message files can be edited by <em>--client-filter</em> scripts.</li>
<li>Better support for CRAM-SHAx authentication.</li>
<li>New <em>--client-auth-config</em> and <em>--server-auth-config</em> options.</li>
<li>New <em>--show</em> option on windows to better control the user interface style.</li>
@ -42,11 +49,11 @@
<li>Certificate contents are not logged.</li>
<li>Timestamp parts of spool filenames no longer limited to six digits.</li>
</ul>
<h2><a class="a-header" name="SH_1_3">2.0 -> 2.0.1</a></h2> <!-- index:2:SH:1:3:2.0 -> 2.0.1 -->
<h2><a class="a-header" name="SH_1_4">2.0 -> 2.0.1</a></h2> <!-- index:2:SH:1:4:2.0 -> 2.0.1 -->
<ul>
<li>Make PLAIN client authentication work against servers with broken 334 responses.</li>
</ul>
<h2><a class="a-header" name="SH_1_4">1.9.2 -> 2.0</a></h2> <!-- index:2:SH:1:4:1.9.2 -> 2.0 -->
<h2><a class="a-header" name="SH_1_5">1.9.2 -> 2.0</a></h2> <!-- index:2:SH:1:5:1.9.2 -> 2.0 -->
<ul>
<li>Improved IPv6 support, with IPv4 and IPv6 used independently at run-time (see <em>--interface</em>).</li>
<li>Server process is not blocked during <em>--filter</em> or <em>--address-verifier</em> execution, if multi-threaded.</li>
@ -77,7 +84,7 @@
<li>C++ 2011 is preferred, and required for multi-threading.</li>
<li>Support for very old versions of Windows is dropped.</li>
</ul>
<h2><a class="a-header" name="SH_1_5">1.9.1 -> 1.9.2</a></h2> <!-- index:2:SH:1:5:1.9.1 -> 1.9.2 -->
<h2><a class="a-header" name="SH_1_6">1.9.1 -> 1.9.2</a></h2> <!-- index:2:SH:1:6:1.9.1 -> 1.9.2 -->
<ul>
<li>Fixed a leak in the event-loop garbage collection.</li>
<li>A local hostname that fails to resolve is not an error.</li>
@ -93,11 +100,11 @@
<li>Qt4 or Qt5 selected by the <em>configure</em> script.</li>
<li>Improved the RPM spec file.</li>
</ul>
<h2><a class="a-header" name="SH_1_6">1.9 -> 1.9.1</a></h2> <!-- index:2:SH:1:6:1.9 -> 1.9.1 -->
<h2><a class="a-header" name="SH_1_7">1.9 -> 1.9.1</a></h2> <!-- index:2:SH:1:7:1.9 -> 1.9.1 -->
<ul>
<li>Updated OpenSSL from 1.0.1e to 1.0.1g in the Windows build.</li>
</ul>
<h2><a class="a-header" name="SH_1_7">1.8.2 -> 1.9</a></h2> <!-- index:2:SH:1:7:1.8.2 -> 1.9 -->
<h2><a class="a-header" name="SH_1_8">1.8.2 -> 1.9</a></h2> <!-- index:2:SH:1:8:1.8.2 -> 1.9 -->
<ul>
<li>Added negotiated TLS/SSL for POP (ie. <em>STLS</em>).</li>
<li>The first two fields in the secrets files are reordered (with backwards compatibility).</li>
@ -122,17 +129,17 @@
<li>Added Windows <em>--peer-lookup</em> option.</li>
<li>Fix for MD5 code in 64-bit builds.</li>
</ul>
<h2><a class="a-header" name="SH_1_8">1.8.1 -> 1.8.2</a></h2> <!-- index:2:SH:1:8:1.8.1 -> 1.8.2 -->
<h2><a class="a-header" name="SH_1_9">1.8.1 -> 1.8.2</a></h2> <!-- index:2:SH:1:9:1.8.1 -> 1.8.2 -->
<ul>
<li>Fix namespaces for gcc 3.4.</li>
</ul>
<h2><a class="a-header" name="SH_1_9">1.8 -> 1.8.1</a></h2> <!-- index:2:SH:1:9:1.8 -> 1.8.1 -->
<h2><a class="a-header" name="SH_1_10">1.8 -> 1.8.1</a></h2> <!-- index:2:SH:1:10:1.8 -> 1.8.1 -->
<ul>
<li>Changed the definition of <em>--as-proxy</em> to use <em>--poll 0</em> rather than <em>--immediate</em> [bug-id 1961652].</li>
<li>Fixed stalling bug when using server-side TLS/SSL (<em>--server-tls</em>) [bug-id 1961655].</li>
<li>Improved Debian packaging for Linux (<em>make deb</em>).</li>
</ul>
<h2><a class="a-header" name="SH_1_10">1.7 -> 1.8</a></h2> <!-- index:2:SH:1:10:1.7 -> 1.8 -->
<h2><a class="a-header" name="SH_1_11">1.7 -> 1.8</a></h2> <!-- index:2:SH:1:11:1.7 -> 1.8 -->
<ul>
<li>Speed optimisations (as identified by KCachegrind/valgrind in KDevelop).</li>
<li>Build-time size optimisations (eg. <em>./configure --disable-exec --enable-small-exceptions ...</em>).</li>
@ -148,7 +155,7 @@
<li>Improved native support for Mac OS X (10.5) with graphical installation from disk image.</li>
<li>Compatibility with gcc 2.95 restored.</li>
</ul>
<h2><a class="a-header" name="SH_1_11">1.6 -> 1.7</a></h2> <!-- index:2:SH:1:11:1.6 -> 1.7 -->
<h2><a class="a-header" name="SH_1_12">1.6 -> 1.7</a></h2> <!-- index:2:SH:1:12:1.6 -> 1.7 -->
<ul>
<li>TLS/SSL support for SMTP using OpenSSL (<em>./configure --with-openssl</em> with <em>--client-tls</em> and <em>--server-tls</em>).</li>
<li>Authentication mechanism <em>PLAIN</em> added.</li>
@ -156,7 +163,7 @@
<li>Windows service wrapper has an <em>--uninstall</em> option.</li>
<li>Windows installation GUI uninstalls the service before reinstalling it.</li>
</ul>
<h2><a class="a-header" name="SH_1_12">1.5 -> 1.6</a></h2> <!-- index:2:SH:1:12:1.5 -> 1.6 -->
<h2><a class="a-header" name="SH_1_13">1.5 -> 1.6</a></h2> <!-- index:2:SH:1:13:1.5 -> 1.6 -->
<ul>
<li>GPLv3 licence (see <em>http://gplv3.fsf.org</em>).</li>
<li>New <em>--prompt-timeout</em> switch for the timeout when waiting for the initial 220 prompt from the SMTP server.</li>
@ -176,7 +183,7 @@
<li>Experimental SpamAssassin spamc/spamd protocol support.</li>
<li>Acceptance tests added to the distribution.</li>
</ul>
<h2><a class="a-header" name="SH_1_13">1.4 -> 1.5</a></h2> <!-- index:2:SH:1:13:1.4 -> 1.5 -->
<h2><a class="a-header" name="SH_1_14">1.4 -> 1.5</a></h2> <!-- index:2:SH:1:14:1.4 -> 1.5 -->
<ul>
<li>New installation and configuration GUI using TrollTech Qt 4.x (<em>./configure --enable-gui</em>)</li>
<li>Default address verifier accepts all addresses as valid and never treats them as local mailboxes.</li>
@ -191,7 +198,7 @@
<li>Documentation also created in docbook format (requires xmlto).</li>
<li>Windows installation document revised.</li>
</ul>
<h2><a class="a-header" name="SH_1_14">1.3.3 -> 1.4</a></h2> <!-- index:2:SH:1:14:1.3.3 -> 1.4 -->
<h2><a class="a-header" name="SH_1_15">1.3.3 -> 1.4</a></h2> <!-- index:2:SH:1:15:1.3.3 -> 1.4 -->
<ul>
<li>POP3 server (enable with <em>--pop</em>, disable at build-time with <em>./configure --disable-pop</em>).</li>
<li>Fix for logging reentrancy bug (affects <em>./configure --enable-debug</em> with <em>--debug</em>).</li>
@ -205,7 +212,7 @@
<li>The <em>--dont-listen</em> switch is now <em>--no-smtp</em>.</li>
<li>Better IPv6 support (Linux only).</li>
</ul>
<h2><a class="a-header" name="SH_1_15">1.3.2 -> 1.3.3</a></h2> <!-- index:2:SH:1:15:1.3.2 -> 1.3.3 -->
<h2><a class="a-header" name="SH_1_16">1.3.2 -> 1.3.3</a></h2> <!-- index:2:SH:1:16:1.3.2 -> 1.3.3 -->
<ul>
<li>No bind() for outgoing connections [bug-id 1051689].</li>
<li>Updated rpm spec file [bug-id 1224850].</li>
@ -214,21 +221,21 @@
<li>Documentation of <em>auth</em> switches corrected.</li>
<li>State-machine template type declaration modernised, possibly breaking older compilers.</li>
</ul>
<h2><a class="a-header" name="SH_1_16">1.3.1 -> 1.3.2</a></h2> <!-- index:2:SH:1:16:1.3.1 -> 1.3.2 -->
<h2><a class="a-header" name="SH_1_17">1.3.1 -> 1.3.2</a></h2> <!-- index:2:SH:1:17:1.3.1 -> 1.3.2 -->
<ul>
<li>Fix for core dump when <em>--client-filter</em> pre-processing fails.</li>
<li>Revised code structure to prepare for asynchronous pre-processing.</li>
<li>Better diagnostics when pre-processor exec() fails.</li>
<li>Better cleanup of empty and orphaned files.</li>
</ul>
<h2><a class="a-header" name="SH_1_17">1.3 -> 1.3.1</a></h2> <!-- index:2:SH:1:17:1.3 -> 1.3.1 -->
<h2><a class="a-header" name="SH_1_18">1.3 -> 1.3.1</a></h2> <!-- index:2:SH:1:18:1.3 -> 1.3.1 -->
<ul>
<li>Windows resource leak from CreateProcess() fixed.</li>
<li>Windows dialog box double-close fix.</li>
<li>Some documentation for the <em>--scanner</em> switch.</li>
<li>New usage patterns section in the user guide.</li>
</ul>
<h2><a class="a-header" name="SH_1_18">1.2 -> 1.3</a></h2> <!-- index:2:SH:1:18:1.2 -> 1.3 -->
<h2><a class="a-header" name="SH_1_19">1.2 -> 1.3</a></h2> <!-- index:2:SH:1:19:1.2 -> 1.3 -->
<ul>
<li>Client protocol waits for a greeting from the server on startup [bug-id 842156].</li>
<li>Fix for incorrect backslash normalisation on <em>--verifier</em> command-lines containing spaces [bug-id 890646].</li>
@ -241,7 +248,7 @@
<li>New switches for the <em>configure</em> script.</li>
<li>More JavaScript example scripts.</li>
</ul>
<h2><a class="a-header" name="SH_1_19">1.1.2 -> 1.2</a></h2> <!-- index:2:SH:1:19:1.1.2 -> 1.2 -->
<h2><a class="a-header" name="SH_1_20">1.1.2 -> 1.2</a></h2> <!-- index:2:SH:1:20:1.1.2 -> 1.2 -->
<ul>
<li>The <em>--filter</em> and <em>--verifier</em> arguments interpreted as command-lines; spaces in executable paths now need escaping.</li>
<li>The <em>--interface</em> switch applies to outgoing connections too.</li>
@ -250,7 +257,7 @@
<li>Fix for dangling reference bug, seen after <em>quit</em> command on Windows.</li>
<li>JavaScript examples in the documentation.</li>
</ul>
<h2><a class="a-header" name="SH_1_20">1.1.1 -> 1.1.2</a></h2> <!-- index:2:SH:1:20:1.1.1 -> 1.1.2 -->
<h2><a class="a-header" name="SH_1_21">1.1.1 -> 1.1.2</a></h2> <!-- index:2:SH:1:21:1.1.1 -> 1.1.2 -->
<ul>
<li>Earlier check for un-bindable ports on startup, and later fork()ing [bug-id 776972].</li>
<li>Resolved the file-descriptor kludge for <em>--verifier</em> on Windows.</li>
@ -259,7 +266,7 @@
<li>Pre-processor (<em>--filter</em>) program's standard output searched for a failure reason string.</li>
<li>Undocumented <em>--scanner</em> switch added for asynchronous processing by a separate network server.</li>
</ul>
<h2><a class="a-header" name="SH_1_21">1.1.0 -> 1.1.1</a></h2> <!-- index:2:SH:1:21:1.1.0 -> 1.1.1 -->
<h2><a class="a-header" name="SH_1_22">1.1.0 -> 1.1.1</a></h2> <!-- index:2:SH:1:22:1.1.0 -> 1.1.1 -->
<ul>
<li>Restored the fix for building with gcc2.96.</li>
<li>Support for MinGW builds on Windows.</li>
@ -269,7 +276,7 @@
<li>Fix for <em>make install</em> when <em>man2html</em> is not available.</li>
<li>Updated init script.</li>
</ul>
<h2><a class="a-header" name="SH_1_22">1.0.2 -> 1.1.0</a></h2> <!-- index:2:SH:1:22:1.0.2 -> 1.1.0 -->
<h2><a class="a-header" name="SH_1_23">1.0.2 -> 1.1.0</a></h2> <!-- index:2:SH:1:23:1.0.2 -> 1.1.0 -->
<ul>
<li>In proxy mode unexpected client-side disconnects and timeouts do not leave <em>.bad</em> files [see also bug-id 659039].</li>
<li>By default proxy mode does not interpret addresses for local delivery (<em>--postmaster</em>).</li>
@ -284,14 +291,14 @@
<li>Support for Sun WorkShop 5.0 added.</li>
<li>Documentation overhaul.</li>
</ul>
<h2><a class="a-header" name="SH_1_23">1.0.0 -> 1.0.2</a></h2> <!-- index:2:SH:1:23:1.0.0 -> 1.0.2 -->
<h2><a class="a-header" name="SH_1_24">1.0.0 -> 1.0.2</a></h2> <!-- index:2:SH:1:24:1.0.0 -> 1.0.2 -->
<ul>
<li>Support for trusted IP addresses, allowing certain clients to avoid authentication.</li>
<li>Address verifier interface extended to include authentication information.</li>
<li>New public mail relay section added to the user guide.</li>
<li>Example verifier scripts etc. added to the reference guide.</li>
</ul>
<h2><a class="a-header" name="SH_1_24">1.0.0 -> 1.0.1</a></h2> <!-- index:2:SH:1:24:1.0.0 -> 1.0.1 -->
<h2><a class="a-header" name="SH_1_25">1.0.0 -> 1.0.1</a></h2> <!-- index:2:SH:1:25:1.0.0 -> 1.0.1 -->
<ul>
<li>In proxy mode unexpected client-side disconnects and timeouts result in <em>.bad</em> files [bug-id 659039].</li>
<li>Require successful <em>AUTH</em> before <em>MAIL FROM</em> when using <em>--server-auth</em>.</li>
@ -304,7 +311,7 @@
<li>Fix build when using gcc2.96 rather than gcc2.95 (1.0.0-pl1).</li>
<li>Fix default spool directory in example scripts (1.0.0-pl1).</li>
</ul>
<h2><a class="a-header" name="SH_1_25">0.9.9 -> 1.0.0</a></h2> <!-- index:2:SH:1:25:0.9.9 -> 1.0.0 -->
<h2><a class="a-header" name="SH_1_26">0.9.9 -> 1.0.0</a></h2> <!-- index:2:SH:1:26:0.9.9 -> 1.0.0 -->
<ul>
<li>Briefer <em>--help</em> output; works with <em>--verbose</em>.</li>
<li>Option to listen on a specific network interface (<em>--interface</em>).</li>
@ -317,7 +324,7 @@
<li>EHLO response parsing is now case-insensitive [bug-id 561522].</li>
<li>Fewer missing-secrets warnings [bug-id 564987].</li>
</ul>
<h2><a class="a-header" name="SH_1_26">0.9.8 -> 0.9.9</a></h2> <!-- index:2:SH:1:26:0.9.8 -> 0.9.9 -->
<h2><a class="a-header" name="SH_1_27">0.9.8 -> 0.9.9</a></h2> <!-- index:2:SH:1:27:0.9.8 -> 0.9.9 -->
<ul>
<li>More flexible logging options (<em>--verbose</em> and <em>--debug</em> work better).</li>
<li>File Hierarchy Standard (FHS) option for <em>configure</em> (<em>--enable-fhs</em>).</li>
@ -333,14 +340,14 @@
<li>Submit utility works under Windows. [rc2]</li>
<li>Improved Windows project files. [rc2]</li>
</ul>
<h2><a class="a-header" name="SH_1_27">0.9.7 -> 0.9.8</a></h2> <!-- index:2:SH:1:27:0.9.7 -> 0.9.8 -->
<h2><a class="a-header" name="SH_1_28">0.9.7 -> 0.9.8</a></h2> <!-- index:2:SH:1:28:0.9.7 -> 0.9.8 -->
<ul>
<li>Fix for running pre-processor (<em>--filter</em>) as root.</li>
<li>Ignore bogus <em>AUTH=LOGIN</em> lines in EHLO response.</li>
<li>Submit utility improved to work with mutt.</li>
<li>Installation of submit man page.</li>
</ul>
<h2><a class="a-header" name="SH_1_28">0.9.6 -> 0.9.7</a></h2> <!-- index:2:SH:1:28:0.9.6 -> 0.9.7 -->
<h2><a class="a-header" name="SH_1_29">0.9.6 -> 0.9.7</a></h2> <!-- index:2:SH:1:29:0.9.6 -> 0.9.7 -->
<ul>
<li>CRAM-MD5 authentication mechanism added.</li>
<li>Revoke root permissions at start up, and reclaim them when needed.</li>
@ -356,7 +363,7 @@
<li>Submission utility <em>emailrelay-submit</em> added.</li>
<li>HTML4.0 compliant HTML documentation, using CSS.</li>
</ul>
<h2><a class="a-header" name="SH_1_29">0.9.5 -> 0.9.6</a></h2> <!-- index:2:SH:1:29:0.9.5 -> 0.9.6 -->
<h2><a class="a-header" name="SH_1_30">0.9.5 -> 0.9.6</a></h2> <!-- index:2:SH:1:30:0.9.5 -> 0.9.6 -->
<ul>
<li>SMTP AUTHentication extension -- LOGIN mechanism only.</li>
<li>Client-side protocol timeout.</li>
@ -366,7 +373,7 @@
<li>Multiple hard-coded listening addresses supported at compile-time.</li>
<li>Fix for automatic reopening of stderr stream.</li>
</ul>
<h2><a class="a-header" name="SH_1_30">0.9.4 -> 0.9.5</a></h2> <!-- index:2:SH:1:30:0.9.4 -> 0.9.5 -->
<h2><a class="a-header" name="SH_1_31">0.9.4 -> 0.9.5</a></h2> <!-- index:2:SH:1:31:0.9.4 -> 0.9.5 -->
<p>
Windows fixes and improvements...
</p>
@ -376,14 +383,14 @@
<li>fix for content file deletion</li>
<li>fix for directory iterator</li>
</ul>
<h2><a class="a-header" name="SH_1_31">0.9.3 -> 0.9.4</a></h2> <!-- index:2:SH:1:31:0.9.3 -> 0.9.4 -->
<h2><a class="a-header" name="SH_1_32">0.9.3 -> 0.9.4</a></h2> <!-- index:2:SH:1:32:0.9.3 -> 0.9.4 -->
<ul>
<li>Fixed memory leak when no <em>--log</em> switch.</li>
<li>Windows build is more <em>gui</em> and less <em>command-line</em>.</li>
<li><em>Info</em> command added to the administration interface.</li>
<li>Doxygen files removed from binary RPM.</li>
</ul>
<h2><a class="a-header" name="SH_1_32">0.9.2 -> 0.9.3</a></h2> <!-- index:2:SH:1:32:0.9.2 -> 0.9.3 -->
<h2><a class="a-header" name="SH_1_33">0.9.2 -> 0.9.3</a></h2> <!-- index:2:SH:1:33:0.9.2 -> 0.9.3 -->
<ul>
<li>Proxy mode (<em>--immediate</em> and <em>--as-proxy</em>).</li>
<li>Message pre-processing (<em>--filter</em>).</li>
@ -391,7 +398,7 @@
<li>Improved notification script, with MIME encoding.</li>
<li>Builds with old 2.91 version of gcc.</li>
</ul>
<h2><a class="a-header" name="SH_1_33">0.9.1 -> 0.9.2</a></h2> <!-- index:2:SH:1:33:0.9.1 -> 0.9.2 -->
<h2><a class="a-header" name="SH_1_34">0.9.1 -> 0.9.2</a></h2> <!-- index:2:SH:1:34:0.9.1 -> 0.9.2 -->
<ul>
<li>Better autoconf detection.</li>
<li>Workround for FreeBSD uname() feature.</li>
@ -399,7 +406,7 @@
<li>Fixed a benign directory iterator bug.</li>
<li>Use of gcc's <em>exception</em> header.</li>
</ul>
<h2><a class="a-header" name="SH_1_34">0.9 -> 0.9.1</a></h2> <!-- index:2:SH:1:34:0.9 -> 0.9.1 -->
<h2><a class="a-header" name="SH_1_35">0.9 -> 0.9.1</a></h2> <!-- index:2:SH:1:35:0.9 -> 0.9.1 -->
<ul>
<li>Improved documentation from doxygen.</li>
<li>More complete use of namespaces.</li>

View File

@ -1,6 +1,14 @@
E-MailRelay Change Log
======================
2.2 -> 2.2.1
------------
* Unix domain sockets supported (eg. `--interface=/tmp/smtp.s`).
* Windows event log not used for verbose logging (prefer `--log-file`).
* New admin `forward` command to trigger forwarding without waiting.
* Support for MbedTLS version 3.
2.1 -> 2.2
----------

View File

@ -2,6 +2,14 @@
E-MailRelay Change Log
**********************
2.2 -> 2.2.1
============
* Unix domain sockets supported (eg. *--interface=/tmp/smtp.s*).
* Windows event log not used for verbose logging (prefer *--log-file*).
* New admin *forward* command to trigger forwarding without waiting.
* Support for MbedTLS version 3.
2.1 -> 2.2
==========
@ -27,7 +35,7 @@ E-MailRelay Change Log
* New *--idle-timeout* option for server-side connections.
* Support for RFC-5782_ DNSBL_ blocking (\ *--dnsbl*\ ).
* Filter scripts are given the path of the envelope file in argv2.
* Message files can be editied by *--client-filter* scripts.
* Message files can be edited by *--client-filter* scripts.
* Better support for CRAM-SHAx authentication.
* New *--client-auth-config* and *--server-auth-config* options.
* New *--show* option on windows to better control the user interface style.

View File

@ -1,6 +1,13 @@
E-MailRelay Change Log
======================
2.2 -> 2.2.1
------------
* Unix domain sockets supported (eg. "--interface=/tmp/smtp.s").
* Windows event log not used for verbose logging (prefer "--log-file").
* New admin "forward" command to trigger forwarding without waiting.
* Support for MbedTLS version 3.
2.1 -> 2.2
----------
* Connections from IPv4 'private use' addresses are allowed by default (see "--remote-clients").
@ -24,7 +31,7 @@ E-MailRelay Change Log
* New "--idle-timeout" option for server-side connections.
* Support for RFC-5782 DNSBL blocking ("--dnsbl").
* Filter scripts are given the path of the envelope file in argv2.
* Message files can be editied by "--client-filter" scripts.
* Message files can be edited by "--client-filter" scripts.
* Better support for CRAM-SHAx authentication.
* New "--client-auth-config" and "--server-auth-config" options.
* New "--show" option on windows to better control the user interface style.

View File

@ -366,8 +366,7 @@ Graeme Walker, mailto:<A HREF="mailto:graeme_walker@users.sourceforge.net">graem
</DL>
<HR>
This document was created by
<A HREF="lynxcgi:FOO/cgi-bin/man/man2html">man2html</A>,
<A HREF="lynxcgi:./cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
</BODY>
</HTML>
<!-- Copyright (C) 2001-2021 Graeme Walker <graeme_walker@users.sourceforge.net>. All rights reserved. -->

View File

@ -15,7 +15,7 @@
</p>
<div class="div-pre">
<pre>emailrelay [<option> [<option> ...]] [<config-file>]
<pre>emailrelay [&lt;option&gt; [&lt;option&gt; ...]] [&lt;config-file&gt;]
</pre>
</div><!-- div-pre -->
<p>
@ -595,9 +595,9 @@ envelope="${2}"
ip="`awk '/MailRelay-Client:/ {print $2;exit}' \"${envelope}\"`"
if test "${ip}" = "192.168.0.2"
then
/usr/sbin/sendmail -t < "${content}"
/usr/sbin/sendmail -t &lt; "${content}"
rm -f "${envelope}" "${content}"
exit 100 # <= cancel further processing by emailrelay
exit 100 # &lt;= cancel further processing by emailrelay
fi
exit 0
</pre>
@ -1083,6 +1083,49 @@ password required pam_deny.so
<pre>--as-client ipv4or6.example.com:25 --client-interface 0.0.0.0
--as-client ipv4or6.example.com:25 --client-interface ::</pre>
</div><!-- div-pre -->
<h2><a class="a-header" name="SH_1_99">Unix domain sockets</a></h2> <!-- index:2:SH:1:99:Unix domain sockets -->
<p>
E-MailRelay on Unix will listen on unix-domain sockets instead of IPv4 or IPv6
if the <em>--interface</em> option is given as an absolute file-system path:
</p>
<p>
Eg:
</p>
<div class="div-pre">
<pre>--interface=/run/smtp.s --port=0</pre>
</div><!-- div-pre -->
<p>
When listening on more than one unix-domain socket use the extended form of the
"--interface" option with a prefix of "smtp=", "pop=", or "admin=":
</p>
<p>
Eg:
</p>
<div class="div-pre">
<pre>--interface=smtp=/run/smtp.s --port=0 --interface=pop=/run/pop.s --pop --pop-port=0</pre>
</div><!-- div-pre -->
<p>
The forwarding address can also be a unix-domain address:
</p>
<p>
Eg:
</p>
<div class="div-pre">
<pre>--forward-to=/run/smtp.s</pre>
</div><!-- div-pre -->
<p>
And it is also possible to communicate with message filters over a unix-domain
socket:
</p>
<p>
Eg:
</p>
<div class="div-pre">
<pre>--filter=net:/run/filter.s
--filter=spam:/run/spamd.s
--filter=spam-edit:/run/spamd.s</pre>
</div><!-- div-pre -->
<h2><a class="a-header" name="SH_1_9">SOCKS</a></h2> <!-- index:2:SH:1:9:SOCKS -->
<p>
E-MailRelay can use a SOCKS 4a proxy for establishing outgoing SMTP
@ -1167,7 +1210,7 @@ exit 1
<div class="div-pre">
<pre>#!/bin/sh
# address verifier -- accept as local (250)
echo Local Postmaster '<postmaster@localhost>'
echo Local Postmaster '&lt;postmaster@localhost&gt;'
echo postmaster
exit 0
</pre>
@ -1229,7 +1272,7 @@ exit 100
<pre>#!/bin/sh
# address verifier -- accept only if containing an at sign
address="$1"
expr "$address" : ".*@" > /dev/null || exit 2
expr "$address" : ".*@" &gt; /dev/null || exit 2
echo ""
echo "$address"
exit 1 # accept
@ -1444,13 +1487,14 @@ catch( e )
<div class="div-pre">
<pre>$ emailrelay --as-server --port=125 --forward-to=localhost:25 --admin=10026
$ telnet localhost 10026
E-MailRelay> help
E-MailRelay> quit
E-MailRelay&gt; help
E-MailRelay&gt; quit
</pre>
</div><!-- div-pre -->
<p>
The <em>flush</em> command is used to get the E-MailRelay server to forward spooled
mail to the next SMTP server.
mail to the next SMTP server. The <em>forward</em> command does the same but without
waiting for completion.
</p>
<p>
@ -1497,6 +1541,7 @@ E-MailRelay> quit
<li>e_docdir=&lt;dir&gt;</li>
<li>e_examplesdir=&lt;dir&gt;</li>
<li>e_icondir=&lt;dir&gt;</li>
<li>e_trdir=&lt;dir&gt;</li>
<li>e_initdir=&lt;dir&gt;</li>
<li>e_libexecdir=&lt;dir&gt;</li>
<li>e_pamdir=&lt;dir&gt;</li>

View File

@ -210,7 +210,7 @@ where &lt;option&gt; is:
* \-\-hidden (-H)
Windows only. Hides the application window and disables all message boxes,
overriding any ``--show`` option. This is useful when running as a windows
overriding any `--show` option. This is useful when running as a windows
service.
* \-\-idle-timeout &lt;time&gt;
@ -895,6 +895,37 @@ Eg:
--as-client ipv4or6.example.com:25 --client-interface 0.0.0.0
--as-client ipv4or6.example.com:25 --client-interface ::
Unix domain sockets
-------------------
E-MailRelay on Unix will listen on unix-domain sockets instead of IPv4 or IPv6
if the `--interface` option is given as an absolute file-system path:
Eg:
--interface=/run/smtp.s --port=0
When listening on more than one unix-domain socket use the extended form of the
`--interface` option with a prefix of `smtp=`, `pop=`, or `admin=`:
Eg:
--interface=smtp=/run/smtp.s --port=0 --interface=pop=/run/pop.s --pop --pop-port=0
The forwarding address can also be a unix-domain address:
Eg:
--forward-to=/run/smtp.s
And it is also possible to communicate with message filters over a unix-domain
socket:
Eg:
--filter=net:/run/filter.s
--filter=spam:/run/spamd.s
--filter=spam-edit:/run/spamd.s
SOCKS
-----
E-MailRelay can use a [SOCKS][] 4a proxy for establishing outgoing SMTP
@ -1184,7 +1215,8 @@ simple command-line interface which is compatible with `netcat` and `telnet`:
E-MailRelay> quit
The `flush` command is used to get the E-MailRelay server to forward spooled
mail to the next SMTP server.
mail to the next SMTP server. The `forward` command does the same but without
waiting for completion.
The `list` command lists the messages in the spool directory, `status` provides
network status information and activity statistics, and `notify` enables
@ -1222,6 +1254,7 @@ Installation directories can be defined at build-time by the following
* e_docdir=&lt;dir&gt;
* e_examplesdir=&lt;dir&gt;
* e_icondir=&lt;dir&gt;
* e_trdir=&lt;dir&gt;
* e_initdir=&lt;dir&gt;
* e_libexecdir=&lt;dir&gt;
* e_pamdir=&lt;dir&gt;

View File

@ -213,7 +213,7 @@ where \<option\> is:
* --hidden (-H)
Windows only. Hides the application window and disables all message boxes,
overriding any **--show** option. This is useful when running as a windows
overriding any *--show* option. This is useful when running as a windows
service.
* --idle-timeout \<time\>
@ -938,6 +938,45 @@ Eg:
--as-client ipv4or6.example.com:25 --client-interface 0.0.0.0
--as-client ipv4or6.example.com:25 --client-interface ::
Unix domain sockets
===================
E-MailRelay on Unix will listen on unix-domain sockets instead of IPv4 or IPv6
if the *--interface* option is given as an absolute file-system path:
Eg:
::
--interface=/run/smtp.s --port=0
When listening on more than one unix-domain socket use the extended form of the
*--interface* option with a prefix of *smtp=*, *pop=*, or *admin=*:
Eg:
::
--interface=smtp=/run/smtp.s --port=0 --interface=pop=/run/pop.s --pop --pop-port=0
The forwarding address can also be a unix-domain address:
Eg:
::
--forward-to=/run/smtp.s
And it is also possible to communicate with message filters over a unix-domain
socket:
Eg:
::
--filter=net:/run/filter.s
--filter=spam:/run/spamd.s
--filter=spam-edit:/run/spamd.s
SOCKS
=====
E-MailRelay can use a SOCKS_ 4a proxy for establishing outgoing SMTP
@ -1251,7 +1290,8 @@ simple command-line interface which is compatible with *netcat* and *telnet*:
E-MailRelay> quit
The *flush* command is used to get the E-MailRelay server to forward spooled
mail to the next SMTP server.
mail to the next SMTP server. The *forward* command does the same but without
waiting for completion.
The *list* command lists the messages in the spool directory, *status* provides
network status information and activity statistics, and *notify* enables
@ -1289,6 +1329,7 @@ Installation directories can be defined at build-time by the following
* e_docdir=\<dir\>
* e_examplesdir=\<dir\>
* e_icondir=\<dir\>
* e_trdir=\<dir\>
* e_initdir=\<dir\>
* e_libexecdir=\<dir\>
* e_pamdir=\<dir\>

View File

@ -178,7 +178,7 @@ where <option> is:
# --hidden (-H)
Windows only. Hides the application window and disables all message boxes,
overriding any ""--show"" option. This is useful when running as a windows
overriding any "--show" option. This is useful when running as a windows
service.
# --idle-timeout <time>
@ -820,6 +820,33 @@ Eg:
--as-client ipv4or6.example.com:25 --client-interface 0.0.0.0
--as-client ipv4or6.example.com:25 --client-interface ::
Unix domain sockets
-------------------
E-MailRelay on Unix will listen on unix-domain sockets instead of IPv4 or IPv6
if the "--interface" option is given as an absolute file-system path:
Eg:
--interface=/run/smtp.s --port=0
When listening on more than one unix-domain socket use the extended form of the
"--interface" option with a prefix of "smtp=", "pop=", or "admin=":
Eg:
--interface=smtp=/run/smtp.s --port=0 --interface=pop=/run/pop.s --pop --pop-port=0
The forwarding address can also be a unix-domain address:
Eg:
--forward-to=/run/smtp.s
And it is also possible to communicate with message filters over a unix-domain
socket:
Eg:
--filter=net:/run/filter.s
--filter=spam:/run/spamd.s
--filter=spam-edit:/run/spamd.s
SOCKS
-----
E-MailRelay can use a SOCKS 4a proxy for establishing outgoing SMTP
@ -1109,7 +1136,8 @@ simple command-line interface which is compatible with "netcat" and "telnet":
E-MailRelay> quit
The "flush" command is used to get the E-MailRelay server to forward spooled
mail to the next SMTP server.
mail to the next SMTP server. The "forward" command does the same but without
waiting for completion.
The "list" command lists the messages in the spool directory, "status" provides
network status information and activity statistics, and "notify" enables
@ -1146,6 +1174,7 @@ Installation directories can be defined at build-time by the following
* e_docdir=<dir>
* e_examplesdir=<dir>
* e_icondir=<dir>
* e_trdir=<dir>
* e_initdir=<dir>
* e_libexecdir=<dir>
* e_pamdir=<dir>

View File

@ -431,7 +431,7 @@ WScript.Quit( 0 ) ;
<div class="div-pre">
<pre>#!/bin/sh
spamassassin "$1" > "$1.tmp"
spamassassin "$1" &gt; "$1.tmp"
mv "$1.tmp" "$1"
exit 0
</pre>
@ -441,7 +441,7 @@ exit 0
</p>
<div class="div-pre">
<pre>c:\perl\site\bin\spamassassin.bat %1 > %1.tmp
<pre>c:\perl\site\bin\spamassassin.bat %1 &gt; %1.tmp
ren %1.tmp %1
exit 0</pre>
</div><!-- div-pre -->

View File

@ -9,6 +9,9 @@ setup program "emailrelay-setup.exe" and its associated "payload" files.
Run "emailrelay-setup.exe" as an administrator if you are going to be installing
into protected directories like "Program Files".
You may need to run "vc_redist.x64.exe" first to install the Microsoft C++
run-time files.
The setup GUI will take you through the installation options and then install
the run-time files into your chosen locations.
@ -24,9 +27,10 @@ run the "emailrelay-start.bat" batch file to start the E-MailRelay server, and
you should then see an icon appear in the Windows system tray under the "Show
hidden icons" button.
Note that the "emailrelay-start.bat" file lives under "ProgramData", and although
this might be a hidden directory you can still navigate there by right-clicking
on the E-MailRelay link under "Program Files" and selecting "Open file location".
Note that the "emailrelay-start.bat" file lives under "ProgramData", and
although this might be a hidden directory you can still navigate there by
right-clicking on the "E-MailRelay" link under "Program Files" and selecting
"Open file location".
Configuration
-------------

View File

@ -1,11 +1,11 @@
Summary: Simple e-mail message transfer agent and proxy using SMTP
Name: emailrelay
Version: 2.2
Version: 2.2.1
Release: 1
License: GPL3
Group: System Environment/Daemons
URL: http://emailrelay.sourceforge.net
Source: http://sourceforge.net/projects/emailrelay/files/emailrelay/2.2/emailrelay-2.2-src.tar.gz
Source: http://sourceforge.net/projects/emailrelay/files/emailrelay/2.2/emailrelay-2.2.1-src.tar.gz
BuildRoot: /tmp/emailrelay-install
%description
@ -53,14 +53,11 @@ test "$RPM_BUILD_ROOT" = "/" || rm -rf "$RPM_BUILD_ROOT"
%files
/etc/emailrelay.auth.template
/etc/emailrelay.auth.template
%config /etc/emailrelay.conf
/etc/emailrelay.conf.template
/etc/emailrelay.conf.template
/etc/init.d/emailrelay
%config /etc/pam.d/emailrelay
%config /etc/pam.d/emailrelay
%dir /usr/lib/emailrelay
%attr(2755, root, daemon) /usr/lib/emailrelay/emailrelay-filter-copy
%dir /usr/lib/emailrelay/examples
@ -68,8 +65,6 @@ test "$RPM_BUILD_ROOT" = "/" || rm -rf "$RPM_BUILD_ROOT"
/usr/lib/emailrelay/examples/emailrelay-bcc-check.pl
/usr/lib/emailrelay/examples/emailrelay-deliver.sh
/usr/lib/emailrelay/examples/emailrelay-fail2ban-filter
/usr/lib/emailrelay/examples/emailrelay-fail2ban-filter
/usr/lib/emailrelay/examples/emailrelay-fail2ban-jail
/usr/lib/emailrelay/examples/emailrelay-fail2ban-jail
/usr/lib/emailrelay/examples/emailrelay-ldap-verify.py
/usr/lib/emailrelay/examples/emailrelay-multicast.sh

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -99,7 +99,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@ -217,6 +217,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -253,6 +254,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -325,8 +327,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -428,7 +430,10 @@ ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \

View File

@ -12,3 +12,7 @@ ExecStart=__INIT_DIR__/emailrelay start
ExecStop=__INIT_DIR__/emailrelay stop
PIDFile=__RUN_DIR__/emailrelay.pid
SuccessExitStatus=0 143
[Install]
WantedBy=multi-user.target

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -98,7 +98,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@ -185,6 +185,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -221,6 +222,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -273,8 +275,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -292,7 +294,10 @@ ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \

View File

@ -18,23 +18,9 @@ dnl ----------------------
dnl Checks c++ language features.
dnl
AC_DEFUN([GCONFIG_FN_CHECK_CXX],[
AC_REQUIRE([GCONFIG_FN_CXX_NULLPTR])
AC_REQUIRE([GCONFIG_FN_CXX_CONSTEXPR])
AC_REQUIRE([GCONFIG_FN_CXX_ENUM_CLASS])
AC_REQUIRE([GCONFIG_FN_CXX_NOEXCEPT])
AC_REQUIRE([GCONFIG_FN_CXX_OVERRIDE])
AC_REQUIRE([GCONFIG_FN_CXX_FINAL])
AC_REQUIRE([GCONFIG_FN_CXX_TYPE_TRAITS])
AC_REQUIRE([GCONFIG_FN_CXX_EMPLACE])
AC_REQUIRE([GCONFIG_FN_CXX_ALIGNMENT])
AC_REQUIRE([GCONFIG_FN_CXX_MOVE])
AC_REQUIRE([GCONFIG_FN_CXX_SHARED_PTR])
AC_REQUIRE([GCONFIG_FN_CXX_MAKE_UNIQUE])
AC_REQUIRE([GCONFIG_FN_CXX_STD_THREAD])
AC_REQUIRE([GCONFIG_FN_CXX_STD_WSTRING])
AC_REQUIRE([GCONFIG_FN_CXX_DELETED])
AC_REQUIRE([GCONFIG_FN_CXX_DEFAULTED])
AC_REQUIRE([GCONFIG_FN_CXX_INITIALIZER_LIST])
])
dnl GCONFIG_FN_CHECK_FUNCTIONS
@ -46,6 +32,7 @@ AC_DEFUN([GCONFIG_FN_CHECK_FUNCTIONS],[
AC_REQUIRE([GCONFIG_FN_GETPWNAM_R])
AC_REQUIRE([GCONFIG_FN_GETGRNAM])
AC_REQUIRE([GCONFIG_FN_GETGRNAM_R])
AC_REQUIRE([GCONFIG_FN_GETTEXT])
AC_REQUIRE([GCONFIG_FN_GMTIME_R])
AC_REQUIRE([GCONFIG_FN_GMTIME_S])
AC_REQUIRE([GCONFIG_FN_LOCALTIME_R])
@ -148,6 +135,7 @@ AC_DEFUN([GCONFIG_FN_CHECK_NET],[
AC_REQUIRE([GCONFIG_FN_IFNAMETOINDEX])
AC_REQUIRE([GCONFIG_FN_IFNAMETOLUID])
AC_REQUIRE([GCONFIG_FN_GAISTRERROR])
AC_REQUIRE([GCONFIG_FN_UDS])
])
dnl GCONFIG_FN_CHECK_TYPES
@ -173,6 +161,7 @@ AC_DEFUN([GCONFIG_FN_CHECK_TYPES],[
AC_DEFINE([GCONFIG_HAVE_GID_T],0,[Define true if gid_t is a type]))
AC_REQUIRE([GCONFIG_FN_STATBUF_TIMESPEC])
AC_REQUIRE([GCONFIG_FN_STATBUF_NSEC])
AC_REQUIRE([GCONFIG_FN_IOVEC_SIMPLE])
])
dnl GCONFIG_FN_CXX_ALIGNMENT
@ -205,308 +194,8 @@ AC_DEFUN([GCONFIG_FN_CXX_ALIGNMENT],
fi
])
dnl GCONFIG_FN_CXX_CONSTEXPR
dnl ------------------------
dnl Tests for c++ support for constexpr in a static initialisation.
dnl
AC_DEFUN([GCONFIG_FN_CXX_CONSTEXPR],
[AC_CACHE_CHECK([for c++ constexpr],[gconfig_cv_cxx_constexpr],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[template <typename T> struct Foo {static constexpr int foo = 1;} ;]
],
[
])],
gconfig_cv_cxx_constexpr=yes ,
gconfig_cv_cxx_constexpr=no )
])
if test "$gconfig_cv_cxx_constexpr" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_CONSTEXPR,1,[Define true if compiler supports c++ constexpr])
else
AC_DEFINE(GCONFIG_HAVE_CXX_CONSTEXPR,0,[Define true if compiler supports c++ constexpr])
fi
])
dnl GCONFIG_FN_CXX_DEFAULTED
dnl ----------------------
dnl Tests for c++ =default.
dnl
AC_DEFUN([GCONFIG_FN_CXX_DEFAULTED],
[AC_CACHE_CHECK([for c++ eq default],[gconfig_cv_cxx_defaulted],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#if defined(__GNUC__) && __cplusplus < 200000L]
[#error gcc is too noisy when using =delete without std=c++11]
[#endif]
[struct X { X() = default ; } ;]
] ,
[
])],
gconfig_cv_cxx_defaulted=yes ,
gconfig_cv_cxx_defaulted=no )
])
if test "$gconfig_cv_cxx_defaulted" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_DEFAULTED,1,[Define true if compiler supports c++ =default])
else
AC_DEFINE(GCONFIG_HAVE_CXX_DEFAULTED,0,[Define true if compiler supports c++ =default])
fi
])
dnl GCONFIG_FN_CXX_DELETED
dnl ----------------------
dnl Tests for c++ =delete.
dnl
AC_DEFUN([GCONFIG_FN_CXX_DELETED],
[AC_CACHE_CHECK([for c++ eq delete],[gconfig_cv_cxx_deleted],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#if defined(__GNUC__) && __cplusplus < 200000L]
[#error gcc is too noisy when using =delete without std=c++11]
[#endif]
[struct X { X(const X&) = delete ; } ;]
],
[
])],
gconfig_cv_cxx_deleted=yes ,
gconfig_cv_cxx_deleted=no )
])
if test "$gconfig_cv_cxx_deleted" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_DELETED,1,[Define true if compiler supports c++ =delete])
else
AC_DEFINE(GCONFIG_HAVE_CXX_DELETED,0,[Define true if compiler supports c++ =delete])
fi
])
dnl GCONFIG_FN_CXX_EMPLACE
dnl ----------------------
dnl Tests for c++ std::vector::emplace_back() etc.
dnl
AC_DEFUN([GCONFIG_FN_CXX_EMPLACE],
[AC_CACHE_CHECK([for c++ emplace_back and friends],[gconfig_cv_cxx_emplace],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#include <vector>]
[std::vector<int> v ;]
],
[
[v.emplace_back(1) ;]
])],
gconfig_cv_cxx_emplace=yes ,
gconfig_cv_cxx_emplace=no )
])
if test "$gconfig_cv_cxx_emplace" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_EMPLACE,1,[Define true if compiler has std::vector::emplace_back()])
else
AC_DEFINE(GCONFIG_HAVE_CXX_EMPLACE,0,[Define true if compiler has std::vector::emplace_back()])
fi
])
dnl GCONFIG_FN_CXX_ENUM_CLASS
dnl -------------------------
dnl Tests for c++ support for class enums.
dnl
AC_DEFUN([GCONFIG_FN_CXX_ENUM_CLASS],
[AC_CACHE_CHECK([for c++ class enums],[gconfig_cv_cxx_enum_class],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[enum class Type { t1 , t2 } ;]
[Type t = Type::t1 ;]
],
[
])],
gconfig_cv_cxx_enum_class=yes ,
gconfig_cv_cxx_enum_class=no )
])
if test "$gconfig_cv_cxx_enum_class" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_ENUM_CLASS,1,[Define true if compiler supports c++ class enums])
else
AC_DEFINE(GCONFIG_HAVE_CXX_ENUM_CLASS,0,[Define true if compiler supports c++ class enums])
fi
])
dnl GCONFIG_FN_CXX_FINAL
dnl --------------------
dnl Tests for c++ final keyword.
dnl
AC_DEFUN([GCONFIG_FN_CXX_FINAL],
[AC_CACHE_CHECK([for c++ final keyword],[gconfig_cv_cxx_final],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#if defined(__GNUC__) && __cplusplus < 200000L]
[#error gcc is too noisy when using override/final without std=c++11]
[#endif]
[struct base { virtual void fn() {} } ;]
[struct derived : public base { virtual void fn() final {} } ;]
[derived d ;]
],
[
])],
gconfig_cv_cxx_final=yes ,
gconfig_cv_cxx_final=no )
])
if test "$gconfig_cv_cxx_final" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_FINAL,1,[Define true if compiler supports c++ final keyword])
else
AC_DEFINE(GCONFIG_HAVE_CXX_FINAL,0,[Define true if compiler supports c++ final keyword])
fi
])
dnl GCONFIG_FN_CXX_INITIALIZER_LIST
dnl -------------------------------
dnl Tests for c++ initializer_list.
dnl
AC_DEFUN([GCONFIG_FN_CXX_INITIALIZER_LIST],
[AC_CACHE_CHECK([for c++ initializer_list],[gconfig_cv_cxx_initializer_list],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#include <initializer_list>]
[struct X { X( std::initializer_list<int> ) {} } ;]
],
[
])],
gconfig_cv_cxx_initializer_list=yes ,
gconfig_cv_cxx_initializer_list=no )
])
if test "$gconfig_cv_cxx_initializer_list" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_INITIALIZER_LIST,1,[Define true if compiler supports c++ initializer_list])
else
AC_DEFINE(GCONFIG_HAVE_CXX_INITIALIZER_LIST,0,[Define true if compiler supports c++ initializer_list])
fi
])
dnl GCONFIG_FN_CXX_MOVE
dnl -------------------
dnl Tests for c++ std::move.
dnl
AC_DEFUN([GCONFIG_FN_CXX_MOVE],
[AC_CACHE_CHECK([for c++ std::move],[gconfig_cv_cxx_move],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#include <utility>]
[struct X {} x ;]
[void fn( X&& ) ;]
],
[
[fn( std::move(x) ) ;]
])],
gconfig_cv_cxx_move=yes ,
gconfig_cv_cxx_move=no )
])
if test "$gconfig_cv_cxx_move" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_MOVE,1,[Define true if compiler has std::move()])
else
AC_DEFINE(GCONFIG_HAVE_CXX_MOVE,0,[Define true if compiler has std::move()])
fi
])
dnl GCONFIG_FN_CXX_NOEXCEPT
dnl -----------------------
dnl Tests for c++ noexcept support.
dnl
AC_DEFUN([GCONFIG_FN_CXX_NOEXCEPT],
[AC_CACHE_CHECK([for c++ noexcept],[gconfig_cv_cxx_noexcept],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[void fn() noexcept ;]
],
[
])],
gconfig_cv_cxx_noexcept=yes ,
gconfig_cv_cxx_noexcept=no )
])
if test "$gconfig_cv_cxx_noexcept" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_NOEXCEPT,1,[Define true if compiler supports c++ noexcept])
else
AC_DEFINE(GCONFIG_HAVE_CXX_NOEXCEPT,0,[Define true if compiler supports c++ noexcept])
fi
])
dnl GCONFIG_FN_CXX_NULLPTR
dnl ----------------------
dnl Tests for c++ nullptr keyword.
dnl
AC_DEFUN([GCONFIG_FN_CXX_NULLPTR],
[AC_CACHE_CHECK([for c++ nullptr],[gconfig_cv_cxx_nullptr],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[void * p = nullptr ;]
] ,
[
])],
gconfig_cv_cxx_nullptr=yes ,
gconfig_cv_cxx_nullptr=no )
])
if test "$gconfig_cv_cxx_nullptr" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_NULLPTR,1,[Define true if compiler supports c++ nullptr])
else
AC_DEFINE(GCONFIG_HAVE_CXX_NULLPTR,0,[Define true if compiler supports c++ nullptr])
fi
])
dnl GCONFIG_FN_CXX_OVERRIDE
dnl -----------------------
dnl Tests for c++ override support.
dnl
AC_DEFUN([GCONFIG_FN_CXX_OVERRIDE],
[AC_CACHE_CHECK([for c++ override],[gconfig_cv_cxx_override],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#if defined(__GNUC__) && __cplusplus < 200000L]
[#error gcc is too noisy when using override/final without std=c++11]
[#endif]
[struct base { virtual void fn() {} } ;]
[struct derived : public base { virtual void fn() override {} } ;]
[derived d ;]
],
[
])],
gconfig_cv_cxx_override=yes ,
gconfig_cv_cxx_override=no )
])
if test "$gconfig_cv_cxx_override" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_OVERRIDE,1,[Define true if compiler supports c++ override])
else
AC_DEFINE(GCONFIG_HAVE_CXX_OVERRIDE,0,[Define true if compiler supports c++ override])
fi
])
dnl GCONFIG_FN_CXX_SHARED_PTR
dnl -------------------------
dnl Tests for c++ std::shared_ptr.
dnl
AC_DEFUN([GCONFIG_FN_CXX_SHARED_PTR],
[AC_CACHE_CHECK([for c++ std::shared_ptr and friends],[gconfig_cv_cxx_std_shared_ptr],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#include <memory>]
[typedef std::shared_ptr<int> ptr ;]
],
[
])],
gconfig_cv_cxx_std_shared_ptr=yes ,
gconfig_cv_cxx_std_shared_ptr=no )
])
if test "$gconfig_cv_cxx_std_shared_ptr" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_SHARED_PTR,1,[Define true if compiler has std::shared_ptr])
else
AC_DEFINE(GCONFIG_HAVE_CXX_SHARED_PTR,0,[Define true if compiler has std::shared_ptr])
fi
])
dnl GCONFIG_FN_CXX_SHARED_PTR
dnl -------------------------
dnl GCONFIG_FN_CXX_MAKE_UNIQUE
dnl --------------------------
dnl Tests for c++ std::make_unique.
dnl
AC_DEFUN([GCONFIG_FN_CXX_MAKE_UNIQUE],
@ -625,54 +314,6 @@ AC_DEFUN([GCONFIG_FN_CXX_STD_THREAD],
GCONFIG_FN_CXX_STD_THREAD_IMP([std::thread_asynchronous_script_execution])
])
dnl GCONFIG_FN_CXX_STD_WSTRING
dnl --------------------------
dnl Tests for std::wstring typedef.
dnl
AC_DEFUN([GCONFIG_FN_CXX_STD_WSTRING],
[AC_CACHE_CHECK([for c++ std::wstring],[gconfig_cv_cxx_std_wstring],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#include <string>]
[std::wstring ws;]
],
[
])],
gconfig_cv_cxx_std_wstring=yes ,
gconfig_cv_cxx_std_wstring=no )
])
if test "$gconfig_cv_cxx_std_wstring" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_STD_WSTRING,1,[Define true if compiler has std::wstring])
else
AC_DEFINE(GCONFIG_HAVE_CXX_STD_WSTRING,0,[Define true if compiler has std::wstring])
fi
])
dnl GCONFIG_FN_CXX_TYPE_TRAITS
dnl --------------------------
dnl Tests for c++ <type_traits> std::make_unsigned.
dnl
AC_DEFUN([GCONFIG_FN_CXX_TYPE_TRAITS],
[AC_CACHE_CHECK([for c++ type_traits],[gconfig_cv_cxx_type_traits_make_unsigned],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#include <type_traits>]
[std::make_unsigned<int>::type i = 0U ;]
],
[
])],
gconfig_cv_cxx_type_traits_make_unsigned=yes ,
gconfig_cv_cxx_type_traits_make_unsigned=no )
])
if test "$gconfig_cv_cxx_type_traits_make_unsigned" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_CXX_TYPE_TRAITS_MAKE_UNSIGNED,1,[Define true if compiler has <type_traits> make_unsigned])
else
AC_DEFINE(GCONFIG_HAVE_CXX_TYPE_TRAITS_MAKE_UNSIGNED,0,[Define true if compiler has <type_traits> make_unsigned])
fi
])
dnl GCONFIG_FN_ENABLE_BSD
dnl ---------------------
dnl Enables bsd tweaks if "--enable-bsd" is used. Typically used after
@ -734,39 +375,46 @@ AC_DEFUN([GCONFIG_FN_ENABLE_EPOLL],
dnl GCONFIG_FN_ENABLE_GUI
dnl ---------------------
dnl Allows for "if GCONFIG_GUI" conditionals in makefiles, based on "--enable-gui"
dnl or QT_MOC. Typically used after GCONFIG_FN_QT and AC_ARG_ENABLE(gui).
dnl or "gconfig_have_qt" and "gconfig_qt_build" if "auto". Typically used after
dnl GCONFIG_FN_QT, GCONFIG_FN_QT_BUILD and AC_ARG_ENABLE(gui).
dnl
AC_DEFUN([GCONFIG_FN_ENABLE_GUI],
[
if test "$enable_gui" = "no"
then
QT_MOC=""
fi
if test "$enable_gui" = "yes"
gconfig_gui="no"
:
elif test "$enable_gui" = "yes"
then
gconfig_gui="yes"
if test "$gconfig_have_qt" = "no"
then
AC_MSG_WARN([ignoring --enable-gui: set QT_MOC to override])
QT_MOC=""
AC_MSG_WARN([gui enabled but no qt tools found])
fi
if test "$gconfig_qt_build" = "no"
then
AC_MSG_WARN([gui enabled but qt does not compile])
fi
:
else
if test "$gconfig_have_qt" = "yes" -a "$gconfig_qt_build" = "yes"
then
gconfig_gui="yes"
else
gconfig_gui="no"
fi
fi
if test "$enable_gui" != "no" -a "$QT_MOC" = ""
if test "$gconfig_gui" = "no" -a "$enable_gui" != "no"
then
gconfig_warnings="$gconfig_warnings qt_graphical_user_interface"
fi
if test "$QT_MOC" != ""
then
AC_MSG_NOTICE([QT moc command: $QT_MOC])
fi
AC_SUBST([GCONFIG_QT_LIBS],[$QT_LIBS])
AC_SUBST([GCONFIG_QT_CFLAGS],[$QT_CFLAGS])
AC_SUBST([GCONFIG_QT_MOC],[$QT_MOC])
AM_CONDITIONAL([GCONFIG_GUI],[test "$QT_MOC" != ""])
AM_CONDITIONAL([GCONFIG_GUI],[test "$gconfig_gui" = "yes"])
])
dnl GCONFIG_FN_ENABLE_INSTALL_HOOK
@ -842,7 +490,7 @@ dnl GCONFIG_FN_ENABLE_STD_THREAD
dnl ----------------------------
dnl Defines GCONFIG_ENABLE_STD_THREAD based on the GCONFIG_FN_CXX_STD_THREAD
dnl result, unless "--disable-std-thread" has disabled it. Using
dnl "--disable-std-thread" is useful for current versions of mingw32-w64.
dnl "--disable-std-thread" is useful for old versions of mingw32-w64.
dnl
dnl Typically used after GCONFIG_FN_CXX_STD_THREAD and AC_ARG_ENABLE(std-thread).
dnl
@ -1195,6 +843,36 @@ AC_DEFUN([GCONFIG_FN_GETGRNAM_R],
fi
])
dnl GCONFIG_FN_GETTEXT
dnl --------------------
dnl Tests for gettext and sets gconfig_cv_gettext. Used before
dnl AC_ARG_WITH and GCONFIG_FN_WITH_GETTEXT.
dnl
dnl Typically needs CFLAGS, LIBS and LDFLAGS etc. to be set
dnl correctly.
dnl
dnl See also GCONFIG_FN_GETTEXT_NEW and AM_GNU_GETTEXT.
dnl
AC_DEFUN([GCONFIG_FN_GETTEXT],
[AC_CACHE_CHECK([for gettext],[gconfig_cv_gettext],
[
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[
[#include <libintl.h>]
[const char * p = 0;]
[const char * dir = 0;]
[const char * md = 0;]
],
[
[p = gettext( "foo" );]
[dir = bindtextdomain( "foo" , "bar" );]
[md = textdomain( "foo" );]
])],
gconfig_cv_gettext=yes ,
gconfig_cv_gettext=no )
])
])
dnl GCONFIG_FN_GMTIME_R
dnl -------------------
dnl Tests for gmtime_r().
@ -1459,6 +1137,39 @@ AC_DEFUN([GCONFIG_FN_INET_PTON],
fi
])
dnl GCONFIG_FN_IOVEC_SIMPLE
dnl -----------------------
dnl Tests whether struct iovec is available and matches
dnl the layout of a trivial {char*,size_t} structure.
dnl
AC_DEFUN([GCONFIG_FN_IOVEC_SIMPLE],
[AC_CACHE_CHECK([for iovec layout],[gconfig_cv_iovec_is_simple],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#include <cstddef>]
[#include <sys/types.h>]
[#include <sys/uio.h>]
[struct simple { const char * p ; std::size_t n ; } ;]
],
[
static_assert( sizeof(simple) == sizeof(::iovec) , "" ) ;
static_assert( alignof(simple) == alignof(::iovec) , "" ) ;
static_assert( sizeof(simple::p) == sizeof(::iovec::iov_base) , "" ) ;
static_assert( sizeof(simple::n) == sizeof(::iovec::iov_len) , "" ) ;
static_assert( offsetof(simple,p) == offsetof(::iovec,iov_base) , "" ) ;
static_assert( offsetof(simple,n) == offsetof(::iovec,iov_len) , "" ) ;
])],
gconfig_cv_iovec_is_simple=yes ,
gconfig_cv_iovec_is_simple=no )
])
if test "$gconfig_cv_iovec_is_simple" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_IOVEC_SIMPLE,1,[Define true if struct iovec has a simple layout])
else
AC_DEFINE(GCONFIG_HAVE_IOVEC_SIMPLE,0,[Define true if struct iovec has a simple layout])
fi
])
dnl GCONFIG_FN_IPV6
dnl ---------------
dnl Tests for a minimum set of IPv6 features available.
@ -1573,7 +1284,7 @@ AC_DEFUN([GCONFIG_FN_NETROUTE],
[struct ifa_msghdr header2 ;]
] ,
[
[int fd = socket( PF_ROUTE , SOCK_RAW , AF_INET ) ;]
[(void) socket( PF_ROUTE , SOCK_RAW , AF_INET ) ;]
[header1.rtm_msglen = header2.ifam_msglen = 0 ;]
[header1.rtm_type = RTM_ADD ;]
[header2.ifam_type = RTM_NEWADDR ;]
@ -1801,13 +1512,14 @@ AC_DEFUN([GCONFIG_FN_PTHREAD_SIGMASK],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#include <csignal>]
[#include <cstddef>]
[sigset_t set ;]
[int rc ;]
],
[
[sigemptyset( &set ) ;]
[sigaddset( &set , SIGTERM ) ;]
[rc = pthread_sigmask( SIG_BLOCK|SIG_UNBLOCK|SIG_SETMASK , &set , &set ) ;]
[rc = pthread_sigmask( SIG_BLOCK|SIG_UNBLOCK|SIG_SETMASK , &set , NULL ) ;]
])],
gconfig_cv_pthread_sigmask=yes ,
gconfig_cv_pthread_sigmask=no )
@ -1850,12 +1562,13 @@ AC_DEFUN([GCONFIG_FN_PUTENV_S],
dnl GCONFIG_FN_QT
dnl -------------
dnl Tests for Qt5. Sets gconfig_have_qt, QT_MOC, QT_LIBS and QT_CFLAGS.
dnl A fallback copy of "pkg.m4" should be included in the distribution.
dnl Tests for Qt5. Sets gconfig_have_qt, QT_MOC, QT_LRELEASE, QT_LIBS and
dnl QT_CFLAGS. A fallback copy of "pkg.m4" should be included in the
dnl distribution.
dnl
AC_DEFUN([GCONFIG_FN_QT],
[
# try pkg-config
# try pkg-config -- this says 'checking for QT'
PKG_CHECK_MODULES([QT],[Qt5Widgets > 5],
[
gconfig_pkgconfig_qt=yes
@ -1867,23 +1580,36 @@ AC_DEFUN([GCONFIG_FN_QT],
)
# allow the moc command to be defined with QT_MOC on the configure
# command-line, typically with CXXFLAGS and LIBS pointing to Qt
# command-line, typically also with CXXFLAGS and LIBS pointing to Qt
# headers and libraries
AC_ARG_VAR([QT_MOC],[moc command for QT])
if echo "$QT_MOC" | grep -q /
then
QT_LRELEASE="`dirname \"$QT_MOC\"`/lrelease"
else
QT_LRELEASE="lrelease"
fi
# or build the moc command using pkg-config results
if test "$QT_MOC" = ""
then
if test "$gconfig_pkgconfig_qt" = "yes"
then
QT_MOC="`$PKG_CONFIG --variable=host_bins Qt5Core`/moc"
QT_LRELEASE="`$PKG_CONFIG --variable=host_bins Qt5Core`/lrelease"
QT_CHOOSER="`$PKG_CONFIG --variable=exec_prefix Qt5Core`/bin/qtchooser"
if test -x "$QT_MOC" ; then : ; else QT_MOC="" ; fi
if test -x "$QT_LRELEASE" ; then : ; else QT_LRELEASE="" ; fi
if test -x "$QT_CHOOSER" ; then : ; else QT_CHOOSER="" ; fi
if test "$QT_MOC" = "" -a "$QT_CHOOSER" != ""
then
QT_MOC="$QT_CHOOSER -run-tool=moc -qt=qt5"
fi
if test "$QT_LRELEASE" = "" -a "$QT_CHOOSER" != ""
then
QT_LRELEASE="$QT_CHOOSER -run-tool=lrelease -qt=qt5"
fi
fi
fi
@ -1893,6 +1619,20 @@ AC_DEFUN([GCONFIG_FN_QT],
AC_PATH_PROG([QT_MOC],[moc])
fi
if test "$QT_LRELEASE" = ""
then
AC_PATH_PROG([QT_LRELEASE],[lrelease])
if test "$QT_LRELEASE" = ""
then
QT_LRELEASE=false
fi
fi
if test "$QT_MOC" != ""
then
AC_MSG_NOTICE([QT moc command: $QT_MOC])
fi
# set gconfig_have_qt, QT_CFLAGS and QT_LIBS iff we have a moc command
if test "$QT_MOC" != ""
then
@ -1918,6 +1658,44 @@ AC_DEFUN([GCONFIG_FN_QT],
fi
])
dnl GCONFIG_FN_QT_BUILD
dnl -------------------
dnl Tests for successful Qt5 compilation if GCONFIG_FN_QT
dnl has set gconfig_have_qt. Sets gconfig_qt_build.
dnl
AC_DEFUN([GCONFIG_FN_QT_BUILD],
[AC_CACHE_CHECK([for QT compilation],[gconfig_cv_qt_build],
[
if test "$gconfig_have_qt" = "yes"
then
gconfig_save_LIBS="$LIBS"
gconfig_save_CXXFLAGS="$CXXFLAGS"
LIBS="$LIBS $QT_LIBS"
CXXFLAGS="$CXXFLAGS $QT_CFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[
[#include <QtCore/QtCore>]
[#if QT_VERSION < 0x050000]
[#error Qt is too old]
[#endif]
[#include <QtGui/QtGui>]
[#include <QtWidgets/QtWidgets>]
[#include <QtCore/QtPlugin>]
],
[
[throw QSize(1,1).width() ;]
])],
gconfig_cv_qt_build=yes ,
gconfig_cv_qt_build=no )
LIBS="$gconfig_save_LIBS"
CXXFLAGS="$gconfig_save_CXXFLAGS"
else
gconfig_cv_qt_build=no
fi
])
gconfig_qt_build="$gconfig_cv_qt_build"
])
dnl GCONFIG_FN_READLINK
dnl -------------------
dnl Tests for readlink().
@ -2048,6 +1826,10 @@ AC_DEFUN([GCONFIG_FN_SET_DIRECTORIES_E],
then
e_icondir="$datadir/$PACKAGE"
fi
if test "$e_trdir" = ""
then
e_trdir="$datadir/$PACKAGE"
fi
if test "$e_rundir" = ""
then
# (linux fhs says "/run", not "/var/run")
@ -2064,6 +1846,7 @@ AC_DEFUN([GCONFIG_FN_SET_DIRECTORIES_E],
AC_SUBST([e_initdir])
AC_SUBST([e_bsdinitdir])
AC_SUBST([e_icondir])
AC_SUBST([e_trdir])
AC_SUBST([e_spooldir])
AC_SUBST([e_examplesdir])
AC_SUBST([e_libexecdir])
@ -2134,13 +1917,14 @@ AC_DEFUN([GCONFIG_FN_SIGPROCMASK],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#include <csignal>]
[#include <cstddef>]
[sigset_t set ;]
[int rc ;]
],
[
[sigemptyset( &set ) ;]
[sigaddset( &set , SIGTERM ) ;]
[rc = sigprocmask( SIG_BLOCK|SIG_UNBLOCK|SIG_SETMASK , &set , &set ) ;]
[rc = sigprocmask( SIG_BLOCK|SIG_UNBLOCK|SIG_SETMASK , &set , NULL ) ;]
])],
gconfig_cv_sigprocmask=yes ,
gconfig_cv_sigprocmask=no )
@ -2463,6 +2247,8 @@ AC_DEFUN([GCONFIG_FN_TLS],
gconfig_ssl_notice="openssl and mbedtls"
gconfig_ssl_use_none=no
gconfig_ssl_use_both=yes
gconfig_ssl_use_openssl_only=no
gconfig_ssl_use_mbedtls_only=no
GCONFIG_TLS_LIBS="$gconfig_ssl_mbedtls_libs $gconfig_ssl_openssl_libs"
fi
if test "$gconfig_ssl_use_openssl" = "yes" -a "$gconfig_ssl_use_mbedtls" = "no"
@ -2470,6 +2256,8 @@ AC_DEFUN([GCONFIG_FN_TLS],
gconfig_ssl_notice="openssl"
gconfig_ssl_use_none=no
gconfig_ssl_use_both=no
gconfig_ssl_use_openssl_only=yes
gconfig_ssl_use_mbedtls_only=no
GCONFIG_TLS_LIBS="$gconfig_ssl_openssl_libs"
fi
if test "$gconfig_ssl_use_openssl" = "no" -a "$gconfig_ssl_use_mbedtls" = "yes"
@ -2477,6 +2265,8 @@ AC_DEFUN([GCONFIG_FN_TLS],
gconfig_ssl_notice="mbedtls"
gconfig_ssl_use_none=no
gconfig_ssl_use_both=no
gconfig_ssl_use_openssl_only=no
gconfig_ssl_use_mbedtls_only=yes
GCONFIG_TLS_LIBS="$gconfig_ssl_mbedtls_libs"
fi
if test "$gconfig_ssl_use_openssl" = "no" -a "$gconfig_ssl_use_mbedtls" = "no"
@ -2484,6 +2274,8 @@ AC_DEFUN([GCONFIG_FN_TLS],
gconfig_ssl_notice="none"
gconfig_ssl_use_none=yes
gconfig_ssl_use_both=no
gconfig_ssl_use_openssl_only=no
gconfig_ssl_use_mbedtls_only=no
GCONFIG_TLS_LIBS=""
fi
@ -2494,8 +2286,8 @@ AC_DEFUN([GCONFIG_FN_TLS],
AC_SUBST([GCONFIG_TLS_LIBS])
AM_CONDITIONAL([GCONFIG_TLS_USE_BOTH],test "$gconfig_ssl_use_both" = "yes")
AM_CONDITIONAL([GCONFIG_TLS_USE_OPENSSL],test "$gconfig_ssl_use_openssl" = "yes")
AM_CONDITIONAL([GCONFIG_TLS_USE_MBEDTLS],test "$gconfig_ssl_use_mbedtls" = "yes")
AM_CONDITIONAL([GCONFIG_TLS_USE_OPENSSL],test "$gconfig_ssl_use_openssl_only" = "yes")
AM_CONDITIONAL([GCONFIG_TLS_USE_MBEDTLS],test "$gconfig_ssl_use_mbedtls_only" = "yes")
AM_CONDITIONAL([GCONFIG_TLS_USE_NONE],test "$gconfig_ssl_use_none" = "yes")
AC_MSG_NOTICE([using tls library: $gconfig_ssl_notice])
])
@ -2811,6 +2603,35 @@ AC_DEFUN([GCONFIG_FN_TYPE_UINTPTR_T],
fi
])
dnl GCONFIG_FN_UDS
dnl --------------
dnl Tests for unix domain socket support.
dnl
AC_DEFUN([GCONFIG_FN_UDS],
[AC_CACHE_CHECK([for unix domain sockets],[gconfig_cv_uds],
[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[
[#include <sys/types.h>]
[#include <sys/socket.h>]
[#include <sys/un.h>]
[struct sockaddr_un a ;]
] ,
[
[a.sun_family = AF_UNIX | PF_UNIX ;]
[a.sun_path[0] = '\0' ;]
])] ,
[gconfig_cv_uds=yes],
[gconfig_cv_uds=no])
])
if test "$gconfig_cv_uds" = "yes"
then
AC_DEFINE(GCONFIG_HAVE_UDS,1,[Define true to use unix domain sockets])
else
AC_DEFINE(GCONFIG_HAVE_UDS,0,[Define true to use unix domain sockets])
fi
])
dnl GCONFIG_FN_WARNINGS
dnl -------------------
dnl Displays a summary warning.
@ -2857,18 +2678,25 @@ dnl relevant library code. See also AM_GNU_GETTEXT.
dnl
AC_DEFUN([GCONFIG_FN_WITH_GETTEXT],
[
if test "$with_gettext" = "yes"
if test "$with_gettext" = "no"
then
gconfig_use_gettext="yes"
else
gconfig_use_gettext="no"
gconfig_cv_gettext="no"
:
elif test "$with_gettext" = "yes"
then
if test "$gconfig_cv_gettext" = "no"
then
AC_MSG_WARN([forcing use of gettext even though not detected])
gconfig_cv_gettext="yes"
fi
fi
if test "$gconfig_use_gettext" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_GETTEXT,1,[Define true to use GNU gettext])
if test "$gconfig_cv_gettext" = "yes" ; then
AC_DEFINE(GCONFIG_HAVE_GETTEXT,1,[Define true to use gettext])
else
AC_DEFINE(GCONFIG_HAVE_GETTEXT,0,[Define true to use GNU gettext])
AC_DEFINE(GCONFIG_HAVE_GETTEXT,0,[Define true to use gettext])
fi
AM_CONDITIONAL([GCONFIG_GETTEXT],[test "$gconfig_cv_gettext" = "yes"])
])
dnl GCONFIG_FN_WITH_MAN2HTML
@ -2937,3 +2765,24 @@ AC_DEFUN([GCONFIG_FN_WITH_PAM],
AM_CONDITIONAL([GCONFIG_PAM],[test "$gconfig_use_pam" = "yes"])
])
dnl GCONFIG_FN_WITH_UDS
dnl -------------------
dnl Enables unix domain sockets if detected unless "--without-uds" is
dnl used. Requires GCONFIG_FN_UDS to set gconfig_cv_uds.
dnl Typically used after AC_ARG_WITH(uds).
dnl
AC_DEFUN([GCONFIG_FN_WITH_UDS],
[
AC_REQUIRE([GCONFIG_FN_UDS])
if test "$with_uds" = "no"
then
AM_CONDITIONAL([GCONFIG_UDS],[false])
else
if test "$with_uds" = "yes" -a "$gconfig_cv_uds" = "no"
then
AC_MSG_WARN([forcing use of unix domain sockets even though not detected])
fi
AM_CONDITIONAL([GCONFIG_UDS],[true])
fi
])

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -126,7 +126,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@ -213,6 +213,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -249,6 +250,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -299,8 +301,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -318,7 +320,10 @@ ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \

View File

@ -120,6 +120,7 @@
./src/gnet/geventloop_epoll.cpp
./src/gnet/geventloop.cpp
./src/gnet/ginterfaces_common.cpp
./src/gnet/gaddresslocal_unix.cpp
./src/gnet/gmonitor.cpp
./src/gnet/ginterfaces_unix.cpp
./src/gnet/gclientptr.cpp
@ -131,6 +132,7 @@
./src/gnet/gaddress4.cpp
./src/gnet/gresolver.cpp
./src/gnet/glinebuffer.cpp
./src/gnet/gaddresslocal_none.cpp
./src/gnet/gsocket.cpp
./src/gnet/glocal.cpp
./src/gnet/glocation.cpp

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -98,7 +98,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@ -135,8 +135,9 @@ am__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)
distdir distdir-am
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)gconfig_defs.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.
@ -156,7 +157,7 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/gconfig_defs.h.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@ -245,6 +246,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -281,6 +283,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -310,7 +313,8 @@ top_srcdir = @top_srcdir@
SUBDIRS = glib gssl gnet gauth gsmtp gpop win32 main gui
EXTRA_DIST = .clang-tidy .clang-format
CLEANFILES = compile_commands.json
all: all-recursive
all: gconfig_defs.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@ -330,8 +334,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -343,6 +347,21 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
gconfig_defs.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/gconfig_defs.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status src/gconfig_defs.h
$(srcdir)/gconfig_defs.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f gconfig_defs.h stamp-h1
# 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,
@ -442,7 +461,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -499,7 +521,7 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-recursive
all-am: Makefile
all-am: Makefile gconfig_defs.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
@ -539,7 +561,7 @@ clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
@ -599,19 +621,20 @@ ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) install-am install-strip
.MAKE: $(am__recursive_targets) all install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic cscopelist-am ctags ctags-am \
distclean distclean-generic distclean-tags 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 installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags tags-am uninstall uninstall-am
distclean distclean-generic distclean-hdr distclean-tags \
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 installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
tags-am uninstall uninstall-am
.PRECIOUS: Makefile

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -99,7 +99,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
@ -139,9 +139,18 @@ 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@ -I$(top_builddir)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/gcram.Po ./$(DEPDIR)/gsaslclient.Po \
./$(DEPDIR)/gsaslclientsecrets.Po ./$(DEPDIR)/gsaslserver.Po \
./$(DEPDIR)/gsaslserverbasic.Po \
./$(DEPDIR)/gsaslserverfactory_basic.Po \
./$(DEPDIR)/gsaslserverfactory_pam.Po \
./$(DEPDIR)/gsaslserverpam.Po \
./$(DEPDIR)/gsaslserversecrets.Po ./$(DEPDIR)/gsecret.Po \
./$(DEPDIR)/gsecrets.Po ./$(DEPDIR)/gsecretsfile.Po \
./$(DEPDIR)/gvalid.Po
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@ -258,6 +267,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -294,6 +304,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -391,8 +402,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -418,19 +429,25 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gcram.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslclient.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslclientsecrets.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserverbasic.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserverfactory_basic.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserverfactory_pam.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserverpam.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserversecrets.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsecret.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsecrets.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsecretsfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvalid.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gcram.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslclient.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslclientsecrets.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserver.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserverbasic.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserverfactory_basic.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserverfactory_pam.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserverpam.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsaslserversecrets.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsecret.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsecrets.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsecretsfile.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gvalid.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -498,7 +515,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -567,7 +587,19 @@ clean: clean-am
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/gcram.Po
-rm -f ./$(DEPDIR)/gsaslclient.Po
-rm -f ./$(DEPDIR)/gsaslclientsecrets.Po
-rm -f ./$(DEPDIR)/gsaslserver.Po
-rm -f ./$(DEPDIR)/gsaslserverbasic.Po
-rm -f ./$(DEPDIR)/gsaslserverfactory_basic.Po
-rm -f ./$(DEPDIR)/gsaslserverfactory_pam.Po
-rm -f ./$(DEPDIR)/gsaslserverpam.Po
-rm -f ./$(DEPDIR)/gsaslserversecrets.Po
-rm -f ./$(DEPDIR)/gsecret.Po
-rm -f ./$(DEPDIR)/gsecrets.Po
-rm -f ./$(DEPDIR)/gsecretsfile.Po
-rm -f ./$(DEPDIR)/gvalid.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -613,7 +645,19 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/gcram.Po
-rm -f ./$(DEPDIR)/gsaslclient.Po
-rm -f ./$(DEPDIR)/gsaslclientsecrets.Po
-rm -f ./$(DEPDIR)/gsaslserver.Po
-rm -f ./$(DEPDIR)/gsaslserverbasic.Po
-rm -f ./$(DEPDIR)/gsaslserverfactory_basic.Po
-rm -f ./$(DEPDIR)/gsaslserverfactory_pam.Po
-rm -f ./$(DEPDIR)/gsaslserverpam.Po
-rm -f ./$(DEPDIR)/gsaslserversecrets.Po
-rm -f ./$(DEPDIR)/gsecret.Po
-rm -f ./$(DEPDIR)/gsecrets.Po
-rm -f ./$(DEPDIR)/gsecretsfile.Po
-rm -f ./$(DEPDIR)/gvalid.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -633,18 +677,18 @@ uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-tags 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 \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-noinstLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-tags 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 installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile

View File

@ -1,4 +1,4 @@
/* gconfig_defs.h.in. Generated from configure.ac by autoheader. */
/* src/gconfig_defs.h.in. Generated from configure.ac by autoheader. */
/* Define true to use epoll */
#undef GCONFIG_ENABLE_EPOLL
@ -15,54 +15,12 @@
/* Define true if compiler has std::align() */
#undef GCONFIG_HAVE_CXX_ALIGNMENT
/* Define true if compiler supports c++ constexpr */
#undef GCONFIG_HAVE_CXX_CONSTEXPR
/* Define true if compiler supports c++ =default */
#undef GCONFIG_HAVE_CXX_DEFAULTED
/* Define true if compiler supports c++ =delete */
#undef GCONFIG_HAVE_CXX_DELETED
/* Define true if compiler has std::vector::emplace_back() */
#undef GCONFIG_HAVE_CXX_EMPLACE
/* Define true if compiler supports c++ class enums */
#undef GCONFIG_HAVE_CXX_ENUM_CLASS
/* Define true if compiler supports c++ final keyword */
#undef GCONFIG_HAVE_CXX_FINAL
/* Define true if compiler supports c++ initializer_list */
#undef GCONFIG_HAVE_CXX_INITIALIZER_LIST
/* Define true if compiler has std::make_unique */
#undef GCONFIG_HAVE_CXX_MAKE_UNIQUE
/* Define true if compiler has std::move() */
#undef GCONFIG_HAVE_CXX_MOVE
/* Define true if compiler supports c++ noexcept */
#undef GCONFIG_HAVE_CXX_NOEXCEPT
/* Define true if compiler supports c++ nullptr */
#undef GCONFIG_HAVE_CXX_NULLPTR
/* Define true if compiler supports c++ override */
#undef GCONFIG_HAVE_CXX_OVERRIDE
/* Define true if compiler has std::shared_ptr */
#undef GCONFIG_HAVE_CXX_SHARED_PTR
/* Define true if compiler has std::thread */
#undef GCONFIG_HAVE_CXX_STD_THREAD
/* Define true if compiler has std::wstring */
#undef GCONFIG_HAVE_CXX_STD_WSTRING
/* Define true if compiler has <type_traits> make_unsigned */
#undef GCONFIG_HAVE_CXX_TYPE_TRAITS_MAKE_UNSIGNED
/* Define true to enable use of epoll */
#undef GCONFIG_HAVE_EPOLL
@ -99,7 +57,7 @@
/* Define true if getpwnam_r in pwd.h */
#undef GCONFIG_HAVE_GETPWNAM_R
/* Define true to use GNU gettext */
/* Define true to use gettext */
#undef GCONFIG_HAVE_GETTEXT
/* Define true if gid_t is a type */
@ -138,6 +96,9 @@
/* Define true if inttypes.h is available */
#undef GCONFIG_HAVE_INTTYPES_H
/* Define true if struct iovec has a simple layout */
#undef GCONFIG_HAVE_IOVEC_SIMPLE
/* Define true if ipv6 is available */
#undef GCONFIG_HAVE_IPV6
@ -264,6 +225,9 @@
/* Define true if sys/wait.h is available */
#undef GCONFIG_HAVE_SYS_WAIT_H
/* Define true to use unix domain sockets */
#undef GCONFIG_HAVE_UDS
/* Define true if uid_t is a type */
#undef GCONFIG_HAVE_UID_T

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -99,7 +99,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
@ -222,9 +222,40 @@ 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@ -I$(top_builddir)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/garg.Po ./$(DEPDIR)/gbase64.Po \
./$(DEPDIR)/gbatchfile.Po ./$(DEPDIR)/gcleanup_unix.Po \
./$(DEPDIR)/gcleanup_win32.Po ./$(DEPDIR)/gconvert.Po \
./$(DEPDIR)/gconvert_win32.Po ./$(DEPDIR)/gdaemon_unix.Po \
./$(DEPDIR)/gdaemon_win32.Po ./$(DEPDIR)/gdate.Po \
./$(DEPDIR)/gdatetime.Po ./$(DEPDIR)/gdirectory.Po \
./$(DEPDIR)/gdirectory_unix.Po ./$(DEPDIR)/gdirectory_win32.Po \
./$(DEPDIR)/genvironment.Po ./$(DEPDIR)/genvironment_unix.Po \
./$(DEPDIR)/genvironment_win32.Po ./$(DEPDIR)/gexception.Po \
./$(DEPDIR)/gexecutablecommand.Po \
./$(DEPDIR)/gexecutablecommand_unix.Po \
./$(DEPDIR)/gexecutablecommand_win32.Po ./$(DEPDIR)/gfile.Po \
./$(DEPDIR)/gfile_unix.Po ./$(DEPDIR)/gfile_win32.Po \
./$(DEPDIR)/gformat.Po ./$(DEPDIR)/ggetopt.Po \
./$(DEPDIR)/ghash.Po ./$(DEPDIR)/ghostname_unix.Po \
./$(DEPDIR)/ghostname_win32.Po ./$(DEPDIR)/gidentity_unix.Po \
./$(DEPDIR)/gidentity_win32.Po ./$(DEPDIR)/glog.Po \
./$(DEPDIR)/glogoutput.Po ./$(DEPDIR)/glogoutput_unix.Po \
./$(DEPDIR)/glogoutput_win32.Po ./$(DEPDIR)/gmapfile.Po \
./$(DEPDIR)/gmd5.Po ./$(DEPDIR)/gmsg_unix.Po \
./$(DEPDIR)/gmsg_win32.Po ./$(DEPDIR)/gnewprocess_unix.Po \
./$(DEPDIR)/gnewprocess_win32.Po ./$(DEPDIR)/goptionmap.Po \
./$(DEPDIR)/goptionparser.Po ./$(DEPDIR)/goptions.Po \
./$(DEPDIR)/gpam_linux.Po ./$(DEPDIR)/gpam_none.Po \
./$(DEPDIR)/gpath.Po ./$(DEPDIR)/gpidfile.Po \
./$(DEPDIR)/gprocess_unix.Po ./$(DEPDIR)/gprocess_win32.Po \
./$(DEPDIR)/grandom.Po ./$(DEPDIR)/greadwrite.Po \
./$(DEPDIR)/groot.Po ./$(DEPDIR)/gslot.Po ./$(DEPDIR)/gstr.Po \
./$(DEPDIR)/gstringwrap.Po ./$(DEPDIR)/gtest.Po \
./$(DEPDIR)/gthread.Po ./$(DEPDIR)/gtime.Po \
./$(DEPDIR)/gxtext.Po
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@ -341,6 +372,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -377,6 +409,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -672,8 +705,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -699,66 +732,72 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/garg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gbase64.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gbatchfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gcleanup_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gcleanup_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconvert.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconvert_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdaemon_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdaemon_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdate.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdatetime.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdirectory.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdirectory_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdirectory_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genvironment.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genvironment_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genvironment_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexception.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexecutablecommand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexecutablecommand_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexecutablecommand_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gformat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ggetopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghash.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghostname_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghostname_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gidentity_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gidentity_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glog.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glogoutput.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glogoutput_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glogoutput_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmapfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmd5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmsg_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmsg_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnewprocess_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnewprocess_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goptionmap.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goptionparser.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goptions.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpam_linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpam_none.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpath.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpidfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprocess_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprocess_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grandom.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/greadwrite.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/groot.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gslot.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gstr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gstringwrap.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gthread.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtime.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gxtext.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/garg.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gbase64.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gbatchfile.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gcleanup_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gcleanup_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconvert.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconvert_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdaemon_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdaemon_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdate.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdatetime.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdirectory.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdirectory_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdirectory_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genvironment.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genvironment_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genvironment_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexception.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexecutablecommand.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexecutablecommand_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexecutablecommand_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfile_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gformat.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ggetopt.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghash.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghostname_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghostname_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gidentity_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gidentity_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glog.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glogoutput.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glogoutput_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glogoutput_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmapfile.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmd5.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmsg_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmsg_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnewprocess_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnewprocess_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goptionmap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goptionparser.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goptions.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpam_linux.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpam_none.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpath.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpidfile.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprocess_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gprocess_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grandom.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/greadwrite.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/groot.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gslot.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gstr.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gstringwrap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtest.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gthread.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtime.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gxtext.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -826,7 +865,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -895,7 +937,66 @@ clean: clean-am
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/garg.Po
-rm -f ./$(DEPDIR)/gbase64.Po
-rm -f ./$(DEPDIR)/gbatchfile.Po
-rm -f ./$(DEPDIR)/gcleanup_unix.Po
-rm -f ./$(DEPDIR)/gcleanup_win32.Po
-rm -f ./$(DEPDIR)/gconvert.Po
-rm -f ./$(DEPDIR)/gconvert_win32.Po
-rm -f ./$(DEPDIR)/gdaemon_unix.Po
-rm -f ./$(DEPDIR)/gdaemon_win32.Po
-rm -f ./$(DEPDIR)/gdate.Po
-rm -f ./$(DEPDIR)/gdatetime.Po
-rm -f ./$(DEPDIR)/gdirectory.Po
-rm -f ./$(DEPDIR)/gdirectory_unix.Po
-rm -f ./$(DEPDIR)/gdirectory_win32.Po
-rm -f ./$(DEPDIR)/genvironment.Po
-rm -f ./$(DEPDIR)/genvironment_unix.Po
-rm -f ./$(DEPDIR)/genvironment_win32.Po
-rm -f ./$(DEPDIR)/gexception.Po
-rm -f ./$(DEPDIR)/gexecutablecommand.Po
-rm -f ./$(DEPDIR)/gexecutablecommand_unix.Po
-rm -f ./$(DEPDIR)/gexecutablecommand_win32.Po
-rm -f ./$(DEPDIR)/gfile.Po
-rm -f ./$(DEPDIR)/gfile_unix.Po
-rm -f ./$(DEPDIR)/gfile_win32.Po
-rm -f ./$(DEPDIR)/gformat.Po
-rm -f ./$(DEPDIR)/ggetopt.Po
-rm -f ./$(DEPDIR)/ghash.Po
-rm -f ./$(DEPDIR)/ghostname_unix.Po
-rm -f ./$(DEPDIR)/ghostname_win32.Po
-rm -f ./$(DEPDIR)/gidentity_unix.Po
-rm -f ./$(DEPDIR)/gidentity_win32.Po
-rm -f ./$(DEPDIR)/glog.Po
-rm -f ./$(DEPDIR)/glogoutput.Po
-rm -f ./$(DEPDIR)/glogoutput_unix.Po
-rm -f ./$(DEPDIR)/glogoutput_win32.Po
-rm -f ./$(DEPDIR)/gmapfile.Po
-rm -f ./$(DEPDIR)/gmd5.Po
-rm -f ./$(DEPDIR)/gmsg_unix.Po
-rm -f ./$(DEPDIR)/gmsg_win32.Po
-rm -f ./$(DEPDIR)/gnewprocess_unix.Po
-rm -f ./$(DEPDIR)/gnewprocess_win32.Po
-rm -f ./$(DEPDIR)/goptionmap.Po
-rm -f ./$(DEPDIR)/goptionparser.Po
-rm -f ./$(DEPDIR)/goptions.Po
-rm -f ./$(DEPDIR)/gpam_linux.Po
-rm -f ./$(DEPDIR)/gpam_none.Po
-rm -f ./$(DEPDIR)/gpath.Po
-rm -f ./$(DEPDIR)/gpidfile.Po
-rm -f ./$(DEPDIR)/gprocess_unix.Po
-rm -f ./$(DEPDIR)/gprocess_win32.Po
-rm -f ./$(DEPDIR)/grandom.Po
-rm -f ./$(DEPDIR)/greadwrite.Po
-rm -f ./$(DEPDIR)/groot.Po
-rm -f ./$(DEPDIR)/gslot.Po
-rm -f ./$(DEPDIR)/gstr.Po
-rm -f ./$(DEPDIR)/gstringwrap.Po
-rm -f ./$(DEPDIR)/gtest.Po
-rm -f ./$(DEPDIR)/gthread.Po
-rm -f ./$(DEPDIR)/gtime.Po
-rm -f ./$(DEPDIR)/gxtext.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -941,7 +1042,66 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/garg.Po
-rm -f ./$(DEPDIR)/gbase64.Po
-rm -f ./$(DEPDIR)/gbatchfile.Po
-rm -f ./$(DEPDIR)/gcleanup_unix.Po
-rm -f ./$(DEPDIR)/gcleanup_win32.Po
-rm -f ./$(DEPDIR)/gconvert.Po
-rm -f ./$(DEPDIR)/gconvert_win32.Po
-rm -f ./$(DEPDIR)/gdaemon_unix.Po
-rm -f ./$(DEPDIR)/gdaemon_win32.Po
-rm -f ./$(DEPDIR)/gdate.Po
-rm -f ./$(DEPDIR)/gdatetime.Po
-rm -f ./$(DEPDIR)/gdirectory.Po
-rm -f ./$(DEPDIR)/gdirectory_unix.Po
-rm -f ./$(DEPDIR)/gdirectory_win32.Po
-rm -f ./$(DEPDIR)/genvironment.Po
-rm -f ./$(DEPDIR)/genvironment_unix.Po
-rm -f ./$(DEPDIR)/genvironment_win32.Po
-rm -f ./$(DEPDIR)/gexception.Po
-rm -f ./$(DEPDIR)/gexecutablecommand.Po
-rm -f ./$(DEPDIR)/gexecutablecommand_unix.Po
-rm -f ./$(DEPDIR)/gexecutablecommand_win32.Po
-rm -f ./$(DEPDIR)/gfile.Po
-rm -f ./$(DEPDIR)/gfile_unix.Po
-rm -f ./$(DEPDIR)/gfile_win32.Po
-rm -f ./$(DEPDIR)/gformat.Po
-rm -f ./$(DEPDIR)/ggetopt.Po
-rm -f ./$(DEPDIR)/ghash.Po
-rm -f ./$(DEPDIR)/ghostname_unix.Po
-rm -f ./$(DEPDIR)/ghostname_win32.Po
-rm -f ./$(DEPDIR)/gidentity_unix.Po
-rm -f ./$(DEPDIR)/gidentity_win32.Po
-rm -f ./$(DEPDIR)/glog.Po
-rm -f ./$(DEPDIR)/glogoutput.Po
-rm -f ./$(DEPDIR)/glogoutput_unix.Po
-rm -f ./$(DEPDIR)/glogoutput_win32.Po
-rm -f ./$(DEPDIR)/gmapfile.Po
-rm -f ./$(DEPDIR)/gmd5.Po
-rm -f ./$(DEPDIR)/gmsg_unix.Po
-rm -f ./$(DEPDIR)/gmsg_win32.Po
-rm -f ./$(DEPDIR)/gnewprocess_unix.Po
-rm -f ./$(DEPDIR)/gnewprocess_win32.Po
-rm -f ./$(DEPDIR)/goptionmap.Po
-rm -f ./$(DEPDIR)/goptionparser.Po
-rm -f ./$(DEPDIR)/goptions.Po
-rm -f ./$(DEPDIR)/gpam_linux.Po
-rm -f ./$(DEPDIR)/gpam_none.Po
-rm -f ./$(DEPDIR)/gpath.Po
-rm -f ./$(DEPDIR)/gpidfile.Po
-rm -f ./$(DEPDIR)/gprocess_unix.Po
-rm -f ./$(DEPDIR)/gprocess_win32.Po
-rm -f ./$(DEPDIR)/grandom.Po
-rm -f ./$(DEPDIR)/greadwrite.Po
-rm -f ./$(DEPDIR)/groot.Po
-rm -f ./$(DEPDIR)/gslot.Po
-rm -f ./$(DEPDIR)/gstr.Po
-rm -f ./$(DEPDIR)/gstringwrap.Po
-rm -f ./$(DEPDIR)/gtest.Po
-rm -f ./$(DEPDIR)/gthread.Po
-rm -f ./$(DEPDIR)/gtime.Po
-rm -f ./$(DEPDIR)/gxtext.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -961,18 +1121,18 @@ uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-tags 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 \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-noinstLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-tags 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 installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile

View File

@ -76,6 +76,14 @@ public:
static void release() noexcept ;
///< Releases block()ed signals.
static const char * strdup( const char * ) ;
///< A strdup() function that makes it clear in the stack trace
///< that leaks are expected.
static const char * strdup( const std::string & ) ;
///< A strdup() function that makes it clear in the stack trace
///< that leaks are expected.
public:
Cleanup() = delete ;
} ;

View File

@ -23,6 +23,7 @@
#include "gprocess.h"
#include "groot.h"
#include "glog.h"
#include <cstring> // ::strdup()
#include <csignal> // ::sigaction() etc
#include <array>
@ -71,6 +72,9 @@ public:
static void release() noexcept ;
// Releases blocked signals.
static const char * strdup_ignore_leaks( const char * p ) ;
// A strdup() function.
private:
struct Link /// A private linked-list structure used by G::CleanupImp.
{
@ -129,6 +133,16 @@ void G::Cleanup::release() noexcept
CleanupImp::release() ;
}
const char * G::Cleanup::strdup( const char * p )
{
return CleanupImp::strdup_ignore_leaks( p ) ;
}
const char * G::Cleanup::strdup( const std::string & s )
{
return CleanupImp::strdup_ignore_leaks( s.c_str() ) ;
}
// ===
void G::CleanupImp::init()
@ -283,3 +297,8 @@ void G::CleanupImp::release() noexcept
gdef_pthread_sigmask( SIG_SETMASK , &set , nullptr ) ;
}
const char * G::CleanupImp::strdup_ignore_leaks( const char * p )
{
return ::strdup( p ) ; // NOLINT
}

View File

@ -20,6 +20,7 @@
#include "gdef.h"
#include "gcleanup.h"
#include <cstring> // _strdup()
void G::Cleanup::init()
{
@ -46,3 +47,20 @@ void G::Cleanup::release() noexcept
// not implemented
}
namespace
{
const char * strdup_ignore_leaks( const char * p )
{
return _strdup( p ) ; // NOLINT
}
}
const char * G::Cleanup::strdup( const char * p )
{
return strdup_ignore_leaks( p ) ;
}
const char * G::Cleanup::strdup( const std::string & s )
{
return strdup_ignore_leaks( s.c_str() ) ;
}

View File

@ -700,6 +700,13 @@
#define GCONFIG_HAVE_PTHREAD_SIGMASK 0
#endif
#endif
#if !defined(GCONFIG_HAVE_UDS)
#ifdef G_UNIX
#define GCONFIG_HAVE_UDS 1
#else
#define GCONFIG_HAVE_UDS 0
#endif
#endif
/* Include early o/s headers
*/

View File

@ -94,14 +94,8 @@ int G::Directory::usable( bool for_creation ) const
bool G::Directory::writeable( const std::string & filename ) const
{
// use open(2) so we can use O_EXCL, ie. fail if it already exists
Path path( m_path , filename.empty() ? tmp() : filename ) ;
int fd = ::open( path.cstr() , O_WRONLY | O_CREAT | O_EXCL , S_IRWXU ) ;
if( fd == -1 )
return false ;
::close( fd ) ;
return 0 == std::remove( path.cstr() ) ;
return File::probe( path.cstr() ) ;
}
// ===

View File

@ -54,10 +54,7 @@ int G::Directory::usable( bool for_creation ) const
bool G::Directory::writeable( const std::string & filename ) const
{
Path path( m_path , filename.empty() ? tmp() : filename ) ;
int fd = -1 ;
const int oflags = _O_WRONLY | _O_CREAT | _O_EXCL | _O_TEMPORARY ;
errno_t e = _sopen_s( &fd , path.cstr() , oflags , _SH_DENYNO , _S_IWRITE ) ;
return e == 0 && fd != -1 && 0 == _close( fd ) ; // close and delete
return File::probe( path.cstr() ) ;
}
// ===

View File

@ -106,18 +106,29 @@ public:
///< if necessary. Returns false on error.
static bool mkdirs( const Path & dir , std::nothrow_t , int = 100 ) ;
///< Creates a directory and all necessary parents. Returns false on error.
///< Creates a directory and all necessary parents.
///< Does chmodx() on all created directories.
///< Returns false on error, but EEXIST is not
///< an error and chmod errors are also ignored.
///<
///< Note that the EEXIST result is ignored even if
///< the target path already exists as a non-directory.
///< This is a feature not a bug because it can avoid
///< races.
static void mkdirs( const Path & dir , int = 100 ) ;
///< Creates a directory and all necessary parents.
///< Does chmodx() on all created directories.
///< Throws on error, but EEXIST is not an error
///< and chmod errors are also ignored.
static bool mkdir( const Path & dir , std::nothrow_t ) ;
///< Creates a directory. Returns false on error.
///< Creates a directory. Returns false on error
///< (including EEXIST).
static void mkdir( const Path & dir ) ;
///< Creates a directory.
///< Creates a directory. Throws on error (including
///< EEXIST).
static bool isEmpty( const Path & file , std::nothrow_t ) ;
///< Returns true if the file size is zero.
@ -228,6 +239,10 @@ public:
///< Opens a file descriptor. Returns -1 on error.
///< Uses SH_DENYNO and O_BINARY on windows.
static bool probe( const char * ) noexcept ;
///< Creates and deletes a temporary probe file. Fails if
///< the file already exists. Returns false on error.
static ssize_t read( int fd , char * , std::size_t ) noexcept ;
///< Calls ::read() or equivalent.
@ -254,7 +269,7 @@ private:
static Stat statImp( const char * , bool = false ) noexcept ;
static bool rename( const char * , const char * to , bool & enoent ) noexcept ;
static bool chmodx( const Path & file , bool ) ;
static int link( const char * , const char * ) ;
static int linkImp( const char * , const char * ) ;
static bool linked( const Path & , const Path & ) ;
static int mkdirImp( const Path & dir ) noexcept ;
static bool mkdirsr( int * , const Path & dir , int ) ;

View File

@ -88,16 +88,26 @@ std::filebuf * G::File::open( std::filebuf & fb , const Path & path , InOut inou
int G::File::open( const char * path , InOutAppend mode ) noexcept
{
if( mode == InOutAppend::In )
return ::open( path , O_RDONLY ) ;
return ::open( path , O_RDONLY ) ; // NOLINT
else if( mode == InOutAppend::Out )
return ::open( path , O_WRONLY|O_CREAT|O_TRUNC , 0666 ) ;
return ::open( path , O_WRONLY|O_CREAT|O_TRUNC , 0666 ) ; // NOLINT
else
return ::open( path , O_WRONLY|O_CREAT|O_APPEND , 0666 ) ;
return ::open( path , O_WRONLY|O_CREAT|O_APPEND , 0666 ) ; // NOLINT
}
bool G::File::probe( const char * path ) noexcept
{
int fd = ::open( path , O_WRONLY|O_CREAT|O_EXCL , 0666 ) ; // NOLINT
if( fd < 0 )
return false ;
std::remove( path ) ;
::close( fd ) ;
return true ;
}
void G::File::create( const Path & path )
{
int fd = ::open( path.cstr() , O_RDONLY|O_CREAT , 0666 ) ;
int fd = ::open( path.cstr() , O_RDONLY|O_CREAT , 0666 ) ; // NOLINT
if( fd < 0 )
throw CannotCreate( path.str() ) ;
::close( fd ) ;
@ -121,12 +131,16 @@ void G::File::close( int fd ) noexcept
int G::File::mkdirImp( const Path & dir ) noexcept
{
int rc = ::mkdir( dir.cstr() , 0777 ) ; // open permissions, but limited by umask
if( rc != 0 )
if( rc == 0 )
{
rc = G::Process::errno_() ;
if( rc == 0 ) rc = EINVAL ;
return 0 ;
}
else
{
int e = G::Process::errno_() ;
if( e == 0 ) e = EINVAL ;
return e ;
}
return rc ;
}
G::File::Stat G::File::statImp( const char * path , bool link ) noexcept
@ -138,15 +152,15 @@ G::File::Stat G::File::statImp( const char * path , bool link ) noexcept
s.error = 0 ;
s.enoent = false ;
s.eaccess = false ;
s.is_link = (statbuf.st_mode & S_IFLNK) ;
s.is_dir = (statbuf.st_mode & S_IFDIR) ;
s.is_executable = !!(statbuf.st_mode & S_IXUSR) && !!(statbuf.st_mode & S_IRUSR) ; // indicitive
s.is_link = (statbuf.st_mode & S_IFMT) == S_IFLNK ; // NOLINT
s.is_dir = (statbuf.st_mode & S_IFMT) == S_IFDIR ; // NOLINT
s.is_executable = !!(statbuf.st_mode & S_IXUSR) && !!(statbuf.st_mode & S_IRUSR) ; // indicitive // NOLINT
s.is_empty = statbuf.st_size == 0 ;
s.mtime_s = FileImp::mtime(statbuf).first ;
s.mtime_us = FileImp::mtime(statbuf).second ;
s.mode = static_cast<unsigned long>( statbuf.st_mode & 07777 ) ;
s.mode = static_cast<unsigned long>( statbuf.st_mode & mode_t(07777) ) ; // NOLINT
s.size = static_cast<unsigned long long>( statbuf.st_size ) ;
s.blocks = static_cast<unsigned long long>( statbuf.st_size >> 24 ) ;
s.blocks = static_cast<unsigned long long>(statbuf.st_size) >> 24U ;
}
else
{
@ -174,9 +188,9 @@ bool G::File::chmodx( const Path & path , bool do_throw )
Stat s = statImp( path.cstr() ) ;
mode_t mode = s.error ? mode_t(0777) : mode_t(s.mode) ;
mode |= ( S_IRUSR | S_IXUSR ) ; // add user-read and user-executable
if( mode & S_IRGRP ) mode |= S_IXGRP ; // add group-executable iff group-read
if( mode & S_IROTH ) mode |= S_IXOTH ; // add world-executable iff world-read
mode |= ( S_IRUSR | S_IXUSR ) ; // add user-read and user-executable // NOLINT
if( mode & S_IRGRP ) mode |= S_IXGRP ; // add group-executable iff group-read // NOLINT
if( mode & S_IROTH ) mode |= S_IXOTH ; // add world-executable iff world-read // NOLINT
// apply the current umask
mode_t mask = ::umask( 0 ) ; ::umask( mask ) ;
@ -217,7 +231,7 @@ bool G::File::chmod( const Path & path , const std::string & spec , std::nothrow
std::pair<bool,mode_t> G::FileImp::newmode( mode_t mode , const std::string & spec_in )
{
mode &= 07777 ;
mode &= mode_t(07777) ;
G::StringArray spec_list = G::Str::splitIntoFields( spec_in , "," ) ;
bool ok = !spec_list.empty() ;
for( auto spec : spec_list )
@ -236,25 +250,25 @@ std::pair<bool,mode_t> G::FileImp::newmode( mode_t mode , const std::string & sp
for( const char * p = spec.c_str()+2 ; *p ; p++ )
{
if( *p == 'r' )
part |= 4 ;
part |= mode_t(4) ;
else if( *p == 'w' )
part |= 2 ;
part |= mode_t(2) ;
else if( *p == 'x' )
part |= 1 ;
part |= mode_t(1) ;
else if( *p == 's' && spec[0] == 'u' )
special |= S_ISUID ;
special |= S_ISUID ; // NOLINT
else if( *p == 's' && spec[0] == 'g' )
special |= S_ISGID ;
special |= S_ISGID ; // NOLINT
else if( *p == 't' && spec[0] == 'o' )
special |= S_ISVTX ;
special |= S_ISVTX ; // NOLINT
else
ok = false ;
}
int shift = spec[0]=='u' ? 6 : (spec[0]=='g'?3:0) ;
unsigned int shift = spec[0]=='u' ? 6U : (spec[0]=='g'?3U:0U) ;
if( spec[0] == 'a' )
{
mode_t mask = umask(0) ; umask( mask ) ;
part = ( ((part<<6)|(part<<3)|part) & ~mask ) ;
part = ( ((part<<6U)|(part<<3U)|part) & ~mask ) ;
}
if( spec[1] == '=' && spec[0] == 'a' )
{
@ -262,7 +276,7 @@ std::pair<bool,mode_t> G::FileImp::newmode( mode_t mode , const std::string & sp
}
else if( spec[1] == '=' )
{
mode_t clearbits = (7<<shift) | (spec[0]=='u'?S_ISUID:(spec[0]=='g'?S_ISGID:S_ISVTX)) ;
mode_t clearbits = (mode_t(7)<<shift) | (spec[0]=='u'?mode_t(S_ISUID):(spec[0]=='g'?mode_t(S_ISGID):mode_t(S_ISVTX))) ;
mode &= ~clearbits ;
mode |= (part<<shift) ;
mode |= special ;
@ -281,7 +295,7 @@ std::pair<bool,mode_t> G::FileImp::newmode( mode_t mode , const std::string & sp
ok = false ;
}
}
return std::make_pair( ok , mode ) ;
return { ok , mode } ;
}
void G::File::chgrp( const Path & path , const std::string & group )
@ -304,7 +318,7 @@ void G::File::link( const Path & target , const Path & new_link )
if( exists(new_link) )
remove( new_link , std::nothrow ) ;
int error = link( target.cstr() , new_link.cstr() ) ;
int error = linkImp( target.cstr() , new_link.cstr() ) ;
if( error != 0 )
{
@ -322,10 +336,10 @@ bool G::File::link( const Path & target , const Path & new_link , std::nothrow_t
if( exists(new_link) )
remove( new_link , std::nothrow ) ;
return 0 == link( target.cstr() , new_link.cstr() ) ;
return 0 == linkImp( target.cstr() , new_link.cstr() ) ;
}
int G::File::link( const char * target , const char * new_link )
int G::File::linkImp( const char * target , const char * new_link )
{
int rc = ::symlink( target , new_link ) ;
int error = Process::errno_() ;

View File

@ -39,7 +39,7 @@ namespace G
template <typename T>
void open( T & io , const char * path , std::ios_base::openmode mode )
{
#if GCONFIG_HAVE_EXTENDEND_OPEN
#if GCONFIG_HAVE_EXTENDED_OPEN
io.open( path , mode , _SH_DENYNO ) ; // _fsopen()
#else
io.open( path , mode ) ;
@ -48,6 +48,7 @@ namespace G
int open( const char * path , int flags , int pmode ) noexcept
{
#if GCONFIG_HAVE_SOPEN_S
_set_errno( 0 ) ; // mingw bug
int fd = -1 ;
errno_t rc = _sopen_s( &fd , path , flags , _SH_DENYNO , pmode ) ;
return rc == 0 ? fd : -1 ;
@ -106,6 +107,15 @@ int G::File::open( const char * path , InOutAppend mode ) noexcept
return FileImp::open( path , _O_WRONLY|_O_CREAT|_O_APPEND|_O_BINARY , pmode ) ;
}
bool G::File::probe( const char * path ) noexcept
{
int pmode = _S_IREAD | _S_IWRITE ;
int fd = FileImp::open( path , _O_WRONLY|_O_CREAT|_O_EXCL|O_TEMPORARY|_O_BINARY , pmode ) ;
if( fd >= 0 )
_close( fd ) ; // also deletes
return fd >= 0 ;
}
void G::File::create( const Path & path )
{
int fd = FileImp::open( path.cstr() , _O_RDONLY|_O_CREAT , _S_IREAD|_S_IWRITE ) ;

View File

@ -58,7 +58,7 @@ std::string G::format::str() const
{
std::string s = m_fmt ;
const std::size_t npos = std::string::npos ;
for( std::size_t p = s.find('%') ; p != npos ; p = s.find('%',p) )
for( std::size_t p = s.find('%') ; p != npos && (p+2U) < s.size() ; )
{
std::size_t q = s.find( '%' , p+1 ) ;
if( q != npos && q == (p+2U) && isdigit(s.at(p+1U)) ) // kiss 1..9 only
@ -78,6 +78,7 @@ std::string G::format::str() const
{
p++ ;
}
p = p < s.size() ? s.find('%',p) : npos ;
}
return s ;
}

View File

@ -74,7 +74,10 @@ void G::LogOutput::osoutput( int fd , G::Log::Severity severity , char * message
{
// event log
//
if( m_config.m_use_syslog && severity != Log::Severity::s_Debug && m_handle != HNULL )
if( m_config.m_use_syslog &&
severity != Log::Severity::s_Debug &&
severity != Log::Severity::s_InfoVerbose && // (new)
m_handle != HNULL )
{
DWORD id = 0x400003E9L ; // 1001
WORD type = EVENTLOG_INFORMATION_TYPE ;

View File

@ -37,22 +37,18 @@ namespace G
class G::Msg
{
public:
static ssize_t send( SOCKET , const void * , std::size_t , int ,
int fd_to_send = -1 ) noexcept ;
static ssize_t send( SOCKET , const void * , std::size_t , int flags ) noexcept ;
///< A send() replacement using sendmsg().
static ssize_t sendto( SOCKET , const void * , std::size_t , int , const sockaddr * , socklen_t ,
int fd_to_send = -1 ) noexcept ;
static ssize_t sendto( SOCKET , const void * , std::size_t , int flags ,
const sockaddr * , socklen_t ) noexcept ;
///< A sendto() replacement using sendmsg().
static ssize_t recv( SOCKET , void * , std::size_t , int ) ;
static ssize_t recv( SOCKET , void * , std::size_t , int flags ) ;
///< A recv() wrapper.
static ssize_t recv( SOCKET , void * , std::size_t , int , int * fd_received_p ) ;
///< A recv() replacement using recvmsg().
static ssize_t recvfrom( SOCKET , void * , std::size_t , int , sockaddr * , socklen_t * ,
int * fd_received_p = nullptr ) ;
static ssize_t recvfrom( SOCKET , void * , std::size_t , int flags ,
sockaddr * , socklen_t * ) ;
///< A recvfrom() replacement using recvmsg().
static bool fatal( int error ) noexcept ;

View File

@ -31,52 +31,15 @@
#include <sys/socket.h>
#include <sys/uio.h>
ssize_t G::Msg::send( int fd , const void * buffer , std::size_t size , int flags ,
int fd_to_send ) noexcept
ssize_t G::Msg::send( int fd , const void * buffer , std::size_t size , int flags ) noexcept
{
return sendto( fd , buffer , size , flags , nullptr , 0 , fd_to_send ) ;
return ::sendto( fd , buffer , size , flags | MSG_NOSIGNAL , nullptr , 0U ) ;
}
ssize_t G::Msg::sendto( int fd , const void * buffer , std::size_t size , int flags ,
const sockaddr * address_p , socklen_t address_n , int fd_to_send ) noexcept
const sockaddr * address_p , socklen_t address_n ) noexcept
{
struct ::msghdr msg {} ;
msg.msg_name = const_cast<sockaddr*>(address_p) ;
msg.msg_namelen = address_n ;
struct ::iovec io {} ;
io.iov_base = const_cast<void*>(buffer) ;
io.iov_len = size ;
msg.msg_iov = &io ;
msg.msg_iovlen = 1 ;
constexpr std::size_t space = CMSG_SPACE( sizeof(int) ) ;
static_assert( space != 0U , "" ) ;
std::array<char,space> control_buffer {} ;
if( fd_to_send == -1 )
{
msg.msg_control = nullptr ;
msg.msg_controllen = 0U ;
}
else
{
std::memset( &control_buffer[0] , 0 , control_buffer.size() ) ;
msg.msg_control = &control_buffer[0] ;
msg.msg_controllen = control_buffer.size() ;
struct ::cmsghdr * cmsg = CMSG_FIRSTHDR( &msg ) ;
G_ASSERT( cmsg != nullptr ) ;
if( cmsg != nullptr )
{
cmsg->cmsg_len = CMSG_LEN( sizeof(int) ) ;
cmsg->cmsg_level = SOL_SOCKET ;
cmsg->cmsg_type = SCM_RIGHTS ;
std::memcpy( CMSG_DATA(cmsg) , &fd_to_send , sizeof(int) ) ;
}
}
return ::sendmsg( fd , &msg , flags | MSG_NOSIGNAL ) ;
return ::sendto( fd , buffer , size , flags | MSG_NOSIGNAL , const_cast<sockaddr*>(address_p) , address_n ) ;
}
ssize_t G::Msg::recv( int fd , void * buffer , std::size_t size , int flags )
@ -84,46 +47,10 @@ ssize_t G::Msg::recv( int fd , void * buffer , std::size_t size , int flags )
return ::recv( fd , buffer , size , flags ) ;
}
ssize_t G::Msg::recv( int fd , void * buffer , std::size_t size , int flags ,
int * fd_received_p )
{
return recvfrom( fd , buffer , size , flags , nullptr , nullptr , fd_received_p ) ;
}
ssize_t G::Msg::recvfrom( int fd , void * buffer , std::size_t size , int flags ,
sockaddr * address_p , socklen_t * address_np , int * fd_received_p )
sockaddr * address_p , socklen_t * address_np )
{
struct ::msghdr msg {} ;
msg.msg_name = address_p ;
msg.msg_namelen = address_np == nullptr ? socklen_t(0) : *address_np ;
struct ::iovec io {} ;
io.iov_base = buffer ;
io.iov_len = size ;
msg.msg_iov = &io ;
msg.msg_iovlen = 1 ;
std::array<char,CMSG_SPACE(sizeof(int))> control_buffer ; // NOLINT cppcoreguidelines-pro-type-member-init
msg.msg_control = &control_buffer[0] ;
msg.msg_controllen = control_buffer.size() ;
ssize_t rc = ::recvmsg( fd , &msg , flags ) ;
int e = Process::errno_() ;
if( rc >= 0 && msg.msg_controllen > 0U && fd_received_p != nullptr )
{
struct cmsghdr * cmsg = CMSG_FIRSTHDR( &msg ) ;
if( cmsg != nullptr && cmsg->cmsg_type == SCM_RIGHTS )
{
std::memcpy( fd_received_p , CMSG_DATA(cmsg) , sizeof(int) ) ;
}
}
if( rc >= 0 && address_np != nullptr )
{
*address_np = msg.msg_namelen ;
}
Process::errno_( SignalSafe() , e ) ;
return rc ; // with errno
return ::recvfrom( fd , buffer , size , flags , address_p , address_np ) ;
}
bool G::Msg::fatal( int error ) noexcept

View File

@ -23,13 +23,13 @@
#include "gprocess.h"
#include "gstr.h"
ssize_t G::Msg::send( SOCKET fd , const void * buffer , std::size_t size , int flags , int ) noexcept
ssize_t G::Msg::send( SOCKET fd , const void * buffer , std::size_t size , int flags ) noexcept
{
return ::send( fd , reinterpret_cast<const char*>(buffer) , static_cast<int>(size) , flags ) ;
}
ssize_t G::Msg::sendto( SOCKET fd , const void * buffer , std::size_t size , int flags ,
const sockaddr * address_p , socklen_t address_n , int ) noexcept
const sockaddr * address_p , socklen_t address_n ) noexcept
{
return ::sendto( fd , reinterpret_cast<const char*>(buffer) , static_cast<int>(size) ,
flags , address_p , address_n ) ;
@ -40,13 +40,8 @@ ssize_t G::Msg::recv( SOCKET fd , void * buffer , std::size_t size , int flags )
return ::recv( fd , reinterpret_cast<char*>(buffer) , static_cast<int>(size) , flags ) ;
}
ssize_t G::Msg::recv( SOCKET fd , void * buffer , std::size_t size , int flags , int * )
{
return ::recv( fd , reinterpret_cast<char*>(buffer) , static_cast<int>(size) , flags ) ;
}
ssize_t G::Msg::recvfrom( SOCKET fd , void * buffer , std::size_t size , int flags ,
sockaddr * address_p , socklen_t * address_np , int * fd_received_p )
sockaddr * address_p , socklen_t * address_np )
{
return ::recvfrom( fd , reinterpret_cast<char*>(buffer) , static_cast<int>(size) ,
flags , address_p , address_np ) ;

View File

@ -79,7 +79,7 @@ void G::PidFile::create( const Path & pid_file )
if( buffer[0] == '\0' && pid_file.size() < buffer.size() )
G::Str::strncpy_s( &buffer[0] , buffer.size() , pid_file.cstr() , pid_file.size() ) ;
else
cleanup_arg = new_string_ignore_leak(pid_file.str())->c_str() ;
cleanup_arg = Cleanup::strdup( pid_file.str() ) ;
Cleanup::add( cleanup , cleanup_arg ) ;
}
@ -153,8 +153,3 @@ bool G::PidFile::valid() const
return !m_path.empty() ;
}
std::string * G::PidFile::new_string_ignore_leak( const std::string & s )
{
return new std::string( s ) ; // ignore leak
}

View File

@ -118,7 +118,6 @@ public:
private:
static void create( const Path & pid_file ) ;
static std::string * new_string_ignore_leak( const std::string & ) ;
static Process::Id read( SignalSafe , const char * path ) noexcept ;
bool valid() const ;

View File

@ -157,7 +157,7 @@ public:
class Umask /// Used to temporarily modify the process umask.
{
public:
enum class Mode { Readable , Tighter , Tightest , GroupOpen } ;
enum class Mode { Readable , Tighter , Tightest , GroupOpen , Open } ;
explicit Umask( Mode ) ;
~Umask() ;
static void set( Mode ) ;

View File

@ -302,6 +302,7 @@ mode_t G::ProcessImp::umaskValue( Process::Umask::Mode mode )
if( mode == Process::Umask::Mode::Tighter ) m = 0117 ; // -rw-rw----
if( mode == Process::Umask::Mode::Readable ) m = 0133 ; // -rw-r--r--
if( mode == Process::Umask::Mode::GroupOpen ) m = 0113 ;// -rw-rw-r--
if( mode == Process::Umask::Mode::Open ) m = 0111 ; // -rw-rw-rw-
return m ;
}

View File

@ -61,7 +61,7 @@ namespace G
short toShort( const std::string & s , bool & overflow , bool & invalid ) ;
long toLong( const std::string & s , bool & overflow , bool & invalid ) ;
int toInt( const std::string & s , bool & overflow , bool & invalid ) ;
void strncpy( char * , const char * , size_t ) noexcept ;
void strncpy( char * , const char * , std::size_t ) noexcept ;
void escape( std::string & s , char c_escape , const char * specials_in , const char * specials_out ,
bool with_nul ) ;
void readLineFrom( std::istream & stream , const std::string & eol , std::string & line ) ;
@ -652,7 +652,7 @@ unsigned long G::StrImp::toULongHex( const std::string & s , bool limited )
{
unsigned long n = 0U ;
if( s.empty() ) return 0U ;
size_t i0 = s.find_first_not_of('0') ;
std::size_t i0 = s.find_first_not_of('0') ;
if( i0 == std::string::npos ) i0 = 0U ;
if( (s.size()-i0) > (sizeof(unsigned long)*2U) )
{
@ -1514,7 +1514,7 @@ G::StringArray::iterator G::Str::removeMatch( StringArray::iterator begin , Stri
std::bind(imp::inList,match_list.begin(),match_list.end(),_1,ignore_case) ) ;
}
void G::StrImp::strncpy( char * dst , const char * src , size_t n ) noexcept
void G::StrImp::strncpy( char * dst , const char * src , std::size_t n ) noexcept
{
// (because 'strncpy considered dangerous' analytics)
for( ; n ; n-- , dst++ , src++ )
@ -1525,7 +1525,7 @@ void G::StrImp::strncpy( char * dst , const char * src , size_t n ) noexcept
}
}
errno_t G::Str::strncpy_s( char * dst , size_t n_dst , const char * src , size_t count ) noexcept
errno_t G::Str::strncpy_s( char * dst , std::size_t n_dst , const char * src , std::size_t count ) noexcept
{
namespace imp = G::StrImp ;
if( dst == nullptr || n_dst == 0U )

View File

@ -542,10 +542,10 @@ public:
///< in the match-list (blocklist). (Removes nothing if the match-list is
///< empty.) Returns an iterator for erase().
static constexpr size_t truncate = (~(static_cast<std::size_t>(0U))) ;
static constexpr std::size_t truncate = (~(static_cast<std::size_t>(0U))) ;
///< A special value for the G::Str::strncpy_s() 'count' parameter.
static errno_t strncpy_s( char * dst , size_t n_dst , const char * src , size_t count ) noexcept ;
static errno_t strncpy_s( char * dst , std::size_t n_dst , const char * src , std::size_t count ) noexcept ;
///< Does the same as windows strncpy_s(). Copies count characters
///< from src to dst and adds a terminator character, but fails
///< if dst is too small. If the count is 'truncate' then as

View File

@ -30,6 +30,7 @@ if GCONFIG_WINDOWS
AM_CPPFLAGS = -I$(top_srcdir)/src/glib -I$(top_srcdir)/src/gssl -I$(top_srcdir)/src/win32
EXTRA_DIST_COMMON=\
gaddresslocal_unix.cpp \
gdescriptor_unix.cpp \
geventloop_select.cpp \
geventloop_epoll.cpp \
@ -64,6 +65,8 @@ endif
libgnet_a_SOURCES = \
$(IP46_SOURCES) \
gaddresslocal_none.cpp \
gaddresslocal.h \
gaddress4.cpp \
gaddress4.h \
gaddress6.cpp \
@ -150,6 +153,24 @@ EXTRA_DIST_COMMON=\
gfutureevent_win32.cpp \
gsocket_win32.cpp
if GCONFIG_UDS
UDS_SOURCES = \
gaddresslocal_unix.cpp
EXTRA_DIST_UDS = \
gaddresslocal_none.cpp
else
UDS_SOURCES = \
gaddresslocal_none.cpp
EXTRA_DIST_UDS = \
gaddresslocal_unix.cpp
endif
if GCONFIG_INTERFACE_NAMES
EXTRA_DIST_INTERFACES = \
@ -192,13 +213,16 @@ endif
EXTRA_DIST = \
$(EXTRA_DIST_COMMON) \
$(EXTRA_DIST_UDS) \
$(EXTRA_DIST_INTERFACES) \
$(EXTRA_DIST_EVENTLOOP) \
$(EXTRA_DIST_IP46)
libgnet_a_SOURCES = \
$(IP46_SOURCES) \
$(UDS_SOURCES) \
gaddress.h \
gaddresslocal.h \
gaddress4.h \
gaddress4.cpp \
gaddress6.h \

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -99,7 +99,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/gconfig_defs.h
CONFIG_HEADER = $(top_builddir)/src/gconfig_defs.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
@ -111,9 +111,10 @@ am__v_AR_1 =
libgnet_a_AR = $(AR) $(ARFLAGS)
libgnet_a_LIBADD =
am__libgnet_a_SOURCES_DIST = gaddress_ipv4.cpp gaddress_ipv6.cpp \
gaddress.h gaddress4.h gaddress4.cpp gaddress6.h gaddress6.cpp \
gclient.cpp gclient.h gclientptr.cpp gclientptr.h \
gconnection.cpp gconnection.h gdescriptor.h \
gaddresslocal_none.cpp gaddresslocal_unix.cpp gaddress.h \
gaddresslocal.h gaddress4.h gaddress4.cpp gaddress6.h \
gaddress6.cpp gclient.cpp gclient.h gclientptr.cpp \
gclientptr.h gconnection.cpp gconnection.h gdescriptor.h \
gdescriptor_unix.cpp gdnsblock.cpp gdnsblock.h gdnsmessage.cpp \
gdnsmessage.h gevent.h geventhandler.cpp geventhandler.h \
geventhandlerlist.cpp geventhandlerlist.h \
@ -136,17 +137,20 @@ am__libgnet_a_SOURCES_DIST = gaddress_ipv4.cpp gaddress_ipv6.cpp \
gfutureevent_win32.cpp gsocket_win32.cpp
@GCONFIG_IPV6_FALSE@am__objects_1 = gaddress_ipv4.$(OBJEXT)
@GCONFIG_IPV6_TRUE@am__objects_1 = gaddress_ipv6.$(OBJEXT)
@GCONFIG_EPOLL_FALSE@@GCONFIG_WINDOWS_FALSE@am__objects_2 = geventloop_select.$(OBJEXT)
@GCONFIG_EPOLL_TRUE@@GCONFIG_WINDOWS_FALSE@am__objects_2 = geventloop_epoll.$(OBJEXT)
@GCONFIG_INTERFACE_NAMES_FALSE@@GCONFIG_WINDOWS_FALSE@am__objects_3 = ginterfaces_none.$(OBJEXT)
@GCONFIG_INTERFACE_NAMES_FALSE@@GCONFIG_WINDOWS_TRUE@am__objects_3 = ginterfaces_none.$(OBJEXT)
@GCONFIG_INTERFACE_NAMES_TRUE@@GCONFIG_WINDOWS_FALSE@am__objects_3 = ginterfaces_unix.$(OBJEXT) \
@GCONFIG_UDS_FALSE@@GCONFIG_WINDOWS_FALSE@am__objects_2 = gaddresslocal_none.$(OBJEXT)
@GCONFIG_UDS_TRUE@@GCONFIG_WINDOWS_FALSE@am__objects_2 = gaddresslocal_unix.$(OBJEXT)
@GCONFIG_EPOLL_FALSE@@GCONFIG_WINDOWS_FALSE@am__objects_3 = geventloop_select.$(OBJEXT)
@GCONFIG_EPOLL_TRUE@@GCONFIG_WINDOWS_FALSE@am__objects_3 = geventloop_epoll.$(OBJEXT)
@GCONFIG_INTERFACE_NAMES_FALSE@@GCONFIG_WINDOWS_FALSE@am__objects_4 = ginterfaces_none.$(OBJEXT)
@GCONFIG_INTERFACE_NAMES_FALSE@@GCONFIG_WINDOWS_TRUE@am__objects_4 = ginterfaces_none.$(OBJEXT)
@GCONFIG_INTERFACE_NAMES_TRUE@@GCONFIG_WINDOWS_FALSE@am__objects_4 = ginterfaces_unix.$(OBJEXT) \
@GCONFIG_INTERFACE_NAMES_TRUE@@GCONFIG_WINDOWS_FALSE@ ginterfaces_common.$(OBJEXT)
@GCONFIG_INTERFACE_NAMES_TRUE@@GCONFIG_WINDOWS_TRUE@am__objects_3 = ginterfaces_common.$(OBJEXT) \
@GCONFIG_INTERFACE_NAMES_TRUE@@GCONFIG_WINDOWS_TRUE@am__objects_4 = ginterfaces_common.$(OBJEXT) \
@GCONFIG_INTERFACE_NAMES_TRUE@@GCONFIG_WINDOWS_TRUE@ ginterfaces_win32.$(OBJEXT)
@GCONFIG_WINDOWS_FALSE@am_libgnet_a_OBJECTS = $(am__objects_1) \
@GCONFIG_WINDOWS_FALSE@ gaddress4.$(OBJEXT) gaddress6.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gclient.$(OBJEXT) gclientptr.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ $(am__objects_2) gaddress4.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gaddress6.$(OBJEXT) gclient.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gclientptr.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gconnection.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gdescriptor_unix.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gdnsblock.$(OBJEXT) \
@ -154,12 +158,12 @@ am__libgnet_a_SOURCES_DIST = gaddress_ipv4.cpp gaddress_ipv6.cpp \
@GCONFIG_WINDOWS_FALSE@ geventhandler.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ geventhandlerlist.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ geventloggingcontext.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ geventloop.$(OBJEXT) $(am__objects_2) \
@GCONFIG_WINDOWS_FALSE@ geventloop.$(OBJEXT) $(am__objects_3) \
@GCONFIG_WINDOWS_FALSE@ gexceptionhandler.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gexceptionsink.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gexceptionsource.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gfutureevent_unix.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ $(am__objects_3) glinebuffer.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ $(am__objects_4) glinebuffer.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ glinestore.$(OBJEXT) glocal.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ glocation.$(OBJEXT) gmonitor.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gmultiserver.$(OBJEXT) \
@ -172,6 +176,7 @@ am__libgnet_a_SOURCES_DIST = gaddress_ipv4.cpp gaddress_ipv6.cpp \
@GCONFIG_WINDOWS_FALSE@ gsocks.$(OBJEXT) gtask.$(OBJEXT) \
@GCONFIG_WINDOWS_FALSE@ gtimer.$(OBJEXT) gtimerlist.$(OBJEXT)
@GCONFIG_WINDOWS_TRUE@am_libgnet_a_OBJECTS = $(am__objects_1) \
@GCONFIG_WINDOWS_TRUE@ gaddresslocal_none.$(OBJEXT) \
@GCONFIG_WINDOWS_TRUE@ gaddress4.$(OBJEXT) gaddress6.$(OBJEXT) \
@GCONFIG_WINDOWS_TRUE@ gclient.$(OBJEXT) gclientptr.$(OBJEXT) \
@GCONFIG_WINDOWS_TRUE@ gconnection.$(OBJEXT) \
@ -188,7 +193,7 @@ am__libgnet_a_SOURCES_DIST = gaddress_ipv4.cpp gaddress_ipv6.cpp \
@GCONFIG_WINDOWS_TRUE@ gexceptionsink.$(OBJEXT) \
@GCONFIG_WINDOWS_TRUE@ gexceptionsource.$(OBJEXT) \
@GCONFIG_WINDOWS_TRUE@ gfutureevent_win32.$(OBJEXT) \
@GCONFIG_WINDOWS_TRUE@ $(am__objects_3) glinebuffer.$(OBJEXT) \
@GCONFIG_WINDOWS_TRUE@ $(am__objects_4) glinebuffer.$(OBJEXT) \
@GCONFIG_WINDOWS_TRUE@ glinestore.$(OBJEXT) glocal.$(OBJEXT) \
@GCONFIG_WINDOWS_TRUE@ glocation.$(OBJEXT) gmonitor.$(OBJEXT) \
@GCONFIG_WINDOWS_TRUE@ gmultiserver.$(OBJEXT) \
@ -213,9 +218,39 @@ 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@ -I$(top_builddir)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/gaddress4.Po \
./$(DEPDIR)/gaddress6.Po ./$(DEPDIR)/gaddress_ipv4.Po \
./$(DEPDIR)/gaddress_ipv6.Po ./$(DEPDIR)/gaddresslocal_none.Po \
./$(DEPDIR)/gaddresslocal_unix.Po ./$(DEPDIR)/gclient.Po \
./$(DEPDIR)/gclientptr.Po ./$(DEPDIR)/gconnection.Po \
./$(DEPDIR)/gdescriptor_unix.Po \
./$(DEPDIR)/gdescriptor_win32.Po ./$(DEPDIR)/gdnsblock.Po \
./$(DEPDIR)/gdnsmessage.Po ./$(DEPDIR)/geventhandler.Po \
./$(DEPDIR)/geventhandlerlist.Po \
./$(DEPDIR)/geventloggingcontext.Po ./$(DEPDIR)/geventloop.Po \
./$(DEPDIR)/geventloop_epoll.Po \
./$(DEPDIR)/geventloop_select.Po \
./$(DEPDIR)/geventloop_win32.Po \
./$(DEPDIR)/gexceptionhandler.Po ./$(DEPDIR)/gexceptionsink.Po \
./$(DEPDIR)/gexceptionsource.Po \
./$(DEPDIR)/gfutureevent_unix.Po \
./$(DEPDIR)/gfutureevent_win32.Po \
./$(DEPDIR)/ginterfaces_common.Po \
./$(DEPDIR)/ginterfaces_none.Po \
./$(DEPDIR)/ginterfaces_unix.Po \
./$(DEPDIR)/ginterfaces_win32.Po ./$(DEPDIR)/glinebuffer.Po \
./$(DEPDIR)/glinestore.Po ./$(DEPDIR)/glocal.Po \
./$(DEPDIR)/glocation.Po ./$(DEPDIR)/gmonitor.Po \
./$(DEPDIR)/gmultiserver.Po ./$(DEPDIR)/gnetdone.Po \
./$(DEPDIR)/gresolver.Po ./$(DEPDIR)/gresolverfuture.Po \
./$(DEPDIR)/gserver.Po ./$(DEPDIR)/gserverpeer.Po \
./$(DEPDIR)/gsocket.Po ./$(DEPDIR)/gsocket_unix.Po \
./$(DEPDIR)/gsocket_win32.Po ./$(DEPDIR)/gsocketprotocol.Po \
./$(DEPDIR)/gsocks.Po ./$(DEPDIR)/gtask.Po \
./$(DEPDIR)/gtimer.Po ./$(DEPDIR)/gtimerlist.Po
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@ -332,6 +367,7 @@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
QT_CFLAGS = @QT_CFLAGS@
QT_LIBS = @QT_LIBS@
QT_LRELEASE = @QT_LRELEASE@
QT_MOC = @QT_MOC@
RANLIB = @RANLIB@
SED = @SED@
@ -368,6 +404,7 @@ e_rundir = @e_rundir@
e_spooldir = @e_spooldir@
e_sysconfdir = @e_sysconfdir@
e_systemddir = @e_systemddir@
e_trdir = @e_trdir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
@ -408,6 +445,7 @@ noinst_LIBRARIES = libgnet.a
@GCONFIG_WINDOWS_FALSE@ gsocket_win32.cpp
@GCONFIG_WINDOWS_TRUE@EXTRA_DIST_COMMON = \
@GCONFIG_WINDOWS_TRUE@ gaddresslocal_unix.cpp \
@GCONFIG_WINDOWS_TRUE@ gdescriptor_unix.cpp \
@GCONFIG_WINDOWS_TRUE@ geventloop_select.cpp \
@GCONFIG_WINDOWS_TRUE@ geventloop_epoll.cpp \
@ -429,6 +467,7 @@ noinst_LIBRARIES = libgnet.a
@GCONFIG_WINDOWS_FALSE@EXTRA_DIST = \
@GCONFIG_WINDOWS_FALSE@ $(EXTRA_DIST_COMMON) \
@GCONFIG_WINDOWS_FALSE@ $(EXTRA_DIST_UDS) \
@GCONFIG_WINDOWS_FALSE@ $(EXTRA_DIST_INTERFACES) \
@GCONFIG_WINDOWS_FALSE@ $(EXTRA_DIST_EVENTLOOP) \
@GCONFIG_WINDOWS_FALSE@ $(EXTRA_DIST_IP46)
@ -449,7 +488,9 @@ noinst_LIBRARIES = libgnet.a
@GCONFIG_WINDOWS_FALSE@libgnet_a_SOURCES = \
@GCONFIG_WINDOWS_FALSE@ $(IP46_SOURCES) \
@GCONFIG_WINDOWS_FALSE@ $(UDS_SOURCES) \
@GCONFIG_WINDOWS_FALSE@ gaddress.h \
@GCONFIG_WINDOWS_FALSE@ gaddresslocal.h \
@GCONFIG_WINDOWS_FALSE@ gaddress4.h \
@GCONFIG_WINDOWS_FALSE@ gaddress4.cpp \
@GCONFIG_WINDOWS_FALSE@ gaddress6.h \
@ -525,6 +566,8 @@ noinst_LIBRARIES = libgnet.a
@GCONFIG_WINDOWS_TRUE@libgnet_a_SOURCES = \
@GCONFIG_WINDOWS_TRUE@ $(IP46_SOURCES) \
@GCONFIG_WINDOWS_TRUE@ gaddresslocal_none.cpp \
@GCONFIG_WINDOWS_TRUE@ gaddresslocal.h \
@GCONFIG_WINDOWS_TRUE@ gaddress4.cpp \
@GCONFIG_WINDOWS_TRUE@ gaddress4.h \
@GCONFIG_WINDOWS_TRUE@ gaddress6.cpp \
@ -601,6 +644,18 @@ noinst_LIBRARIES = libgnet.a
@GCONFIG_WINDOWS_TRUE@ gtimerlist.cpp \
@GCONFIG_WINDOWS_TRUE@ gtimerlist.h
@GCONFIG_UDS_FALSE@@GCONFIG_WINDOWS_FALSE@UDS_SOURCES = \
@GCONFIG_UDS_FALSE@@GCONFIG_WINDOWS_FALSE@ gaddresslocal_none.cpp
@GCONFIG_UDS_TRUE@@GCONFIG_WINDOWS_FALSE@UDS_SOURCES = \
@GCONFIG_UDS_TRUE@@GCONFIG_WINDOWS_FALSE@ gaddresslocal_unix.cpp
@GCONFIG_UDS_FALSE@@GCONFIG_WINDOWS_FALSE@EXTRA_DIST_UDS = \
@GCONFIG_UDS_FALSE@@GCONFIG_WINDOWS_FALSE@ gaddresslocal_unix.cpp
@GCONFIG_UDS_TRUE@@GCONFIG_WINDOWS_FALSE@EXTRA_DIST_UDS = \
@GCONFIG_UDS_TRUE@@GCONFIG_WINDOWS_FALSE@ gaddresslocal_none.cpp
@GCONFIG_INTERFACE_NAMES_FALSE@@GCONFIG_WINDOWS_FALSE@EXTRA_DIST_INTERFACES = \
@GCONFIG_INTERFACE_NAMES_FALSE@@GCONFIG_WINDOWS_FALSE@ ginterfaces_win32.cpp \
@GCONFIG_INTERFACE_NAMES_FALSE@@GCONFIG_WINDOWS_FALSE@ ginterfaces_unix.cpp \
@ -643,8 +698,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -670,52 +725,60 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaddress4.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaddress6.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaddress_ipv4.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaddress_ipv6.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gclient.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gclientptr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconnection.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdescriptor_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdescriptor_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdnsblock.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdnsmessage.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventhandler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventhandlerlist.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventloggingcontext.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventloop.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventloop_epoll.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventloop_select.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventloop_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexceptionhandler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexceptionsink.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexceptionsource.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfutureevent_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfutureevent_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginterfaces_common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginterfaces_none.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginterfaces_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginterfaces_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glinebuffer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glinestore.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glocal.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glocation.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmonitor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmultiserver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnetdone.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gresolver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gresolverfuture.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gserver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gserverpeer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocket.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocket_unix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocket_win32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocketprotocol.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocks.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtask.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtimer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtimerlist.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaddress4.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaddress6.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaddress_ipv4.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaddress_ipv6.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaddresslocal_none.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gaddresslocal_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gclient.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gclientptr.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gconnection.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdescriptor_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdescriptor_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdnsblock.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdnsmessage.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventhandler.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventhandlerlist.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventloggingcontext.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventloop.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventloop_epoll.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventloop_select.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geventloop_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexceptionhandler.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexceptionsink.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gexceptionsource.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfutureevent_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gfutureevent_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginterfaces_common.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginterfaces_none.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginterfaces_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginterfaces_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glinebuffer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glinestore.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glocal.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glocation.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmonitor.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmultiserver.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnetdone.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gresolver.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gresolverfuture.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gserver.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gserverpeer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocket.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocket_unix.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocket_win32.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocketprotocol.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsocks.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtask.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtimer.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtimerlist.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.cpp.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@ -783,7 +846,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -852,7 +918,54 @@ clean: clean-am
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/gaddress4.Po
-rm -f ./$(DEPDIR)/gaddress6.Po
-rm -f ./$(DEPDIR)/gaddress_ipv4.Po
-rm -f ./$(DEPDIR)/gaddress_ipv6.Po
-rm -f ./$(DEPDIR)/gaddresslocal_none.Po
-rm -f ./$(DEPDIR)/gaddresslocal_unix.Po
-rm -f ./$(DEPDIR)/gclient.Po
-rm -f ./$(DEPDIR)/gclientptr.Po
-rm -f ./$(DEPDIR)/gconnection.Po
-rm -f ./$(DEPDIR)/gdescriptor_unix.Po
-rm -f ./$(DEPDIR)/gdescriptor_win32.Po
-rm -f ./$(DEPDIR)/gdnsblock.Po
-rm -f ./$(DEPDIR)/gdnsmessage.Po
-rm -f ./$(DEPDIR)/geventhandler.Po
-rm -f ./$(DEPDIR)/geventhandlerlist.Po
-rm -f ./$(DEPDIR)/geventloggingcontext.Po
-rm -f ./$(DEPDIR)/geventloop.Po
-rm -f ./$(DEPDIR)/geventloop_epoll.Po
-rm -f ./$(DEPDIR)/geventloop_select.Po
-rm -f ./$(DEPDIR)/geventloop_win32.Po
-rm -f ./$(DEPDIR)/gexceptionhandler.Po
-rm -f ./$(DEPDIR)/gexceptionsink.Po
-rm -f ./$(DEPDIR)/gexceptionsource.Po
-rm -f ./$(DEPDIR)/gfutureevent_unix.Po
-rm -f ./$(DEPDIR)/gfutureevent_win32.Po
-rm -f ./$(DEPDIR)/ginterfaces_common.Po
-rm -f ./$(DEPDIR)/ginterfaces_none.Po
-rm -f ./$(DEPDIR)/ginterfaces_unix.Po
-rm -f ./$(DEPDIR)/ginterfaces_win32.Po
-rm -f ./$(DEPDIR)/glinebuffer.Po
-rm -f ./$(DEPDIR)/glinestore.Po
-rm -f ./$(DEPDIR)/glocal.Po
-rm -f ./$(DEPDIR)/glocation.Po
-rm -f ./$(DEPDIR)/gmonitor.Po
-rm -f ./$(DEPDIR)/gmultiserver.Po
-rm -f ./$(DEPDIR)/gnetdone.Po
-rm -f ./$(DEPDIR)/gresolver.Po
-rm -f ./$(DEPDIR)/gresolverfuture.Po
-rm -f ./$(DEPDIR)/gserver.Po
-rm -f ./$(DEPDIR)/gserverpeer.Po
-rm -f ./$(DEPDIR)/gsocket.Po
-rm -f ./$(DEPDIR)/gsocket_unix.Po
-rm -f ./$(DEPDIR)/gsocket_win32.Po
-rm -f ./$(DEPDIR)/gsocketprotocol.Po
-rm -f ./$(DEPDIR)/gsocks.Po
-rm -f ./$(DEPDIR)/gtask.Po
-rm -f ./$(DEPDIR)/gtimer.Po
-rm -f ./$(DEPDIR)/gtimerlist.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -898,7 +1011,54 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/gaddress4.Po
-rm -f ./$(DEPDIR)/gaddress6.Po
-rm -f ./$(DEPDIR)/gaddress_ipv4.Po
-rm -f ./$(DEPDIR)/gaddress_ipv6.Po
-rm -f ./$(DEPDIR)/gaddresslocal_none.Po
-rm -f ./$(DEPDIR)/gaddresslocal_unix.Po
-rm -f ./$(DEPDIR)/gclient.Po
-rm -f ./$(DEPDIR)/gclientptr.Po
-rm -f ./$(DEPDIR)/gconnection.Po
-rm -f ./$(DEPDIR)/gdescriptor_unix.Po
-rm -f ./$(DEPDIR)/gdescriptor_win32.Po
-rm -f ./$(DEPDIR)/gdnsblock.Po
-rm -f ./$(DEPDIR)/gdnsmessage.Po
-rm -f ./$(DEPDIR)/geventhandler.Po
-rm -f ./$(DEPDIR)/geventhandlerlist.Po
-rm -f ./$(DEPDIR)/geventloggingcontext.Po
-rm -f ./$(DEPDIR)/geventloop.Po
-rm -f ./$(DEPDIR)/geventloop_epoll.Po
-rm -f ./$(DEPDIR)/geventloop_select.Po
-rm -f ./$(DEPDIR)/geventloop_win32.Po
-rm -f ./$(DEPDIR)/gexceptionhandler.Po
-rm -f ./$(DEPDIR)/gexceptionsink.Po
-rm -f ./$(DEPDIR)/gexceptionsource.Po
-rm -f ./$(DEPDIR)/gfutureevent_unix.Po
-rm -f ./$(DEPDIR)/gfutureevent_win32.Po
-rm -f ./$(DEPDIR)/ginterfaces_common.Po
-rm -f ./$(DEPDIR)/ginterfaces_none.Po
-rm -f ./$(DEPDIR)/ginterfaces_unix.Po
-rm -f ./$(DEPDIR)/ginterfaces_win32.Po
-rm -f ./$(DEPDIR)/glinebuffer.Po
-rm -f ./$(DEPDIR)/glinestore.Po
-rm -f ./$(DEPDIR)/glocal.Po
-rm -f ./$(DEPDIR)/glocation.Po
-rm -f ./$(DEPDIR)/gmonitor.Po
-rm -f ./$(DEPDIR)/gmultiserver.Po
-rm -f ./$(DEPDIR)/gnetdone.Po
-rm -f ./$(DEPDIR)/gresolver.Po
-rm -f ./$(DEPDIR)/gresolverfuture.Po
-rm -f ./$(DEPDIR)/gserver.Po
-rm -f ./$(DEPDIR)/gserverpeer.Po
-rm -f ./$(DEPDIR)/gsocket.Po
-rm -f ./$(DEPDIR)/gsocket_unix.Po
-rm -f ./$(DEPDIR)/gsocket_win32.Po
-rm -f ./$(DEPDIR)/gsocketprotocol.Po
-rm -f ./$(DEPDIR)/gsocks.Po
-rm -f ./$(DEPDIR)/gtask.Po
-rm -f ./$(DEPDIR)/gtimer.Po
-rm -f ./$(DEPDIR)/gtimerlist.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -918,18 +1078,18 @@ uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-tags 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 \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-noinstLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-tags 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 installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile

View File

@ -25,12 +25,14 @@
#include "gstrings.h"
#include "gexception.h"
#include <string>
#include <memory>
namespace GNet
{
class Address ;
class Address4 ;
class Address6 ;
class AddressLocal ;
class AddressStorage ;
class AddressStorageImp ;
}
@ -40,12 +42,10 @@ namespace GNet
/// address is exposed as a 'sockaddr' structure for low-level socket
/// operations.
///
/// A double pimple pattern is used for the implementation; this class
/// instantiates either a GNet::Address4 implementation sub-object or a
/// GNet::Address6 sub-object depending on the address family, and forwards
/// its method calls directly to the one instantiated sub-object. In an
/// IPv4-only build the GNet::Address6 is forward-declared but not defined
/// and all methods are forwarded to the GNet::Address4 sub-object.
/// A multi-pimple pattern is used for the implementation, with implementation
/// classes including GNet::Address4 and GNet::Address6. In an IPv4-only build
/// the GNet::Address6 can be forward-declared but not defined, with all methods
/// forwarded to the GNet::Address4 sub-object.
///
/// \see GNet::Resolver
///
@ -55,20 +55,27 @@ public:
enum class Family
{
ipv4 ,
ipv6
ipv6 ,
local
} ;
struct Domain /// Overload discriminator for Address::supports()
{} ;
G_EXCEPTION( Error , "address error" ) ;
G_EXCEPTION( BadString , "invalid address" ) ;
G_EXCEPTION_CLASS( BadFamily , "unsupported address family" ) ;
static bool supports( Family ) ;
///< Returns true if the implementation supports the given address family,
///< either ipv4 or ipv6.
///< Returns true if the implementation supports the given
///< address family.
static bool supports( int af , int dummy ) ;
///< Returns true if the implementation supports the given address family,
///< either AF_INET or AF_INET6.
///< Returns true if the implementation supports the given
///< address family given as AF_INET etc.
static bool supports( const Domain & , int domain ) ;
///< Returns true if the implementation supports the given
///< address domain given as PF_INET etc.
Address( const Address & ) ;
///< Copy constructor.
@ -85,19 +92,11 @@ public:
///< fixup.
Address( Family , unsigned int port ) ;
///< Constructor for a wildcard INADDR_ANY address with the given port
///< number. Throws an exception if an invalid port number.
///< Constructor for a wildcard address like INADDR_ANY with the
///< given port number. Throws an exception if an invalid port number.
///< Postcondition: isAny()
/// \see validPort()
explicit Address( const std::string & display_string ) ;
///< Constructor taking a string originally obtained from displayString().
///< Throws an exception if an invalid string. See also validString().
Address( const std::string & ip , unsigned int port ) ;
///< Constructor taking an ip-address and a port number. Throws an
///< exception if an invalid string.
Address( Address && ) noexcept ;
///< Move constructor.
@ -110,6 +109,31 @@ public:
Address & operator=( Address && ) noexcept ;
///< Move assignment operator.
struct NotLocal /// Overload discriminator for Address::parse()
{} ;
static Address parse( const std::string & display_string ) ;
///< Factory function for any address family. Throws if
///< an invalid string. See also validString().
static Address parse( const std::string & display_string , NotLocal ) ;
///< Factory function for Family::ipv4 or Family::ipv6.
///< Throws if an invalid string. See also validString().
static Address parse( const std::string & host_part_string , unsigned int port ) ;
///< Factory function for Family::ipv4 or Family::ipv6.
///< Throws if an invalid string. See also validStrings().
static Address parse( const std::string & host_part_string , const std::string & port ) ;
///< Factory function for Family::ipv4 or Family::ipv6.
///< Throws if an invalid string. See also validStrings().
static bool isFamilyLocal( const std::string & display_string ) ;
///< Returns true if the given address display string looks
///< will parse to Family::local and Family::local is
///< supported. The address may still fail to parse if
///< it is invalid.
static Address defaultAddress() ;
///< Returns a default address, being the IPv4 wildcard address
///< with a zero port number.
@ -129,12 +153,13 @@ public:
///< Returns the size of the sockaddr address. See address().
std::string displayString( bool with_scope_id = false ) const ;
///< Returns a string which represents the transport address for
///< debugging and diagnostics purposes.
///< Returns a string which represents the transport address.
std::string hostPartString() const ;
///< Returns a string which represents the network address for
///< debugging and diagnostics purposes.
std::string hostPartString( bool raw = false ) const ;
///< Returns a string which represents the network address.
///< For unix-domain sockets this returns the address path
///< and if the 'raw' parameter is set then any non-printing
///< characters are not escaped.
std::string queryString() const ;
///< Returns a string that can be used as a prefix for rDNS or
@ -143,14 +168,15 @@ public:
unsigned int port() const;
///< Returns port part of the address.
int domain() const ;
///< Returns the address 'domain', eg. PF_INET.
static int domain( Family ) ;
///< Returns the address 'domain' for the given family, eg. PF_INET
///< for Family::ipv4.
Family family() const ;
///< Returns the address family enumeration.
int af() const ;
///< Returns the address family number, AF_INET or AFINET6.
///< Returns the address family number such as AF_INET or AFINET6.
static bool validPort( unsigned int n ) ;
///< Returns true if the port number is within the valid range. This
@ -160,6 +186,10 @@ public:
///< Returns true if the transport-address display string is valid.
///< This can be used to avoid exceptions from the relevant constructor.
static bool validString( const std::string & display_string , NotLocal , std::string * reason = nullptr ) ;
///< Returns true if the transport-address display string is valid.
///< This can be used to avoid exceptions from the relevant constructor.
static bool validStrings( const std::string & ip , const std::string & port_string , std::string * reason = nullptr ) ;
///< Returns true if the combined network-address string and port string
///< is valid. This can be used to avoid exceptions from the relevant
@ -216,7 +246,7 @@ public:
bool isLocal( std::string & reason ) const ;
///< Returns true if this seems to be a 'local' address, ie. an
///< address that is inherently more trusted. Returns an
///< address that is likely to be more trusted. Returns an
///< explanation by reference otherwise.
bool is4() const ;
@ -225,7 +255,7 @@ public:
bool is6() const ;
///< Returns true if family() is ipv6.
bool same( const Address & , bool with_scope ) const ;
bool same( const Address & , bool ipv6_compare_with_scope ) const ;
///< Comparison function.
bool operator==( const Address & ) const ;
@ -239,10 +269,15 @@ public:
private:
Address( Family , unsigned int , int ) ; // loopback()
explicit Address( const std::string & display_string ) ; // parse()
Address( const std::string & display_string , NotLocal ) ; // parse(NotLocal)
Address( const std::string & ip , const std::string & port ) ; // parse(ip,port)
Address( const std::string & ip , unsigned int port ) ; // parse(ip,port)
private:
std::unique_ptr<Address4> m_4imp ;
std::unique_ptr<Address6> m_6imp ;
std::unique_ptr<Address4> m_ipv4 ;
std::unique_ptr<Address6> m_ipv6 ;
std::unique_ptr<AddressLocal> m_local ;
} ;
namespace GNet

View File

@ -35,17 +35,17 @@ namespace GNet
{
namespace Address4Imp
{
constexpr const char * port_separators = ":/" ;
constexpr const char * port_separators = ":" ;
constexpr char port_separator = ':' ;
}
}
unsigned short GNet::Address4::family()
unsigned short GNet::Address4::af() noexcept
{
return AF_INET ;
}
int GNet::Address4::domain()
int GNet::Address4::domain() noexcept
{
return PF_INET ;
}
@ -53,7 +53,7 @@ int GNet::Address4::domain()
GNet::Address4::Address4( std::nullptr_t ) :
m_inet{}
{
m_inet.sin_family = family() ;
m_inet.sin_family = af() ;
m_inet.sin_port = 0 ;
}
@ -65,7 +65,7 @@ GNet::Address4::Address4( unsigned int port ) :
if( reason ) throw Address::Error(reason) ;
}
GNet::Address4::Address4( unsigned int port , int ) :
GNet::Address4::Address4( unsigned int port , int /*loopback_overload*/ ) :
Address4(nullptr)
{
m_inet.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
@ -73,12 +73,12 @@ GNet::Address4::Address4( unsigned int port , int ) :
if( reason ) throw Address::Error(reason) ;
}
GNet::Address4::Address4( const sockaddr * addr , socklen_t len ) :
GNet::Address4::Address4( const sockaddr * addr , socklen_t len , bool ) :
Address4(nullptr)
{
if( addr == nullptr )
throw Address::Error() ;
if( addr->sa_family != family() || static_cast<std::size_t>(len) < sizeof(sockaddr_type) )
if( addr->sa_family != af() || static_cast<std::size_t>(len) < sizeof(sockaddr_type) )
throw Address::BadFamily() ;
m_inet = *(reinterpret_cast<const sockaddr_type*>(addr)) ;
@ -131,10 +131,10 @@ const char * GNet::Address4::setHostAddress( sockaddr_type & inet , const std::s
{
// start with a stricter check than inet_pton(), inet_addr() etc. since they allow eg. "123.123"
if( !Address4::format(host_part) )
return "invalid ipv4 network address format" ;
return "invalid network address" ;
int rc = inet_pton( family() , host_part.c_str() , &inet.sin_addr ) ;
return rc == 1 ? nullptr : "invalid ipv4 network address" ;
int rc = inet_pton( af() , host_part.c_str() , &inet.sin_addr ) ;
return rc == 1 ? nullptr : "invalid network address" ;
}
void GNet::Address4::setPort( unsigned int port )
@ -159,7 +159,16 @@ const char * GNet::Address4::setPort( sockaddr_type & inet , unsigned int port )
return nullptr ;
}
std::string GNet::Address4::displayString() const
bool GNet::Address4::setZone( const std::string & /*ipv6_zone_name_or_scope_id*/ )
{
return true ;
}
void GNet::Address4::setScopeId( unsigned long /*ipv6_scope_id*/ )
{
}
std::string GNet::Address4::displayString( bool /*ipv6_with_scope*/ ) const
{
std::ostringstream ss ;
ss << hostPartString() ;
@ -167,15 +176,15 @@ std::string GNet::Address4::displayString() const
return ss.str() ;
}
std::string GNet::Address4::hostPartString() const
std::string GNet::Address4::hostPartString( bool /*raw*/ ) const
{
std::array<char,INET_ADDRSTRLEN+1U> buffer ; // NOLINT cppcoreguidelines-pro-type-member-init
std::array<char,INET_ADDRSTRLEN+1U> buffer {} ;
const void * vp = & m_inet.sin_addr ;
const char * p = inet_ntop( family() , const_cast<void*>(vp) , &buffer[0] , buffer.size() ) ;
const char * p = inet_ntop( af() , const_cast<void*>(vp) , &buffer[0] , buffer.size() ) ;
if( p == nullptr )
throw Address::Error( "inet_ntop() failure" ) ;
buffer[buffer.size()-1U] = '\0' ;
return std::string(&buffer[0]) ;
return { &buffer[0] } ; // sic
}
std::string GNet::Address4::queryString() const
@ -187,7 +196,7 @@ std::string GNet::Address4::queryString() const
bool GNet::Address4::validData( const sockaddr * addr , socklen_t len )
{
return addr != nullptr && addr->sa_family == family() && len == sizeof(sockaddr_type) ;
return addr != nullptr && addr->sa_family == af() && len == sizeof(sockaddr_type) ;
}
bool GNet::Address4::validString( const std::string & s , std::string * reason_p )
@ -218,11 +227,11 @@ bool GNet::Address4::validPort( unsigned int port )
return reason == nullptr ;
}
bool GNet::Address4::same( const Address4 & other ) const
bool GNet::Address4::same( const Address4 & other , bool /*ipv6_compare_with_scope*/ ) const
{
return
m_inet.sin_family == family() &&
other.m_inet.sin_family == family() &&
m_inet.sin_family == af() &&
other.m_inet.sin_family == af() &&
sameAddr( m_inet.sin_addr , other.m_inet.sin_addr ) &&
m_inet.sin_port == other.m_inet.sin_port ;
}
@ -230,8 +239,8 @@ bool GNet::Address4::same( const Address4 & other ) const
bool GNet::Address4::sameHostPart( const Address4 & other ) const
{
return
m_inet.sin_family == family() &&
other.m_inet.sin_family == family() &&
m_inet.sin_family == af() &&
other.m_inet.sin_family == af() &&
sameAddr( m_inet.sin_addr , other.m_inet.sin_addr ) ;
}
@ -245,6 +254,11 @@ unsigned int GNet::Address4::port() const
return ntohs( m_inet.sin_port ) ;
}
unsigned long GNet::Address4::scopeId( unsigned long default_ ) const
{
return default_ ;
}
const sockaddr * GNet::Address4::address() const
{
return reinterpret_cast<const sockaddr*>(&m_inet) ;
@ -273,8 +287,10 @@ G::StringArray GNet::Address4::wildcards() const
G::Str::splitIntoFields( ip_string , part , "." ) ;
G_ASSERT( part.size() == 4U ) ;
if( part.size() != 4U ||
part[0].empty() || !G::Str::isUInt(part[0]) ||
if( part.size() != 4U )
return result ;
if( part[0].empty() || !G::Str::isUInt(part[0]) ||
part[1].empty() || !G::Str::isUInt(part[1]) ||
part[2].empty() || !G::Str::isUInt(part[2]) ||
part[3].empty() || !G::Str::isUInt(part[3]) )
@ -304,41 +320,41 @@ G::StringArray GNet::Address4::wildcards() const
const std::string empty ;
add( result , part_0_1_2 , n3 & 0xff , "/32" ) ;
add( result , part_0_1_2 , n3 & 0xfe , "/31" ) ;
add( result , part_0_1_2 , n3 & 0xfc , "/30" ) ;
add( result , part_0_1_2 , n3 & 0xf8 , "/29" ) ;
add( result , part_0_1_2 , n3 & 0xf0 , "/28" ) ;
add( result , part_0_1_2 , n3 & 0xe0 , "/27" ) ;
add( result , part_0_1_2 , n3 & 0xc0 , "/26" ) ;
add( result , part_0_1_2 , n3 & 0x80 , "/25" ) ;
add( result , part_0_1_2 , n3 & 0xffU , "/32" ) ;
add( result , part_0_1_2 , n3 & 0xfeU , "/31" ) ;
add( result , part_0_1_2 , n3 & 0xfcU , "/30" ) ;
add( result , part_0_1_2 , n3 & 0xf8U , "/29" ) ;
add( result , part_0_1_2 , n3 & 0xf0U , "/28" ) ;
add( result , part_0_1_2 , n3 & 0xe0U , "/27" ) ;
add( result , part_0_1_2 , n3 & 0xc0U , "/26" ) ;
add( result , part_0_1_2 , n3 & 0x80U , "/25" ) ;
add( result , part_0_1_2 , 0 , "/24" ) ;
add( result , part_0_1_2 , "*" ) ;
add( result , part_0_1 , n2 & 0xfe , ".0/23" ) ;
add( result , part_0_1 , n2 & 0xfc , ".0/22" ) ;
add( result , part_0_1 , n2 & 0xfc , ".0/21" ) ;
add( result , part_0_1 , n2 & 0xf8 , ".0/20" ) ;
add( result , part_0_1 , n2 & 0xf0 , ".0/19" ) ;
add( result , part_0_1 , n2 & 0xe0 , ".0/18" ) ;
add( result , part_0_1 , n2 & 0xc0 , ".0/17" ) ;
add( result , part_0_1 , n2 & 0xfeU , ".0/23" ) ;
add( result , part_0_1 , n2 & 0xfcU , ".0/22" ) ;
add( result , part_0_1 , n2 & 0xfcU , ".0/21" ) ;
add( result , part_0_1 , n2 & 0xf8U , ".0/20" ) ;
add( result , part_0_1 , n2 & 0xf0U , ".0/19" ) ;
add( result , part_0_1 , n2 & 0xe0U , ".0/18" ) ;
add( result , part_0_1 , n2 & 0xc0U , ".0/17" ) ;
add( result , part_0_1 , 0 , ".0/16" ) ;
add( result , part_0_1 , "*.*" ) ;
add( result , part_0 , n1 & 0xfe , ".0.0/15" ) ;
add( result , part_0 , n1 & 0xfc , ".0.0/14" ) ;
add( result , part_0 , n1 & 0xf8 , ".0.0/13" ) ;
add( result , part_0 , n1 & 0xf0 , ".0.0/12" ) ;
add( result , part_0 , n1 & 0xe0 , ".0.0/11" ) ;
add( result , part_0 , n1 & 0xc0 , ".0.0/10" ) ;
add( result , part_0 , n1 & 0x80 , ".0.0/9" ) ;
add( result , part_0 , n1 & 0xfeU , ".0.0/15" ) ;
add( result , part_0 , n1 & 0xfcU , ".0.0/14" ) ;
add( result , part_0 , n1 & 0xf8U , ".0.0/13" ) ;
add( result , part_0 , n1 & 0xf0U , ".0.0/12" ) ;
add( result , part_0 , n1 & 0xe0U , ".0.0/11" ) ;
add( result , part_0 , n1 & 0xc0U , ".0.0/10" ) ;
add( result , part_0 , n1 & 0x80U , ".0.0/9" ) ;
add( result , part_0 , 0 , ".0.0/8" ) ;
add( result , part_0 , "*.*.*" ) ;
add( result , empty , n0 & 0xfe , ".0.0.0/7" ) ;
add( result , empty , n0 & 0xfc , ".0.0.0/6" ) ;
add( result , empty , n0 & 0xf8 , ".0.0.0/5" ) ;
add( result , empty , n0 & 0xf0 , ".0.0.0/4" ) ;
add( result , empty , n0 & 0xe0 , ".0.0.0/3" ) ;
add( result , empty , n0 & 0xc0 , ".0.0.0/2" ) ;
add( result , empty , n0 & 0x80 , ".0.0.0/1" ) ;
add( result , empty , n0 & 0xfeU , ".0.0.0/7" ) ;
add( result , empty , n0 & 0xfcU , ".0.0.0/6" ) ;
add( result , empty , n0 & 0xf8U , ".0.0.0/5" ) ;
add( result , empty , n0 & 0xf0U , ".0.0.0/4" ) ;
add( result , empty , n0 & 0xe0U , ".0.0.0/3" ) ;
add( result , empty , n0 & 0xc0U , ".0.0.0/2" ) ;
add( result , empty , n0 & 0x80U , ".0.0.0/1" ) ;
add( result , empty , 0 , ".0.0.0/0" ) ;
add( result , empty , "*.*.*.*" ) ;
@ -383,7 +399,7 @@ unsigned int GNet::Address4::bits() const
{
const unsigned long a = ntohl( m_inet.sin_addr.s_addr ) ;
unsigned int count = 0U ;
for( unsigned long mask = 0x80000000U ; mask && ( a & mask ) ; mask >>= 1 )
for( unsigned long mask = 0x80000000U ; mask && ( a & mask ) ; mask >>= 1U )
count++ ;
return count ;
}
@ -408,22 +424,22 @@ bool GNet::Address4::isLocal( std::string & reason ) const
bool GNet::Address4::isLoopback() const
{
// RFC-1918, RFC-6890
return ( ntohl(m_inet.sin_addr.s_addr) >> 24 ) == 127U ; // 127.0.0.0/8
return ( ntohl(m_inet.sin_addr.s_addr) >> 24U ) == 127U ; // 127.0.0.0/8
}
bool GNet::Address4::isLinkLocal() const
{
// RFC-3927, RFC-6890
return ( ntohl(m_inet.sin_addr.s_addr) >> 16 ) == 0xA9FE ; // 169.254.0.0/16
return ( ntohl(m_inet.sin_addr.s_addr) >> 16U ) == 0xA9FEU ; // 169.254.0.0/16
}
bool GNet::Address4::isUniqueLocal() const
{
// RFC-1918, RFC-6890
return
( ntohl(m_inet.sin_addr.s_addr) >> 24 ) == 0x0A || // 10.0.0.0/8
( ntohl(m_inet.sin_addr.s_addr) >> 20 ) == 0xAC1 || // 172.16.0.0/12
( ntohl(m_inet.sin_addr.s_addr) >> 16 ) == 0xC0A8 ; // 192.168.0.0/16
( ntohl(m_inet.sin_addr.s_addr) >> 24U ) == 0x0AU || // 10.0.0.0/8
( ntohl(m_inet.sin_addr.s_addr) >> 20U ) == 0xAC1U || // 172.16.0.0/12
( ntohl(m_inet.sin_addr.s_addr) >> 16U ) == 0xC0A8U ; // 192.168.0.0/16
}
bool GNet::Address4::isAny() const

View File

@ -37,30 +37,30 @@ class GNet::Address4
{
public:
using sockaddr_type = sockaddr_in ;
using storage_type = sockaddr_storage ;
explicit Address4( unsigned int ) ;
explicit Address4( const std::string & ) ;
Address4( const std::string & , const std::string & ) ;
Address4( const std::string & , unsigned int ) ;
Address4( unsigned int port , int /*for overload resolution*/ ) ; // canonical loopback address
Address4( const sockaddr * addr , socklen_t len ) ;
Address4( unsigned int port , int /*loopback_overload*/ ) ; // canonical loopback address
Address4( const sockaddr * addr , socklen_t len , bool ipv6_scope_id_fixup = false ) ;
static int domain() ;
static unsigned short family() ;
static int domain() noexcept ;
static unsigned short af() noexcept ;
const sockaddr * address() const ;
sockaddr * address() ;
static socklen_t length() noexcept ;
unsigned long scopeId( unsigned long default_ = 0UL ) const ;
unsigned int port() const ;
void setPort( unsigned int port ) ;
bool setZone( const std::string & ipv6_zone_name_or_scope_id ) ;
void setScopeId( unsigned long ipv6_scope_id ) ;
static bool validString( const std::string & , std::string * = nullptr ) ;
static bool validStrings( const std::string & , const std::string & , std::string * = nullptr ) ;
static bool validPort( unsigned int port ) ;
static bool validData( const sockaddr * addr , socklen_t len ) ;
bool same( const Address4 & other ) const ;
bool same( const Address4 & other , bool ipv6_compare_with_scope = false ) const ;
bool sameHostPart( const Address4 & other ) const ;
bool isLoopback() const ;
bool isLocal( std::string & ) const ;
@ -68,8 +68,8 @@ public:
bool isUniqueLocal() const ;
bool isAny() const ;
unsigned int bits() const ;
std::string displayString() const ;
std::string hostPartString() const ;
std::string displayString( bool ipv6_with_scope = false ) const ;
std::string hostPartString( bool raw = false ) const ;
std::string queryString() const ;
G::StringArray wildcards() const ;
static bool format( std::string ) ;

View File

@ -26,6 +26,7 @@
#include "glog.h"
#include <algorithm> // std::swap()
#include <utility> // std::swap()
#include <cstring> // std::memcpy()
#include <climits>
#include <sys/types.h>
#include <sstream>
@ -37,17 +38,17 @@ namespace GNet
{
namespace Address6Imp
{
const char * port_separators = ":/." ;
const char * port_separators = ":." ;
char port_separator = '.' ;
}
}
unsigned short GNet::Address6::family()
unsigned short GNet::Address6::af() noexcept
{
return AF_INET6 ;
}
int GNet::Address6::domain()
int GNet::Address6::domain() noexcept
{
return PF_INET6 ;
}
@ -55,7 +56,7 @@ int GNet::Address6::domain()
GNet::Address6::Address6( std::nullptr_t ) :
m_inet{}
{
m_inet.sin6_family = family() ;
m_inet.sin6_family = af() ;
m_inet.sin6_port = 0 ;
m_inet.sin6_flowinfo = 0 ;
gdef_address6_init( m_inet ) ; // gdef.h
@ -69,7 +70,7 @@ GNet::Address6::Address6( unsigned int port ) :
if( reason ) throw Address::Error(reason) ;
}
GNet::Address6::Address6( unsigned int port , int ) :
GNet::Address6::Address6( unsigned int port , int /*loopback_overload*/ ) :
Address6(nullptr)
{
m_inet.sin6_addr = in6addr_loopback ;
@ -77,23 +78,23 @@ GNet::Address6::Address6( unsigned int port , int ) :
if( reason ) throw Address::Error(reason) ;
}
GNet::Address6::Address6( const sockaddr * addr , socklen_t len , bool scope_id_fixup ) :
GNet::Address6::Address6( const sockaddr * addr , socklen_t len , bool ipv6_scope_id_fixup ) :
Address6(nullptr)
{
if( addr == nullptr )
throw Address::Error() ;
if( addr->sa_family != family() || static_cast<std::size_t>(len) < sizeof(sockaddr_type) )
if( addr->sa_family != af() || static_cast<std::size_t>(len) < sizeof(sockaddr_type) )
throw Address::BadFamily() ;
std::memcpy( &m_inet , addr , sizeof(m_inet) ) ;
if( scope_id_fixup ) // for eg. NetBSD v7 getifaddrs() -- see FreeBSD Handbook "Scope Index"
if( ipv6_scope_id_fixup ) // for eg. NetBSD v7 getifaddrs() -- see FreeBSD Handbook "Scope Index"
{
auto hi = static_cast<unsigned int>( m_inet.sin6_addr.s6_addr[2] ) ;
auto lo = static_cast<unsigned int>( m_inet.sin6_addr.s6_addr[3] ) ;
m_inet.sin6_addr.s6_addr[2] = 0 ;
m_inet.sin6_addr.s6_addr[3] = 0 ;
m_inet.sin6_scope_id = ( hi << 8 | lo ) ;
m_inet.sin6_scope_id = ( hi << 8U | lo ) ;
}
}
@ -155,7 +156,7 @@ const char * GNet::Address6::setHostAddress( sockaddr_type & inet , const std::s
std::string zone = G::Str::tail( host_part , host_part.find('%') , std::string() ) ;
std::string host_part_head = G::Str::head( host_part , host_part.find('%') , host_part ) ;
int rc = inet_pton( family() , host_part_head.c_str() , &inet.sin6_addr ) ;
int rc = inet_pton( af() , host_part_head.c_str() , &inet.sin6_addr ) ;
if( rc == 1 && !zone.empty() )
{
@ -211,30 +212,30 @@ bool GNet::Address6::setZone( sockaddr_type & inet , const std::string & zone )
return no_overflow ;
}
void GNet::Address6::setScopeId( unsigned long scope_id )
void GNet::Address6::setScopeId( unsigned long ipv6_scope_id )
{
m_inet.sin6_scope_id = scope_id ; // narrowing conversion on unix
m_inet.sin6_scope_id = ipv6_scope_id ; // narrowing conversion on unix
}
std::string GNet::Address6::displayString( bool with_scope_id ) const
std::string GNet::Address6::displayString( bool ipv6_with_scope_id ) const
{
std::ostringstream ss ;
ss << hostPartString() ;
if( with_scope_id && scopeId() != 0U )
if( ipv6_with_scope_id && scopeId() != 0U )
ss << "%" << scopeId() ;
ss << Address6Imp::port_separator << port() ;
return ss.str() ;
}
std::string GNet::Address6::hostPartString() const
std::string GNet::Address6::hostPartString( bool /*raw*/ ) const
{
std::array<char,INET6_ADDRSTRLEN+1U> buffer ; // NOLINT cppcoreguidelines-pro-type-member-init
std::array<char,INET6_ADDRSTRLEN+1U> buffer {} ;
const void * vp = & m_inet.sin6_addr ;
const char * p = inet_ntop( family() , const_cast<void*>(vp) , &buffer[0] , buffer.size() ) ; // cast for win32
const char * p = inet_ntop( af() , const_cast<void*>(vp) , &buffer[0] , buffer.size() ) ; // cast for win32
if( p == nullptr )
throw Address::Error( "inet_ntop() failure" ) ;
buffer[buffer.size()-1U] = '\0' ;
return std::string(&buffer[0]) ;
return { &buffer[0] } ; // sic
}
std::string GNet::Address6::queryString() const
@ -251,7 +252,7 @@ std::string GNet::Address6::queryString() const
bool GNet::Address6::validData( const sockaddr * addr , socklen_t len )
{
return addr != nullptr && addr->sa_family == family() && len == sizeof(sockaddr_type) ;
return addr != nullptr && addr->sa_family == af() && len == sizeof(sockaddr_type) ;
}
bool GNet::Address6::validString( const std::string & s , std::string * reason_p )
@ -285,8 +286,8 @@ bool GNet::Address6::validPort( unsigned int port )
bool GNet::Address6::same( const Address6 & other , bool with_scope ) const
{
return
m_inet.sin6_family == family() &&
other.m_inet.sin6_family == family() &&
m_inet.sin6_family == af() &&
other.m_inet.sin6_family == af() &&
sameAddr( m_inet.sin6_addr , other.m_inet.sin6_addr ) &&
( !with_scope || m_inet.sin6_scope_id == other.m_inet.sin6_scope_id ) &&
m_inet.sin6_port == other.m_inet.sin6_port ;
@ -295,8 +296,8 @@ bool GNet::Address6::same( const Address6 & other , bool with_scope ) const
bool GNet::Address6::sameHostPart( const Address6 & other , bool with_scope ) const
{
return
m_inet.sin6_family == family() &&
other.m_inet.sin6_family == family() &&
m_inet.sin6_family == af() &&
other.m_inet.sin6_family == af() &&
sameAddr( m_inet.sin6_addr , other.m_inet.sin6_addr ) &&
( !with_scope || m_inet.sin6_scope_id == other.m_inet.sin6_scope_id ) ;
}
@ -316,7 +317,7 @@ unsigned int GNet::Address6::port() const
return ntohs( m_inet.sin6_port ) ;
}
unsigned long GNet::Address6::scopeId() const
unsigned long GNet::Address6::scopeId( unsigned long /*default*/ ) const
{
return m_inet.sin6_scope_id ;
}

View File

@ -37,40 +37,39 @@ class GNet::Address6
{
public:
using sockaddr_type = sockaddr_in6 ;
using storage_type = sockaddr_storage ;
explicit Address6( unsigned int ) ;
explicit Address6( const std::string & ) ;
Address6( const std::string & , const std::string & ) ;
Address6( const std::string & , unsigned int ) ;
Address6( unsigned int port , int /*for overload resolution*/ ) ; // canonical loopback address
Address6( const sockaddr * addr , socklen_t len , bool = false ) ;
Address6( const sockaddr * addr , socklen_t len , bool ipv6_scope_id_fixup = false ) ;
static int domain() ;
static unsigned short family() ;
static int domain() noexcept ;
static unsigned short af() noexcept ;
const sockaddr * address() const ;
sockaddr * address() ;
static socklen_t length() noexcept ;
unsigned long scopeId() const ;
unsigned long scopeId( unsigned long default_ = 0UL ) const ;
unsigned int port() const ;
void setPort( unsigned int port ) ;
bool setZone( const std::string & zone_name_or_scope_id ) ;
void setScopeId( unsigned long ) ;
bool setZone( const std::string & ipv6_zone_name_or_scope_id ) ;
void setScopeId( unsigned long ipv6_scope_id ) ;
static bool validString( const std::string & , std::string * = nullptr ) ;
static bool validStrings( const std::string & , const std::string & , std::string * = nullptr ) ;
static bool validPort( unsigned int port ) ;
static bool validData( const sockaddr * addr , socklen_t len ) ;
bool same( const Address6 & other , bool with_scope = false ) const ;
bool sameHostPart( const Address6 & other , bool with_scope = false ) const ;
bool same( const Address6 & other , bool ipv6_compare_with_scope = false ) const ;
bool sameHostPart( const Address6 & other , bool ipv6_compare_with_scope = false ) const ;
bool isLoopback() const ;
bool isLocal( std::string & ) const ;
bool isLinkLocal() const ;
bool isUniqueLocal() const ;
bool isAny() const ;
unsigned int bits() const ;
std::string displayString( bool ) const ;
std::string hostPartString() const ;
std::string displayString( bool ipv6_with_scope = false ) const ;
std::string hostPartString( bool raw = false ) const ;
std::string queryString() const ;
G::StringArray wildcards() const ;

View File

@ -31,6 +31,9 @@ namespace GNet
class Address6
{
} ;
class AddressLocal
{
} ;
namespace AddressImp
{
void check( GNet::Address::Family f )
@ -51,55 +54,70 @@ bool GNet::Address::supports( int af , int )
return af == AF_INET ;
}
bool GNet::Address::supports( const Address::Domain & , int domain )
{
return domain == Address4::domain() ;
}
GNet::Address GNet::Address::defaultAddress()
{
return Address( Family::ipv4 , 0U ) ;
return { Family::ipv4 , 0U } ;
}
GNet::Address::Address( Family f , unsigned int port ) :
m_4imp(std::make_unique<Address4>(port))
m_ipv4(std::make_unique<Address4>(port))
{
AddressImp::check( f ) ;
}
GNet::Address::Address( const AddressStorage & storage ) :
m_4imp(std::make_unique<Address4>(storage.p(),storage.n()))
m_ipv4(std::make_unique<Address4>(storage.p(),storage.n()))
{
}
GNet::Address::Address( const sockaddr * addr , socklen_t len ) :
m_4imp(std::make_unique<Address4>(addr,len))
m_ipv4(std::make_unique<Address4>(addr,len))
{
}
GNet::Address::Address( const sockaddr * addr , socklen_t len , bool ) :
m_4imp(std::make_unique<Address4>(addr,len))
m_ipv4(std::make_unique<Address4>(addr,len))
{
}
GNet::Address::Address( const std::string & s ) :
m_4imp(std::make_unique<Address4>(s))
m_ipv4(std::make_unique<Address4>(s))
{
}
GNet::Address::Address( const std::string & s , NotLocal ) :
m_ipv4(std::make_unique<Address4>(s))
{
}
GNet::Address::Address( const std::string & host_part , const std::string & port_part ) :
m_ipv4(std::make_unique<Address4>(host_part,port_part))
{
}
GNet::Address::Address( const std::string & s , unsigned int port ) :
m_4imp(std::make_unique<Address4>(s,port))
m_ipv4(std::make_unique<Address4>(s,port))
{
}
GNet::Address::Address( Family f , unsigned int port , int loopback_overload ) :
m_4imp(std::make_unique<Address4>(port,loopback_overload))
m_ipv4(std::make_unique<Address4>(port,loopback_overload))
{
AddressImp::check( f ) ;
}
GNet::Address::Address( const Address & other ) :
m_4imp(std::make_unique<Address4>(*other.m_4imp))
m_ipv4(std::make_unique<Address4>(*other.m_ipv4))
{
}
GNet::Address::Address( Address && other ) noexcept
=default ;
= default ;
GNet::Address::~Address()
= default;
@ -107,7 +125,7 @@ GNet::Address::~Address()
void GNet::Address::swap( Address & other ) noexcept
{
using std::swap ;
swap( m_4imp , other.m_4imp ) ;
swap( m_ipv4 , other.m_ipv4 ) ;
}
GNet::Address & GNet::Address::operator=( const Address & other )
@ -119,6 +137,31 @@ GNet::Address & GNet::Address::operator=( const Address & other )
GNet::Address & GNet::Address::operator=( Address && other ) noexcept
= default ;
GNet::Address GNet::Address::parse( const std::string & s )
{
return Address( s ) ;
}
GNet::Address GNet::Address::parse( const std::string & s , Address::NotLocal not_local )
{
return { s , not_local } ;
}
GNet::Address GNet::Address::parse( const std::string & host_part , unsigned int port )
{
return { host_part , port } ;
}
GNet::Address GNet::Address::parse( const std::string & host_part , const std::string & port_part )
{
return { host_part , port_part } ;
}
bool GNet::Address::isFamilyLocal( const std::string & )
{
return false ;
}
GNet::Address GNet::Address::loopback( Family f , unsigned int port )
{
return Address( f , port , 1 ) ;
@ -126,7 +169,7 @@ GNet::Address GNet::Address::loopback( Family f , unsigned int port )
GNet::Address & GNet::Address::setPort( unsigned int port )
{
m_4imp->setPort( port ) ;
m_ipv4->setPort( port ) ;
return *this ;
}
@ -142,32 +185,32 @@ bool GNet::Address::setZone( const std::string & )
unsigned int GNet::Address::bits() const
{
return m_4imp->bits() ;
return m_ipv4->bits() ;
}
bool GNet::Address::isLoopback() const
{
return m_4imp->isLoopback() ;
return m_ipv4->isLoopback() ;
}
bool GNet::Address::isLocal( std::string & reason ) const
{
return m_4imp->isLocal( reason ) ;
return m_ipv4->isLocal( reason ) ;
}
bool GNet::Address::isLinkLocal() const
{
return m_4imp->isLinkLocal() ;
return m_ipv4->isLinkLocal() ;
}
bool GNet::Address::isUniqueLocal() const
{
return m_4imp->isUniqueLocal() ;
return m_ipv4->isUniqueLocal() ;
}
bool GNet::Address::isAny() const
{
return m_4imp->isAny() ;
return m_ipv4->isAny() ;
}
bool GNet::Address::is4() const
@ -182,12 +225,12 @@ bool GNet::Address::is6() const
bool GNet::Address::same( const Address & other , bool ) const
{
return m_4imp->same( *other.m_4imp ) ;
return m_ipv4->same( *other.m_ipv4 ) ;
}
bool GNet::Address::operator==( const Address & other ) const
{
return m_4imp->same( *other.m_4imp ) ;
return m_ipv4->same( *other.m_ipv4 ) ;
}
bool GNet::Address::operator!=( const Address & other ) const
@ -197,22 +240,22 @@ bool GNet::Address::operator!=( const Address & other ) const
bool GNet::Address::sameHostPart( const Address & other ) const
{
return m_4imp->sameHostPart(*other.m_4imp) ;
return m_ipv4->sameHostPart(*other.m_ipv4) ;
}
std::string GNet::Address::displayString( bool ) const
{
return m_4imp->displayString() ;
return m_ipv4->displayString() ;
}
std::string GNet::Address::hostPartString() const
std::string GNet::Address::hostPartString( bool ) const
{
return m_4imp->hostPartString() ;
return m_ipv4->hostPartString() ;
}
std::string GNet::Address::queryString() const
{
return m_4imp->queryString() ;
return m_ipv4->queryString() ;
}
bool GNet::Address::validString( const std::string & s , std::string * reason_p )
@ -220,6 +263,11 @@ bool GNet::Address::validString( const std::string & s , std::string * reason_p
return Address4::validString( s , reason_p ) ;
}
bool GNet::Address::validString( const std::string & s , NotLocal , std::string * reason_p )
{
return Address4::validString( s , reason_p ) ;
}
bool GNet::Address::validStrings( const std::string & s1 , const std::string & s2 , std::string * reason_p )
{
return Address4::validStrings( s1 , s2 , reason_p ) ;
@ -227,12 +275,12 @@ bool GNet::Address::validStrings( const std::string & s1 , const std::string & s
sockaddr * GNet::Address::address()
{
return m_4imp->address() ;
return m_ipv4->address() ;
}
const sockaddr * GNet::Address::address() const
{
return m_4imp->address() ;
return m_ipv4->address() ;
}
socklen_t GNet::Address::length() const
@ -242,7 +290,7 @@ socklen_t GNet::Address::length() const
unsigned int GNet::Address::port() const
{
return m_4imp->port() ;
return m_ipv4->port() ;
}
unsigned long GNet::Address::scopeId( unsigned long default_ ) const
@ -260,9 +308,9 @@ bool GNet::Address::validData( const sockaddr * addr , socklen_t len )
return Address4::validData( addr , len ) ;
}
int GNet::Address::domain() const
int GNet::Address::domain( Family family )
{
return Address4::domain() ;
return family == Family::ipv4 ? Address4::domain() : 0 ;
}
GNet::Address::Family GNet::Address::family() const
@ -277,7 +325,7 @@ int GNet::Address::af() const
G::StringArray GNet::Address::wildcards() const
{
return m_4imp->wildcards() ;
return m_ipv4->wildcards() ;
}
// ==
@ -288,7 +336,7 @@ G::StringArray GNet::Address::wildcards() const
class GNet::AddressStorageImp
{
public:
Address4::storage_type u ;
sockaddr_storage u ;
socklen_t n ;
} ;
@ -297,9 +345,9 @@ public:
GNet::AddressStorage::AddressStorage() :
m_imp(std::make_unique<AddressStorageImp>())
{
static_assert( sizeof(Address4::sockaddr_type) <= sizeof(Address4::storage_type) , "" ) ;
static_assert( alignof(Address4::sockaddr_type) <= alignof(Address4::storage_type) , "" ) ;
m_imp->n = sizeof( Address4::storage_type ) ;
static_assert( sizeof(Address4::sockaddr_type) <= sizeof(sockaddr_storage) , "" ) ;
static_assert( alignof(Address4::sockaddr_type) <= alignof(sockaddr_storage) , "" ) ;
m_imp->n = sizeof( sockaddr_storage ) ;
}
GNet::AddressStorage::~AddressStorage()

View File

@ -21,105 +21,170 @@
#include "gdef.h"
#include "gaddress4.h"
#include "gaddress6.h"
#include "gaddresslocal.h"
#include "gaddress.h"
#include "gstr.h"
#include "gassert.h"
#include <algorithm> // std::swap()
#include <utility> // std::swap()
#include <sstream>
#include <cstring>
namespace GNet
bool GNet::Address::supports( Family f )
{
namespace AddressImp
{
static bool is4( const sockaddr * p )
{
return p && p->sa_family == GNet::Address4::family() ;
}
static bool is4( const std::string & s )
{
std::string r ;
return GNet::Address4::validString(s,&r) ;
}
static bool is4( const std::string & s , unsigned int )
{
std::string r ;
return GNet::Address4::validStrings(s,"0",&r) ;
}
template <typename... Args>
std::unique_ptr<Address4> make_4_if( bool b , Args&&... args )
{
return b ? std::make_unique<Address4>(std::forward<Args>(args)...) : std::unique_ptr<Address4>() ;
}
template <typename... Args>
std::unique_ptr<Address6> make_6_if( bool b , Args&&... args )
{
return b ? std::make_unique<Address6>(std::forward<Args>(args)...) : std::unique_ptr<Address6>() ;
}
}
}
bool GNet::Address::supports( Family )
{
return true ;
if( f == Address::Family::local && AddressLocal::af() == 0 )
return false ;
else
return true ;
}
bool GNet::Address::supports( int af , int )
{
return af == AF_INET || af == AF_INET6 ;
return af == Address4::af() || af == Address6::af() || af == AddressLocal::af() ;
}
GNet::Address GNet::Address::defaultAddress()
bool GNet::Address::supports( const Address::Domain & , int domain )
{
return Address( Family::ipv4 , 0U ) ;
return domain == Address4::domain() || domain == Address6::domain() || domain == AddressLocal::domain() ;
}
GNet::Address::Address( Family f , unsigned int port ) :
m_4imp(AddressImp::make_4_if(f==Family::ipv4,port)) ,
m_6imp(AddressImp::make_6_if(f!=Family::ipv4,port))
GNet::Address::Address( Family f , unsigned int port )
{
if( Address4::af() && f == Address::Family::ipv4 )
m_ipv4 = std::make_unique<Address4>( port ) ;
else if( Address6::af() && f == Address::Family::ipv6 )
m_ipv6 = std::make_unique<Address6>( port ) ;
else if( AddressLocal::af() && f == Address::Family::local )
m_local = std::make_unique<AddressLocal>( port ) ;
else
throw Address::BadFamily() ;
}
GNet::Address::Address( const AddressStorage & storage ) :
m_4imp(AddressImp::make_4_if(AddressImp::is4(storage.p()),storage.p(),storage.n())) ,
m_6imp(AddressImp::make_6_if(!AddressImp::is4(storage.p()),storage.p(),storage.n()))
GNet::Address::Address( const AddressStorage & storage )
{
if( storage.p()->sa_family == 0 )
throw Address::BadFamily() ;
else if( Address4::af() && storage.p()->sa_family == Address4::af() )
m_ipv4 = std::make_unique<Address4>( storage.p() , storage.n() ) ;
else if( Address6::af() && storage.p()->sa_family == Address6::af() )
m_ipv6 = std::make_unique<Address6>( storage.p() , storage.n() ) ;
else if( AddressLocal::af() && storage.p()->sa_family == AddressLocal::af() )
m_local = std::make_unique<AddressLocal>( storage.p() , storage.n() ) ;
else
throw Address::BadFamily() ;
}
GNet::Address::Address( const sockaddr * addr , socklen_t len ) :
m_4imp(AddressImp::make_4_if(AddressImp::is4(addr),addr,len)) ,
m_6imp(AddressImp::make_6_if(!AddressImp::is4(addr),addr,len))
GNet::Address::Address( const sockaddr * addr , socklen_t len )
{
if( addr == nullptr || len < sizeof(sockaddr::sa_family) )
throw Address::Error() ;
else if( addr->sa_family == 0 )
throw Address::BadFamily() ;
else if( Address4::af() && addr->sa_family == Address4::af() )
m_ipv4 = std::make_unique<Address4>( addr , len ) ;
else if( Address6::af() && addr->sa_family == Address6::af() )
m_ipv6 = std::make_unique<Address6>( addr , len ) ;
else if( AddressLocal::af() && addr->sa_family == AddressLocal::af() )
m_local = std::make_unique<AddressLocal>( addr , len ) ;
else
throw Address::BadFamily() ;
}
GNet::Address::Address( const sockaddr * addr , socklen_t len , bool scope_id_fixup ) :
m_4imp(AddressImp::make_4_if(AddressImp::is4(addr),addr,len)) ,
m_6imp(AddressImp::make_6_if(!AddressImp::is4(addr),addr,len,scope_id_fixup))
GNet::Address::Address( const sockaddr * addr , socklen_t len , bool ipv6_scope_id_fixup )
{
if( addr == nullptr || len < sizeof(sockaddr::sa_family) )
throw Address::Error() ;
else if( addr->sa_family == 0 )
throw Address::BadFamily() ;
else if( Address4::af() && addr->sa_family == Address4::af() )
m_ipv4 = std::make_unique<Address4>( addr , len , ipv6_scope_id_fixup ) ;
else if( Address6::af() && addr->sa_family == Address6::af() )
m_ipv6 = std::make_unique<Address6>( addr , len , ipv6_scope_id_fixup ) ;
else if( AddressLocal::af() && addr->sa_family == AddressLocal::af() )
m_local = std::make_unique<AddressLocal>( addr , len , ipv6_scope_id_fixup ) ;
else
throw Address::BadFamily() ;
}
GNet::Address::Address( const std::string & s ) :
m_4imp(AddressImp::make_4_if(AddressImp::is4(s),s)) ,
m_6imp(AddressImp::make_6_if(!AddressImp::is4(s),s))
GNet::Address::Address( const std::string & s )
{
std::string r1 , r2 ;
if( s.empty() )
throw Address::Error( "empty string" ) ;
else if( AddressLocal::af() && isFamilyLocal(s) )
m_local = std::make_unique<AddressLocal>( s ) ;
else if( Address4::af() && Address4::validString(s,&r1) )
m_ipv4 = std::make_unique<Address4>( s ) ;
else if( Address6::af() && Address6::validString(s,&r2) )
m_ipv6 = std::make_unique<Address6>( s ) ;
else
throw Address::Error( r1 , r1==r2?std::string():r2 , G::Str::printable(s) ) ;
}
GNet::Address::Address( const std::string & s , unsigned int port ) :
m_4imp(AddressImp::make_4_if(AddressImp::is4(s,port),s,port)) ,
m_6imp(AddressImp::make_6_if(!AddressImp::is4(s,port),s,port))
GNet::Address::Address( const std::string & s , NotLocal )
{
std::string r1 , r2 ;
if( s.empty() )
throw Address::Error( "empty string" ) ;
else if( Address4::af() && Address4::validString(s,&r1) )
m_ipv4 = std::make_unique<Address4>( s ) ;
else if( Address6::af() && Address6::validString(s,&r2) )
m_ipv6 = std::make_unique<Address6>( s ) ;
else
throw Address::Error( r1 , r1==r2?std::string():r2 , G::Str::printable(s) ) ;
}
GNet::Address::Address( Family f , unsigned int port , int loopback_overload ) :
m_4imp(AddressImp::make_4_if(f==Family::ipv4,port,loopback_overload)) ,
m_6imp(AddressImp::make_6_if(f!=Family::ipv4,port,loopback_overload))
GNet::Address::Address( const std::string & host_part , const std::string & port_part )
{
std::string r1 , r2 ;
if( host_part.empty() )
throw Address::Error( "empty string" ) ;
else if( AddressLocal::af() && isFamilyLocal( host_part ) )
m_local = std::make_unique<AddressLocal>( host_part , port_part ) ;
else if( Address4::af() && Address4::validStrings(host_part,port_part,&r1) )
m_ipv4 = std::make_unique<Address4>( host_part , port_part ) ;
else if( Address6::af() && Address6::validStrings(host_part,port_part,&r2) )
m_ipv6 = std::make_unique<Address6>( host_part , port_part ) ;
else
throw Address::Error( r1 , r1==r2?std::string():r2 , G::Str::printable(host_part) + " " + G::Str::printable(port_part) ) ;
}
GNet::Address::Address( const std::string & host_part , unsigned int port )
{
std::string r1 , r2 ;
if( host_part.empty() )
throw Address::Error( "empty string" ) ;
else if( AddressLocal::af() && isFamilyLocal( host_part ) )
m_local = std::make_unique<AddressLocal>( host_part , port ) ;
else if( Address4::af() && Address4::validStrings(host_part,"0",&r1) && Address4::validPort(port) )
m_ipv4 = std::make_unique<Address4>( host_part , port ) ;
else if( Address6::af() && Address6::validStrings(host_part,"0",&r2) && Address6::validPort(port) )
m_ipv6 = std::make_unique<Address6>( host_part , port ) ;
else
throw Address::Error( r1 , r1==r2?std::string():r2 , G::Str::printable(host_part) ) ;
}
GNet::Address::Address( Family f , unsigned int port , int loopback_overload )
{
if( Address4::af() && f == Address::Family::ipv4 )
m_ipv4 = std::make_unique<Address4>( port , loopback_overload ) ;
else if( Address6::af() && f == Address::Family::ipv6 )
m_ipv6 = std::make_unique<Address6>( port , loopback_overload ) ;
else if( AddressLocal::af() && f == Address::Family::local )
m_local = std::make_unique<AddressLocal>( port , loopback_overload ) ;
else
throw Address::BadFamily() ;
}
GNet::Address::Address( const Address & other )
{
if( other.m_4imp ) m_4imp = std::make_unique<Address4>( *other.m_4imp ) ;
if( other.m_6imp ) m_6imp = std::make_unique<Address6>( *other.m_6imp ) ;
G_ASSERT( other.m_ipv4 || other.m_ipv6 || other.m_local ) ;
if( other.m_ipv4 )
m_ipv4 = std::make_unique<Address4>( *other.m_ipv4 ) ;
if( other.m_ipv6 )
m_ipv6 = std::make_unique<Address6>( *other.m_ipv6 ) ;
if( other.m_local )
m_local = std::make_unique<AddressLocal>( *other.m_local ) ;
}
GNet::Address::Address( Address && other ) noexcept
@ -131,8 +196,9 @@ GNet::Address::~Address()
void GNet::Address::swap( Address & other ) noexcept
{
using std::swap ;
swap( m_4imp , other.m_4imp ) ;
swap( m_6imp , other.m_6imp ) ;
swap( m_ipv4 , other.m_ipv4 ) ;
swap( m_ipv6 , other.m_ipv6 ) ;
swap( m_local , other.m_local ) ;
}
GNet::Address & GNet::Address::operator=( const Address & other )
@ -144,90 +210,148 @@ GNet::Address & GNet::Address::operator=( const Address & other )
GNet::Address & GNet::Address::operator=( Address && other ) noexcept
= default ;
GNet::Address GNet::Address::parse( const std::string & s )
{
return Address( s ) ;
}
GNet::Address GNet::Address::parse( const std::string & s , Address::NotLocal not_local )
{
return { s , not_local } ;
}
GNet::Address GNet::Address::parse( const std::string & host_part , unsigned int port )
{
return { host_part , port } ;
}
GNet::Address GNet::Address::parse( const std::string & host_part , const std::string & port_part )
{
return { host_part , port_part } ;
}
bool GNet::Address::isFamilyLocal( const std::string & s )
{
return supports( Family::local ) && !s.empty() && s[0] == '/' ;
}
GNet::Address GNet::Address::defaultAddress()
{
return { Family::ipv4 , 0U } ;
}
GNet::Address GNet::Address::loopback( Family f , unsigned int port )
{
return Address( f , port , 1 ) ;
return { f , port , 1 } ;
}
GNet::Address & GNet::Address::setPort( unsigned int port )
{
m_4imp ? m_4imp->setPort(port) : m_6imp->setPort(port) ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) m_ipv4->setPort( port ) ;
if( m_ipv6 ) m_ipv6->setPort( port ) ;
if( m_local ) m_local->setPort( port ) ;
return *this ;
}
bool GNet::Address::setZone( const std::string & zone )
bool GNet::Address::setZone( const std::string & ipv6_zone )
{
return m_4imp ? true : m_6imp->setZone(zone) ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) m_ipv4->setZone( ipv6_zone ) ;
if( m_ipv6 ) m_ipv6->setZone( ipv6_zone ) ;
if( m_local ) m_local->setZone( ipv6_zone ) ;
return true ;
}
GNet::Address & GNet::Address::setScopeId( unsigned long scope_id )
GNet::Address & GNet::Address::setScopeId( unsigned long ipv6_scope_id )
{
if( m_6imp ) m_6imp->setScopeId(scope_id) ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) m_ipv4->setScopeId( ipv6_scope_id ) ;
if( m_ipv6 ) m_ipv6->setScopeId( ipv6_scope_id ) ;
if( m_local ) m_local->setScopeId( ipv6_scope_id ) ;
return *this ;
}
unsigned int GNet::Address::bits() const
{
return m_4imp ? m_4imp->bits() : m_6imp->bits() ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return m_ipv4->bits() ;
if( m_ipv6 ) return m_ipv6->bits() ;
if( m_local ) return m_local->bits() ;
return 0U ;
}
bool GNet::Address::isLoopback() const
{
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
return
( m_4imp && m_4imp->isLoopback() ) ||
( m_6imp && m_6imp->isLoopback() ) ;
( m_ipv4 && m_ipv4->isLoopback() ) ||
( m_ipv6 && m_ipv6->isLoopback() ) ||
( m_local && m_local->isLoopback() ) ;
}
bool GNet::Address::isLocal( std::string & reason ) const
{
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
return
( m_4imp && m_4imp->isLocal(reason) ) ||
( m_6imp && m_6imp->isLocal(reason) ) ;
( m_ipv4 && m_ipv4->isLocal(reason) ) ||
( m_ipv6 && m_ipv6->isLocal(reason) ) ||
( m_local && m_local->isLocal(reason) ) ;
}
bool GNet::Address::isLinkLocal() const
{
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
return
( m_4imp && m_4imp->isLinkLocal() ) ||
( m_6imp && m_6imp->isLinkLocal() ) ;
( m_ipv4 && m_ipv4->isLinkLocal() ) ||
( m_ipv6 && m_ipv6->isLinkLocal() ) ||
( m_local && m_local->isLinkLocal() ) ;
}
bool GNet::Address::isUniqueLocal() const
{
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
return
( m_4imp && m_4imp->isUniqueLocal() ) ||
( m_6imp && m_6imp->isUniqueLocal() ) ;
( m_ipv4 && m_ipv4->isUniqueLocal() ) ||
( m_ipv6 && m_ipv6->isUniqueLocal() ) ||
( m_local && m_local->isUniqueLocal() ) ;
}
bool GNet::Address::isAny() const
{
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
return
( m_4imp && m_4imp->isAny() ) ||
( m_6imp && m_6imp->isAny() ) ;
( m_ipv4 && m_ipv4->isAny() ) ||
( m_ipv6 && m_ipv6->isAny() ) ||
( m_local && m_local->isAny() ) ;
}
bool GNet::Address::is4() const
{
return !!m_4imp ;
return !!m_ipv4 ;
}
bool GNet::Address::is6() const
{
return !!m_6imp ;
return !!m_ipv6 ;
}
bool GNet::Address::same( const Address & other , bool with_scope ) const
bool GNet::Address::same( const Address & other , bool ipv6_compare_with_scope ) const
{
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
return
( m_4imp && other.m_4imp && m_4imp->same(*other.m_4imp) ) ||
( m_6imp && other.m_6imp && m_6imp->same(*other.m_6imp,with_scope) ) ;
( m_ipv4 && other.m_ipv4 && m_ipv4->same(*other.m_ipv4,ipv6_compare_with_scope) ) ||
( m_ipv6 && other.m_ipv6 && m_ipv6->same(*other.m_ipv6,ipv6_compare_with_scope) ) ||
( m_local && other.m_local && m_local->same(*other.m_local,ipv6_compare_with_scope) ) ;
}
bool GNet::Address::operator==( const Address & other ) const
{
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
return
( m_4imp && other.m_4imp && m_4imp->same(*other.m_4imp) ) ||
( m_6imp && other.m_6imp && m_6imp->same(*other.m_6imp) ) ;
( m_ipv4 && other.m_ipv4 && m_ipv4->same(*other.m_ipv4) ) ||
( m_ipv6 && other.m_ipv6 && m_ipv6->same(*other.m_ipv6) ) ||
( m_local && other.m_local && m_local->same(*other.m_local) ) ;
}
bool GNet::Address::operator!=( const Address & other ) const
@ -237,62 +361,106 @@ bool GNet::Address::operator!=( const Address & other ) const
bool GNet::Address::sameHostPart( const Address & other ) const
{
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
return
( m_4imp && other.m_4imp && m_4imp->sameHostPart(*other.m_4imp) ) ||
( m_6imp && other.m_6imp && m_6imp->sameHostPart(*other.m_6imp) ) ;
( m_ipv4 && other.m_ipv4 && m_ipv4->sameHostPart(*other.m_ipv4) ) ||
( m_ipv6 && other.m_ipv6 && m_ipv6->sameHostPart(*other.m_ipv6) ) ||
( m_local && other.m_local && m_local->sameHostPart(*other.m_local) ) ;
}
std::string GNet::Address::displayString( bool with_scope_id ) const
std::string GNet::Address::displayString( bool ipv6_with_scope_id ) const
{
G_ASSERT( m_4imp || m_6imp ) ;
return m_4imp ? m_4imp->displayString() : m_6imp->displayString(with_scope_id) ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return m_ipv4->displayString( ipv6_with_scope_id ) ;
if( m_ipv6 ) return m_ipv6->displayString( ipv6_with_scope_id ) ;
if( m_local ) return m_local->displayString( ipv6_with_scope_id ) ;
return {} ;
}
std::string GNet::Address::hostPartString() const
std::string GNet::Address::hostPartString( bool raw ) const
{
G_ASSERT( m_4imp || m_6imp ) ;
return m_4imp ? m_4imp->hostPartString() : m_6imp->hostPartString() ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return m_ipv4->hostPartString( raw ) ;
if( m_ipv6 ) return m_ipv6->hostPartString( raw ) ;
if( m_local ) return m_local->hostPartString( raw ) ;
return {} ;
}
std::string GNet::Address::queryString() const
{
G_ASSERT( m_4imp || m_6imp ) ;
return m_4imp ? m_4imp->queryString() : m_6imp->queryString() ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return m_ipv4->queryString() ;
if( m_ipv6 ) return m_ipv6->queryString() ;
if( m_local ) return m_local->queryString() ;
return {} ;
}
bool GNet::Address::validString( const std::string & s , std::string * reason_p )
{
return Address4::validString( s , reason_p ) || Address6::validString( s , reason_p ) ;
return
Address4::validString( s , reason_p ) ||
Address6::validString( s , reason_p ) ||
AddressLocal::validString( s , reason_p ) ;
}
bool GNet::Address::validString( const std::string & s , NotLocal , std::string * reason_p )
{
return
Address4::validString( s , reason_p ) ||
Address6::validString( s , reason_p ) ;
}
bool GNet::Address::validStrings( const std::string & s1 , const std::string & s2 , std::string * reason_p )
{
return Address4::validStrings( s1 , s2 , reason_p ) || Address6::validStrings( s1 , s2 , reason_p ) ;
return
Address4::validStrings( s1 , s2 , reason_p ) ||
Address6::validStrings( s1 , s2 , reason_p ) ||
AddressLocal::validStrings( s1 , s2 , reason_p ) ;
}
sockaddr * GNet::Address::address()
{
return m_4imp ? m_4imp->address() : m_6imp->address() ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return m_ipv4->address() ;
if( m_ipv6 ) return m_ipv6->address() ;
if( m_local ) return m_local->address() ;
return nullptr ;
}
const sockaddr * GNet::Address::address() const
{
return m_4imp ? m_4imp->address() : m_6imp->address() ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return m_ipv4->address() ;
if( m_ipv6 ) return m_ipv6->address() ;
if( m_local ) return m_local->address() ;
return nullptr ;
}
socklen_t GNet::Address::length() const
{
return m_4imp ? Address4::length() : Address6::length() ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return m_ipv4->length() ;
if( m_ipv6 ) return m_ipv6->length() ;
if( m_local ) return m_local->length() ;
return 0 ;
}
unsigned int GNet::Address::port() const
{
return m_4imp ? m_4imp->port() : m_6imp->port() ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return m_ipv4->port() ;
if( m_ipv6 ) return m_ipv6->port() ;
if( m_local ) return m_local->port() ;
return 0 ;
}
unsigned long GNet::Address::scopeId( unsigned long default_ ) const
{
return m_4imp ? default_ : m_6imp->scopeId() ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return m_ipv4->scopeId( default_ ) ;
if( m_ipv6 ) return m_ipv6->scopeId( default_ ) ;
if( m_local ) return m_local->scopeId( default_ ) ;
return default_ ;
}
bool GNet::Address::validPort( unsigned int port )
@ -302,27 +470,45 @@ bool GNet::Address::validPort( unsigned int port )
bool GNet::Address::validData( const sockaddr * addr , socklen_t len )
{
return Address4::validData( addr , len ) || Address6::validData( addr , len ) ;
return
Address4::validData( addr , len ) ||
Address6::validData( addr , len ) ||
AddressLocal::validData( addr , len ) ;
}
int GNet::Address::domain() const
int GNet::Address::domain( Family family )
{
return m_4imp ? Address4::domain() : Address6::domain() ;
if( family == Family::ipv4 ) return Address4::domain() ;
if( family == Family::ipv6 ) return Address6::domain() ;
if( family == Family::local ) return AddressLocal::domain() ;
return 0 ;
}
GNet::Address::Family GNet::Address::family() const
{
return m_4imp ? Family::ipv4 : Family::ipv6 ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return Family::ipv4 ;
if( m_ipv6 ) return Family::ipv6 ;
if( m_local ) return Family::local ;
return Family::ipv4 ;
}
int GNet::Address::af() const
{
return m_4imp ? AF_INET : AF_INET6 ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return Address4::af() ;
if( m_ipv6 ) return Address6::af() ;
if( m_local ) return AddressLocal::af() ;
return 0 ;
}
G::StringArray GNet::Address::wildcards() const
{
return m_4imp ? m_4imp->wildcards() : m_6imp->wildcards() ;
G_ASSERT( m_ipv4 || m_ipv6 || m_local ) ;
if( m_ipv4 ) return m_ipv4->wildcards() ;
if( m_ipv6 ) return m_ipv6->wildcards() ;
if( m_local ) return m_local->wildcards() ;
return {} ;
}
// ===
@ -333,7 +519,7 @@ G::StringArray GNet::Address::wildcards() const
class GNet::AddressStorageImp
{
public:
Address6::storage_type u ;
sockaddr_storage u ;
socklen_t n ;
} ;
@ -342,11 +528,15 @@ public:
GNet::AddressStorage::AddressStorage() :
m_imp(std::make_unique<AddressStorageImp>())
{
static_assert( sizeof(Address4::storage_type) <= sizeof(Address6::storage_type) , "" ) ;
static_assert( sizeof(Address6::sockaddr_type) <= sizeof(Address6::storage_type) , "" ) ;
static_assert( alignof(Address4::sockaddr_type) <= alignof(Address6::storage_type) , "" ) ;
static_assert( alignof(Address6::sockaddr_type) <= alignof(Address6::storage_type) , "" ) ;
m_imp->n = sizeof( Address6::storage_type ) ;
static_assert( sizeof(Address4::sockaddr_type) <= sizeof(sockaddr_storage) , "" ) ;
static_assert( sizeof(Address6::sockaddr_type) <= sizeof(sockaddr_storage) , "" ) ;
static_assert( sizeof(AddressLocal::sockaddr_type) <= sizeof(sockaddr_storage) , "" ) ;
static_assert( alignof(Address4::sockaddr_type) <= alignof(sockaddr_storage) , "" ) ;
static_assert( alignof(Address6::sockaddr_type) <= alignof(sockaddr_storage) , "" ) ;
static_assert( alignof(AddressLocal::sockaddr_type) <= alignof(sockaddr_storage) , "" ) ;
m_imp->n = sizeof( sockaddr_storage ) ;
}
GNet::AddressStorage::~AddressStorage()

104
src/gnet/gaddresslocal.h Normal file
View File

@ -0,0 +1,104 @@
//
// Copyright (C) 2001-2021 Graeme Walker <graeme_walker@users.sourceforge.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ===
///
/// \file gaddresslocal.h
///
#ifndef G_NET_ADDRESSLOCAL_H
#define G_NET_ADDRESSLOCAL_H
#include "gdef.h"
#include "gaddress.h"
#include "gstrings.h"
#include <string>
#if GCONFIG_HAVE_UDS
#include <sys/types.h>
#include <sys/un.h>
#else
#ifdef G_DOXYGEN
struct sockaddr_un ;
#else
struct sockaddr_un {} ;
#endif
#endif
namespace GNet
{
class AddressLocal ;
}
//| \class GNet::AddressLocal
/// A 'sockaddr' wrapper class for local-domain addresses.
///
/// Use "netcat -U" or "socat" to connect to local-domain
/// sockets, eg:
/// \code
/// $ nc -U -C /run/cmd.s
/// $ socat -d tcp-listen:8080,fork unix:/run/cmd.s
/// \endcode
///
class GNet::AddressLocal
{
public:
using sockaddr_type = sockaddr_un ;
explicit AddressLocal( unsigned int ) ;
explicit AddressLocal( const std::string & ) ;
AddressLocal( const std::string & , const std::string & ) ;
AddressLocal( const std::string & , unsigned int ) ;
AddressLocal( unsigned int port , int /*for overload resolution*/ ) ;
AddressLocal( const sockaddr * addr , socklen_t len , bool ipv6_scope_id_fixup = false ) ;
static int domain() noexcept ;
static unsigned short af() noexcept ;
const sockaddr * address() const ;
sockaddr * address() ;
socklen_t length() const noexcept ;
unsigned long scopeId( unsigned long default_ = 0UL ) const ;
unsigned int port() const ;
void setPort( unsigned int port ) ;
bool setZone( const std::string & ipv6_zone_name_or_scope_id ) ;
void setScopeId( unsigned long ipv6_scope_id ) ;
static bool validString( const std::string & , std::string * = nullptr ) ;
static bool validStrings( const std::string & , const std::string & , std::string * = nullptr ) ;
static bool validPort( unsigned int port ) ;
static bool validData( const sockaddr * addr , socklen_t len ) ;
bool same( const AddressLocal & other , bool ipv6_compare_with_scope = false ) const ;
bool sameHostPart( const AddressLocal & other ) const ;
bool isLoopback() const ;
bool isLocal( std::string & ) const ;
bool isLinkLocal() const ;
bool isUniqueLocal() const ;
bool isAny() const ;
unsigned int bits() const ;
std::string displayString( bool ipv6_with_scope = false ) const ;
std::string hostPartString( bool raw = false ) const ;
std::string queryString() const ;
G::StringArray wildcards() const ;
static bool format( const std::string & ) ;
private:
explicit AddressLocal( std::nullptr_t ) ;
std::string path() const ;
private:
sockaddr_type m_local ;
std::size_t m_size ;
} ;
#endif

View File

@ -0,0 +1,200 @@
//
// Copyright (C) 2001-2021 Graeme Walker <graeme_walker@users.sourceforge.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ===
///
/// \file gaddresslocal_none.cpp
///
#include "gdef.h"
#include "gaddresslocal.h"
unsigned short GNet::AddressLocal::af() noexcept
{
return 0 ;
}
int GNet::AddressLocal::domain() noexcept
{
return 0 ;
}
GNet::AddressLocal::AddressLocal( std::nullptr_t ) :
m_local{} ,
m_size(0U)
{
}
GNet::AddressLocal::AddressLocal( unsigned int /*port*/ ) :
AddressLocal(nullptr)
{
}
GNet::AddressLocal::AddressLocal( unsigned int /*port*/ , int /*loopback_overload*/ ) :
AddressLocal(nullptr)
{
}
GNet::AddressLocal::AddressLocal( const sockaddr * /*addr*/ , socklen_t /*len*/ , bool /*ipv6_scope_id_fixup*/ ) :
AddressLocal(nullptr)
{
}
GNet::AddressLocal::AddressLocal( const std::string & /*host_part*/ , unsigned int /*port*/ ) :
AddressLocal(nullptr)
{
}
GNet::AddressLocal::AddressLocal( const std::string & /*host_part*/ , const std::string & /*port_part*/ ) :
AddressLocal(nullptr)
{
}
GNet::AddressLocal::AddressLocal( const std::string & /*display_string*/ ) :
AddressLocal(nullptr)
{
}
void GNet::AddressLocal::setPort( unsigned int /*port*/ )
{
}
bool GNet::AddressLocal::setZone( const std::string & /*ipv6_zone_name_or_scope_id*/ )
{
return true ;
}
void GNet::AddressLocal::setScopeId( unsigned long /*ipv6_scope_id*/ )
{
}
std::string GNet::AddressLocal::path() const
{
return std::string() ;
}
std::string GNet::AddressLocal::displayString( bool /*ipv6_with_scope*/ ) const
{
return path() ;
}
std::string GNet::AddressLocal::hostPartString( bool /*raw*/ ) const
{
return displayString() ;
}
std::string GNet::AddressLocal::queryString() const
{
return std::string() ;
}
bool GNet::AddressLocal::validData( const sockaddr * /*addr*/ , socklen_t /*len*/ )
{
return false ;
}
bool GNet::AddressLocal::validString( const std::string & /*path*/ , std::string * reason_p )
{
if( reason_p )
*reason_p = "not implemented" ;
return false ;
}
bool GNet::AddressLocal::validStrings( const std::string & /*host_part*/ , const std::string & /*port_part*/ ,
std::string * reason_p )
{
return validString( std::string() , reason_p ) ;
}
bool GNet::AddressLocal::validPort( unsigned int /*port*/ )
{
return false ;
}
bool GNet::AddressLocal::same( const AddressLocal & /*other*/ , bool /*ipv6_compare_with_scope*/ ) const
{
return false ;
}
bool GNet::AddressLocal::sameHostPart( const AddressLocal & /*other*/ ) const
{
return false ;
}
unsigned int GNet::AddressLocal::port() const
{
return 0U ;
}
unsigned long GNet::AddressLocal::scopeId( unsigned long default_ ) const
{
return default_ ;
}
const sockaddr * GNet::AddressLocal::address() const
{
return nullptr ;
}
sockaddr * GNet::AddressLocal::address()
{
return nullptr ;
}
socklen_t GNet::AddressLocal::length() const noexcept
{
return 0 ;
}
G::StringArray GNet::AddressLocal::wildcards() const
{
return {} ;
}
bool GNet::AddressLocal::format( const std::string & )
{
return true ;
}
bool GNet::AddressLocal::isLocal( std::string & ) const
{
return false ;
}
bool GNet::AddressLocal::isLoopback() const
{
return false ;
}
bool GNet::AddressLocal::isLinkLocal() const
{
return false ;
}
bool GNet::AddressLocal::isUniqueLocal() const
{
return false ;
}
bool GNet::AddressLocal::isAny() const
{
return false ;
}
unsigned int GNet::AddressLocal::bits() const
{
return 0U ;
}

View File

@ -0,0 +1,269 @@
//
// Copyright (C) 2001-2021 Graeme Walker <graeme_walker@users.sourceforge.net>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ===
///
/// \file gaddresslocal_unix.cpp
///
#include "gdef.h"
#include "gaddresslocal.h"
#include "gstr.h"
#include "gassert.h"
#include <cstddef> // offsetof
#include <cstring> // std::memcpy()
#include <sys/types.h>
#include <sys/un.h>
namespace GNet
{
namespace AddressLocalImp
{
static constexpr std::size_t minsize()
{
return sizeof( sockaddr_un::sun_family ) ;
}
static constexpr std::size_t psize()
{
return sizeof( sockaddr_un::sun_path ) ;
}
static std::size_t poffset() noexcept
{
return offsetof( sockaddr_un , sun_path ) ;
}
std::string unescape( std::string path )
{
if( path.size() > 1U && path[0U] == '\\' && path[1U] == '0' )
{
path = path.substr( 1U ) ;
path[0] = '\0' ;
}
return path ;
}
}
}
unsigned short GNet::AddressLocal::af() noexcept
{
return AF_UNIX ;
}
int GNet::AddressLocal::domain() noexcept
{
return PF_UNIX ;
}
GNet::AddressLocal::AddressLocal( std::nullptr_t ) :
m_local{} ,
m_size(AddressLocalImp::minsize())
{
m_local.sun_family = af() ;
std::memset( m_local.sun_path , 0 , AddressLocalImp::psize() ) ;
}
GNet::AddressLocal::AddressLocal( unsigned int /*port*/ ) :
AddressLocal(nullptr)
{
}
GNet::AddressLocal::AddressLocal( unsigned int /*port*/ , int /*loopback_overload*/ ) :
AddressLocal(nullptr)
{
}
GNet::AddressLocal::AddressLocal( const sockaddr * addr , socklen_t len , bool /*ipv6_scope_id_fixup*/ ) :
AddressLocal(nullptr)
{
std::size_t size = static_cast<std::size_t>( len ) ;
if( addr == nullptr )
throw Address::Error() ;
if( addr->sa_family != af() || size > sizeof(sockaddr_type) )
throw Address::BadFamily() ;
m_local = *(reinterpret_cast<const sockaddr_type*>(addr)) ;
m_size = size ;
}
GNet::AddressLocal::AddressLocal( const std::string & host_part , unsigned int /*port*/ ) :
AddressLocal(nullptr)
{
if( host_part.size() >= AddressLocalImp::psize() )
throw Address::BadString( "local-domain address too long" ) ;
std::memcpy( m_local.sun_path , host_part.data() , host_part.size() ) ;
m_size = AddressLocalImp::poffset() + host_part.size() + 1U ; // include terminator
}
GNet::AddressLocal::AddressLocal( const std::string & host_part , const std::string & /*port_part*/ ) :
AddressLocal(host_part,0)
{
}
GNet::AddressLocal::AddressLocal( const std::string & display_string ) :
AddressLocal(AddressLocalImp::unescape(display_string),0)
{
}
void GNet::AddressLocal::setPort( unsigned int /*port*/ )
{
}
bool GNet::AddressLocal::setZone( const std::string & /*ipv6_zone_name_or_scope_id*/ )
{
return true ;
}
void GNet::AddressLocal::setScopeId( unsigned long /*ipv6_scope_id*/ )
{
}
std::string GNet::AddressLocal::path() const
{
namespace imp = AddressLocalImp ;
G_ASSERT( m_size >= imp::minsize() ) ;
if( m_size <= imp::poffset() )
return {} ;
else if( m_local.sun_path[0] == '\0' ) // if abstract
return { m_local.sun_path , std::min(m_size-imp::poffset(),imp::psize()) } ;
else
return { m_local.sun_path , std::min(std::strlen(m_local.sun_path),imp::psize()) } ;
}
std::string GNet::AddressLocal::displayString( bool /*ipv6_with_scope*/ ) const
{
std::string p = path() ;
return p.empty() ? std::string(1U,'/') : G::Str::printable( p ) ;
}
std::string GNet::AddressLocal::hostPartString( bool raw ) const
{
return raw ? path() : G::Str::printable(path()) ;
}
std::string GNet::AddressLocal::queryString() const
{
return {} ;
}
bool GNet::AddressLocal::validData( const sockaddr * addr , socklen_t len )
{
return addr != nullptr && addr->sa_family == af() && len >= AddressLocalImp::minsize() && len <= sizeof(sockaddr_type) ;
}
bool GNet::AddressLocal::validString( const std::string & path , std::string * reason_p )
{
const char * reason = nullptr ;
if( path.size() > AddressLocalImp::psize() )
reason = "local-domain address too long" ;
if( path.empty() )
reason = "empty string" ;
if( path[0] != '\0' && path[0] != '/' )
reason = "not an absolute filesystem path" ;
if( reason && reason_p )
*reason_p = std::string( reason ) ;
return reason == nullptr ;
}
bool GNet::AddressLocal::validStrings( const std::string & host_part , const std::string & /*port_part*/ ,
std::string * reason_p )
{
return validString( host_part , reason_p ) ;
}
bool GNet::AddressLocal::validPort( unsigned int /*port*/ )
{
return true ;
}
bool GNet::AddressLocal::same( const AddressLocal & other , bool /*ipv6_compare_with_scope*/ ) const
{
G_ASSERT( m_local.sun_family == af() ) ;
return
m_local.sun_family == other.m_local.sun_family &&
m_size == other.m_size &&
path() == other.path() ;
}
bool GNet::AddressLocal::sameHostPart( const AddressLocal & other ) const
{
return same( other ) ;
}
unsigned int GNet::AddressLocal::port() const
{
return 0U ;
}
unsigned long GNet::AddressLocal::scopeId( unsigned long default_ ) const
{
return default_ ;
}
const sockaddr * GNet::AddressLocal::address() const
{
return reinterpret_cast<const sockaddr*>(&m_local) ;
}
sockaddr * GNet::AddressLocal::address()
{
return reinterpret_cast<sockaddr*>(&m_local) ;
}
socklen_t GNet::AddressLocal::length() const noexcept
{
return m_size ;
}
G::StringArray GNet::AddressLocal::wildcards() const
{
return { displayString() } ;
}
bool GNet::AddressLocal::format( const std::string & )
{
return true ;
}
bool GNet::AddressLocal::isLocal( std::string & ) const
{
return true ;
}
bool GNet::AddressLocal::isLoopback() const
{
return false ;
}
bool GNet::AddressLocal::isLinkLocal() const
{
return false ;
}
bool GNet::AddressLocal::isUniqueLocal() const
{
return true ;
}
bool GNet::AddressLocal::isAny() const
{
return path().empty() ;
}
unsigned int GNet::AddressLocal::bits() const
{
return 0U ;
}

View File

@ -30,6 +30,7 @@
#include "gassert.h"
#include "gtest.h"
#include "glog.h"
#include <numeric> // std::accumulate
#include <sstream>
#include <cstdlib>
@ -178,7 +179,7 @@ void GNet::Client::startConnecting()
// create and open a socket
//
m_sp.reset() ;
m_socket = std::make_unique<StreamSocket>( m_remote_location.address().domain() ) ;
m_socket = std::make_unique<StreamSocket>( m_remote_location.address().family() ) ;
socket().addWriteHandler( *this , m_es ) ;
// create a socket protocol object
@ -280,6 +281,7 @@ void GNet::Client::writeEvent()
void GNet::Client::onWriteable()
{
bool has_peer = m_state == State::Connecting && socket().getPeerAddress().first ;
if( m_state == State::Connected )
{
if( m_sp->writeEvent() )
@ -291,7 +293,7 @@ void GNet::Client::onWriteable()
setState( State::Connecting ) ;
m_connected_timer.startTimer( 2U , 100000U ) ; // -> onConnectedTimeout()
}
else if( m_state == State::Connecting && socket().hasPeer() && m_remote_location.socks() )
else if( m_state == State::Connecting && has_peer && m_remote_location.socks() )
{
setState( State::Socksing ) ;
m_socks = std::make_unique<Socks>( m_remote_location ) ;
@ -308,7 +310,7 @@ void GNet::Client::onWriteable()
socket().dropReadHandler() ;
}
}
else if( m_state == State::Connecting && socket().hasPeer() )
else if( m_state == State::Connecting && has_peer )
{
socket().dropWriteHandler() ;
socket().addReadHandler( *this , m_es ) ;
@ -432,7 +434,7 @@ std::pair<bool,GNet::Address> GNet::Client::localAddress() const
{
return
m_socket != nullptr ?
socket().getLocalAddress() :
std::make_pair(true,socket().getLocalAddress()) :
std::make_pair(false,GNet::Address::defaultAddress()) ;
}
@ -478,7 +480,9 @@ bool GNet::Client::send( const std::string & data , std::size_t offset )
bool GNet::Client::send( const std::vector<G::string_view> & data , std::size_t offset )
{
if( m_response_timeout && data.size() > offset )
std::size_t total_size = std::accumulate( data.begin() , data.end() , std::size_t(0U) ,
[](std::size_t n,G::string_view s){return n+s.size();} ) ;
if( m_response_timeout && offset < total_size )
m_response_timer.startTimer( m_response_timeout ) ;
return m_sp->send( data , offset ) ;
}

View File

@ -121,7 +121,7 @@ void GNet::DnsBlock::configureImp( const std::string & config , DnsBlock * p )
if( list.size() < 4U )
throw std::runtime_error( "not enough comma-sparated fields" ) ;
Address dns_server( list.at(0U) ) ;
Address dns_server = Address::parse( list.at(0U) , Address::NotLocal() ) ;
// normally allow on timeout, but deny on timeout if configured value is negative
std::size_t threshold = G::Str::toUInt( list.at(2U) ) ;
@ -167,7 +167,7 @@ void GNet::DnsBlock::start( const Address & address )
id_generator = 10 ;
// create a socket to receive responses
m_socket_ptr = std::make_unique<DatagramSocket>( m_dns_server.domain() ) ;
m_socket_ptr = std::make_unique<DatagramSocket>( m_dns_server.family() ) ;
m_socket_ptr->addReadHandler( *this , m_es ) ;
// send a DNS query to each configured server

View File

@ -439,7 +439,7 @@ GNet::Address GNet::DnsMessageRR::address() const
{
throw DnsMessage::Error( "not an address" ) ;
}
return Address( ss.str() ) ;
return Address::parse( ss.str() , Address::NotLocal() ) ;
}
// ==

View File

@ -28,6 +28,7 @@
#include "gdescriptor.h"
#include "gsignalsafe.h"
#include <list>
#include <memory>
#include <string>
namespace GNet
@ -127,10 +128,6 @@ public:
///< list of exception sources.
///< See also Socket::dropOtherHandler().
virtual std::string report() const = 0 ;
///< Returns a line of text reporting the status of the event loop.
///< Used in debugging and diagnostics.
virtual void disarm( ExceptionHandler * ) noexcept = 0 ;
///< Used to prevent the given interface from being used,
///< typically called from the ExceptionHandler

View File

@ -58,7 +58,6 @@ private: // overrides
void dropRead( Descriptor fd ) noexcept override ;
void dropWrite( Descriptor fd ) noexcept override ;
void dropOther( Descriptor fd ) noexcept override ;
std::string report() const override ;
void disarm( ExceptionHandler * ) noexcept override ;
public:
@ -318,11 +317,6 @@ void GNet::EventLoopImp::dropOther( Descriptor ) noexcept
// no-op
}
std::string GNet::EventLoopImp::report() const
{
return std::string() ;
}
void GNet::EventLoopImp::disarm( ExceptionHandler * p ) noexcept
{
m_read_list.disarm( p ) ;

View File

@ -85,7 +85,6 @@ private: // overrides
void dropRead( Descriptor fd ) noexcept override ;
void dropWrite( Descriptor fd ) noexcept override ;
void dropOther( Descriptor fd ) noexcept override ;
std::string report() const override ;
void disarm( ExceptionHandler * ) noexcept override ;
public:
@ -363,8 +362,3 @@ void GNet::EventLoopImp::disarm( ExceptionHandler * p ) noexcept
m_other_list.disarm( p ) ;
}
std::string GNet::EventLoopImp::report() const
{
return std::string() ;
}

View File

@ -80,7 +80,6 @@ private:
void dropRead( Descriptor ) noexcept override ;
void dropWrite( Descriptor ) noexcept override ;
void dropOther( Descriptor ) noexcept override ;
std::string report() const override ;
public:
EventLoopImp( const EventLoopImp & ) = delete ;
@ -412,11 +411,6 @@ void GNet::EventLoopImp::quit( const G::SignalSafe & )
// not implemented
}
std::string GNet::EventLoopImp::report() const
{
return std::string() ;
}
// ==
GNet::EventLoopImp::Library::Library()

View File

@ -105,10 +105,14 @@ public:
///< found or if found but not up. Does lazy load()ing.
std::vector<Address> addresses( const G::StringArray & names , unsigned int port ,
G::StringArray & used_names , G::StringArray & empty_names ) const ;
G::StringArray & used_names , G::StringArray & empty_names ,
G::StringArray & bad_names ) const ;
///< Treats each name given as an address or interface name and
///< returns the total set of addresses. Returns by reference
///< lists of interface names with and without addresses.
///< (1) names that are, or have, addresses, (2) names that might
///< be interfaces with no bound addresses, and (3) the remainder,
///< ie. names that are not addresses and cannot be a valid
///< interface name.
private: // overrides
void readEvent() override ; // GNet::EventHandler

View File

@ -98,19 +98,33 @@ std::vector<GNet::Address> GNet::Interfaces::find( const std::string & name_in ,
}
std::vector<GNet::Address> GNet::Interfaces::addresses( const G::StringArray & names , unsigned int port ,
G::StringArray & used_names , G::StringArray & empty_names ) const
G::StringArray & used_names , G::StringArray & empty_names , G::StringArray & bad_names ) const
{
AddressList result ;
for( const auto & name : names )
{
if( Address::validStrings(name,G::Str::fromUInt(port)) )
{
result.push_back( Address(name,port) ) ;
result.push_back( Address::parse(name,port) ) ;
}
else
{
// 'name' is not an address so treat it as an interface name having
// bound addresses -- reject file system paths as 'bad' unless
// they are under "/dev" (bsd)
AddressList list = find( name , port , true ) ;
(list.empty()?empty_names:used_names).push_back( name ) ;
if( list.empty() && ( name.empty() || ( name.find('/') != std::string::npos && name.find("/dev/") != 0U ) ) )
{
bad_names.push_back( name ) ;
}
else if( list.empty() )
{
empty_names.push_back( name ) ;
}
else
{
used_names.push_back( name ) ;
}
result.insert( result.end() , list.begin() , list.end() ) ;
}
}

View File

@ -56,11 +56,21 @@ std::vector<GNet::Address> GNet::Interfaces::find( const std::string & , unsigne
}
std::vector<GNet::Address> GNet::Interfaces::addresses( const G::StringArray & names , unsigned int port ,
G::StringArray & , G::StringArray & ) const
G::StringArray & used_names , G::StringArray & , G::StringArray & bad_names ) const
{
AddressList result ;
for( const auto & name : names )
result.push_back( Address(name,port) ) ; // throws if an interface name
{
if( !Address::validStrings( name , G::Str::fromUInt(port) ) )
{
bad_names.push_back( name ) ;
}
else
{
used_names.push_back( name ) ;
result.push_back( Address::parse(name,port) ) ;
}
}
return result ;
}

View File

@ -183,7 +183,7 @@ GNet::InterfacesNotifierImp::InterfacesNotifierImp( Interfaces * outer , Excepti
#endif
{
G::Root claim_root ;
m_socket = std::make_unique<RawSocket>( AF_NETLINK , NETLINK_ROUTE ) ;
m_socket = std::make_unique<RawSocket>( AF_NETLINK , SOCK_RAW , NETLINK_ROUTE ) ;
int rc = ::bind( m_socket->fd() , &address.generic , sizeof(address.specific) ) ;
int e = G::Process::errno_() ;
if( rc < 0 )
@ -251,7 +251,7 @@ GNet::InterfacesNotifierImp::InterfacesNotifierImp( Interfaces * outer , Excepti
{
{
G::Root claim_root ;
m_socket = std::make_unique<RawSocket>( PF_ROUTE , AF_UNSPEC ) ;
m_socket = std::make_unique<RawSocket>( PF_ROUTE , SOCK_RAW , AF_UNSPEC ) ;
}
m_socket->addReadHandler( *outer , es ) ;
}

View File

@ -44,7 +44,7 @@ std::string GNet::Local::resolvedHostname()
if( first )
{
first = false ;
static Location location( hostname() , "0" ) ;
static Location location( hostname().append(":0") ) ;
bool ok = Resolver::resolve(location).empty() && !location.name().empty() ;
result = ok ? location.name() : (hostname()+".localnet") ;
}

View File

@ -24,65 +24,59 @@
#include "gresolver.h"
#include "gassert.h"
namespace GNet
{
namespace LocationImp
{
constexpr const char * host_service_separators = ":/" ;
}
}
GNet::Location::Location( const std::string & host , const std::string & service , int family ) :
m_host(host) ,
m_service(service) ,
GNet::Location::Location( const std::string & spec , int family ) :
m_host(head(sockless(spec))) ,
m_service(tail(sockless(spec))) ,
m_address_valid(false) ,
m_address(Address::defaultAddress()) ,
m_family(family) ,
m_dgram(false) ,
m_update_time(0U) ,
m_socks(false) ,
m_socks_far_port(0U)
m_using_socks(false)
{
m_using_socks = socksified( spec , m_socks_far_host , m_socks_far_port ) ;
if( m_host.empty() )
throw InvalidFormat( spec ) ;
G_DEBUG( "GNet::Location::ctor: unresolved location [" << displayString() << "]" << (m_using_socks?" (using socks)":"") ) ;
}
GNet::Location::Location( const std::string & spec , int family , int ) : // nosocks() overload
m_host(head(spec)) ,
m_service(tail(spec)) ,
m_address_valid(false) ,
m_address(Address::defaultAddress()) ,
m_family(family) ,
m_update_time(0U) ,
m_using_socks(false)
{
G_DEBUG( "GNet::Location::ctor: unresolved location [" << displayString() << "]" ) ;
}
GNet::Location::Location( const std::string & socks_host , const std::string & socks_service ,
const std::string & far_host , const std::string & far_service , int family ) :
m_host(socks_host) ,
m_service(socks_service) ,
m_address_valid(false) ,
m_address(Address::defaultAddress()) ,
m_family(family) ,
m_dgram(false) ,
m_update_time(0U) ,
m_socks(!far_host.empty()) ,
m_socks_far_host(far_host) ,
m_socks_far_port(0U)
{
if( far_host.empty() != far_service.empty() )
throw InvalidFormat() ;
if( m_socks && !G::Str::isUInt(far_service) )
throw InvalidFormat( "invalid port number: [" + far_service + "]" ) ;
if( m_socks )
m_socks_far_port = G::Str::toUInt( far_service ) ;
G_DEBUG( "GNet::Location::ctor: unresolved location [" << displayString() << "]" << (m_socks?" (using socks)":"") ) ;
}
GNet::Location::Location( const std::string & location_string , int family ) :
m_host(head(sockless(location_string))) ,
m_service(tail(sockless(location_string))) ,
GNet::Location::Location( const std::string & socks_server , const std::string & far_server , int family ) : // socks() overload
m_host(head(socks_server)) ,
m_service(tail(socks_server)) ,
m_address_valid(false) ,
m_address(Address::defaultAddress()) ,
m_family(family) ,
m_dgram(false) ,
m_update_time(0U) ,
m_socks(false) ,
m_socks_far_port(0U)
m_using_socks(true) ,
m_socks_far_host(head(far_server)) ,
m_socks_far_port(tail(far_server))
{
m_socks = socksified( location_string , m_socks_far_host , m_socks_far_port ) ;
if( m_host.empty() || m_service.empty() )
throw InvalidFormat( location_string ) ;
G_DEBUG( "GNet::Location::ctor: unresolved location [" << displayString() << "]" << (m_socks?" (using socks)":"") ) ;
if( m_socks_far_host.empty() || m_socks_far_port.empty() )
throw InvalidFormat() ;
if( !G::Str::isUInt(m_socks_far_port) )
throw InvalidFormat( "invalid port number: [" + m_socks_far_port + "]" ) ;
G_DEBUG( "GNet::Location::ctor: unresolved location [" << displayString() << "]" << " (using socks)" ) ;
}
GNet::Location GNet::Location::nosocks( const std::string & spec , int family )
{
return { spec , family , 1 } ;
}
GNet::Location GNet::Location::socks( const std::string & socks_server , const std::string & far_server )
{
return { socks_server , far_server , AF_UNSPEC } ;
}
std::string GNet::Location::sockless( const std::string & s )
@ -91,32 +85,31 @@ std::string GNet::Location::sockless( const std::string & s )
return G::Str::tail( s , s.find('@') , s ) ;
}
bool GNet::Location::socksified( const std::string & s , std::string & far_host , unsigned int & far_port )
bool GNet::Location::socksified( const std::string & s , std::string & far_host_out , std::string & far_port_out )
{
namespace imp = LocationImp ;
std::string::size_type pos = s.find('@') ;
if( pos != std::string::npos )
{
std::string ss = G::Str::head( s , pos ) ;
far_host = G::Str::head( ss , ss.find_last_of(imp::host_service_separators) ) ;
far_port = G::Str::toUInt( G::Str::tail( ss , ss.find_last_of(imp::host_service_separators) ) ) ;
far_host_out = G::Str::head( ss , ss.rfind(':') ) ;
far_port_out = G::Str::tail( ss , ss.rfind(':') ) ;
G::Str::toUInt( far_port_out ) ; // throw if not a number
}
return pos != std::string::npos ;
}
std::string GNet::Location::head( const std::string & s )
{
namespace imp = LocationImp ;
std::string result = G::Str::head( s , s.find_last_of(imp::host_service_separators) ) ;
if( result.size() > 1U && result.at(0U) == '[' && result.at(result.size()-1U) == ']' )
result = result.substr( 1U , result.size()-2U ) ;
return result ;
std::size_t pos = s.rfind( ':' ) ;
std::string h = ( pos == std::string::npos && !s.empty() && s[0] == '/' ) ? s : G::Str::head( s , pos ) ;
if( h.size() > 1U && h.at(0U) == '[' && h.at(h.size()-1U) == ']' )
h = h.substr( 1U , h.size()-2U ) ;
return h ;
}
std::string GNet::Location::tail( const std::string & s )
{
namespace imp = LocationImp ;
return G::Str::tail( s , s.find_last_of(imp::host_service_separators) ) ;
return G::Str::tail( s , s.rfind(':') ) ;
}
std::string GNet::Location::host() const
@ -134,16 +127,16 @@ int GNet::Location::family() const
return m_family ;
}
bool GNet::Location::dgram() const
{
return m_dgram ;
}
void GNet::Location::resolveTrivially()
bool GNet::Location::resolveTrivially()
{
std::string reason ;
if( !resolved() && Address::validStrings(m_host,m_service,&reason) )
update( Address(m_host,G::Str::toUInt(m_service)) , std::string() ) ;
std::string address_string = G::Str::join( ":" , m_host , m_service ) ;
if( !resolved() && Address::validString(address_string,&reason) )
{
Address address = Address::parse( address_string ) ;
update( address , std::string() ) ;
}
return resolved() ;
}
bool GNet::Location::resolved() const
@ -158,13 +151,27 @@ GNet::Address GNet::Location::address() const
void GNet::Location::update( const Address & address , const std::string & name )
{
G_ASSERT( m_family == AF_UNSPEC || address.domain() == m_family ) ;
if( !update(address,name,std::nothrow) )
throw InvalidFamily() ;
}
bool GNet::Location::update( const Address & address , const std::string & name , std::nothrow_t )
{
bool valid_family =
address.family() == Address::Family::ipv4 ||
address.family() == Address::Family::ipv6 ||
address.family() == Address::Family::local ;
if( !valid_family || ( m_family != AF_UNSPEC && address.af() != m_family ) )
return false ;
m_address = address ;
m_family = address.domain() ; // not family()
m_family = address.af() ; // not enum
m_address_valid = true ;
m_canonical_name = name ;
m_update_time = G::SystemTime::now() ;
G_DEBUG( "GNet::Location::ctor: resolved location [" << displayString() << "]" ) ;
return true ;
}
std::string GNet::Location::name() const
@ -174,8 +181,19 @@ std::string GNet::Location::name() const
std::string GNet::Location::displayString() const
{
const char * ipvx = m_family == AF_UNSPEC ? "ip" : ( m_family == AF_INET ? "ipv4" : "ipv6" ) ;
return resolved() ? address().displayString() : (m_host+"/"+m_service+"/"+ipvx) ;
if( resolved() )
{
return address().displayString() ;
}
else if( m_host.find('/') == 0U )
{
return m_host ;
}
else
{
const char * ipvx = m_family == AF_UNSPEC ? "ip" : ( m_family == AF_INET ? "ipv4" : "ipv6" ) ;
return m_host + "/" + m_service + "/" + ipvx ;
}
}
G::SystemTime GNet::Location::updateTime() const
@ -185,12 +203,13 @@ G::SystemTime GNet::Location::updateTime() const
bool GNet::Location::socks() const
{
return m_socks ;
return m_using_socks ;
}
unsigned int GNet::Location::socksFarPort() const
{
return m_socks_far_port ;
G_ASSERT( m_socks_far_port.empty() || G::Str::isUInt(m_socks_far_port) ) ;
return m_socks_far_port.empty() ? 0U : G::Str::toUInt(m_socks_far_port) ;
}
std::string GNet::Location::socksFarHost() const

Some files were not shown because too many files have changed in this diff Show More