Commit 4ef40dfc authored by Matias Muhonen's avatar Matias Muhonen

Initial commit

parents
*.o
*.lo
*.la
.*.swp
.deps
.libs
.dirstamp
Makefile
Makefile.in
aclocal.m4
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
cscope.out
depcomp
compile
install-sh
libtool
ltmain.sh
missing
stamp-h1
tags
autom4te.cache
debian/*.log
debian/libiphb0
build-stamp
configure-stamp
debian/files
debian/hbtest-dbg.substvars
debian/hbtest-dbg/
debian/hbtest.substvars
debian/hbtest/
debian/libiphb-dev.substvars
debian/libiphb-dev/
debian/libiphb0-dbg.substvars
debian/libiphb0-dbg/
debian/libiphb0.substvars
debian/libiphb0.postinst.debhelper
debian/libiphb0.postrm.debhelper
debian/tmp/
iphbd/hbtest
iphbd/libiphb.pc
iphbd/libiphb-uninstalled.pc
m4/
This diff is collapsed.
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
SUBDIRS = iphbd
#!/bin/sh
#
# Bootstrap autotools environment
libtoolize
aclocal
automake -ac
autoconf
echo 'Ready to rock!'
# Package name and version
AC_INIT(libiphb, 0.6.25)
AM_INIT_AUTOMAKE
AC_PREREQ([2.61])
AC_CONFIG_SRCDIR([iphbd/libiphb.c])
#
# CONFIG OPTIONS
#
#
# Compiler and linker flags
#
AC_DEFINE_UNQUOTED([PRG_VERSION],[$VERSION],[Version for libiphb])
# FIXME: DSME_LOG_ENABLE should be proper&working configure option
#AC_DEFINE([DSME_LOG_ENABLE], [1])
AC_SUBST(C_GENFLAGS, ["-pthread -g -std=c99 -Wall -Wwrite-strings -Wmissing-prototypes -Werror"])
AC_SUBST(C_OPTFLAGS, ["-O2 -s"])
AC_SUBST(C_DBGFLAGS, ["-g -DDEBUG -DDSME_LOG_ENABLE"])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
PKG_PROG_PKG_CONFIG
# Specify dir for local macros
AC_CONFIG_MACRO_DIR([m4])
# Enable per-target compiler options
AM_PROG_CC_C_O()
# Pkgconf checks
PKG_CHECK_MODULES(GLIB, glib-2.0)
PKG_CHECK_MODULES(DBUS, dbus-1)
PKG_CHECK_MODULES(DBUSGLIB, dbus-glib-1)
# Check libs (that are not yet checked)
# Whitespaces in 'action-if-found' fields in order to not (auto)update LIBS variable
AC_CHECK_LIB([rt], [clock_nanosleep], [AC_MSG_NOTICE([got librt])], AC_MSG_FAILURE([librt required!]))
AC_CHECK_LIB([dsme], [dsmesock_init], [AC_MSG_NOTICE([got libdsme])], AC_MSG_FAILURE([libdsme required!]), [$GLIB_LIBS])
# Check headers
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h stdint.h stdlib.h \
string.h strings.h sys/ioctl.h sys/socket.h sys/time.h \
syslog.h unistd.h utmpx.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Check common library functions
AC_FUNC_ALLOCA
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([atexit clock_gettime dup2 gettimeofday inet_ntoa memmove \
memset realpath select setenv socket strcasecmp strdup strerror \
strndup strpbrk strrchr strstr strtoul uname utmpxname])
# Create files
AC_CONFIG_FILES([Makefile
iphbd/Makefile
iphbd/libiphb-uninstalled.pc
iphbd/libiphb.pc])
AC_OUTPUT
libiphb (0.61.25) unstable; urgency=low
* Move libiphb to its own source package (Fixes: NB#188832).
-- Matias Muhonen <ext-matias.muhonen@nokia.com> Wed, 20 Oct 2010 12:32:13 +0300
Source: libiphb
Section: misc
Priority: optional
Maintainer: Semi Malinen <semi.malinen@nokia.com>
Uploaders: Matias Muhonen <ext-matias.muhonen@nokia.com>
Build-Depends: debhelper (>= 4.1.0),
libdsme0.2.0-dev (>= 0.61.4),
pkg-config,
libglib2.0-dev,
libdbus-1-dev (>= 1.0),
libdbus-glib-1-dev,
libtool,
autoconf,
automake
Standards-Version: 3.7.2
Package: hbtest
Architecture: any
Depends: libiphb0 (>= 0.61.6)
Description: Test tool for IP Heartbeat service
Command line utility to test IP Heartbeat functionality.
Package: hbtest-dbg
Priority: extra
Architecture: any
Depends: hbtest (= ${Source-Version})
Description: Debug symbols for hbtest
This package provides debug symbols for the IP Heartbeat test tool.
Package: libiphb0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}
Description: API for IP Heartbeat service
This package contains C API for using IP Heartbeat service.
Package: libiphb0-dbg
Section: libdevel
Priority: extra
Architecture: any
Depends: libiphb0 (= ${Source-Version})
Description: Debug symbols for libiphb0
This package provides debug symbols for the IP Heartbeat API.
Package: libiphb-dev
Section: libdevel
Architecture: any
Depends: libiphb0 (= ${Source-Version}), ${shlibs:Depends}
Description: Development files for IP Heartbeat service
This package contains C headers for the IP Heartbeat API.
debian/tmp/usr/bin/hbtest
usr/include/iphbd
usr/lib/pkgconfig
debian/tmp/usr/include/iphbd/*.h
debian/tmp/usr/lib/pkgconfig/*.pc
debian/tmp/usr/lib/libiphb.so.*
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#
# 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
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
# To build testcases as well, add "testcases" to DEB_BUILD_OPTIONS
ifneq (,$(findstring testcases,$(DEB_BUILD_OPTIONS)))
DH_OPTIONS=
else
DH_OPTIONS=-Ndsme-testcases
endif
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
./autogen.sh
touch configure-stamp
#Architecture
build: build-stamp
build-stamp: configure-stamp
# To build testcases as well, add "testcases" to DEB_BUILD_OPTIONS
ifneq (,$(findstring testcases,$(DEB_BUILD_OPTIONS)))
$(MAKE) tests
else
dh_auto_configure -- --disable-static
dh_auto_build
endif
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
if [ -e Makefile ]; then $(MAKE) distclean; fi
rm -rf Makefile.in aclocal.m4 compile config.guess config.sub \
configure depcomp install-sh iphbd/Makefile.in ltmain.sh \
missing modules/Makefile.in test/Makefile test/Makefile.in \
util/Makefile.in m4
dh_clean
install:
dh_testdir
dh_testroot
dh_clean -k -s
dh_installdirs
# Add here commands to install the package into
# debian/tmp.
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
dh_install -s
# Must not depend on anything. This is to be called by
# binary-arch/binary-indep
# in another 'make' thread.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs -XREADME
dh_installexamples
dh_installman
dh_link
dh_strip --dbg-package=hbtest \
--dbg-package=libiphb0
dh_compress
dh_fixperms
dh_makeshlibs --exclude=/usr/lib/dsme/
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build install
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure
#
# Generic options
#
AM_CFLAGS = -Wall -Wmissing-prototypes -std=c99 -Os -g -fPIC
AM_CPPFLAGS = -I$(top_srcdir)/modules -D_GNU_SOURCE
AM_LDFLAGS = -g -Wl,--as-needed
ACLOCAL_AMFLAGS = -I m4
#
# Additional dirs
#
iphbdincludedir = @includedir@/iphbd
#
# Build targets
#
bin_PROGRAMS = hbtest
lib_LTLIBRARIES = libiphb.la
hbtest_SOURCES = hbtest.c
hbtest_LDADD = libiphb.la
libiphb_la_SOURCES = libiphb.c
libiphb_la_LDFLAGS = $(AM_LDFLAGS) -shared
iphbdinclude_HEADERS = libiphb.h \
iphb_internal.h
pkgconfigdir = ${libdir}/pkgconfig
pkgconfig_DATA = libiphb.pc
#! /usr/bin/env python
# =============================================================================
# File: depend_filter.py
#
# Copyright (C) 2007-2010 Nokia.
#
# Author: Simo Piiroinen <simo.piiroinen@nokia.com>
#
# This file is part of Dsme.
#
# Dsme is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License
# version 2.1 as published by the Free Software Foundation.
#
# Dsme 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with Dsme. If not, see <http://www.gnu.org/licenses/>.
#
# -----------------------------------------------------------------------------
#
# History:
#
# 05-Dec-2007 Simo Piiroinen
# - initial version
# =============================================================================
# gcc -MM filters out only standard includes, which
# does not cover glib etc headers ... so we filter
# out all dependencies with absolute path
import sys,os
DEST = None
args = sys.argv[1:]
args.reverse()
while args:
a = args.pop()
k,v = a[:2],a[2:]
if k in "-d":
DEST = v or args.pop()
else:
print>>sys.stderr, "Unknown option: %s" % a
sys.exit(1)
def dep_compare(a,b):
return cmp(a.count("/"),b.count("/")) or cmp(a,b)
def dep_filter(deps):
src, hdr = [], {}
for dep in deps:
if dep.endswith(".c"):
src.append(dep)
elif dep.startswith("/"):
continue
elif not dep in hdr:
hdr[dep] = None
hdr = hdr.keys()
hdr.sort(dep_compare)
return src + hdr
for line in sys.stdin.read().replace("\\\n", " ").split("\n"):
if not ':' in line:
continue
dest,srce = line.split(":",1)
if DEST:
dest = os.path.basename(dest)
dest = os.path.join(DEST, dest)
srce = dep_filter(srce.split())
print '%s: %s\n' % (dest, " \\\n ".join(srce))
/**
@brief Test utility for IP Heartbeat service
@file hbtest.c
This is the test utility for IP Heartbeat service.
It tries to emulate applications that use IP (UDP or TCP) and
go to sleep to wait for timeout to send "keepalive" message or some input.
This test pgm creates a TCP connection to a remote peer and runs in the following loop:
@code
while (1) {
send 4 segments of 128 bytes to the server within 40 msecs
sleep pseudorandom 30-90 msecs (to get randomness to TCP keepalive scheduling)
send 1 segment of 128 bytes to the server
wait IP heartbeat for 60 secs, or data from test server
(in this test the server never sends)
}
@endcode
See tests/TEST script for more information.
<p>
Copyright (C) 2008-2010 Nokia Corporation.
@author Raimo Vuonnala <raimo.vuonnala@nokia.com>
This file is part of Dsme.
Dsme is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License
version 2.1 as published by the Free Software Foundation.
Dsme 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with Dsme. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ioctl.h>
/* socket transport */
#include <sys/socket.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include "libiphb.h"
static volatile int run = 1;
#define ME "hbtest: "
#define SLEEP_TIME 60
static int debugmode = 0;
static void
sig_handler(int signo)
{
switch (signo) {
case SIGQUIT:
case SIGTERM:
case SIGINT:
run = 0;
break;
default:
fprintf(stderr, ME "\aERROR, unknown signal %d\n", signo);
}