Initial commit

Change-Id: I6a4444e3c193dae437cd7929f4c39aba7b749efa
diff --git a/contrib/debian/changelog b/contrib/debian/changelog
new file mode 100644
index 0000000..526d9ef
--- /dev/null
+++ b/contrib/debian/changelog
@@ -0,0 +1,209 @@
+freediameter (1.2.1) UNRELEASED; urgency=low
+
+  * New extension: rt_randomize (load-balancing on possible destinations)
+  * New contrib: Gx extension.
+  * rt_redirect.fdx and rt_load_balance.fdx improvement: use a hash table. Thanks Thomas.
+  * New hook HOOK_MESSAGE_SENDING to give a last chance to edit messages before they are sent.
+    This will be mostly used for enforcing interoperability constraints on non-compliant peers.
+  * Simplified log output. Old output can be recovered with DEBUG_WITH_META build option.
+  * Updated the internal counters for finer control on the load.
+  * Fixes in message expiry mechanism.
+  * Bug fixes in error messages generation and various parts.
+  * Improvements on shutdown sequence handling.
+  * Improvements to the dict_dcca_* extensions.
+  * Improved default CMake configuration.
+  * Improved build for MacOSX
+  * Fixes for a few newer operating systems compatibility.
+  * Fixed default secure Diameter port number 5868 instead of5658 (errata of RFC 6733)
+
+ -- Sebastien Decugis <sdecugis@freediameter.net>  Sat, 30 Jan 2016 23:38:03 +0800
+
+freediameter (1.2.0) UNRELEASED; urgency=low
+
+  * Major changes in the logging system to be more syslog and production friendly
+  * New extension: dict_dcca_3gpp
+  * New extension: dict_dcca_starent (Starent DCCA vendor-specific AVPs)
+  * New extension: rt_ignore_dh (hide network topology by proxying Destination-Host).
+  * New extension: rt_load_balance (load balancer based on pending queue size).
+  * New extension: rt_busypeers. See doc/rt_busypeers.conf.sample.
+  * New extension: dbg_msg_timings. Measures timing of message operations.
+  * New extension: dbg_msg_dumps. Use to control hooks display.
+  * New API (fd_hook_*) for extensions to control messages logging & profiling
+  * New API (fd_stats_*) for extensions to monitor framework state (e.g. SNMP implem)
+  * API change: all the fd_*_dump functions now return malloc'd strings instead of logging directly.
+  * API change: callback parameter of fd_rt_out_register had its signature updated.
+  * Updated dbg_monitoring extension to use the new API
+  * New script to generate dictionary extensions from org file (see contrib/tools)
+  * New compilation option: WORKAROUND_ACCEPT_INVALID_VSAI to improve compatibility
+    with invalid Vendor-Specific-Application-Id AVPs received from some equipments (e.g. Cisco).
+  * New compilation option: DISABLE_PEER_EXPIRY for use in test environments.
+  * Extensions are now also searched in LD_LIBRARY_PATH.
+  * Copy Proxy-Info AVP automatically in new answers.
+  * Port value 0 allowed in configuration to disable local server (e.g. disable non-secure port).
+  * API change: fd_msg_send_timeout now takes a separate callback for timeout situation.
+  * Function changes: fd_msg_dump_* now split in three different type of output.
+  * New test testmesg_stress to measure message parser performance
+  * Fix termination of the framework to avoid failures.
+  * Fix invalid timespec value in peer PSM appearing randomly (leading to crash).
+  * Return DIAMETER_LOOP_DETECTED if local peer in the Route-Record list of a message.
+  * Allow running without TLS configuration.
+  * Upgraded SCTP code to comply with RFC 6458
+  * Using default secure Diameter port number 5658 as per RFC 6733
+  * Updated TLS code for performance improvements with new GNU TLS.
+  * Fix interlocking problem when large number of requests were failed over.
+  * New option in test_app.fdx extension for long messages payload.
+  * Performance improvement in message sending code path.
+
+ -- Sebastien Decugis <sdecugis@freediameter.net>  Sat, 14 Sep 2013 18:08:07 +0800
+
+freediameter (1.1.6) UNRELEASED; urgency=low
+
+  * Fix major issue in 1.1.5 preventing to send answers to a received message.
+  * New command-line option: --enable_msg_log=( DROPPED | RECEIVED | SENT | NODELIVER | TIMING )
+  * Improved parsing error handling and Failed-AVP generation.
+  * Added support for some timings measurements in freeDiameter (in the logs)
+  * Fix port handling when using non-default port.
+  * Some cleanups in several dictionary files.
+  * New option to fd_dict_search: AVP_BY_STRUCT
+  * Improved compatibility with C++ compilers.
+  * Cleanups in sessions creation/destruction to avoid memory corruption under stress.
+  * Add support for "include" directive in freeDiameter.conf file.
+
+ -- Sebastien Decugis <sdecugis@freediameter.net>  Sun, 03 Mar 2013 07:40:43 +0100
+
+freediameter (1.1.5) UNRELEASED; urgency=low
+
+  * Added compatibility with MAC OS X
+  * Fix behavior of timeout whe nsending messages to allow re-send.
+  * Several cleanups and new contributions included.
+  * Added dependency on C++ compiler for CMakeLists.txt
+
+ -- Sebastien Decugis <sdecugis@freediameter.net>  Sat, 03 Nov 2012 17:58:11 +0100
+
+freediameter (1.1.4) UNRELEASED; urgency=low
+
+  * Compatibility with GnuTLS 3.x versions / updated packaging files accordingly
+  * Fix crash on Sparc 64 (possibly other 64b machines)
+  * Updated dict_dcca in extensions and contrib (thanks Konstantin)
+  * Changed dumping of messages to avoid interleaved information
+
+ -- Sebastien Decugis <sdecugis@freediameter.net>  Fri, 24 Aug 2012 00:17:05 +0200
+
+freediameter (1.1.3) UNRELEASED; urgency=low
+
+  * Fixed a memory leak
+  * Clean-up of some extensions
+
+ -- Sebastien Decugis <sdecugis@freediameter.net>  Tue, 03 Jul 2012 08:15:49 +0200
+
+freediameter (1.1.2) UNRELEASED; urgency=low
+
+  * FIFO queues are now capped to avoid memory exhaustion.
+  * Cleanups in MIPv6 dictionaries.
+  * app_acct upgraded: enabled vendor-specific AVP logging, thread-safe version.
+  * New function: fd_dict_getlistof to list dictionary contents.
+  * New function: fd_dict_delete to remove an entry (dangerous function!)
+  * New function: fd_sess_getcount to get count of session objects.
+  * A few additional bug fixes, check hg log for details.
+
+ -- Sebastien Decugis <sdecugis@freediameter.net>  Tue, 21 Feb 2012 18:38:10 +0100
+
+freediameter (1.1.1) UNRELEASED; urgency=low
+
+  * Bug fix release
+  * Supports newer GNUTLS versions
+  * Allow empty OctetString AVPs (l=0)
+  * Allow two instances of freeDiameter on a single host.
+
+ -- Sebastien Decugis <sdecugis@nict.go.jp>  Fri, 30 Sep 2011 21:56:50 +0200
+
+freediameter (1.1.0) UNRELEASED; urgency=low
+
+  * Source package restructured. Most of the 
+    framework now contained in the libfdcore library.
+    libfreeDiameter renamed as libfdproto.
+    This closes #15.
+  * API version bumped to version 4.
+  * Improved fd_dict_new() when the same object already exists.
+  * Improvements to dict_legacy_xml extension.
+  * Cleanups in links to shared libraries
+  * (app_radgw.fdx) Better handling conversion of DEA with error status
+    to RADIUS (closes #25)
+  * Allow default signals such as SIGTSTP (ctrl-z) to be used with
+    freeDiameterd
+  * Improved DiameterIdentity handling (esp. interationalization issues), 
+    and improve efficiency of some string operations in peers, sessions, 
+    and dictionary modules (closes #7)
+  * Cleanup in the session module to free only unreferenced sessions (#16)
+  * Removed fd_cpu_flush_cache(), replaced by more robust alternatives.
+  * Improved peer state machine algorithm to counter SCTP multistream race 
+    condition.
+  * New extension rt_redirect.fdx that handles the Diameter Redirect errors.
+  * New extension app_redirect that allows sending Redirect indications to 
+    other peers. See doc/app_redirect.conf.sample for more information.
+  * Added incomplete dictionary extension for rfc4006 (DCCA), courtesy
+    of Konstantin Chekushin <koch@lmt.lv>
+
+ -- Sebastien Decugis <sdecugis@freediameter.net>  Tue, 29 Mar 2011 10:41:19 +0900
+
+freediameter (1.0.4) UNRELEASED; urgency=low
+
+  * Added new API to specify timeout on receiving answer (#10) 
+  * Bumped API version number accordingly.
+  * New test_netemul extension (simple network emulator proxy)
+  * Improved API compatibility to C++ compilers
+
+ -- Sebastien Decugis <sdecugis@nict.go.jp>  Tue, 11 Jan 2011 12:28:22 +0900
+
+freediameter (1.0.3) UNRELEASED; urgency=low
+
+  * Fixed a couple of issues for portability (#21, #22, #23)
+  * Fixed issue with ListenOn bit ordering (#20)
+  * Added dictionary support for MIPv6 application objects.
+  * Added dictionary support for legacy XML files.
+  * Added python interface dbg_interactive (experimental). 
+  * Added parameters to fd_disp_register() and fd_sess_handler_create(),
+    Bumped API version number accordingly.
+
+ -- Sebastien Decugis <sdecugis@nict.go.jp>  Tue, 14 Dec 2010 11:39:29 +0900
+
+freediameter (1.0.2) UNRELEASED; urgency=low
+
+  * Fix an issue in app_diameap.fdx with user names (#18)
+  * Allow DH parameters loaded from a file (#17) 
+  * Fixed a few compilation warnings on 64bits architectures.
+  * New ALL_EXTENSIONS build option.
+
+ -- Sebastien Decugis <sdecugis@nict.go.jp>  Wed, 27 Oct 2010 11:17:32 +0900
+
+freediameter (1.0.1) UNRELEASED; urgency=low
+
+  * app_acct.fdx: new set of PHP scripts available in source
+    contrib/app_acct_tools
+  * app_acct.fdx: new directive 'Server_name_field' in the
+    configuration.
+  * app_radgw.fdx: new directive 'nonai' in acct and auth plugins to
+    disable NAI processing.
+  * app_radgw.fdx: New support for RADIUS proxies.
+  * app_radgw.fdx: many bug fixes.
+  * daemon: Check the local certificate is valid during TLS
+    initialization.
+  * daemon: Fixed issue for IP addresses in the form x.x.x.235
+  * daemon: new option --dbg_gnutls to get GNUTLS debug messages.
+  * debian: some cleanups in the packaging (dependencies, meta-data)
+  * rt_ereg.fdx: New routing extension based on regular expression
+    matching in package freediameter-daemon.
+
+ -- Sebastien Decugis <sdecugis@nict.go.jp>  Wed, 15 Sep 2010 18:30:28 +0900
+
+freediameter (1.0.0-2) experimental; urgency=low
+
+  * Official release 1.0.0 
+
+ -- Sebastien Decugis <sdecugis@nict.go.jp>  Thu, 29 Jul 2010 17:27:13 +0900
+
+freediameter (1.0.0-1) experimental; urgency=low
+
+  * Initial Release.
+  
+ -- Sebastien Decugis <sdecugis@nict.go.jp>  Wed, 19 May 2010 15:36:54 +0900
diff --git a/contrib/debian/compat b/contrib/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/contrib/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/contrib/debian/control b/contrib/debian/control
new file mode 100644
index 0000000..919e10e
--- /dev/null
+++ b/contrib/debian/control
@@ -0,0 +1,229 @@
+Source: freediameter
+Section: contrib/net
+Priority: extra
+Maintainer: Sebastien Decugis <sdecugis@freediameter.net>
+Build-Depends: debhelper ( >= 7.3.9),
+ cmake, make, gcc, g++, bison, flex,
+ libsctp-dev, libgnutls-dev | gnutls-dev, libidn11-dev,
+ libpq-dev, libmysqlclient-dev, libxml2-dev, swig, python-dev,
+ libgcrypt11-dev | libgcrypt20-dev
+Standards-Version: 3.8.3
+Homepage: http://www.freediameter.net
+
+Package: freediameter-common
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: The freeDiameter libraries.
+ This package contains the freeDiameter framework core libraries, 
+ required by all freeDiameter components.
+ It may also be useful for other projects which need to 
+ perform operations on Diameter messages. 
+ .
+ The freeDiameter framework provides support for the Diameter
+ Base Protocol. Without any extension, the framework can only
+ be used as a Diameter routing agent. You probably want to 
+ install some freeDiameter extension(s) to extend its 
+ features, and also the freediameter-daemon package that
+ will initialize the framework for you.
+ .
+ See 'freeDiameter-dev' package to retrieve the API for the library.
+
+Package: freediameter-dev
+Architecture: any
+Section: contrib/devel
+Depends: freediameter-common (= ${binary:Version}), libsctp-dev, libgnutls-dev, libgcrypt-dev
+Description: This package provides the development files for freeDiameter.
+
+Package: freediameter-daemon
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freediameter-common (= ${binary:Version})
+Suggests: ssl-cert, freediameter-dictionary-rfc4005, freediameter-dictionary-rfc4072, freediameter-dictionary-rfc4740,
+  freediameter-dictionary-mip6, freediameter-dictionary-legacy
+Description: The freeDiameter daemon. 
+ This daemon is a simple loader for the freeDiameter framework.
+ It is shipped with a small set of extensions, for
+ example to configure the routing behavior. See the 
+ examples in /usr/share/freediameter* for more details.
+
+Package: freediameter-debug-tools
+Architecture: any
+Section: contrib/debug
+Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
+Suggests: python, libmysqlclient16 | libmysqlclient18
+Description: freeDiameter debug tools.
+ This package provides useful tools to help tracking 
+ problems in freeDiameter installation. For example,
+ the dbg_interactive.fdx extension allows access to the 
+ framework via a python interpreter console.  
+
+Package: freediameter-dictionary-rfc4005
+Architecture: any
+Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
+Description: RFC4005 (NASREQ) dictionary support.
+ This freeDiameter extension provides the dictionary support
+ for commands and AVP defined in RFC4005 (NASREQ).
+ .
+ In order to use this extension, your main freeDiameter 
+ configuration file must contain a LoadExtension directive. 
+ See freeDiameter documentation for more details. 
+ .
+ This extension does not require a configuration file.
+
+Package: freediameter-dictionary-rfc4006
+Architecture: any
+Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
+Description: RFC4006 (DCCA) dictionary support (incomplete).
+ This freeDiameter extension provides the dictionary support
+ for commands and AVP defined in RFC4006 (DCCA).
+ .
+ In order to use this extension, your main freeDiameter 
+ configuration file must contain a LoadExtension directive. 
+ See freeDiameter documentation for more details. 
+ .
+ This extension does not require a configuration file.
+ .
+ Currently this extension is not complete: only AVP definitions 
+ are included. See the source file for more details.
+
+Package: freediameter-dictionary-rfc4072
+Architecture: any
+Depends: ${misc:Depends}, freediameter-common (= ${binary:Version}), freediameter-dictionary-rfc4005 (= ${binary:Version})
+Description: RFC4072 (Diameter EAP) dictionary support.
+ This freeDiameter extension provides the dictionary support
+ for commands and AVP defined in RFC4072 (Diameter EAP).
+ .
+ In order to use this extension, your main freeDiameter 
+ configuration file must contain a LoadExtension directive. 
+ See freeDiameter documentation for more details. 
+ .
+ This extension does not require a configuration file.
+
+Package: freediameter-dictionary-rfc4740
+Architecture: any
+Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
+Description: RFC4740 (Diameter SIP) dictionary support.
+ This freeDiameter extension provides the dictionary support
+ for commands and AVP defined in RFC4740 (Diameter SIP).
+ .
+ In order to use this extension, your main freeDiameter 
+ configuration file must contain a LoadExtension directive. 
+ See freeDiameter documentation for more details. 
+ .
+ This extension does not require a configuration file.
+
+Package: freediameter-dictionary-mip6
+Architecture: any
+Depends: ${misc:Depends}, freediameter-common (= ${binary:Version})
+Description: Diameter Mobile IPv6 application dictionary support.
+ This package contains a set of extensions to provide the support
+ for commands and AVP defined in several RFCs related to
+ Diameter MIPv6. It is split is several extensions:
+ mip6a, mip6i, nas-mipv6, rfc5777.
+ .
+ In order to use these extensions, your main freeDiameter 
+ configuration file must contain LoadExtension directives. 
+ See freeDiameter documentation for more details. 
+ .
+ These extensions do not require a configuration file.
+
+Package: freediameter-dictionary-legacy
+Architecture: any
+Depends: ${misc:Depends}, freediameter-common (= ${binary:Version}), libxml2
+Description: Legacy XML dictionary files support.
+ This freeDiameter extension allows the use of XML dictionary
+ files with the freeDiameter framework. Please note that
+ dictionaries provided as XML files come with less features
+ than native binary format, so the later should be preferred
+ when possible.
+ .
+ In order to use this extension, your main freeDiameter 
+ configuration file must contain a LoadExtension directive. 
+ See freeDiameter documentation for more details. 
+ .
+ This extension requires a configuration file. See 
+ dict_legacy_xml.conf.sample for documentation.
+
+Package: freediameter-radius-gateway
+Architecture: any
+Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version})
+Suggests: freediameter-dictionary-rfc4072 (= ${binary:Version}), freediameter-dictionary-rfc4740 (= ${binary:Version})
+Description: RADIUS/Diameter extensible gateway.
+ This freeDiameter extension implements a RADIUS to Diameter
+ gateway. It allows a RADIUS client to connect to a Diameter
+ server.
+ .
+ The support for specific Diameter applications and/or RADIUS 
+ extensions is provided in the gateway by the use of plugins.
+ Currently, the following plugins are available:
+  - echodrop.rgwx : drop or echo a RADIUS attribute. 
+                    The attribute is not converted to Diameter.
+		    See echodrop.rgwx.conf.sample for details.
+  - auth.rgwx : Convert Access-Request to Diameter AAR or DER.
+                Requests For Comments: RADIUS: 2865, 3162, 2868,
+		2869, 3579; Diameter: 4005, 4072.
+		Requires freediameter-dictionary-rfc4072.
+  - sip.rgwx  : Convert Access-Request to Diameter SIP messages.
+                Requests For Comments: Diameter: 4740.
+		Requires freediameter-dictionary-rfc4740.
+  - acct.rgwx : Converts Accounting-Request (2866) to Diameter 
+                ACR (3588).
+		Requires freediameter-dictionary-rfc4072.
+ .
+ In order to use this extension, your main freeDiameter 
+ configuration file must contain a LoadExtension directive. 
+ See freeDiameter documentation for more details. 
+ .
+ This extension requires a configuration file.
+ See app_radgw.conf.sample for more details.
+
+Package: freediameter-accounting-server
+Architecture: any
+Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version}), libpq5
+Suggests: freediameter-dictionary-rfc4072
+Description: freeDiameter simple Accounting server.
+ This freeDiameter extension implements the Diameter Base 
+ Accounting application. It saves the accounting records
+ in a PostgreSQL database backend in a highly configurable
+ maneer.
+ .
+ In order to use this extension, your main freeDiameter 
+ configuration file must contain a LoadExtension directive. 
+ See freeDiameter documentation for more details. 
+ .
+ This extension requires a configuration file.
+ See app_acct.conf.sample for more details.
+ .
+ You may find some useful resources to parse the saved records
+ in the contrib/app_acct_tools folder in source package.
+
+Package: freediameter-eap-server
+Architecture: any
+Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version}), libmysqlclient16 | libmysqlclient18, freediameter-dictionary-rfc4072 (= ${binary:Version})
+Description: freeDiameter Diameter EAP server implementation.
+ This freeDiameter extension implements a Diameter EAP server. 
+ It supports EAP-MD5 and EAP-TLS methods currently.
+ .
+ In order to use this extension, your main freeDiameter 
+ configuration file must contain a LoadExtension directive. 
+ See freeDiameter documentation for more details. 
+ .
+ This extension requires a configuration file.
+ See app_diameap.conf.sample and 
+ http://diameap.yagami.freediameter.net for more details.
+
+Package: freediameter-sip-server
+Architecture: any
+Depends: ${misc:Depends}, freediameter-daemon (= ${binary:Version}), libmysqlclient16 | libmysqlclient18, freediameter-dictionary-rfc4740 (= ${binary:Version})
+Description: freeDiameter Diameter SIP server implementation.
+ This freeDiameter extension implements a prototype 
+ Diameter SIP server.
+ See http://www.freediameter.net/trac/wiki/app_sip.fdx for
+ status information.
+ .
+ In order to use this extension, your main freeDiameter 
+ configuration file must contain a LoadExtension directive. 
+ See freeDiameter documentation for more details. 
+ .
+ This extension requires a configuration file.
+ See app_sip.conf.sample for more details.
+
diff --git a/contrib/debian/copyright b/contrib/debian/copyright
new file mode 100644
index 0000000..114bfa6
--- /dev/null
+++ b/contrib/debian/copyright
@@ -0,0 +1,35 @@
+Format-Specification: http://dep.debian.net/deps/dep5/
+Name: freeDiameter
+Maintainer: Sebastien Decugis <sdecugis@freediameter.net>
+Source: http://www.freediameter.net
+
+Files: *
+Copyright: 2008-2011, WIDE Project and NICT.
+License: BSD
+ Redistribution and use of this software in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+ .
+ * Redistributions of source code must retain the above
+   copyright notice, this list of conditions and the
+   following disclaimer.
+ . 
+ * Redistributions in binary form must reproduce the above
+   copyright notice, this list of conditions and the
+   following disclaimer in the documentation and/or other
+   materials provided with the distribution.
+ .
+ * Neither the name of the WIDE Project or NICT nor the
+   names of its contributors may be used to endorse or
+   promote products derived from this software without
+   specific prior written permission of WIDE Project and
+   NICT.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/contrib/debian/dirs b/contrib/debian/dirs
new file mode 100644
index 0000000..e9e5399
--- /dev/null
+++ b/contrib/debian/dirs
@@ -0,0 +1 @@
+etc/freeDiameter/
diff --git a/contrib/debian/docs b/contrib/debian/docs
new file mode 100644
index 0000000..5238a99
--- /dev/null
+++ b/contrib/debian/docs
@@ -0,0 +1,3 @@
+INSTALL*
+LICENSE
+README
diff --git a/contrib/debian/freediameter-accounting-server.examples b/contrib/debian/freediameter-accounting-server.examples
new file mode 100644
index 0000000..adce646
--- /dev/null
+++ b/contrib/debian/freediameter-accounting-server.examples
@@ -0,0 +1 @@
+doc/app_acct.conf.sample
diff --git a/contrib/debian/freediameter-accounting-server.install b/contrib/debian/freediameter-accounting-server.install
new file mode 100644
index 0000000..6d3b1d9
--- /dev/null
+++ b/contrib/debian/freediameter-accounting-server.install
@@ -0,0 +1 @@
+usr/lib/freeDiameter/app_acct.fdx
diff --git a/contrib/debian/freediameter-common.examples b/contrib/debian/freediameter-common.examples
new file mode 100644
index 0000000..8abb336
--- /dev/null
+++ b/contrib/debian/freediameter-common.examples
@@ -0,0 +1,5 @@
+doc/freediameter.conf.sample
+doc/acl_wl.conf.sample
+doc/rt_default.conf.sample
+doc/rt_ereg.conf.sample
+doc/single_host
diff --git a/contrib/debian/freediameter-common.install b/contrib/debian/freediameter-common.install
new file mode 100644
index 0000000..b8861ed
--- /dev/null
+++ b/contrib/debian/freediameter-common.install
@@ -0,0 +1,6 @@
+usr/lib/libfdproto.so*
+usr/lib/libfdcore.so*
+usr/lib/freeDiameter/acl_wl.fdx
+usr/lib/freeDiameter/rt_default.fdx
+usr/lib/freeDiameter/rt_ereg.fdx
+usr/lib/freeDiameter/dbg_monitor.fdx
diff --git a/contrib/debian/freediameter-daemon.default b/contrib/debian/freediameter-daemon.default
new file mode 100644
index 0000000..ed8b792
--- /dev/null
+++ b/contrib/debian/freediameter-daemon.default
@@ -0,0 +1,7 @@
+# Defaults for freediameter initscript
+# sourced by /etc/init.d/freediameter
+# installed at /etc/default/freediameter by the maintainer scripts
+
+# Additional options that are passed to the Daemon.
+# See "freeDiameterd --help" for supported flags.
+DAEMON_OPTS=""
diff --git a/contrib/debian/freediameter-daemon.init b/contrib/debian/freediameter-daemon.init
new file mode 100644
index 0000000..7b2a31a
--- /dev/null
+++ b/contrib/debian/freediameter-daemon.init
@@ -0,0 +1,160 @@
+#! /bin/sh
+
+### BEGIN INIT INFO
+# Provides:          freediameter
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Short-Description: Start freeDiameter daemon at boot time
+# Description:       Start the freeDiameter daemon at boot time.
+#	freeDiameter is an extensible implementation of the Diameter protocol,
+#	designed for Authentication, Authorization and Accounting. Diameter is
+#	an evolution of the RADIUS protocol.
+### END INIT INFO#
+
+DAEMON=/usr/bin/freeDiameterd
+CONF=/etc/freeDiameter/freeDiameter.conf
+NAME=freediameter
+DESC="freeDiameter daemon"
+
+test -x $DAEMON || exit 0
+
+LOGDIR=/var/log/freediameter
+PIDFILE=/var/run/$NAME.pid
+DODTIME=30                  # Time to wait for the server to die, in seconds
+                            # The value is high because we wait for STA answers
+			    # before disconnecting the peers.
+
+# Include freediameter defaults if available
+if [ -f /etc/default/freediameter ] ; then
+    . /etc/default/freediameter
+fi
+
+test x"" != x$DAEMON_OPTS || test -f $CONF || exit 0
+
+set -e
+
+running_pid()
+{
+    # Check if a given process pid's cmdline matches a given name
+    pid=$1
+    name=$2
+    [ -z "$pid" ] && return 1
+    [ ! -d /proc/$pid ] &&  return 1
+    cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
+    # Is this the expected child?
+    [ "$cmd" != "$name" ] &&  return 1
+    return 0
+}
+
+running()
+{
+# Check if the process is running looking at /proc
+# (works for all users)
+
+    # No pidfile, probably no daemon present
+    [ ! -f "$PIDFILE" ] && return 1
+    # Obtain the pid and check it against the binary name
+    pid=`cat $PIDFILE`
+    running_pid $pid $DAEMON || return 1
+    return 0
+}
+
+force_stop() {
+# Forcefully kill the process
+    [ ! -f "$PIDFILE" ] && return
+    if running ; then
+        kill -15 $pid
+        # Is it really dead?
+        [ -n "$DODTIME" ] && sleep "$DODTIME"s
+        if running ; then
+            kill -9 $pid
+            [ -n "$DODTIME" ] && sleep "$DODTIME"s
+            if running ; then
+                echo "Cannot kill $LABEL (pid=$pid)!"
+                exit 1
+            fi
+        fi
+    fi
+    rm -f $PIDFILE
+    return 0
+}
+
+case "$1" in
+  start)
+        echo -n "Starting $DESC: "
+        start-stop-daemon --start --quiet --pidfile $PIDFILE \
+            --exec $DAEMON -- $DAEMON_OPTS
+        if running ; then
+            echo "$NAME."
+        else
+            echo " ERROR."
+        fi
+        ;;
+  stop)
+        echo -n "Stopping $DESC: "
+        start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+            --exec $DAEMON
+        echo "$NAME."
+        ;;
+  force-stop)
+        echo -n "Forcefully stopping $DESC: "
+        force_stop
+        if ! running ; then
+            echo "$NAME."
+        else
+            echo " ERROR."
+        fi
+        ;;
+  #reload)
+        #
+        # If the daemon can reload its config files on the fly
+        # for example by sending it SIGHUP, do it here.
+        #
+        # If the daemon responds to changes in its config file
+        # directly anyway, make this a do-nothing entry.
+        #
+        # echo "Reloading $DESC configuration files."
+        # start-stop-daemon --stop --signal 1 --quiet --pidfile \
+        #       /var/run/$NAME.pid --exec $DAEMON
+  #;;
+  force-reload)
+        #
+        # If the "reload" option is implemented, move the "force-reload"
+        # option to the "reload" entry above. If not, "force-reload" is
+        # just the same as "restart" except that it does nothing if the
+        # daemon isn't already running.
+        # check wether $DAEMON is running. If so, restart
+        start-stop-daemon --stop --test --quiet --pidfile \
+            /var/run/$NAME.pid --exec $DAEMON \
+            && $0 restart \
+            || exit 0
+        ;;
+  restart)
+    echo -n "Restarting $DESC: "
+        start-stop-daemon --stop --quiet --pidfile \
+            /var/run/$NAME.pid --exec $DAEMON
+        [ -n "$DODTIME" ] && sleep $DODTIME
+        start-stop-daemon --start --quiet --pidfile \
+            /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
+        echo "$NAME."
+        ;;
+  status)
+    echo -n "$LABEL is "
+    if running ;  then
+        echo "running"
+    else
+        echo " not running."
+        exit 1
+    fi
+    ;;
+  *)
+    N=/etc/init.d/$NAME
+    # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+    echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
+    exit 1
+    ;;
+esac
+
+exit 0
diff --git a/contrib/debian/freediameter-daemon.install b/contrib/debian/freediameter-daemon.install
new file mode 100644
index 0000000..cf167a3
--- /dev/null
+++ b/contrib/debian/freediameter-daemon.install
@@ -0,0 +1 @@
+usr/bin/freeDiameterd*
diff --git a/contrib/debian/freediameter-debug-tools.examples b/contrib/debian/freediameter-debug-tools.examples
new file mode 100644
index 0000000..9750d1e
--- /dev/null
+++ b/contrib/debian/freediameter-debug-tools.examples
@@ -0,0 +1,3 @@
+doc/test_app.conf.sample
+doc/test_netemul.conf.sample
+doc/dbg_interactive.py.sample
diff --git a/contrib/debian/freediameter-debug-tools.install b/contrib/debian/freediameter-debug-tools.install
new file mode 100644
index 0000000..32c7f56
--- /dev/null
+++ b/contrib/debian/freediameter-debug-tools.install
@@ -0,0 +1,5 @@
+usr/lib/freeDiameter/dbg_rt.fdx
+usr/lib/freeDiameter/test_app.fdx
+usr/lib/freeDiameter/test_sip.fdx
+usr/lib/freeDiameter/test_netemul.fdx
+usr/lib/freeDiameter/dbg_interactive.fdx
diff --git a/contrib/debian/freediameter-dev.install b/contrib/debian/freediameter-dev.install
new file mode 100644
index 0000000..e055d40
--- /dev/null
+++ b/contrib/debian/freediameter-dev.install
@@ -0,0 +1 @@
+usr/include/freeDiameter/*
diff --git a/contrib/debian/freediameter-dictionary-legacy.examples b/contrib/debian/freediameter-dictionary-legacy.examples
new file mode 100644
index 0000000..9aede23
--- /dev/null
+++ b/contrib/debian/freediameter-dictionary-legacy.examples
@@ -0,0 +1,2 @@
+doc/dict_legacy_xml.conf.sample
+contrib/dict_legacy/dictionary.dtd
diff --git a/contrib/debian/freediameter-dictionary-legacy.install b/contrib/debian/freediameter-dictionary-legacy.install
new file mode 100644
index 0000000..acddf9b
--- /dev/null
+++ b/contrib/debian/freediameter-dictionary-legacy.install
@@ -0,0 +1 @@
+usr/lib/freeDiameter/dict_legacy_xml.fdx
diff --git a/contrib/debian/freediameter-dictionary-mip6.install b/contrib/debian/freediameter-dictionary-mip6.install
new file mode 100644
index 0000000..b337c3e
--- /dev/null
+++ b/contrib/debian/freediameter-dictionary-mip6.install
@@ -0,0 +1,4 @@
+usr/lib/freeDiameter/dict_nas_mipv6.fdx
+usr/lib/freeDiameter/dict_mip6i.fdx
+usr/lib/freeDiameter/dict_mip6a.fdx
+usr/lib/freeDiameter/dict_rfc5777.fdx
diff --git a/contrib/debian/freediameter-dictionary-rfc4005.install b/contrib/debian/freediameter-dictionary-rfc4005.install
new file mode 100644
index 0000000..1c82430
--- /dev/null
+++ b/contrib/debian/freediameter-dictionary-rfc4005.install
@@ -0,0 +1 @@
+usr/lib/freeDiameter/dict_nasreq.fdx
diff --git a/contrib/debian/freediameter-dictionary-rfc4006.install b/contrib/debian/freediameter-dictionary-rfc4006.install
new file mode 100644
index 0000000..0284a39
--- /dev/null
+++ b/contrib/debian/freediameter-dictionary-rfc4006.install
@@ -0,0 +1 @@
+usr/lib/freeDiameter/dict_dcca.fdx
diff --git a/contrib/debian/freediameter-dictionary-rfc4072.install b/contrib/debian/freediameter-dictionary-rfc4072.install
new file mode 100644
index 0000000..39c44ad
--- /dev/null
+++ b/contrib/debian/freediameter-dictionary-rfc4072.install
@@ -0,0 +1 @@
+usr/lib/freeDiameter/dict_eap.fdx
diff --git a/contrib/debian/freediameter-dictionary-rfc4740.install b/contrib/debian/freediameter-dictionary-rfc4740.install
new file mode 100644
index 0000000..08dbfe2
--- /dev/null
+++ b/contrib/debian/freediameter-dictionary-rfc4740.install
@@ -0,0 +1 @@
+usr/lib/freeDiameter/dict_sip.fdx
diff --git a/contrib/debian/freediameter-eap-server.examples b/contrib/debian/freediameter-eap-server.examples
new file mode 100644
index 0000000..7a9ed7a
--- /dev/null
+++ b/contrib/debian/freediameter-eap-server.examples
@@ -0,0 +1,2 @@
+doc/app_diameap.conf.sample
+doc/eap_tls_plugin.diameap.conf.sample
diff --git a/contrib/debian/freediameter-eap-server.install b/contrib/debian/freediameter-eap-server.install
new file mode 100644
index 0000000..bafb174
--- /dev/null
+++ b/contrib/debian/freediameter-eap-server.install
@@ -0,0 +1,2 @@
+usr/lib/freeDiameter/app_diameap.fdx
+usr/lib/freeDiameter/*.emp
diff --git a/contrib/debian/freediameter-radius-gateway.examples b/contrib/debian/freediameter-radius-gateway.examples
new file mode 100644
index 0000000..0326df0
--- /dev/null
+++ b/contrib/debian/freediameter-radius-gateway.examples
@@ -0,0 +1,2 @@
+doc/app_radgw.conf.sample
+doc/echodrop.rgwx.conf.sample
diff --git a/contrib/debian/freediameter-radius-gateway.install b/contrib/debian/freediameter-radius-gateway.install
new file mode 100644
index 0000000..23ee8dc
--- /dev/null
+++ b/contrib/debian/freediameter-radius-gateway.install
@@ -0,0 +1,2 @@
+usr/lib/freeDiameter/app_radgw.fdx
+usr/lib/freeDiameter/*.rgwx
diff --git a/contrib/debian/freediameter-sip-server.examples b/contrib/debian/freediameter-sip-server.examples
new file mode 100644
index 0000000..f49290b
--- /dev/null
+++ b/contrib/debian/freediameter-sip-server.examples
@@ -0,0 +1,4 @@
+doc/app_sip.conf.sample
+doc/app_sip.sql
+doc/app_sip_SL.sql
+doc/test_sip.conf.sample
diff --git a/contrib/debian/freediameter-sip-server.install b/contrib/debian/freediameter-sip-server.install
new file mode 100644
index 0000000..4b8c612
--- /dev/null
+++ b/contrib/debian/freediameter-sip-server.install
@@ -0,0 +1,3 @@
+usr/lib/freeDiameter/app_sip.fdx
+usr/share/doc/freeDiameter-sip-server/*
+usr/bin/freediameter-sip-*
diff --git a/contrib/debian/rules b/contrib/debian/rules
new file mode 100755
index 0000000..808f7ea
--- /dev/null
+++ b/contrib/debian/rules
@@ -0,0 +1,31 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+#
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets  by Bill Allombert 2001
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+# Comment this out if you want to include the tests when the package is built
+skip_the_tests=-DBUILD_TESTING:BOOL=OFF
+
+%:
+	dh  $@
+
+override_dh_auto_configure:
+	dh_auto_configure -- $(skip_the_tests) \
+		-DCMAKE_BUILD_TYPE:STRING=DebianPackage \
+		-DDEFAULT_CONF_PATH:PATH=/etc/freeDiameter \
+		-DALL_EXTENSIONS:BOOL=ON
+		
+
diff --git a/contrib/debian/update_changelog.txt b/contrib/debian/update_changelog.txt
new file mode 100644
index 0000000..ac6efbd
--- /dev/null
+++ b/contrib/debian/update_changelog.txt
@@ -0,0 +1,3 @@
+new release: dch -v 1.0.3 -D UNRELEASED --release-heuristic log
+Simple addition: dch "changelog entry text"
+