add sofia-sip 1.12.4 (plus some patches through 12/21/2006) to in tree libs

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3774 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2006-12-21 06:30:28 +00:00
1 parent 0cdfa4fe13
commit 2ecac238f3
719 files changed
+311340 -2

No files matched your search

+415
View File
@@ -0,0 +1,415 @@
2006-09-26 Kai Vehmanen <kai.vehmanen@nokia.com>
* libsofia-sip-ua interface v2 frozen (2:0:2) for the 1.12.2 release
2006-08-30 Pekka Pessi <Pekka.Pessi@nokia.com>
* nua: added tag nutag_refer_with_id.
2006-08-28 Kai Vehmanen <kai.vehmanen@nokia.com>
* libsofia-sip-ua interface v2 opened to development, version to 2:0:2.
2006-08-25 Pekka Pessi <Pekka.Pessi@nokia.com>
* Added urltag_scan().
2006-08-23 Pekka Pessi <Pekka.Pessi@nokia.com>
* nta.c, nta.h: added nta_leg_make_replaces(), nta_leg_by_replaces().
* nua: event watcher (nua_subscribe, nua_watcher) now tries to re-establish
subscription if the subscription was terminated with reason "deactivated" or
"probation". Likewise, if SUBSCRIBE was returned a suitable error response
with Retry-After header, nua tries to re-establish subscription after
given interval.
2006-07-27 Kai Vehmanen <kai.vehmanen@nokia.com>
* libsofia-sip-ua interface v1 frozen (1.12.1), version to 1:0:1.
2006-06-16 Kai Vehmanen <kai.vehmanen@nokia.com>
* libsofia-sip-ua interface v0 frozen (1.12.0), version to 0:0:0.
2005-11-28 Kai Vehmanen <kai.vehmanen@nokia.com>
* <SUBDIRS>/Doxyfile: Fixed the use of doxytags. Now
a separate 'doxytags_MODNAME' file is created for each
module.
2005-11-15 Kai Vehmanen <kai.vehmanen@nokia.com>
* <SUBDIRS>/Makefile.am: Changed to use the 'include_sofia_HEADERS'
variable for listing public library headers. The variable
is defined in the top-level configure.ac.
2005-10-27 Pekka Pessi <Pekka.Pessi@nokia.com>
* Always including stun library.
M ./libsofia-sip-ua/Makefile.am -6 +3
* Added rule to make missing module libraries in libsofia-sip-ua/sofia.am
M ./libsofia-sip-ua/sofia.am -1 +6
* Added LDFLAG -static to all test programs in their Makefile.am
M ./libsofia-sip-ua/bnf/Makefile.am -1 +1
M ./libsofia-sip-ua/http/Makefile.am -2 +2
M ./libsofia-sip-ua/ipt/Makefile.am -1 +2
M ./libsofia-sip-ua/iptsec/Makefile.am +2
M ./libsofia-sip-ua/msg/Makefile.am -2 +2
M ./libsofia-sip-ua/nta/Makefile.am -1 +1
M ./libsofia-sip-ua/nth/Makefile.am +2
M ./libsofia-sip-ua/nua/Makefile.am +2
M ./libsofia-sip-ua/sdp/Makefile.am +3
M ./libsofia-sip-ua/sip/Makefile.am +4
M ./libsofia-sip-ua/soa/Makefile.am +2
M ./libsofia-sip-ua/sresolv/Makefile.am -2 +2
M ./libsofia-sip-ua/stun/Makefile.am -6 +1
2005-10-14 Pekka Pessi <Pekka.Pessi@nokia.com>
* Shell syntax exercise.
M ./autogen.sh -4 +4
2005-10-13 Pekka Pessi <Pekka.Pessi@nokia.com>
* <SUBDIRS>/Makefile.am: fixed COVERAGE_INPUT.
2005-10-13 Kai Vehmanen <kai.vehmanen@nokia.com>
* <SUBDIRS>/Makefile.am: Build all submodules as proper shared
libraries (noinst_LTLIBRARIES). Fixes sf.net:#1264030.
2005-09-09 Pekka Pessi <Pekka.Pessi@nokia.com>
* darcs changes --from-tag pessi-darcs-1:
Thu Sep 8 21:50:24 EEST 2005 Pekka.Pessi@nokia.com
* There is no separate TLS test anymore.
M ./tport/Makefile.am -1 +1
Thu Sep 8 21:36:46 EEST 2005 Pekka.Pessi@nokia.com
* Logging.
M ./nua/nua_stack.c -4 +2
Thu Sep 8 21:36:39 EEST 2005 Pekka.Pessi@nokia.com
* Added tests for tport_convert_addr.
M ./tport/tport_test.c +22
Thu Sep 8 21:36:27 EEST 2005 Pekka.Pessi@nokia.com
* Fixed receiving empty SigComp message.
M ./tport/tport.c +7
Thu Sep 8 21:32:48 EEST 2005 Pekka.Pessi@nokia.com
* Updated ChangeLogs.
M ./nta/ChangeLog -2 +10
Thu Sep 8 21:32:37 EEST 2005 Pekka.Pessi@nokia.com
* Updated ChangeLog.
M ./iptsec/ChangeLog +11
Thu Sep 8 21:31:16 EEST 2005 Pekka.Pessi@nokia.com
* Added more tests.
M ./nta/nta.c -2 +2
M ./nta/nta_test.c -2 +44
Thu Sep 8 21:30:19 EEST 2005 Pekka.Pessi@nokia.com
* Handling changes in alias list.
M ./nta/nta.c -9 +22
M ./nta/nta_test.c +1
Thu Sep 8 21:18:47 EEST 2005 Pekka.Pessi@nokia.com
* Gcc4 fixes.
M ./ipt/base64.c -1 +1
M ./iptsec/auth_module.c -1 +1
M ./iptsec/auth_plugin_delayed.c +4
M ./nua/nua_stack.c -1 +1
M ./nua/nua_tag.c -1 +1
M ./nua/nua_tag.h -5 +5
M ./su/htable2.h -1 +1
M ./su/su.c -1 +1
M ./tport/tport.c -7 +7
Thu Sep 8 21:16:39 EEST 2005 Pekka.Pessi@nokia.com
* Added tests for tport_shutdown(). Do not assert() on invalid
input.
M ./tport/tport.c -2
M ./tport/tport_test.c +5
Thu Sep 8 21:13:18 EEST 2005 Pekka.Pessi@nokia.com
* Log when password file is read.
M ./iptsec/auth_module.c +3
Thu Sep 8 21:12:49 EEST 2005 Pekka.Pessi@nokia.com
* Allow empty allow list.
M ./iptsec/auth_module.c -1 +1
Thu Sep 8 21:12:26 EEST 2005 Pekka.Pessi@nokia.com
* Use unsigned as auth_htable_t hash type.
M ./iptsec/auth_module.c -5 +5
Thu Sep 8 21:10:23 EEST 2005 Pekka.Pessi@nokia.com
* Added auth_digest_credentials().
Use opaque to match Authorization header.
M ./iptsec/auth_digest_test.c -2 +3
M ./iptsec/auth_module.c -1 +78
M ./iptsec/auth_plugin.h +4
Thu Sep 8 21:07:57 EEST 2005 Pekka.Pessi@nokia.com
* Fixed gcc4 problems with tag classes.
M ./http/http_tag.h.in +3
M ./msg/msg_mime_protos.h.in +3
M ./sdp/sdp_tag.h +3
M ./su/su_tag_class.h +12
M ./su/su_tag_inline.h -1 +1
M ./url/url_tag_class.h +3
Thu Sep 8 21:06:22 EEST 2005 Pekka.Pessi@nokia.com
* Added sip_security_client_select().
M ./sip/sip_util.c -37 +14
M ./sip/sip_util.h +4
Thu Sep 8 19:32:19 EEST 2005 Pekka.Pessi@nokia.com
* Not using su_home_deinit() to destroy homes that are not
initialized.
M ./nth/nth_server.c -3 +2
M ./nua/nua.c -2 +1
M ./su/su_vector.c -2 +1
Thu Sep 8 19:06:31 EEST 2005 Pekka.Pessi@nokia.com
* Moved function types to msg_types.h.
M ./msg/msg_header.h -7
M ./msg/msg_types.h +9
Thu Sep 8 18:35:12 EEST 2005 Pekka.Pessi@nokia.com
* Fixed su_clone_start() return value.
M ./su/su_root.c -1 +1
Thu Sep 8 18:34:26 EEST 2005 Pekka.Pessi@nokia.com
* Removed SIP_DLL_VAR.
M ./sip/sip_dll.h -7
Thu Sep 8 18:29:27 EEST 2005 Pekka.Pessi@nokia.com
* Avoid __func__.
M ./sresolv/sresolv.c -3 +4
Thu Sep 8 18:29:09 EEST 2005 Pekka.Pessi@nokia.com
* Fix includes.
M ./nta/nta.c -2 +1
M ./sresolv/sresolv.c -4 +7
M ./sresolv/sresolv.h -1 +1
Thu Sep 8 18:26:35 EEST 2005 Pekka.Pessi@nokia.com
* Using autoconf to figure out 64-bit types. Avoid off_t and
64-bit constants.
M ../configure.ac +6
M ./nta/sl_read_payload.c -1 +1
M ./nua/nua_stack.c -6 +5
M ./sdp/sdp_parse.c -3 +2
M ./sdp/sdp_print.c -5 +5
M ./sip/validator.c -18 +18
M ./soa/soa.c -3 +4
M ./su/su_time.c -1 +1
M ./su/tstdef.h -3 +3
Thu Sep 8 18:17:58 EEST 2005 Pekka.Pessi@nokia.com
* Using RETSIGTYPE.
M ../configure.ac -3 +4
M ./nth/http-server.c -2 +2
M ./soa/test_soa.c -1 +3
M ./su/su_test.c -1 +1
M ./su/su_timer_test.c -1 +1
Thu Sep 8 18:13:35 EEST 2005 Pekka.Pessi@nokia.com
* Fixed macro expansion problem with VC6
M ./nta/nta_test.c -2 +2
Thu Sep 8 18:12:45 EEST 2005 Pekka.Pessi@nokia.com
* Compile without sresolv, too.
M ./nta/nta.c -3 +5
Thu Sep 8 18:12:16 EEST 2005 Pekka.Pessi@nokia.com
* Fixed const/non-const problems with gcc4/vc6.
M ./msg/msg_mime.c -6 +6
M ./msg/msg_parser.c -1 +1
M ./nta/nta.c -4 +4
M ./sip/sip_basic.c -1 +1
M ./sip/sip_security.c -1 +1
M ./sip/sip_util.c -2 +2
M ./su/htable.h -10 +10
Thu Sep 8 18:06:04 EEST 2005 Pekka.Pessi@nokia.com
* Moved msg_hclass_t definition into msg_types.h
M ./msg/msg_header.h -37
M ./msg/msg_types.h +40
Thu Sep 8 18:05:32 EEST 2005 Pekka.Pessi@nokia.com
* Silenced vc6 warning.
M ./iptsec/auth_module.c -1 +1
Thu Sep 8 18:05:07 EEST 2005 Pekka.Pessi@nokia.com
* Not using __func__.
M ./iptsec/auth_digest.c -2 +2
Thu Sep 8 18:04:38 EEST 2005 Pekka.Pessi@nokia.com
* Silenced gcc4 warning.
M ./tport/tport.c -1 +1
Thu Sep 8 18:04:16 EEST 2005 Pekka.Pessi@nokia.com
* Better following autoconf macros
M ./tport/tport.c +9
Thu Sep 8 18:02:53 EEST 2005 Pekka.Pessi@nokia.com
* Using TPORT_DLL.
M ./tport/tport.h -10 +19
Thu Sep 8 18:01:58 EEST 2005 Pekka.Pessi@nokia.com
* Not using IS_EXCLUDED_MASK.
M ./url/url.c -1 +6
Thu Sep 8 18:01:17 EEST 2005 Pekka.Pessi@nokia.com
* Explicitly using <errno.h>
M ./msg/msg.c +2
M ./msg/msg_mclass.c +1
M ./msg/msg_mime.c +1
M ./msg/msg_parser.c +1
M ./nta/nta.c +3
M ./nth/nth_client.c +2
M ./nth/nth_server.c +2
M ./su/su_port.c +1
M ./su/su_proxy.c +1
M ./su/su_root.c +1
Thu Sep 8 17:54:28 EEST 2005 Pekka.Pessi@nokia.com
* Using http_off_t instead of off_t.
M ./http/http_basic.c -5 +5
Thu Sep 8 18:56:58 EEST 2005 Pekka.Pessi@nokia.com
* Not using su_home_deinit().
M ./nua/nua.c -3 +2
Thu Sep 8 16:40:30 EEST 2005 Pekka.Pessi@nokia.com
* Adding soa_asynch.c
A ./soa/soa_asynch.c
Thu Sep 8 03:23:00 EEST 2005 Pekka.Pessi@nokia.com
* stab 2 at soa
Added more functionality to soa. Stab at asynchronous API, too.
M ./soa/Makefile.am -1 +2
M ./soa/soa.c -146 +564
M ./soa/soa.h -5 +24
M ./soa/soa_add.h -2 +5
M ./soa/soa_session.h -21 +48
M ./soa/soa_static.c -30 +89
M ./soa/soa_tag.c +64
M ./soa/test_soa.c -7 +224
M ./m4/sac-su2.m4 -1 +1
Thu Sep 8 03:12:28 EEST 2005 Pekka.Pessi@nokia.com
* really run sdp tests
Now really running SDP tests.
M ./sdp/run-tests -1 +1
Thu Sep 8 03:11:35 EEST 2005 Pekka.Pessi@nokia.com
* su_home_new and su_home_unref
Added su_home_new() and su_home_unref().
Fixed su_home_mutex_lock() and su_home_mutex_unlock().
Slightly changed semantics of su_home_clone() versus
su_home_threadsafe().
M ./http/http_test.c -6 +6
M ./msg/msg_test.c -2 +2
M ./su/htable_test.c +3
M ./su/su_alloc.c -173 +337
M ./su/su_alloc.h -10 +18
M ./su/su_alloc_lock.c -8 +31
M ./su/su_alloc_test.c -5 +12
Thu Sep 8 03:07:17 EEST 2005 Pekka.Pessi@nokia.com
* More liberal sdp parsing for config files.
Be more liberal when parsing config files
(do not require v=, accept -1 as len argument).
M ./sdp/sdp_parse.c -9 +25
Thu Sep 8 01:05:02 EEST 2005 Pekka.Pessi@nokia.com
* su_msg_is_non_null
Added su_msg_is_non_null().
M ./su/su_wait.h +11
Thu Sep 8 01:03:31 EEST 2005 Pekka.Pessi@nokia.com
* sdp_parser_home
Added sdp_parser_home()
M ./sdp/sdp.h +2
M ./sdp/sdp_parse.c +10
2005-09-08 Kai Vehmanen <kai.vehmanen@nokia.com>
* Makefile.am: Workaround for automake bug related to adding
custom targets to RECURSIVE_TARGETS.
2005-08-25 Kai Vehmanen <kai.vehmanen@nokia.com>
* Makefile.am: soa depends on ipt and sip, so has to
be after them in SUBDIRS.
2005-08-17 Pekka Pessi <Pekka.Pessi@nokia.com>
* Fixed BEGIN()/END() pairs in test programs.
2005-08-04 Pekka Pessi <Pekka.Pessi@nokia.com>
* Added soa module.
2005-07-18 Kai Vehmanen <kai.vehmanen@nokia.com>
* libsofia-sip-ua created.
+104
View File
@@ -0,0 +1,104 @@
#
# Makefile.am for sofia-sip/libsofia-sip-ua
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
#
# ref: http://www.gnu.org/software/automake/manual/automake.html
AUTOMAKE_OPTIONS = foreign
# note: order does matter in the subdir list
SUBDIRS = su features bnf sresolv sdp url msg sip stun ipt soa \
tport http nta nea iptsec nth nua
DIST_SUBDIRS = $(SUBDIRS) docs
EXTRA_DIST = sofia.am
DOXYGEN = doxygen
lib_LTLIBRARIES = libsofia-sip-ua.la
libsofia_sip_ua_la_SOURCES =
libsofia_sip_ua_la_LIBADD = bnf/libbnf.la \
features/libfeatures.la \
ipt/libipt.la \
iptsec/libiptsec.la \
msg/libmsg.la \
nea/libnea.la \
nta/libnta.la \
nth/libnth.la \
nua/libnua.la \
http/libhttp.la \
sdp/libsdp.la \
sip/libsip.la \
soa/libsoa.la \
sresolv/libsresolv.la \
su/libsu.la \
stun/libstun.la \
tport/libtport.la \
url/liburl.la
# set the libtool version info version:revision:age for libsofia-sip-ua
# - soname to 'libsofia-sip-ua.so.(CUR-AGE)'
libsofia_sip_ua_la_LDFLAGS = \
-version-info $(LIBVER_SOFIA_SIP_UA_CUR):$(LIBVER_SOFIA_SIP_UA_REV):$(LIBVER_SOFIA_SIP_UA_AGE)
if ENABLE_COVERAGE
COVERAGE_RECURSIVE = coverage-recursive
coverage: $(COVERAGE_RECURSIVE)
endif
all-recursive: built-sources-recursive
built-sources: built-sources-recursive
clean-built-sources: clean-built-sources-recursive
built-sources-recursive clean-built-sources-recursive $(COVERAGE_RECURSIVE):
target=`echo $@ | sed s/-recursive//`; \
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
echo "Making $@ in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
done;
doxygen: built-sources
@echo Generating empty doxytags
cd ${srcdir}; \
mkdir -p docs/html ; \
for d in $(DIST_SUBDIRS); do \
test -r $$d/Doxyfile || continue ; \
if ! test -r docs/$$d.doxytags ; then \
echo '<?xml version="1.0"?><tagfile/>' > docs/$$d.doxytags ; \
else \
sed '2,10s!<name>index</name>!<name>'$$d'_index</name>!' \
docs/$$d.doxytags > docs/$$d.doxytags.tmp && \
mv -f docs/$$d.doxytags.tmp docs/$$d.doxytags ; \
fi ; \
done
@cd ${srcdir} ;\
for d in $(DIST_SUBDIRS); do \
test -r $$d/Doxyfile \
&& pushd $$d > /dev/null \
&& echo running ${DOXYGEN} first time in $$d \
&& ${DOXYGEN} 2>&1 \
| egrep -v -i -e 'Warning: (unsupported (xml/)?html tag|unable to resolve reference|could not be resolved)' \
; popd > /dev/null ; \
test -r docs/$$d.doxytags && \
sed '2,10s!<name>index</name>!<name>'$$d'_index</name>!' \
docs/$$d.doxytags > docs/$$d.doxytags.tmp && \
mv -f docs/$$d.doxytags.tmp docs/$$d.doxytags ; \
done
@cd ${srcdir} ;\
for d in $(DIST_SUBDIRS); do \
test -r $$d/Doxyfile \
&& pushd $$d > /dev/null \
&& echo running ${DOXYGEN} in second time in $$d \
&& ${DOXYGEN} 2>&1 \
| egrep -v -i -e 'Warning: Unsupported (xml/)?html tag' \
; popd > /dev/null ; \
test -r docs/$$d.doxytags && \
sed '2,10s!<name>index</name>!<name>'$$d'_index</name>!' \
docs/$$d.doxytags > docs/$$d.doxytags.tmp && \
mv -f docs/$$d.doxytags.tmp docs/$$d.doxytags ; \
done
cd ${srcdir}/docs/html && ../hide_emails.sh
.PHONY: built-sources built-sources-am empty-doxytags doxygen
+679
View File
@@ -0,0 +1,679 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am for sofia-sip/libsofia-sip-ua
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
#
# ref: http://www.gnu.org/software/automake/manual/automake.html
SOURCES = $(libsofia_sip_ua_la_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = libsofia-sip-ua
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/sac-general.m4 \
$(top_srcdir)/m4/sac-openssl.m4 $(top_srcdir)/m4/sac-su.m4 \
$(top_srcdir)/m4/sac-su2.m4 $(top_srcdir)/m4/sac-tport.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h \
$(top_builddir)/libsofia-sip-ua/su/sofia-sip/su_configure.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libsofia_sip_ua_la_DEPENDENCIES = bnf/libbnf.la \
features/libfeatures.la ipt/libipt.la iptsec/libiptsec.la \
msg/libmsg.la nea/libnea.la nta/libnta.la nth/libnth.la \
nua/libnua.la http/libhttp.la sdp/libsdp.la sip/libsip.la \
soa/libsoa.la sresolv/libsresolv.la su/libsu.la \
stun/libstun.la tport/libtport.la url/liburl.la
am_libsofia_sip_ua_la_OBJECTS =
libsofia_sip_ua_la_OBJECTS = $(am_libsofia_sip_ua_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/libsofia-sip-ua/su/sofia-sip
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libsofia_sip_ua_la_SOURCES)
DIST_SOURCES = $(libsofia_sip_ua_la_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COREFOUNDATION_FALSE = @COREFOUNDATION_FALSE@
COREFOUNDATION_TRUE = @COREFOUNDATION_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWFLAG = @CWFLAG@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOXYGEN = doxygen
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_COVERAGE_FALSE = @ENABLE_COVERAGE_FALSE@
ENABLE_COVERAGE_TRUE = @ENABLE_COVERAGE_TRUE@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
EXPENSIVE_CHECKS_FALSE = @EXPENSIVE_CHECKS_FALSE@
EXPENSIVE_CHECKS_TRUE = @EXPENSIVE_CHECKS_TRUE@
F77 = @F77@
FFLAGS = @FFLAGS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GLIB_VERSION = @GLIB_VERSION@
HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@
HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@
HAVE_GLIB_FALSE = @HAVE_GLIB_FALSE@
HAVE_GLIB_TRUE = @HAVE_GLIB_TRUE@
HAVE_MINGW32_FALSE = @HAVE_MINGW32_FALSE@
HAVE_MINGW32_TRUE = @HAVE_MINGW32_TRUE@
HAVE_NTLM_FALSE = @HAVE_NTLM_FALSE@
HAVE_NTLM_TRUE = @HAVE_NTLM_TRUE@
HAVE_TLS_FALSE = @HAVE_TLS_FALSE@
HAVE_TLS_TRUE = @HAVE_TLS_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBVER_SOFIA_SIP_UA_AGE = @LIBVER_SOFIA_SIP_UA_AGE@
LIBVER_SOFIA_SIP_UA_CUR = @LIBVER_SOFIA_SIP_UA_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_AGE = @LIBVER_SOFIA_SIP_UA_GLIB_AGE@
LIBVER_SOFIA_SIP_UA_GLIB_CUR = @LIBVER_SOFIA_SIP_UA_GLIB_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_REV = @LIBVER_SOFIA_SIP_UA_GLIB_REV@
LIBVER_SOFIA_SIP_UA_GLIB_SOVER = @LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
LIBVER_SOFIA_SIP_UA_REV = @LIBVER_SOFIA_SIP_UA_REV@
LIBVER_SOFIA_SIP_UA_SOVER = @LIBVER_SOFIA_SIP_UA_SOVER@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MINGW_ENVIRONMENT = @MINGW_ENVIRONMENT@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NDEBUG_FALSE = @NDEBUG_FALSE@
NDEBUG_TRUE = @NDEBUG_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
REPLACE_LIBADD = @REPLACE_LIBADD@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOFIA_CFLAGS = @SOFIA_CFLAGS@
SOFIA_GLIB_PKG_REQUIRES = @SOFIA_GLIB_PKG_REQUIRES@
STRIP = @STRIP@
TESTS_ENVIRONMENT = @TESTS_ENVIRONMENT@
VERSION = @VERSION@
VER_LIBSOFIA_SIP_UA_MAJOR_MINOR = @VER_LIBSOFIA_SIP_UA_MAJOR_MINOR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_LD = @ac_ct_LD@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
include_sofiadir = @include_sofiadir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
AUTOMAKE_OPTIONS = foreign
# note: order does matter in the subdir list
SUBDIRS = su features bnf sresolv sdp url msg sip stun ipt soa \
tport http nta nea iptsec nth nua
DIST_SUBDIRS = $(SUBDIRS) docs
EXTRA_DIST = sofia.am
lib_LTLIBRARIES = libsofia-sip-ua.la
libsofia_sip_ua_la_SOURCES =
libsofia_sip_ua_la_LIBADD = bnf/libbnf.la \
features/libfeatures.la \
ipt/libipt.la \
iptsec/libiptsec.la \
msg/libmsg.la \
nea/libnea.la \
nta/libnta.la \
nth/libnth.la \
nua/libnua.la \
http/libhttp.la \
sdp/libsdp.la \
sip/libsip.la \
soa/libsoa.la \
sresolv/libsresolv.la \
su/libsu.la \
stun/libstun.la \
tport/libtport.la \
url/liburl.la
# set the libtool version info version:revision:age for libsofia-sip-ua
# - soname to 'libsofia-sip-ua.so.(CUR-AGE)'
libsofia_sip_ua_la_LDFLAGS = \
-version-info $(LIBVER_SOFIA_SIP_UA_CUR):$(LIBVER_SOFIA_SIP_UA_REV):$(LIBVER_SOFIA_SIP_UA_AGE)
@ENABLE_COVERAGE_TRUE@COVERAGE_RECURSIVE = coverage-recursive
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libsofia-sip-ua/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign libsofia-sip-ua/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*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);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libsofia-sip-ua.la: $(libsofia_sip_ua_la_OBJECTS) $(libsofia_sip_ua_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libsofia_sip_ua_la_LDFLAGS) $(libsofia_sip_ua_la_OBJECTS) $(libsofia_sip_ua_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(mkdir_p) "$(distdir)/$$subdir" \
|| exit 1; \
distdir=`$(am__cd) $(distdir) && pwd`; \
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$top_distdir" \
distdir="$$distdir/$$subdir" \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile $(LTLIBRARIES)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am:
install-exec-am: install-libLTLIBRARIES
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
clean clean-generic clean-libLTLIBRARIES clean-libtool \
clean-recursive ctags ctags-recursive distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-recursive distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-libLTLIBRARIES install-man \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
uninstall-info-am uninstall-libLTLIBRARIES
@ENABLE_COVERAGE_TRUE@coverage: $(COVERAGE_RECURSIVE)
all-recursive: built-sources-recursive
built-sources: built-sources-recursive
clean-built-sources: clean-built-sources-recursive
built-sources-recursive clean-built-sources-recursive $(COVERAGE_RECURSIVE):
target=`echo $@ | sed s/-recursive//`; \
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
echo "Making $@ in $$subdir"; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
done;
doxygen: built-sources
@echo Generating empty doxytags
cd ${srcdir}; \
mkdir -p docs/html ; \
for d in $(DIST_SUBDIRS); do \
test -r $$d/Doxyfile || continue ; \
if ! test -r docs/$$d.doxytags ; then \
echo '<?xml version="1.0"?><tagfile/>' > docs/$$d.doxytags ; \
else \
sed '2,10s!<name>index</name>!<name>'$$d'_index</name>!' \
docs/$$d.doxytags > docs/$$d.doxytags.tmp && \
mv -f docs/$$d.doxytags.tmp docs/$$d.doxytags ; \
fi ; \
done
@cd ${srcdir} ;\
for d in $(DIST_SUBDIRS); do \
test -r $$d/Doxyfile \
&& pushd $$d > /dev/null \
&& echo running ${DOXYGEN} first time in $$d \
&& ${DOXYGEN} 2>&1 \
| egrep -v -i -e 'Warning: (unsupported (xml/)?html tag|unable to resolve reference|could not be resolved)' \
; popd > /dev/null ; \
test -r docs/$$d.doxytags && \
sed '2,10s!<name>index</name>!<name>'$$d'_index</name>!' \
docs/$$d.doxytags > docs/$$d.doxytags.tmp && \
mv -f docs/$$d.doxytags.tmp docs/$$d.doxytags ; \
done
@cd ${srcdir} ;\
for d in $(DIST_SUBDIRS); do \
test -r $$d/Doxyfile \
&& pushd $$d > /dev/null \
&& echo running ${DOXYGEN} in second time in $$d \
&& ${DOXYGEN} 2>&1 \
| egrep -v -i -e 'Warning: Unsupported (xml/)?html tag' \
; popd > /dev/null ; \
test -r docs/$$d.doxytags && \
sed '2,10s!<name>index</name>!<name>'$$d'_index</name>!' \
docs/$$d.doxytags > docs/$$d.doxytags.tmp && \
mv -f docs/$$d.doxytags.tmp docs/$$d.doxytags ; \
done
cd ${srcdir}/docs/html && ../hide_emails.sh
.PHONY: built-sources built-sources-am empty-doxytags doxygen
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
@@ -0,0 +1,7 @@
2006-06-15 Kai Vehmanen <kai.vehmanen@nokia.com>
* sofia-sip/hostdomain.h (host_is_local): Function added.
2005-07-18 Kai Vehmanen <kai.vehmanen@nokia.com>
* Initial import of the module to Sofia-SIP tree.
@@ -0,0 +1,14 @@
PROJECT_NAME = "bnf"
OUTPUT_DIRECTORY = ../docs/html/bnf
INPUT = bnf.docs sofia-sip .
@INCLUDE = ../docs/Doxyfile.conf
TAGFILES += ../docs/su.doxytags=../su
GENERATE_TAGFILE = ../docs/bnf.doxytags
PREDEFINED += "static="
MAX_INITIALIZER_LINES = 2
@@ -0,0 +1,46 @@
#
# Makefile.am for bnf module
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
# ----------------------------------------------------------------------
# Header paths
INCLUDES = -I$(srcdir)/../su -I../su
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES = libbnf.la
check_PROGRAMS = torture_bnf
# ----------------------------------------------------------------------
# Rules for building the targets
nobase_include_sofia_HEADERS = sofia-sip/bnf.h sofia-sip/hostdomain.h
libbnf_la_SOURCES = bnf.c
COVERAGE_INPUT = $(libbnf_la_SOURCES) $(include_sofia_HEADERS)
LDADD = libbnf.la
torture_bnf_LDFLAGS = -static
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST = Doxyfile bnf.docs
# ----------------------------------------------------------------------
# Tests
TESTS = torture_bnf
# ----------------------------------------------------------------------
# Sofia specific rules
include ../sofia.am
@@ -0,0 +1,685 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am for bnf module
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
# ----------------------------------------------------------------------
# Header paths
# common Makefile targets for libsofia-sip-ua modules
# ---------------------------------------------------
SOURCES = $(libbnf_la_SOURCES) torture_bnf.c
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
check_PROGRAMS = torture_bnf$(EXEEXT)
DIST_COMMON = $(nobase_include_sofia_HEADERS) $(srcdir)/../sofia.am \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
subdir = libsofia-sip-ua/bnf
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/sac-general.m4 \
$(top_srcdir)/m4/sac-openssl.m4 $(top_srcdir)/m4/sac-su.m4 \
$(top_srcdir)/m4/sac-su2.m4 $(top_srcdir)/m4/sac-tport.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h \
$(top_builddir)/libsofia-sip-ua/su/sofia-sip/su_configure.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libbnf_la_LIBADD =
am_libbnf_la_OBJECTS = bnf.lo
libbnf_la_OBJECTS = $(am_libbnf_la_OBJECTS)
torture_bnf_SOURCES = torture_bnf.c
torture_bnf_OBJECTS = torture_bnf.$(OBJEXT)
torture_bnf_LDADD = $(LDADD)
torture_bnf_DEPENDENCIES = libbnf.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/libsofia-sip-ua/su/sofia-sip
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libbnf_la_SOURCES) torture_bnf.c
DIST_SOURCES = $(libbnf_la_SOURCES) torture_bnf.c
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(include_sofiadir)"
nobase_include_sofiaHEADERS_INSTALL = $(install_sh_DATA)
HEADERS = $(nobase_include_sofia_HEADERS)
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COREFOUNDATION_FALSE = @COREFOUNDATION_FALSE@
COREFOUNDATION_TRUE = @COREFOUNDATION_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWFLAG = @CWFLAG@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOXYGEN = @DOXYGEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_COVERAGE_FALSE = @ENABLE_COVERAGE_FALSE@
ENABLE_COVERAGE_TRUE = @ENABLE_COVERAGE_TRUE@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
EXPENSIVE_CHECKS_FALSE = @EXPENSIVE_CHECKS_FALSE@
EXPENSIVE_CHECKS_TRUE = @EXPENSIVE_CHECKS_TRUE@
F77 = @F77@
FFLAGS = @FFLAGS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GLIB_VERSION = @GLIB_VERSION@
HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@
HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@
HAVE_GLIB_FALSE = @HAVE_GLIB_FALSE@
HAVE_GLIB_TRUE = @HAVE_GLIB_TRUE@
HAVE_MINGW32_FALSE = @HAVE_MINGW32_FALSE@
HAVE_MINGW32_TRUE = @HAVE_MINGW32_TRUE@
HAVE_NTLM_FALSE = @HAVE_NTLM_FALSE@
HAVE_NTLM_TRUE = @HAVE_NTLM_TRUE@
HAVE_TLS_FALSE = @HAVE_TLS_FALSE@
HAVE_TLS_TRUE = @HAVE_TLS_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBVER_SOFIA_SIP_UA_AGE = @LIBVER_SOFIA_SIP_UA_AGE@
LIBVER_SOFIA_SIP_UA_CUR = @LIBVER_SOFIA_SIP_UA_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_AGE = @LIBVER_SOFIA_SIP_UA_GLIB_AGE@
LIBVER_SOFIA_SIP_UA_GLIB_CUR = @LIBVER_SOFIA_SIP_UA_GLIB_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_REV = @LIBVER_SOFIA_SIP_UA_GLIB_REV@
LIBVER_SOFIA_SIP_UA_GLIB_SOVER = @LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
LIBVER_SOFIA_SIP_UA_REV = @LIBVER_SOFIA_SIP_UA_REV@
LIBVER_SOFIA_SIP_UA_SOVER = @LIBVER_SOFIA_SIP_UA_SOVER@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MINGW_ENVIRONMENT = @MINGW_ENVIRONMENT@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NDEBUG_FALSE = @NDEBUG_FALSE@
NDEBUG_TRUE = @NDEBUG_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
REPLACE_LIBADD = @REPLACE_LIBADD@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOFIA_CFLAGS = @SOFIA_CFLAGS@
SOFIA_GLIB_PKG_REQUIRES = @SOFIA_GLIB_PKG_REQUIRES@
STRIP = @STRIP@
TESTS_ENVIRONMENT = @TESTS_ENVIRONMENT@
VERSION = @VERSION@
VER_LIBSOFIA_SIP_UA_MAJOR_MINOR = @VER_LIBSOFIA_SIP_UA_MAJOR_MINOR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_LD = @ac_ct_LD@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
include_sofiadir = @include_sofiadir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
INCLUDES = -I$(srcdir)/../su -I../su
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES = libbnf.la
# ----------------------------------------------------------------------
# Rules for building the targets
nobase_include_sofia_HEADERS = sofia-sip/bnf.h sofia-sip/hostdomain.h
libbnf_la_SOURCES = bnf.c
COVERAGE_INPUT = $(libbnf_la_SOURCES) $(include_sofia_HEADERS)
LDADD = libbnf.la
torture_bnf_LDFLAGS = -static
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST = Doxyfile bnf.docs
# ----------------------------------------------------------------------
# Tests
TESTS = torture_bnf
AM_CFLAGS = $(CWFLAG) $(SOFIA_CFLAGS)
DISTCLEANFILES = $(BUILT_SOURCES)
# rules for building tag files
TAG_AWK = $(top_srcdir)/libsofia-sip-ua/su/tag_dll.awk
INTERNAL_INCLUDES = \
-I$(srcdir)/../features -I../features \
-I$(srcdir)/../ipt -I../ipt \
-I$(srcdir)/../iptsec -I../iptsec \
-I$(srcdir)/../bnf -I../bnf \
-I$(srcdir)/../http -I../http \
-I$(srcdir)/../msg -I../msg \
-I$(srcdir)/../nth -I../nth \
-I$(srcdir)/../nta -I../nta \
-I$(srcdir)/../nea -I../nea \
-I$(srcdir)/../nua -I../nua \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sdp -I../sdp \
-I$(srcdir)/../sip -I../sip \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sresolv -I../sresolv \
-I$(srcdir)/../tport -I../tport \
-I$(srcdir)/../stun -I../stun \
-I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../sofia.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libsofia-sip-ua/bnf/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu libsofia-sip-ua/bnf/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*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);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libbnf.la: $(libbnf_la_OBJECTS) $(libbnf_la_DEPENDENCIES)
$(LINK) $(libbnf_la_LDFLAGS) $(libbnf_la_OBJECTS) $(libbnf_la_LIBADD) $(LIBS)
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
torture_bnf$(EXEEXT): $(torture_bnf_OBJECTS) $(torture_bnf_DEPENDENCIES)
@rm -f torture_bnf$(EXEEXT)
$(LINK) $(torture_bnf_LDFLAGS) $(torture_bnf_OBJECTS) $(torture_bnf_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bnf.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/torture_bnf.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-nobase_include_sofiaHEADERS: $(nobase_include_sofia_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(include_sofiadir)" || $(mkdir_p) "$(DESTDIR)$(include_sofiadir)"
@$(am__vpath_adj_setup) \
list='$(nobase_include_sofia_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__vpath_adj) \
echo " $(nobase_include_sofiaHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(include_sofiadir)/$$f'"; \
$(nobase_include_sofiaHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(include_sofiadir)/$$f"; \
done
uninstall-nobase_include_sofiaHEADERS:
@$(NORMAL_UNINSTALL)
@$(am__vpath_adj_setup) \
list='$(nobase_include_sofia_HEADERS)'; for p in $$list; do \
$(am__vpath_adj) \
echo " rm -f '$(DESTDIR)$(include_sofiadir)/$$f'"; \
rm -f "$(DESTDIR)$(include_sofiadir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list='$(TESTS)'; \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
;; \
*) \
echo "PASS: $$tst"; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
*) \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
echo "SKIP: $$tst"; \
fi; \
done; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="All $$all tests passed"; \
else \
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all tests failed"; \
else \
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
skipped="($$skip tests were not run)"; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
echo "$$dashes"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
$(mkdir_p) $(distdir)/.. $(distdir)/sofia-sip
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(include_sofiadir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
clean-noinstLTLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-nobase_include_sofiaHEADERS
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-nobase_include_sofiaHEADERS
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool \
clean-noinstLTLIBRARIES ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man \
install-nobase_include_sofiaHEADERS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-nobase_include_sofiaHEADERS
built-sources: $(BUILT_SOURCES)
clean-built-sources:
-rm -rf $(BUILT_SOURCES) $(BUILT_SOURCES:%=$(srcdir)/%)
*_tag_ref.c: $(TAG_AWK)
%_tag_ref.c: %_tag.c
$(AWK) -f $(TAG_AWK) NODLL=1 $(TAG_DLL_FLAGS) $<
@ENABLE_COVERAGE_TRUE@coverage:
@ENABLE_COVERAGE_TRUE@ @$(top_srcdir)/scripts/coverage $(COVERAGE_FLAGS) $(COVERAGE_INPUT)
../bnf/libbnf.la ../http/libhttp.la ../ipt/libipt.la ../iptsec/libiptsec.la \
../msg/libmsg.la ../nea/libnea.la ../nta/libnta.la ../nth/libnth.la \
../nua/libnua.la ../sdp/libsdp.la ../sip/libsip.la ../soa/libsoa.la \
../sresolv/libsresolv.la ../stun/libstun.la ../su/libsu.la \
../tport/libtport.la ../url/liburl.la:
$(MAKE) -C $(@D) $(@F)
# ----------------------------------------------------------------------
# Sofia specific rules
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+913
View File
@@ -0,0 +1,913 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005,2006 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE bnf.c
* @brief Character syntax table for HTTP-like protocols.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
* @author Kai Vehmanen <Kai.Vehmanen@nokia.com>
*
* @date Created: Thu Jun 8 19:28:55 2000 ppessi
*/
#include "config.h"
#include "sofia-sip/bnf.h"
#include <assert.h>
#define ws bnf_ws
#define crlf bnf_crlf
#define alpha bnf_alpha
#define digit bnf_mark|bnf_token0|bnf_safe
#define sep bnf_separator
#define msep bnf_mark|bnf_separator
#define psep bnf_param0|bnf_separator
#define tok bnf_token0
#define mtok bnf_mark|bnf_token0
#define smtok bnf_mark|bnf_token0|bnf_safe
#define safe bnf_safe
/** Table for determining class of a character */
unsigned char const _bnf_table[256] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, ws, crlf, 0, 0, crlf, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
ws, mtok, sep, 0, safe, mtok, 0, mtok, /* !"#$%&' */
msep, msep, mtok, tok, sep, smtok, smtok, psep, /* ()*+,-./ */
digit, digit, digit, digit, digit, digit, digit, digit, /* 01234567 */
digit, digit, psep, sep, sep, sep, sep, sep, /* 89:;<=>? */
sep, alpha, alpha, alpha, alpha, alpha, alpha, alpha, /* @ABCDEFG */
alpha, alpha, alpha, alpha, alpha, alpha, alpha, alpha, /* HIJKLMNO */
alpha, alpha, alpha, alpha, alpha, alpha, alpha, alpha, /* PQRSTUVW */
alpha, alpha, alpha, psep, sep, psep, 0, smtok, /* XYZ[\]^_ */
tok, alpha, alpha, alpha, alpha, alpha, alpha, alpha, /* `abcdefg */
alpha, alpha, alpha, alpha, alpha, alpha, alpha, alpha, /* hijklmno */
alpha, alpha, alpha, alpha, alpha, alpha, alpha, alpha, /* pqrstuvw */
alpha, alpha, alpha, sep, 0, sep, mtok, 0, /* xyz{|}~ */
};
#define BM(c, m00, m32, m64, m96) \
((c < 64) \
? ((c < 32) \
? (m00 & (1 << (31 - c))) \
: (m32 & (1 << (63 - c)))) \
: ((c < 96) \
? (m64 & (1 << (95 - c))) \
: (m96 & (1 << (127 - c)))))
/** Span of a token */
size_t bnf_span_token(char const *s)
{
char const *e = s;
unsigned const m32 = 0x4536FFC0U, m64 = 0x7FFFFFE1U, m96 = 0xFFFFFFE2U;
while (BM(*e, 0, m32, m64, m96))
e++;
return e - s;
}
/** Span of a token */
size_t bnf_span_token4(char const *s)
{
char const *e = s;
while (_bnf_table[(unsigned char)(*e)] & bnf_token)
e++;
return e - s;
}
char * bnf_span_token_end(char const *s)
{
return (char *)s;
}
/** Return length of decimal-octet */
static inline int span_ip4_octet(char const *host)
{
/*
decimal-octet = DIGIT
/ DIGIT DIGIT
/ (("0"/"1") 2*(DIGIT))
/ ("2" ("0"/"1"/"2"/"3"/"4") DIGIT)
/ ("2" "5" ("0"/"1"/"2"/"3"/"4"/"5"))
*/
if (!IS_DIGIT(host[0]))
return 0;
/* DIGIT */
if (!IS_DIGIT(host[1]))
return 1;
if (host[0] == '2') {
/* ("2" "5" ("0"/"1"/"2"/"3"/"4"/"5")) */
if (host[1] == '5' && host[2] >= '0' && host[2] <= '5')
return 3;
/* ("2" ("0"/"1"/"2"/"3"/"4") DIGIT) */
if (host[1] >= '0' && host[1] <= '4' &&
host[2] >= '0' && host[2] <= '9')
return 3;
}
else if (host[0] == '0' || host[0] == '1') {
if (IS_DIGIT(host[2]))
/* ("1" 2*(DIGIT)) ... or "0" 2*(DIGIT) */
return 3;
}
/* POS-DIGIT DIGIT */
return 2;
}
/** Return length of valid IP4 address */
static
int span_canonic_ip4_address(char const *host, int *return_canonize)
{
int n, len, canonize = 0;
if (host == NULL)
return 0;
/* IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet */
len = span_ip4_octet(host);
if (len == 0 || host[len] != '.')
return 0;
if (len > 1 && host[0] == '0')
canonize = 1;
n = len + 1;
len = span_ip4_octet(host + n);
if (len == 0 || host[n + len] != '.')
return 0;
if (len > 1 && host[n] == '0')
canonize = 1;
n += len + 1;
len = span_ip4_octet(host + n);
if (len == 0 || host[n + len] != '.')
return 0;
if (len > 1 && host[n] == '0')
canonize = 1;
n += len + 1;
len = span_ip4_octet(host + n);
if (len == 0 || IS_DIGIT(host[n + len]) || host[n + len] == '.')
return 0;
if (len > 1 && host[n] == '0')
canonize = 1;
n += len;
if (canonize && return_canonize)
*return_canonize = 1;
return n;
}
/** Return length of valid IP4 address.
*
* Note that we accept here up to two leading zeroes
* which makes "dotted decimal" notation ambiguous:
* 127.000.000.001 is interpreted same as 127.0.0.1
*
* Note that traditionally IP address octets starting
* with zero have been interpreted as octal:
* 172.055.055.001 has been same as 172.45.45.1
*
* @b However, we interpret them as @b decimal,
* 172.055.055.001 is same as 172.55.55.1.
*/
int span_ip4_address(char const *host)
{
return span_canonic_ip4_address(host, NULL);
}
/** Scan and canonize a valid IP4 address. */
int scan_ip4_address(char **inout_host)
{
char *src = *inout_host, *dst = src;
issize_t n;
int canonize = 0;
n = span_canonic_ip4_address(src, &canonize);
if (n == 0)
return -1;
*inout_host += n;
if (!canonize)
return n;
for (;;) {
char c = *dst++ = *src++;
if (IS_DIGIT(*src)) {
if (canonize && c == '0')
dst--;
else if (c == '.')
canonize = 1;
else
canonize = 0;
}
else if (*src != '.') {
break;
}
}
*dst = '\0';
return n;
}
/** Return length of hex4 */
static inline int span_hex4(char const *host)
{
if (!IS_HEX(host[0]))
return 0;
if (!IS_HEX(host[1]))
return 1;
if (!IS_HEX(host[2]))
return 2;
if (!IS_HEX(host[3]))
return 3;
return 4;
}
/** Return length of valid IP6 address */
static inline
int span_canonic_ip6_address(char const *host,
int *return_canonize,
char *hexparts[9])
{
int n = 0, len, hex4, doublecolon = 0, canonize = 0;
/*
IPv6address = hexpart [ ":" IPv4address ]
hexpart = hexseq / hexseq "::" [ hexseq ] / "::" [ hexseq ]
hexseq = hex4 *( ":" hex4)
hex4 = 1*4HEXDIG
There is at most 8 hex4, 6 hex4 if IPv4address is included.
*/
if (host == NULL)
return 0;
for (hex4 = 0; hex4 < 8; ) {
len = span_hex4(host + n);
if (return_canonize) {
if ((len > 1 && host[n + 1] == '0') || host[n] == '0')
canonize = 1;
if (hexparts)
hexparts[hex4 + doublecolon] = (char *)(host + n);
}
if (host[n + len] == ':') {
if (len != 0) {
hex4++;
n += len + 1;
if (!doublecolon && host[n] == ':') {
if (return_canonize && hexparts) {
hexparts[hex4] = (char *)(host + n - 1);
}
doublecolon++, n++;
}
}
else if (n == 0 && host[1] == ':') {
doublecolon++, n = 2;
}
else
break;
}
else if (host[n + len] == '.') {
len = span_canonic_ip4_address(host + n, return_canonize);
if (len == 0 || hex4 > 6 || !(doublecolon || hex4 == 6))
return 0;
if (canonize && return_canonize)
*return_canonize = 1;
return n + len;
}
else {
if (len != 0)
hex4++;
n += len;
break;
}
}
if (hex4 != 8 && !doublecolon)
return 0;
if (IS_HEX(host[n]) || host[n] == ':')
return 0;
if (canonize && return_canonize)
*return_canonize = canonize;
return n;
}
/** Canonize scanned IP6 address.
*
* @retval Length of canonized IP6 address.
*/
static inline
int canonize_ip6_address(char *host, char *hexparts[9])
{
char *dst, *hex, *ip4 = NULL;
int i, doublecolon, j, maxparts, maxspan, span, len;
char buf[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
/*
Canonic representation has fewest chars
- except for mapped/compatible IP4 addresses, like
::15.21.117.42 or ::ffff:15.21.117.42 which have non-canonic forms of
::f15:752a or ::ffff:f15:752a
=> we just canonize hexparts and ip4part separately
and select optimal place for doublecolon
(with expection of ::1 and ::, which are canonized)
*/
for (i = 0, doublecolon = -1; i < 9; i++) {
hex = hexparts[i];
if (!hex)
break;
if (hex[0] == ':')
doublecolon = i;
while (hex[0] == '0' && IS_HEX(hex[1]))
hex++;
hexparts[i] = hex;
}
assert(i > 0);
if (hexparts[i - 1][span_hex4(hexparts[i - 1])] == '.')
ip4 = hexparts[--i];
maxparts = ip4 ? 6 : 8;
if (doublecolon >= 0) {
/* Order at most 8 (or 6) hexparts */
assert(i <= maxparts + 1);
if (i == maxparts + 1) {
/* There is an extra doublecolon */
for (j = doublecolon; j <= i; j++)
hexparts[j] = hexparts[j + 1];
i--;
}
else {
for (j = maxparts; i > doublecolon + 1; )
hexparts[--j] = hexparts[--i];
for (;j > doublecolon;)
hexparts[--j] = "0:";
i = maxparts;
}
}
assert(i == maxparts);
/* Scan for optimal place for "::" */
for (i = 0, maxspan = 0, span = 0, doublecolon = 0; i < maxparts; i++) {
if (hexparts[i][0] == '0')
span++;
else if (span > maxspan)
doublecolon = i - span, maxspan = span, span = 0;
else
span = 0;
}
if (span > maxspan)
doublecolon = i - span, maxspan = span;
dst = buf;
for (i = 0; i < maxparts; i++) {
if (i == doublecolon)
hex = i == 0 ? "::" : ":", len = 1;
else if (i > doublecolon && i < doublecolon + maxspan)
continue;
else
hex = hexparts[i], len = span_hex4(hex);
if (hex[len] == ':')
len++;
memcpy(dst, hex, len);
dst += len;
}
if (ip4) {
hex = ip4;
len = scan_ip4_address(&hex); assert(len > 0);
/* Canonize :: and ::1 */
if (doublecolon == 0 && maxspan == 6) {
if (len == 7 && strncmp(ip4, "0.0.0.0", len) == 0)
ip4 = "", len = 0;
else if (len == 7 && strncmp(ip4, "0.0.0.1", len) == 0)
ip4 = "1", len = 1;
}
memcpy(dst, ip4, len);
dst += len;
}
len = dst - buf;
memcpy(host, buf, len);
return len;
}
/** Return length of valid IP6 address */
int span_ip6_address(char const *host)
{
return span_canonic_ip6_address(host, NULL, NULL);
}
/** Scan and canonize valid IP6 address.
*
* @param inout_host input pointer to string to scan
* output pointer to first character after valid IP6 address
*
* @retval Length of valid IP6 address or -1 upon an error.
*
* @note Scanned IP6 is not always NUL-terminated.
*/
int scan_ip6_address(char **inout_host)
{
int n, canonize = 0;
char *host = *inout_host;
char *hexparts[9] = { NULL };
n = span_canonic_ip6_address(host, &canonize, hexparts);
if (n == 0)
return -1;
*inout_host += n;
if (canonize) {
int len = canonize_ip6_address(host, hexparts);
assert(len <= n);
if (len < n)
host[len] = '\0';
}
return n;
}
/** Return length of valid IP6 reference. */
int span_ip6_reference(char const *host)
{
/* IPv6reference = "[" IPv6address "]" */
if (host && host[0] == '[') {
int n = span_ip6_address(host + 1);
if (n > 0 && host[n + 1] == ']')
return n + 2;
}
return 0;
}
/** Scan valid IP6 reference. */
int scan_ip6_reference(char **inout_host)
{
int n, canonize = 0;
char *host = *inout_host;
char *hexparts[9] = { NULL };
/* IPv6reference = "[" IPv6address "]" */
if (host == NULL ||
host[0] != '[' ||
(n = span_canonic_ip6_address(host + 1, &canonize, hexparts)) == 0 ||
host[n + 1] != ']')
return -1;
*inout_host += n + 2;
if (canonize) {
int len = canonize_ip6_address(host + 1, hexparts);
assert(len <= n);
host[len + 1] = ']';
if (len + 2 < n + 2)
host[len + 2] = '\0';
}
return n + 2;
}
/** Return length of valid IP4 or IP6 address. */
int span_ip_address(char const *host)
{
if (!host || !host[0])
return 0;
/* IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet */
if (IS_DIGIT(host[0])) {
int n = span_ip4_address(host);
if (n)
return n;
}
if (host[0] == '[')
return span_ip6_reference(host);
else
return span_ip6_address(host);
}
/** Scan valid IP4/IP6 address. */
int scan_ip_address(char **inout_host)
{
char *host = *inout_host;
if (host == NULL)
return -1;
/* IPv6reference = "[" IPv6address "]" */
if (host[0] == '[')
return scan_ip6_reference(inout_host);
if (IS_DIGIT(host[0])) {
int n = scan_ip4_address(inout_host);
if (n > 0)
return n;
}
return scan_ip6_address(inout_host);
}
/** Return length of a valid domain label */
static inline
size_t span_domain_label(char const *label)
{
/* domainlabel = alphanum / alphanum *( alphanum / "-" ) alphanum */
if (IS_ALPHANUM(*label)) {
size_t n;
for (n = 1; IS_ALPHANUM(label[n]) || label[n] == '-'; n++)
;
if (IS_ALPHANUM(label[n - 1]))
return n;
}
return 0;
}
/** Scan valid domain name and count number of labels in it. */
static inline
size_t span_domain_labels(char const *host, size_t *return_labels)
{
size_t len, n, labels;
int c;
if (!host || !host[0])
return 0;
for (n = 0, labels = 0; ; n += len) {
len = span_domain_label(host + n);
if (len == 0)
return 0;
labels++;
if (host[n + len] != '.')
break;
len++;
if (!IS_ALPHANUM(host[n + len]))
break;
}
/* Check that last label does not start with number */
if (!IS_ALPHA(host[n]))
return 0;
c = host[n + len];
if (IS_ALPHANUM(c) || c == '-' || c == '.')
return 0;
if (return_labels)
*return_labels = labels;
return n + len;
}
/** Return length of a valid domain name.
*
* @code
* hostname = *( domainlabel "." ) toplabel [ "." ]
* domainlabel = alphanum
* / alphanum *( alphanum / "-" ) alphanum
* toplabel = ALPHA / ALPHA *( alphanum / "-" ) alphanum
* @endcode
*/
isize_t span_domain(char const *host)
{
return span_domain_labels(host, NULL);
}
/** Scan valid domain name. */
issize_t scan_domain(char **inout_host)
{
char *host;
size_t n, labels;
n = span_domain_labels(host = *inout_host, &labels);
if (n == 0)
return -1;
/* Remove extra dot at the end of hostname */
if (labels > 1 && host[n - 1] == '.')
host[n - 1] = '\0';
*inout_host += n;
return n;
}
/** Return length of a valid domain name or IP address. */
isize_t span_host(char const *host)
{
if (!host || !host[0])
return 0;
if (host[0] == '[')
return span_ip6_reference(host);
if (IS_DIGIT(host[0])) {
int n = span_ip4_address(host);
if (n)
return (isize_t)n;
}
return span_domain(host);
}
/** Scan valid domain name or IP address. */
issize_t scan_host(char **inout_host)
{
char *host = *inout_host;
if (host == NULL)
return -1;
/* IPv6reference = "[" IPv6address "]" */
if (host[0] == '[')
return scan_ip6_reference(inout_host);
if (IS_DIGIT(host[0])) {
int n = scan_ip4_address(inout_host);
if (n > 0)
return (issize_t)n;
}
return scan_domain(inout_host);
}
#include <sofia-sip/hostdomain.h>
/** Return true if @a string is valid IP4 address in dot-notation.
*
* @note Only 4-octet form is accepted, e.g., @c 127.1 is not considered
* valid IP4 address.
*/
int host_is_ip4_address(char const *string)
{
int n = span_ip4_address(string);
return n > 0 && string[n] == '\0';
}
/** Return true if @a string is valid IP6 address in hex notation.
*
* E.g., fe80::1 is a valid IP6 address.
*/
int host_is_ip6_address(char const *string)
{
int n = span_ip6_address(string);
return n > 0 && string[n] == '\0';
}
int host_ip6_reference(char const *string)
{
return host_is_ip6_reference(string);
}
/** Return true if @a string is valid IP6 reference,
* i.e. hex notation in square brackets.
*
* E.g., [::1] is a valid IP6 reference.
*/
int host_is_ip6_reference(char const *string)
{
int n = span_ip6_reference(string);
return n > 0 && string[n] == '\0';
}
/** Return true if @a string is valid IP address.
*
* Valid IP address is either a IP4 adddress in quad-octet notation,
* IP6 hex address or IP6 reference in square brackets ([]).
*/
int host_is_ip_address(char const *string)
{
int n = span_ip_address(string);
return n > 0 && string[n] == '\0';
}
/** Return true if @a string is valid a domain name.
*
* Valid domain name consists of alphanumeric labels separated with
* dot ("."). There can be a "-" in the middle of label.
* The last label must start with a letter.
*
* @code
* hostname = *( domainlabel "." ) toplabel [ "." ]
* domainlabel = alphanum
* / alphanum *( alphanum / "-" ) alphanum
* toplabel = ALPHA / ALPHA *( alphanum / "-" ) alphanum
* @endcode
*/
int host_is_domain(char const *string)
{
size_t n = string ? span_domain(string) : 0;
return string && n > 0 && string[n] == '\0';
}
/** Return true if @a string is valid a host name.
*
* Check if the @a string is a domain name, IP address or IP6 reference.
*/
int host_is_valid(char const *string)
{
size_t n = span_host(string);
return n > 0 && string[n] == '\0';
}
/** Returns true if @a string is describing a local address.
*
* Uses the definitions of local addresses found in RFC1700 and
* RFC4291.
*/
int host_is_local(char const *host)
{
size_t n;
if (host_is_ip6_reference(host))
return (strcmp(host, "[::1]") == 0);
else if (host_is_ip6_address(host))
return (strcmp(host, "::1") == 0);
else if (host_is_ip4_address(host))
return (strncmp(host, "127.", 4) == 0);
n = span_domain(host);
return
n >= 9 /* strlen("localhost") */ &&
strncasecmp(host, "localhost", 9) == 0 &&
(n == 9 ||
((n == 10 || /* localhost. */
n == 21 || /* strlen("localhost.localdomain") */
n == 22) && /* strlen("localhost.localdomain.") */
strncasecmp(host + 9, ".localdomain.", n - 9) == 0));
}
/** Return true if @a string has domain name in "invalid." domain.
*
*/
int host_has_domain_invalid(char const *string)
{
size_t n = span_domain(string);
if (n >= 7 && string[n] == '\0') {
static char const invalid[] = ".invalid";
if (string[n - 1] == '.') /* .invalid. perhaps? */
n--;
if (n == 7 /* strlen("invalid") */)
return strncasecmp(string, invalid + 1, 7) == 0;
else
return strncasecmp(string + n - 8, invalid, 8) == 0;
}
return 0;
}
#include <sofia-sip/su.h>
static size_t convert_ip_address(char const *s,
uint8_t addr[16],
size_t *return_addrlen)
{
size_t len;
int canonize = 0;
#if SU_HAVE_IN6
char buf[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
len = span_ip6_reference(s);
if (len) {
assert(len - 2 < sizeof buf); assert(len > 2);
if (s[len])
return 0;
len = len - 2;
s = memcpy(buf, s + 1, len), buf[len] = '\0';
}
else
len = span_ip6_address(s);
if (len) {
if (s[len] == '\0' && inet_pton(AF_INET6, s, addr) == 1) {
if (SU_IN6_IS_ADDR_V4MAPPED(addr) ||
SU_IN6_IS_ADDR_V4COMPAT(addr)) {
memcpy(addr, addr + 12, 4);
return (void)(*return_addrlen = 4), len;
}
return (void)(*return_addrlen = 16), len;
}
else
return 0;
}
#endif
len = span_canonic_ip4_address(s, &canonize);
if (len) {
if (canonize) {
char *tmp = buf;
s = memcpy(tmp, s, len + 1);
scan_ip4_address(&tmp);
}
if (s[len] == '\0' && inet_pton(AF_INET, s, addr) == 1)
return (void)(*return_addrlen = 4), len;
else
return 0;
}
return 0;
}
/** Compare two host names or IP addresses
*
* Converts valid IP addresses to the binary format before comparing them.
* Note that IP6-mapped IP4 addresses and IP6-compatible IP4 addresses are
* compared as IP4 addresses; that is, ::ffff:127.0.0.1, ::127.0.0.1 and
* 127.0.0.1 all are all equal.
*
* @param a IP address or domain name
* @param b IP address or domain name
*
* @retval -1 if a < b
* @retval 0 if a == b
* @retval 1 if a > b
*
* @since New in @VERSION_1_12_4.
*/
int host_cmp(char const *a, char const *b)
{
uint8_t a6[16], b6[16];
size_t alen, blen, asize = 0, bsize = 0;
if (a == NULL || b == NULL)
return (a != NULL) - (b != NULL);
alen = convert_ip_address(a, a6, &asize);
blen = convert_ip_address(b, b6, &bsize);
if (alen > 0 && blen > 0) {
if (asize < bsize)
return -1;
else if (asize > bsize)
return 1;
else
return memcmp(a6, b6, asize);
}
else {
return strcasecmp(a, b);
}
}
@@ -0,0 +1,17 @@
/* -*- C -*- */
/**@MODULEPAGE "bnf" - String Parser Module
*
* @section bnf_meta Module Meta Information
*
* The Sofia @b bnf module contains macros and functions for parsing
* text-based formats, for example, for SIP. The interface is described in
* <bnf.h>, the <bnf.c> contains a #_bnf_table table used to classify
* characters.
*
* @CONTACT Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @STATUS @SofiaSIP Core library
*
* @LICENSE LGPL
*/
@@ -0,0 +1,330 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef BNF_H /** Defined when <sofia-sip/bnf.h> has been included. */
#define BNF_H
/**@file sofia-sip/bnf.h
*
* Parsing macros and prototypes for HTTP-like protocols.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Jun 06 10:59:34 2000 ppessi
*
*/
#include <sofia-sip/su_types.h>
#include <string.h>
SOFIA_BEGIN_DECLS
/* Parsing tokens */
/** Control characters. */
#define CTL "\001\002\003\004\005\006\007" \
"\010\011\012\013\014\015\016\017" \
"\020\021\022\023\024\025\026\027" \
"\030\031\032\033\034\035\036\037" "\177" "\0"
/** Space */
#define SP " "
/** Horizontal tab */
#define HT "\t"
/** Carriage return */
#define CR "\r"
/** Line feed */
#define LF "\n"
/** Line-ending characters */
#define CRLF CR LF
/** Whitespace */
#define WS SP HT
/** Linear whitespace */
#define LWS SP HT CR LF
/** Lower-case alphabetic characters */
#define LOALPHA "abcdefghijklmnopqrstuvwxyz"
/** Upper-case alphabetic characters */
#define UPALPHA "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
/** Alphabetic characters */
#define ALPHA LOALPHA UPALPHA
/** Digits */
#define DIGIT "0123456789"
/** RTSP safe characters */
#define SAFE "$-_." /* RTSP stuff */
#define ALPHANUM DIGIT ALPHA
#define HEX DIGIT "ABCDEF" "abcdef"
/** SIP token characters.
* @note $|&^# were token chars in RFC 2543, but no more in RFC 3261.
*/
#define SIP_TOKEN ALPHANUM "-.!%*_+`'~"
/** SIP separator characters */
#define SIP_SEPARATOR "()<>@,;:\\\"/[]?={}" SP HT
/** SIP Word characters (that are not token characters) */
#define SIP_WORD "()<>:\\\"/[]?{}"
/** Skip whitespace (SP HT) */
#define skip_ws(ss) (*(ss) += span_ws(*(ss)))
/** Skip linear whitespace (SP HT CR LF) */
#define skip_lws(ss) (*(ss) += span_lws(*(ss)))
/** Skip [a-zA-Z] */
#define skip_alpha(ss) (*(ss) += span_alpha(*(ss)))
/** Skip digits */
#define skip_digit(ss) (*(ss) += span_digit(*(ss)))
/** Skip characters belonging to an RTSP token. */
#define skip_alpha_digit_safe(ss) (*(ss) += span_alpha_digit_safe(*(ss)))
/** Skip characters belonging to a SIP token. */
#define skip_token(ss) (*(ss) += span_token(*(ss)))
/** Skip characters belonging to a SIP parameter value. */
#define skip_param(ss) (*(ss) += span_param(*(ss)))
/** Skip characters belonging to a SIP word. */
#define skip_word(ss) (*(ss) += span_word(*(ss)))
/** Test if @c is CR or LF */
#define IS_CRLF(c) ((c) == '\r' || (c) == '\n')
/** Test if @c is linear whitespace */
#define IS_LWS(c) ((c) == ' ' || (c) == '\t' || (c) == '\r' || (c) == '\n')
/*#define IS_LWS(c) ((_bnf_table[(unsigned char)(c)] & bnf_lws))*/
/** Test if @c is normal whitespace */
#define IS_WS(c) ((c) == ' ' || (c) == '\t')
/** Test if @c is not whitespace (and not NUL). */
#define IS_NON_WS(c) (c && !IS_WS(c))
/*#define IS_NON_WS(c) (c && !(_bnf_table[(unsigned char)c] & bnf_ws))*/
/** Test if @c is not linear whitespace (and not NUL). */
#define IS_NON_LWS(c) (c && !IS_LWS(c))
/*#define IS_NON_LWS(c) (c && !(_bnf_table[(unsigned char)c] & bnf_lws))*/
/** Test if @c is a digit. */
#define IS_DIGIT(c) ((c) >= '0' && (c) <= '9')
/** Test if @c is alphabetic. */
#define IS_ALPHA(c) (c && ((_bnf_table[(unsigned char)c] & bnf_alpha)))
/** Test if @c is alphanumeric. */
#define IS_ALPHANUM(c) (c && (IS_DIGIT(c) || IS_ALPHA(c)))
/** Test if @c is URL-unreserved. */
#define IS_UNRESERVED(c) ((_bnf_table[(unsigned char)c] & bnf_unreserved))
/** Test if @c is URL-reserved. */
#define IS_RESERVED(c) (c && !(_bnf_table[(unsigned char)c] & bnf_unreserved))
/** Test if @c is valid in tokens. */
#define IS_TOKEN(c) ((_bnf_table[(unsigned char)c] & bnf_token))
/** Test if @c is valid for SIP parameter value. */
#define IS_PARAM(c) ((_bnf_table[(unsigned char)c] & (bnf_token|bnf_param)))
/** Test if @c is a hex digit. */
#define IS_HEX(c) (((c) >= '0' && (c) <= '9') || ((c) >= 'A' && (c) <= 'F') || ((c) >= 'a' && (c) <= 'f'))
/** Test if @c is a linear whitespace or valid in tokens. */
#define IS_TOKENLWS(c) ((_bnf_table[(unsigned char)c] & (bnf_token|bn_lws)))
enum {
bnf_ws = 1, /**< Whitespace character */
bnf_crlf = 2, /**< Line end character */
bnf_lws = 3, /**< Linear whitespace */
bnf_alpha = 4, /**< Alphabetic */
bnf_safe = 8, /**< RTSP safe */
bnf_mark = 16, /**< URL mark */
bnf_unreserved = bnf_alpha | bnf_mark, /**< URL unreserved */
bnf_separator = 32, /**< SIP separator */
/** SIP token, not alphabetic (0123456789-.!%*_+`'~) */
bnf_token0 = 64 | bnf_safe,
bnf_token = bnf_token0 | bnf_alpha, /**< SIP token */
bnf_param0 = 128, /**< SIP parameter, not token */
bnf_param = bnf_token | bnf_param0 /**< SIP/HTTP parameter */
};
/** Table for determining class of a character. */
SOFIAPUBVAR unsigned char const _bnf_table[256];
/** Get number of characters before CRLF */
#define span_non_crlf(s) strcspn(s, CR LF)
/** Get number of characters before whitespace */
#define span_non_ws(s) strcspn(s, WS)
/** Get number of whitespace characters */
#define span_ws(s) strspn(s, WS)
/** Get number of characters before linear whitespace */
#define span_non_lws(s) strcspn(s, LWS)
/** Calculate span of a linear whitespace.
* LWS = [*WSP CRLF] 1*WSP
*/
static inline isize_t span_lws(char const *s)
{
char const *e = s;
int i = 0;
e += strspn(s, WS);
if (e[i] == '\r') i++;
if (e[i] == '\n') i++;
if (IS_WS(e[i]))
e += i + strspn(e + i, WS);
return e - s;
}
/** Calculate span of a token or linear whitespace characters. */
static inline isize_t span_token_lws(char const *s)
{
char const *e = s;
while (_bnf_table[(unsigned char)(*e)] & (bnf_token | bnf_lws))
e++;
return e - s;
}
#if 1
/** Calculate span of a token characters. */
static inline isize_t span_token(char const *s)
{
char const *e = s;
while (_bnf_table[(unsigned char)(*e)] & bnf_token)
e++;
return e - s;
}
#else
size_t bnf_span_token(char const *s);
#define span_token(s) bnf_span_token((s))
#endif
/** Calculate span of a alphabetic characters. */
static inline isize_t span_alpha(char const *s)
{
char const *e = s;
while (_bnf_table[(unsigned char)(*e)] & bnf_alpha)
e++;
return e - s;
}
/** Calculate span of a digits. */
static inline isize_t span_digit(char const *s)
{
char const *e = s;
while (*e >= '0' && *e <= '9')
e++;
return e - s;
}
/** Calculate span of a hex. */
static inline isize_t span_hexdigit(char const *s)
{
char const *e = s;
while (IS_HEX(*e))
e++;
return e - s;
}
/** Calculate span of characters belonging to an RTSP token */
static inline isize_t span_alpha_digit_safe(char const *s)
{
char const *e = s;
while (_bnf_table[(unsigned char)(*e)] & (bnf_alpha | bnf_safe))
e++;
return e - s;
}
/** Calculate span of a characters valid in parameters. */
static inline isize_t span_param(char const *s)
{
char const *e = s;
while (IS_PARAM(*e))
e++;
return e - s;
}
/** Calculate span of a SIP word. */
static inline isize_t span_word(char const *s)
{
char const *e = s;
while (*e && (IS_TOKEN(*e) || strchr(SIP_WORD, *e)))
e++;
return e - s;
}
/** Calculate span of a unreserved characters. */
static inline isize_t span_unreserved(char const *s)
{
char const *e = s;
while (IS_UNRESERVED(*e))
e++;
return e - s;
}
/** Calculate span of a double quoted string (with escaped chars inside) */
static inline isize_t span_quoted(char const *s)
{
char const *b = s;
if (*s++ != '"')
return 0;
for (;;) {
s += strcspn(s, "\\\"");
if (!*s)
return 0;
if (*s++ == '"')
return s - b;
if (!*s++)
return 0;
}
}
/* RFC 2396 defines URL chars */
/** Reserved in URLs */
#define URL_RESERVED ";/?:=+$,"
/** Non-alphanumeric characters without syntactical meaning. */
#define URL_MARK "-_.!~*'()"
/** Unreserved characters. */
#define URL_UNRESERVED ALPHANUM URL_MARK
/** URL hex escape. */
#define URL_ESCAPED "%"
#define URL_DELIMS "<>#%\""
#define URL_UNWISE "{}|\\^[]`"
#define URL_SCHEME ALPHANUM "+-."
/** Get number of characters belonging to url scheme */
#define span_url_scheme(s) strspn(s, URL_SCHEME)
SOFIAPUBFUN int span_ip4_address(char const *host);
SOFIAPUBFUN int span_ip6_address(char const *host);
SOFIAPUBFUN int span_ip6_reference(char const *host);
SOFIAPUBFUN int span_ip_address(char const *host);
SOFIAPUBFUN isize_t span_domain(char const *host);
SOFIAPUBFUN isize_t span_host(char const *host);
SOFIAPUBFUN int scan_ip4_address(char **inout_host);
SOFIAPUBFUN int scan_ip6_address(char **inout_host);
SOFIAPUBFUN int scan_ip6_reference(char **inout_host);
SOFIAPUBFUN int scan_ip_address(char **inout_host);
SOFIAPUBFUN issize_t scan_domain(char **inout_host);
SOFIAPUBFUN issize_t scan_host(char **inout_host);
SOFIA_END_DECLS
#endif /* !defined BNF_H */
@@ -0,0 +1,60 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2006 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef SOFIA_SIP_HOSTDOMAIN_H
/** Defined when <sofia-sip/hostdomain.h> has been included. */
#define SOFIA_SIP_HOSTDOMAIN_H
/**@file sofia-sip/hostdomain.h
*
* Predicates for handling host names: IP addresses or domain names.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Thu Mar 9 16:15:22 EET 2006 ppessi
*/
#ifndef SU_CONFIG_H
#include <sofia-sip/su_config.h>
#endif
SOFIA_BEGIN_DECLS
SOFIAPUBFUN int host_is_ip4_address(char const *string);
SOFIAPUBFUN int host_is_ip6_address(char const *string);
SOFIAPUBFUN int host_is_ip6_reference(char const *string);
SOFIAPUBFUN int host_is_ip_address(char const *string);
SOFIAPUBFUN int host_is_domain(char const *string);
SOFIAPUBFUN int host_is_valid(char const *string);
SOFIAPUBFUN int host_is_local(char const *string);
SOFIAPUBFUN int host_has_domain_invalid(char const *string);
SOFIAPUBFUN int host_cmp(char const *a, char const *b);
/** This is typo. @deprecated Use host_is_ip6_reference() instead. */
SOFIAPUBFUN int host_ip6_reference(char const *string);
SOFIA_END_DECLS
#endif /* !defined(SOFIA_SIP_HOSTDOMAIN_H) */
@@ -0,0 +1,366 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE torture_bnf.c
*
* Torture tests for BNF functions.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Aug 21 15:18:26 2001 ppessi
*/
#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <stdio.h>
#include <assert.h>
#include "sofia-sip/bnf.h"
static int test_flags = 0;
#define TSTFLAGS test_flags
#include <sofia-sip/tstdef.h>
char const name[] = "torture_bnf";
int count_bnf(int bnf_flags)
{
int i, n;
for (i = 0, n = 0; i < 128; i++)
if (_bnf_table[i] & bnf_flags)
n++;
return n;
}
int bnf_test(void)
{
BEGIN();
TEST_1(IS_TOKEN('a'));
TEST_1(IS_TOKEN('b'));
/* Fixed for 1.12.2: lws = [*wsp crlf] 1*wsp */
TEST_SIZE(span_lws(" \r\n \r\nLoppuu"), 5);
TEST_SIZE(span_lws(" \r\r \nLoppuu"), 2);
TEST_SIZE(span_lws(" \n\r \nLoppuu"), 2);
TEST_SIZE(span_lws(" \r \nLoppuu"), 4);
TEST_SIZE(span_lws(" \n\t \nLoppuu"), 5);
TEST_SIZE(span_lws(" \r\n\t \nLoppuu"), 6);
TEST_SIZE(span_token(SIP_TOKEN), strlen(SIP_TOKEN));
TEST_SIZE(count_bnf(bnf_token), strlen(SIP_TOKEN "$"));
#define SIP_PARAM SIP_TOKEN "[:]/"
TEST_SIZE(span_param(SIP_PARAM), strlen(SIP_PARAM));
TEST_SIZE(count_bnf(bnf_param), strlen(SIP_PARAM "$"));
TEST_SIZE(span_unreserved(URL_UNRESERVED URL_ESCAPED),
strlen(URL_UNRESERVED URL_ESCAPED));
TEST_SIZE(count_bnf(bnf_unreserved),
strlen(URL_UNRESERVED URL_ESCAPED));
{
char word[] = ALPHA DIGIT "-.!%*_+`'~()<>:\\\"/[]?{}";
TEST_SIZE(span_word(word), strlen(word));
}
END();
}
int ip_test(void)
{
BEGIN();
char *s;
TEST(span_ip4_address("127.255.249.000,"), 15);
TEST(span_ip4_address("0.00.000.000:,"), 12);
/* Test error detection */
TEST(span_ip4_address("256.00.000.000:,"), 0);
TEST(span_ip4_address("255.00.000.0000,"), 0);
TEST(span_ip4_address("255.00.000.199."), 0);
{
char ip0[] = "010.250.020.000,";
char ip1[] = "0.00.000.000:,";
char ip2[] = "256.00.000.000:,";
char ip3[] = "255.00.000.0000,";
char ip4[] = "255.00.000.199.";
s = ip0;
TEST(scan_ip4_address(&s), 15); TEST_S(s, ","); TEST_S(ip0, "10.250.20.0");
s = ip1;
TEST(scan_ip4_address(&s), 12); TEST_S(s, ":,"); TEST_S(ip1, "0.0.0.0");
/* Test error detection */
s = ip2; TEST(scan_ip4_address(&s), -1);
s = ip3; TEST(scan_ip4_address(&s), -1);
s = ip4; TEST(scan_ip4_address(&s), -1);
}
TEST(span_ip6_address("dead:beef:feed:ded:0:1:2:3"), 26);
TEST(span_ip6_address("::beef:feed:ded:0:1:2:3"), 23);
TEST(span_ip6_address("::255.0.0.0,"), 11);
TEST(span_ip6_address("::,"), 2);
TEST(span_ip_address("[dead:beef:feed:ded:0:1:2:3]"), 28);
TEST(span_ip_address("::255.0.0.0,"), 11);
TEST(span_ip_address("[::255.0.0.0]:"), 13);
TEST(span_ip6_address("dead:beef:feed::0ded:0:1:2:3"), 28);
TEST(span_ip6_address("dead:beef:feed::0ded:0000:0001:0002:0003"), 40);
TEST(span_ip6_address("dead:beef:feed::0ded::0000:0001:0002:0003"), 0);
TEST(span_ip6_address("::dead:beef:feed::0ded:0000:0001:0002:0003"), 0);
TEST(span_ip6_address("dead:beef:feed:ded:0:1:2:3:4"), 0);
TEST(span_ip6_address("dead:beef:feed:00ded:0:1:2:3"), 0);
TEST(span_ip6_address("dead:beef:feed:ded:0:1:2:127.0.0.1"), 0);
TEST(span_ip6_address(":255.0.0.0,"), 0);
TEST(span_ip6_address("255.0.0.0,"), 0);
/* Accept colon after IP4-quad */
TEST(span_ip_address("::255.0.0.0:5060"), 11);
/* This is a reference */
TEST(span_ip6_address("[dead:beef:feed:ded:0:1:2:3]"), 0);
TEST(span_ip6_reference("[dead:beef:feed:ded:0:1:2:3]:1"), 28);
TEST(span_ip_address("[dead:beef:feed:ded:0:1:2:3]:1"), 28);
TEST(span_ip_address("[127.0.0.1]:1"), 0);
{
char ip0[] = "dead:beef:feed:ded:0:1:2:3,";
char ip1[] = "::beef:feed:ded:0:1:2:3;";
char ip1b[] = "::beef:feed:ded:0:0:2:3;";
char ip2[] = "::255.00.0.0,";
char ip3[] = "::,";
char ip4[] = "0:0:0:0:0:0:0:0,";
char ip4b[] = "0:0:0:0:0:0:0.0.0.0,";
char ip4c[] = "0:0:0:0:0:0:0.0.0.1,";
char ip5[] = "dead:beef:feed::0ded:0:1:2:3";
char ip6[] = "dead:beef:feed::0ded:0000:0001:0002:0003+";
char ip7[] = "1:0:0:2:0:0:0:3,";
char ip8[] = "1:0:0:2:0:0:3:4,";
char ip9[] = "1::2:0:0:0:3,";
s = ip0; TEST(scan_ip6_address(&s), 26); TEST_S(s, ",");
TEST_S(ip0, "dead:beef:feed:ded::1:2:3");
s = ip1; TEST(scan_ip6_address(&s), 23); TEST_S(s, ";");
TEST_S(ip1, "::beef:feed:ded:0:1:2:3;");
s = ip1b; TEST(scan_ip6_address(&s), 23); TEST_S(s, ";");
TEST_S(ip1b, "0:beef:feed:ded::2:3");
s = ip2; TEST(scan_ip6_address(&s), 12); TEST_S(s, ",");
TEST_S(ip2, "::255.0.0.0");
s = ip3; TEST(scan_ip6_address(&s), 2); TEST_S(s, ",");
TEST_S(ip3, "::,");
s = ip4; TEST(scan_ip6_address(&s), 15); TEST_S(s, ",");
TEST_S(ip4, "::");
s = ip4b; TEST(scan_ip6_address(&s), 19); TEST_S(s, ",");
TEST_S(ip4b, "::");
s = ip4c; TEST(scan_ip6_address(&s), 19); TEST_S(s, ",");
TEST_S(ip4c, "::1");
TEST_S(ip5, "dead:beef:feed::0ded:0:1:2:3");
s = ip5; TEST(scan_ip6_address(&s), 28); TEST_S(s, "");
TEST_S(ip5, "dead:beef:feed:ded::1:2:3");
s = ip6; TEST(scan_ip6_address(&s), 40); TEST_S(s, "+");
TEST_S(ip6, "dead:beef:feed:ded::1:2:3");
s = ip7; TEST(scan_ip6_address(&s), 15); TEST_S(s, ",");
TEST_S(ip7, "1:0:0:2::3");
s = ip8; TEST(scan_ip6_address(&s), 15); TEST_S(s, ",");
TEST_S(ip8, "1::2:0:0:3:4");
s = ip9; TEST(scan_ip6_address(&s), 12); TEST_S(s, ",");
TEST_S(ip9, "1:0:0:2::3");
}
{
char err0[] = "dead:beef:feed::0ded::0000:0001:0002:0003";
char err1[] = "::dead:beef:feed::0ded:0000:0001:0002:0003";
char err2[] = "dead:beef:feed:ded:0:1:2:3:4";
char err3[] = "dead:beef:feed:00ded:0:1:2:3";
char err4[] = "dead:beef:feed:ded:0:1:2:127.0.0.1";
char err5[] = ":255.0.0.0,";
char err6[] = "255.0.0.0,";
char err7[] = "dead:beef:feed:ded:0:1:2:3:4:5,";
TEST(scan_ip6_address((s = err0, &s)), -1);
TEST(scan_ip6_address((s = err1, &s)), -1);
TEST(scan_ip6_address((s = err2, &s)), -1);
TEST(scan_ip6_address((s = err3, &s)), -1);
TEST(scan_ip6_address((s = err4, &s)), -1);
TEST(scan_ip6_address((s = err5, &s)), -1);
TEST(scan_ip6_address((s = err6, &s)), -1);
TEST(scan_ip6_address((s = err7, &s)), -1);
}
{
char err0[] = "[dead:beef:feed::0ded::0000:0001:0002:0003]:";
char err1[] = "[::dead:beef:feed::0ded:0000:0001:0002:0003]+";
char err2[] = "[dead:beef:feed:ded:0:1:2:3:4]+";
char err3[] = "[dead:beef:feed:00ded:0:1:2:3]+";
char err4[] = "[dead:beef:feed:ded:0:1:2:127.0.0.1]";
char err5[] = "[:255.0.0.0],";
char err6[] = "[255.0.0.0],";
char err7[] = "[dead:beef:feed:ded:0:1:2:]";
TEST(scan_ip6_reference((s = err0, &s)), -1);
TEST(scan_ip6_reference((s = err1, &s)), -1);
TEST(scan_ip6_reference((s = err2, &s)), -1);
TEST(scan_ip6_reference((s = err3, &s)), -1);
TEST(scan_ip6_reference((s = err4, &s)), -1);
TEST(scan_ip6_reference((s = err5, &s)), -1);
TEST(scan_ip6_reference((s = err6, &s)), -1);
TEST(scan_ip6_reference((s = err7, &s)), -1);
}
END();
}
#define TEST_SCAN(scanner, input, canonic, output) \
do { char s0[] = input; char *s = s0; \
size_t n = sizeof(input) - sizeof(output); \
TEST_SIZE(scanner(&s), n); \
TEST_S(s, output); \
TEST_S(s0, canonic); } while(0)
#include <sofia-sip/hostdomain.h>
int host_test(void)
{
BEGIN();
TEST(host_is_ip4_address(NULL), 0);
TEST(host_is_ip6_address(NULL), 0);
TEST(host_ip6_reference(NULL), 0);
TEST(host_is_ip_address(NULL), 0);
TEST(host_is_domain(NULL), 0);
TEST(host_is_valid(NULL), 0);
TEST(host_has_domain_invalid(NULL), 0);
TEST_SIZE(span_host("rama"), 4);
TEST_SIZE(span_host("ra-ma.1-2.3-4.a4-9."), 19);
TEST_SIZE(span_host("a.1.b"), 5);
TEST_SIZE(span_host("127.255.249.000.a,"), 17);
TEST_SIZE(span_host("127.255.249.000,"), 15);
TEST_SIZE(span_host("0.00.000.000:,"), 12);
TEST_SIZE(span_host("127.255.249.000,"), 15);
TEST_SIZE(span_host("[dead:beef:feed:ded:0:1:2:3]:1"), 28);
TEST_SIZE(span_host("[dead:beef:feed:ded::1:2:3]:1"), 27);
TEST_SIZE(span_host("[::127.0.0.1]:1"), 13);
TEST_SCAN(scan_host, "rama", "rama", "");
TEST_SCAN(scan_host, "rama.", "rama.", "");
TEST_SCAN(scan_ip4_address, "127.255.249.000,", "127.255.249.0", ",");
TEST_SCAN(scan_host, "127.255.249.000,", "127.255.249.0", ",");
TEST_SCAN(scan_host, "a.1.b.", "a.1.b", "");
TEST_SCAN(scan_host, "ra-ma.1-2.3-4.a4-9.", "ra-ma.1-2.3-4.a4-9", "");
TEST_SCAN(scan_host, "127.255.249.000.a,", "127.255.249.000.a,", ",");
TEST_SCAN(scan_host, "0.00.000.000:,", "0.0.0.0", ":,");
TEST_SCAN(scan_host, "127.255.249.000,", "127.255.249.0", ",");
TEST_SCAN(scan_host, "[dead:beef:feed:ded:0:1:2:3]:1",
"[dead:beef:feed:ded::1:2:3]", ":1");
TEST_SCAN(scan_host, "[::127.0.0.1]:1", "[::127.0.0.1]:1", ":1");
/* Test error detection */
TEST_SIZE(span_host("256.00.000.000:,"), 0);
TEST_SIZE(span_host("255.00.000.0000,"), 0);
TEST_SIZE(span_host("255.00.000.199."), 0);
TEST_SIZE(span_host("[127.0.0.1]:1"), 0);
TEST_SIZE(span_domain("rama.1"), 0);
TEST_SIZE(span_domain("-ma.1-2.3-4.a4-9."), 0);
TEST_SIZE(span_domain("a..b"), 0);
TEST_SIZE(span_domain("a.b.-"), 0);
TEST_SIZE(span_domain("a.b-"), 0);
TEST(host_is_local("126.0.0.0"), 0);
TEST(host_is_local("127.0.0.0"), 1);
TEST(host_is_local("127.0.0.2"), 1);
TEST(host_is_local("0.0.0.0"), 0);
TEST(host_is_local("::1"), 1);
TEST(host_is_local("::1"), 1);
TEST(host_is_local("::1:3fff"), 0);
TEST(host_is_local("[::1]"), 1);
TEST(host_is_local("localdomain.domain.org"), 0);
TEST(host_is_local("localhost.domain.org"), 0);
TEST(host_is_local("localhost"), 1);
TEST(host_is_local("localhost.localdomain"), 1);
TEST(host_is_local("localhost."), 1);
TEST(host_is_local("localhost.localdomain."), 1);
TEST(host_is_local("localhost.localdomain.org"), 0);
TEST(host_has_domain_invalid("invalid"), 1);
TEST(host_has_domain_invalid("invalid."), 1);
TEST(host_has_domain_invalid("1.invalid"), 1);
TEST(host_has_domain_invalid("1.invalid."), 1);
TEST(host_has_domain_invalid("1invalid"), 0);
TEST(host_has_domain_invalid("valid."), 0);
TEST(host_has_domain_invalid("1-.invalid."), 0);
/* Invalid IP4 addresses (extra leading zeros) */
TEST_1(!host_cmp("127.0.0.1", "127.0.0.01"));
TEST_1(!host_cmp("[ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255]",
"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"));
/* Invalid reference (extra leading zeros) */
TEST_1(host_cmp("[0ffff:0ffff:0ffff:0ffff:0ffff:0ffff:255.255.255.255]",
"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"));
TEST_1(!host_cmp("::1", "::001"));
TEST_1(!host_cmp("[::1]", "::1"));
TEST_1(!host_cmp("[::1]", "::0.0.0.1"));
TEST_1(!host_cmp("::ffff:127.0.0.1", "127.0.0.1"));
TEST_1(!host_cmp("::ffff:127.0.0.1", "::ffff:7f00:1"));
TEST_1(!host_cmp("::ffff:127.0.0.1", "::ffff:7f00:1"));
TEST_1(!host_cmp("[::ffff:127.0.0.1]", "[::7f00:1]"));
TEST_1(host_cmp("::", "0.0.0.0"));
TEST_1(host_cmp("::1", "0.0.0.1"));
END();
}
void usage(void)
{
fprintf(stderr, "usage: %s [-v]\n", name);
}
int main(int argc, char *argv[])
{
int retval = 0;
int i;
for (i = 1; argv[i]; i++) {
if (strcmp(argv[i], "-v") == 0)
test_flags |= tst_verbatim;
else
usage();
}
retval |= bnf_test(); fflush(stdout);
retval |= ip_test(); fflush(stdout);
retval |= host_test(); fflush(stdout);
return retval;
}
@@ -0,0 +1,20 @@
2005-10-27 Pekka Pessi <Pekka.Pessi@nokia.com>
* Added aliases for RFC links in libsofia-sip-ua/docs/Doxyfile.aliases.
M ./libsofia-sip-ua/docs/Doxyfile.aliases -7 +2208
2005-10-12 Pekka Pessi <Pekka.Pessi@nokia.com>
* Fixed aliases for Doxygen 1.4.
M ./libsofia-sip-ua/docs/Doxyfile.aliases -6 +6
2005-09-08 Kai Vehmanen <kai.vehmanen@nokia.com>
* hide_emails.sh: Fixed bug in hiding addresses of
form foo.bar-bar@something.org. Fixed sf.net
bug #1277167.
@@ -0,0 +1,30 @@
PROJECT_NAME = "libsofia-sip-ua"
OUTPUT_DIRECTORY = ../docs/html
INPUT = mainpage.docs docguide.docs conformance.docs
# release.docs
@INCLUDE = ../docs/Doxyfile.conf
GENERATE_TAGFILE = docs.doxytags
TAGFILES =
TAGFILES += su.doxytags=su
TAGFILES += ipt.doxytags=ipt
TAGFILES += bnf.doxytags=bnf
TAGFILES += url.doxytags=url
TAGFILES += msg.doxytags=msg
TAGFILES += sip.doxytags=sip
TAGFILES += sresolv.doxytags=sresolv
TAGFILES += stun.doxytags=stun
TAGFILES += tport.doxytags=tport
TAGFILES += nta.doxytags=nta
TAGFILES += iptsec.doxytags=iptsec
TAGFILES += sdp.doxytags=sdp
TAGFILES += soa.doxytags=soa
TAGFILES += nea.doxytags=nea
TAGFILES += nua.doxytags=nua
TAGFILES += features.doxytags=features
EXAMPLE_PATH = ../sip
@@ -0,0 +1,48 @@
# Doxyfile 1.0.0 format
#
PREDEFINED = DOX \
DOXYGEN_ONLY=1 \
DOCUMENTATION_ONLY=1 \
SU_HAVE_INLINE=1 su_inline=inline \
SOFIA_BEGIN_DECLS SOFIA_END_DECLS SOFIAPUBFUN SOFIACALL \
SOFIAPUBVAR=extern \
SU_DLL SIP_DLL RTSP_DLL SU_DLL NTA_DLL NUA_DLL MSG_DLL AUTH_DLL \
NTH_DLL HTTP_DLL \
__attribute__()=
ALIASES = \
"MODULEPAGE=\mainpage Sofia SIP User Agent Library - " \
"CONTACT=\par Contact:\n" \
"STATUS=\par Status:\n" \
"LICENSE=\par License:\n" \
"SofiaSIP=<a href=\"../index.html\">Sofia SIP</a>" \
"SU=@ref su_index \"SU\"" "su=@ref su_index \"su\"" \
"msg=@ref msg_index \"msg\"" \
"sip=@ref sip_index \"sip\"" \
"nua=@ref nua_index \"nua\"" \
"nta=@ref nta_index \"nta\"" \
"soa=@ref soa_index \"soa\"" \
"DEF=\def" \
"TAGS=\par Related Tags:" \
"TAG=\par \n" \
"EVENTS=\par Events:\n" \
"RESPONSES=\par Related Response Codes:\n" \
"CFILE=\file" \
"IFILE=\file" \
"HI=\hideinitializer " \
"HIDE=\hideinitializer " \
"SHOW=\showinitializer " \
"LGPL2=\par Lesser GNU Public License Version 2:\n \ref lgpl2\n \if 0\n" \
"ENDLGPL2=\endif \n" \
"GPL2=\par GNU Public License Version 2:\n \ref gpl2\n \if 0\n" \
"ENDGPL2=\endif \n" \
"ERRORS=\par Errors: " \
"ERROR=\par \n \b " \
"NEW_1_12_2=@since New in <a href=\"http://sofia-sip.sf.net/relnotes/relnotes-sofia-sip-1.12.2.txt\">1.12.2</a>" \
"VERSION_1_12_2=<a href=\"http://sofia-sip.sf.net/relnotes/relnotes-sofia-sip-1.12.2.txt\">1.12.2</a>" \
"NEW_1_12_4=@since New in <a href=\"http://sofia-sip.sf.net/relnotes/relnotes-sofia-sip-1.12.4.txt\">1.12.4</a>" \
"VERSION_1_12_4=<a href=\"http://sofia-sip.sf.net/relnotes/relnotes-sofia-sip-1.12.4.txt\">1.12.4</a>" \
"VERSION_1_12_5=<a href=\"http://sofia-sip.sf.net/relnotes/relnotes-sofia-sip-1.12.5.txt\">1.12.5</a>" \
"NEW_1_12_5=@since New in <a href=\"http://sofia-sip.sf.net/relnotes/relnotes-sofia-sip-1.12.5.txt\">1.12.5</a>" \
@@ -0,0 +1,66 @@
# Doxyfile 1.0.0 format
#
@INCLUDE = "../../libsofia-sip-ua/docs/Doxyfile.version"
@INCLUDE = "../../libsofia-sip-ua/docs/Doxyfile.aliases"
@INCLUDE = "../../libsofia-sip-ua/docs/Doxyfile.rfc"
OUTPUT_LANGUAGE = English
DETAILS_AT_TOP = YES
OPTIMIZE_OUTPUT_FOR_C = YES
SHOW_USED_FILES = NO
QUIET = YES
WARNINGS = YES
DISABLE_INDEX = NO
HAVE_DOT = YES
CLASS_GRAPH = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = NO
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = NO
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
HIDE_UNDOC_RELATIONS = YES
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
HIDE_SCOPE_NAMES = YES
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
JAVADOC_AUTOBRIEF = YES
MAX_INITIALIZER_LINES = 0
ENUM_VALUES_PER_LINE = 1
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
# HTML
GENERATE_HTML = YES
HTML_OUTPUT = .
HTML_ALIGN_MEMBERS = YES
HTML_FOOTER = ../../libsofia-sip-ua/docs/sofia-footer.html
ALLEXTERNALS = NO
EXTERNAL_GROUPS = NO
# LATEX
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = pdflatex
USE_PDFLATEX = YES
PDF_HYPERLINKS = YES
COMPACT_LATEX = YES
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_BATCHMODE = YES
FILE_PATTERNS = *.h *.c
EXCLUDE_PATTERNS = acconfig.h config.h confdefs.h \
test*.h test*.c torture*.c *test.c *torture.c \
*_tag_dll.c *_tag_ref.c
IMAGE_PATH = ../../libsofia-sip-ua/docs/pictures
@@ -0,0 +1 @@
PROJECT_NUMBER = @VERSION@
@@ -0,0 +1,50 @@
EXTRA_DIST = Doxyfile Doxyfile.aliases Doxyfile.conf \
docguide.docs \
mainpage.docs \
conformance.docs \
Doxyfile.version.in \
sofia-footer.html.in \
hide_emails.sh \
ChangeLog \
pictures/SIP_basic_incoming_operation.eps \
pictures/SIP_basic_incoming_operation.gif \
pictures/SIP_basic_incoming_operation.vsd \
pictures/SIP_basic_outgoing_operation.eps \
pictures/SIP_basic_outgoing_operation.gif \
pictures/SIP_basic_outgoing_operation.vsd \
pictures/SIP_incoming_call.eps \
pictures/SIP_incoming_call.gif \
pictures/SIP_incoming_call.vsd \
pictures/SIP_outgoing_call.eps \
pictures/SIP_outgoing_call.gif \
pictures/SIP_outgoing_call.vsd \
pictures/SIP_outgoing_operation_with_auth.eps \
pictures/SIP_outgoing_operation_with_auth.gif \
pictures/SIP_outgoing_operation_with_auth.vsd \
pictures/autotools.eps \
pictures/autotools.gif \
pictures/autotools.vsd \
pictures/nta-receiving-message.eps \
pictures/nta-receiving-message.gif
BUILT_SOURCES = Doxyfile.rfc
# Including Doxyfile.rfc in dist breaks make manpages
Doxyfile.rfc:
$(AWK) 'END { b="\\"; q="\\\""; \
print "# Autogenerated aliases for RFCs "from" .. "to ; \
print "ALIASES += " b; \
for (i=from; i < to; i++) { \
print "RFC"i"=\"<a href="q site i type q">RFC "i"</a>\" "b; \
}}' \
site=http://www.faqs.org/rfcs/rfc type=.html \
from=700 to=4800 \
/dev/null > $@
CLEANFILES = Doxyfile.rfc
# ----------------------------------------------------------------------
# Sofia specific rules
include ../sofia.am
@@ -0,0 +1,474 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# common Makefile targets for libsofia-sip-ua modules
# ---------------------------------------------------
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(srcdir)/../sofia.am $(srcdir)/Doxyfile.version.in \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/sofia-footer.html.in ChangeLog
subdir = libsofia-sip-ua/docs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/sac-general.m4 \
$(top_srcdir)/m4/sac-openssl.m4 $(top_srcdir)/m4/sac-su.m4 \
$(top_srcdir)/m4/sac-su2.m4 $(top_srcdir)/m4/sac-tport.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h \
$(top_builddir)/libsofia-sip-ua/su/sofia-sip/su_configure.h
CONFIG_CLEAN_FILES = Doxyfile.version sofia-footer.html
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COREFOUNDATION_FALSE = @COREFOUNDATION_FALSE@
COREFOUNDATION_TRUE = @COREFOUNDATION_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWFLAG = @CWFLAG@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOXYGEN = @DOXYGEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_COVERAGE_FALSE = @ENABLE_COVERAGE_FALSE@
ENABLE_COVERAGE_TRUE = @ENABLE_COVERAGE_TRUE@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
EXPENSIVE_CHECKS_FALSE = @EXPENSIVE_CHECKS_FALSE@
EXPENSIVE_CHECKS_TRUE = @EXPENSIVE_CHECKS_TRUE@
F77 = @F77@
FFLAGS = @FFLAGS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GLIB_VERSION = @GLIB_VERSION@
HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@
HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@
HAVE_GLIB_FALSE = @HAVE_GLIB_FALSE@
HAVE_GLIB_TRUE = @HAVE_GLIB_TRUE@
HAVE_MINGW32_FALSE = @HAVE_MINGW32_FALSE@
HAVE_MINGW32_TRUE = @HAVE_MINGW32_TRUE@
HAVE_NTLM_FALSE = @HAVE_NTLM_FALSE@
HAVE_NTLM_TRUE = @HAVE_NTLM_TRUE@
HAVE_TLS_FALSE = @HAVE_TLS_FALSE@
HAVE_TLS_TRUE = @HAVE_TLS_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBVER_SOFIA_SIP_UA_AGE = @LIBVER_SOFIA_SIP_UA_AGE@
LIBVER_SOFIA_SIP_UA_CUR = @LIBVER_SOFIA_SIP_UA_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_AGE = @LIBVER_SOFIA_SIP_UA_GLIB_AGE@
LIBVER_SOFIA_SIP_UA_GLIB_CUR = @LIBVER_SOFIA_SIP_UA_GLIB_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_REV = @LIBVER_SOFIA_SIP_UA_GLIB_REV@
LIBVER_SOFIA_SIP_UA_GLIB_SOVER = @LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
LIBVER_SOFIA_SIP_UA_REV = @LIBVER_SOFIA_SIP_UA_REV@
LIBVER_SOFIA_SIP_UA_SOVER = @LIBVER_SOFIA_SIP_UA_SOVER@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MINGW_ENVIRONMENT = @MINGW_ENVIRONMENT@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NDEBUG_FALSE = @NDEBUG_FALSE@
NDEBUG_TRUE = @NDEBUG_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
REPLACE_LIBADD = @REPLACE_LIBADD@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOFIA_CFLAGS = @SOFIA_CFLAGS@
SOFIA_GLIB_PKG_REQUIRES = @SOFIA_GLIB_PKG_REQUIRES@
STRIP = @STRIP@
TESTS_ENVIRONMENT = @TESTS_ENVIRONMENT@
VERSION = @VERSION@
VER_LIBSOFIA_SIP_UA_MAJOR_MINOR = @VER_LIBSOFIA_SIP_UA_MAJOR_MINOR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_LD = @ac_ct_LD@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
include_sofiadir = @include_sofiadir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
EXTRA_DIST = Doxyfile Doxyfile.aliases Doxyfile.conf \
docguide.docs \
mainpage.docs \
conformance.docs \
Doxyfile.version.in \
sofia-footer.html.in \
hide_emails.sh \
ChangeLog \
pictures/SIP_basic_incoming_operation.eps \
pictures/SIP_basic_incoming_operation.gif \
pictures/SIP_basic_incoming_operation.vsd \
pictures/SIP_basic_outgoing_operation.eps \
pictures/SIP_basic_outgoing_operation.gif \
pictures/SIP_basic_outgoing_operation.vsd \
pictures/SIP_incoming_call.eps \
pictures/SIP_incoming_call.gif \
pictures/SIP_incoming_call.vsd \
pictures/SIP_outgoing_call.eps \
pictures/SIP_outgoing_call.gif \
pictures/SIP_outgoing_call.vsd \
pictures/SIP_outgoing_operation_with_auth.eps \
pictures/SIP_outgoing_operation_with_auth.gif \
pictures/SIP_outgoing_operation_with_auth.vsd \
pictures/autotools.eps \
pictures/autotools.gif \
pictures/autotools.vsd \
pictures/nta-receiving-message.eps \
pictures/nta-receiving-message.gif
BUILT_SOURCES = Doxyfile.rfc
CLEANFILES = Doxyfile.rfc
AM_CFLAGS = $(CWFLAG) $(SOFIA_CFLAGS)
DISTCLEANFILES = $(BUILT_SOURCES)
# rules for building tag files
TAG_AWK = $(top_srcdir)/libsofia-sip-ua/su/tag_dll.awk
INTERNAL_INCLUDES = \
-I$(srcdir)/../features -I../features \
-I$(srcdir)/../ipt -I../ipt \
-I$(srcdir)/../iptsec -I../iptsec \
-I$(srcdir)/../bnf -I../bnf \
-I$(srcdir)/../http -I../http \
-I$(srcdir)/../msg -I../msg \
-I$(srcdir)/../nth -I../nth \
-I$(srcdir)/../nta -I../nta \
-I$(srcdir)/../nea -I../nea \
-I$(srcdir)/../nua -I../nua \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sdp -I../sdp \
-I$(srcdir)/../sip -I../sip \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sresolv -I../sresolv \
-I$(srcdir)/../tport -I../tport \
-I$(srcdir)/../stun -I../stun \
-I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../sofia.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libsofia-sip-ua/docs/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu libsofia-sip-ua/docs/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*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);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
Doxyfile.version: $(top_builddir)/config.status $(srcdir)/Doxyfile.version.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
sofia-footer.html: $(top_builddir)/config.status $(srcdir)/sofia-footer.html.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
$(mkdir_p) $(distdir)/.. $(distdir)/pictures
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile
installdirs:
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# Including Doxyfile.rfc in dist breaks make manpages
Doxyfile.rfc:
$(AWK) 'END { b="\\"; q="\\\""; \
print "# Autogenerated aliases for RFCs "from" .. "to ; \
print "ALIASES += " b; \
for (i=from; i < to; i++) { \
print "RFC"i"=\"<a href="q site i type q">RFC "i"</a>\" "b; \
}}' \
site=http://www.faqs.org/rfcs/rfc type=.html \
from=700 to=4800 \
/dev/null > $@
built-sources: $(BUILT_SOURCES)
clean-built-sources:
-rm -rf $(BUILT_SOURCES) $(BUILT_SOURCES:%=$(srcdir)/%)
*_tag_ref.c: $(TAG_AWK)
%_tag_ref.c: %_tag.c
$(AWK) -f $(TAG_AWK) NODLL=1 $(TAG_DLL_FLAGS) $<
@ENABLE_COVERAGE_TRUE@coverage:
@ENABLE_COVERAGE_TRUE@ @$(top_srcdir)/scripts/coverage $(COVERAGE_FLAGS) $(COVERAGE_INPUT)
../bnf/libbnf.la ../http/libhttp.la ../ipt/libipt.la ../iptsec/libiptsec.la \
../msg/libmsg.la ../nea/libnea.la ../nta/libnta.la ../nth/libnth.la \
../nua/libnua.la ../sdp/libsdp.la ../sip/libsip.la ../soa/libsoa.la \
../sresolv/libsresolv.la ../stun/libstun.la ../su/libsu.la \
../tport/libtport.la ../url/liburl.la:
$(MAKE) -C $(@D) $(@F)
# ----------------------------------------------------------------------
# Sofia specific rules
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,249 @@
/*!
@page docguide Documentation Guidelines
@section doxygen Using Doxygen
Doxygen is a document generation program, used by many C/C++ projects. Its
home page is at <a href="http://www.doxygen.org">http://www.doxygen.org</a>.
The Sofia documentation is written using Doxygen.
Doxygen works by extracting the documentation data both from the actual
C/C++ source code and from the specially formatted comments.
The comments can contain some Javadoc-like
@ref doxycommands "special commands".
In general the the style of the comments and documentation should follow the
<a href="http://java.sun.com/j2se/javadoc/writingdoccomments/">
javadoc style guide</a>.
A Doxygen comment must either contain reference about the entity
it is describing, e.g., command
\@file when describing files:
@verbatim
/**
* @file foo.c
*
* Implementation of foo. The foo takes care of grokking xyzzy.
*
* @author Jaska Jokunen <jaska.jokunen@company.com> \n
*
* @date Created: Wed Oct 20 15:06:51 EEST 2004 jasjoku
*/
@endverbatim
Usually the entity that is documented comes straight after the documentation
comment. For example, documenting a function happens like this:
@anchor orch
@verbatim
/**
* Orches a candometer. If orching candometer is not possible, it
* tries to schadule hearping.
*
* @param[in] k pointer to a candometer
* @param[in] level orching level
* @param[out] return_hearping return value for schaduled hearping
*
* @return
* The function orch() returns the candometer value, or #ERROR upon an error.
* If the returned value is 0, the newly schaduled hearping is returned in
* @a return_hearping.
*/
int orch(cando_t *k, int level, hearping_t *return_hearping)
{
...
}
@endverbatim
@subsection doxyfile Doxyfile and Doxyfile.conf
The doxygen options are specified through a configuration file,
<i>Doxyfile</i>. As a convention, a module-specific Doxyfile includes
a common file libsofia-sip-ua/docs/Doxyfile.conf. This makes it possible
to keep the module-specific Doxyfiles as clean as possible:
@code
PROJECT_NAME = "ipt"
OUTPUT_DIRECTORY = ../docs/ipt
INPUT = ipt.docs .
@INCLUDE = ../Doxyfile.conf
TAGFILES += ../docs/docs/doxytags=../docs
TAGFILES += ../docs/su/doxytags=../su
GENERATE_TAGFILE = ../docs/ipt/doxytags
@endcode
From the file above, you can observe some conventions. The
Doxygen-generated HTML documentation is collected in @b docs
subdirectory at top level. A separate output directory is created for
each submodule under it. Doxytags for the module are generated in the @e
doxytags file in the output directory.
@subsection module_docs Module documentation in \<module\>.docs
Each module contains a documentation file containing at least the module
mainpage called @e \<module\>.docs. There should be the module
boilerplate information, for instance the following example is excerpt
contents of file @e ipt.docs:
@verbatim
/**
@MODULEPAGE "ipt" - Utility Module
@section ipt_meta Module Meta Information
Utility library for IP Telephony applications.
@CONTACT Pekka Pessi <Pekka.Pessi@nokia.com>
@STATUS @SofiaSIP Core library
@LICENSE LGPL
@section ipt_overview Overview
This module contain some routines useful for IPT applications, like
- ...
- ...
*/
@endverbatim
@section doxycommands Common Doxygen Commands
In this section we go through the most common Doxygen commands. All
the commands are explained in the manual.
The commands include
- @ref doxystyle "style commands (@@a, @@b, @@c, @@e, @@em, @@p)"
- @ref doxyfuncs "function parameters and return values (@@param, @@return, @@retval)"
@subsection doxystyle Style Commands - @a, @b, @c, @e
The text style can be changed with @@b @b (bold), @@c @c (code), or
@@e @e (italic) commands. Function argument names use style command
@@a.
For example, a sentence "The @b Content-Type header @a ct specifies the @e
media-type of the message body, e.g., @c audio/amr would be AMR-encoded
audio." is produced with commands like
@code
The @b Content-Type header @a ct specifies the @e media-type of
the message body, e.g., @c audio/amr would be AMR-encoded audio.
@endcode
The style commands have synonyms, e.g., @@em and @@e mean same, as
well as @@c and @@p.
@subsection doxyfuncs Function Parameters and Return Values - @param, @return, @retval
Parameters to a function are documented with @@param commands. (See
the @ref orch "orch()" function above.) As a convention, the data flow
direction [in], [out] or [in,out] is indicated in the brackets after the
@@param command keyword.
Return values can be documented in two alternative manners, either
using @@return command (see @ref orch "orch()") or @@retval command. The
latter is used if the function returns a small number of possible
values, e.g., enumeration or success/failure indication.
@verbatim
/**Schadule hearping.
*
* The function schadule() schadules a hearping.
*
* @param[in] h pointer to hearping
*
* @retval 0 hearping was successful
* @retval -1 an error occurred
*/
int schadule(hearping_t *h)
{
...
}
@endverbatim
@subsection doxyexamples Example Blocks - @code, @endcode
An example code fragment can be included using @@code and @@endcode
commands.
@verbatim
/**Destroy a hearping.
*
* The function hearping_destroy() deinitializes a hearping and
* reclaims the memory allocated for it.
*
* @param[in,out] h pointer to pointer to hearping
*
* The function clears the pointer to hearping, so it must be called
* with a pointer to pointer:
* @code
* hearping_destroy(&x->hearping);
* @endcode
*/
void hearping_destroy(hearping_t **h)
{
@endverbatim
@subsection docpar Paragraphs
The command @@par can be used to divide text into paragraphs. The text on
the same line with @@par is used as a subtitle for the paragraph. The
commands @@date, @@note, @@bug, @@todo, @@sa (See Also) and
@@deprecated can be used to add common paragraphs to documentation entries.
@subsection docfiles Documenting Files
In most files there is documentation entry for the file itself. It is
usually at top after the LGPL reference, containing @@file command or alias
@@CFILE/@@IFILE. There are Emacs macros for creating the boilerplate entry.
@subsection docgrouping Grouping Entries
When the structure of the documentation does not follow directory or file
structure, it is possible to use grouping commands @@defgroup and @@ingroup.
The command @@defgroup creates a group, and @@ingroup adds an entry to an
group.
@subsection doclinking Creating Links
Normally, Doxygen creates links to classes (and C structs) when it
encounters the struct/class name. It is also possible to add links to
functions, type names and variables. If the function name is followed by
pair of parenthesis (), Doxygen creates a link to it. If a type name or
variable is prefixed with hash @#, Doxygen creates a link to it.
It is also possible to create links with freely selected link to
documentation entries with @@link and @@endlink commands.
When the link target is a named page, section, or subsection, it is possible
to use the @@ref command.
@subsection doctext Writing Body Text
The main body of the documentation is specified with @@mainpage command. The
contents of the @@mainpage entry become the HTML home page of the
documentation set. In each documentation set generated with Doxygen there
can be only one @@mainpage command. Commands @@section, @@subsection, and
@@subsubsection can be used to structure the body text.
It is also possible to add individual HTML pages to the documentation. It
happens with @@page command. These individual pages are like the home page
added with @@mainpage, they can be accessed with the Related Pages link from
the navigation bar.
@subsection docimages Adding Images
Images are added with @@image command. As the different documentation
formats support different image formats, the @@image has list the image file
name for each supported documentation format. The following example uses
bitmap image for HTML documentation and Encapsulate PostScript for
print documents:
@code
@image html sip-parser.gif
@image latex sip-parser.eps
@endcode
*/
@@ -0,0 +1,37 @@
#!/bin/sh
#
# description: Mangle email addresses in the HTML documentation
# author: Kai Vehmanen <kai.vehmanen@nokia.com>
# version: 20050908-3
#
# --------------------------------------------------------------------
#
# This file is part of the Sofia-SIP package
#
# Copyright (C) 2005 Nokia Corporation.
#
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This library 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 this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
#
# --------------------------------------------------------------------
find . -name '*.html' -print | while read i ; do
(
echo "Hiding email addresses in ${i}."
sed -r -i 's/([:>;][a-z][-a-z.]*)(@[a-z][a-z]*)\.[a-z][a-z]*(["<\&])/\1\2-email.address.hidden\3/gi' $i
)
done
@@ -0,0 +1,740 @@
/* -*- text -*- */
/**@mainpage Sofia SIP User Agent Library - sofia-sip-ua
@section Introduction
This document contains automatically generated reference documentation
for Sofia-SIP components. Some introductory material and
pointers to the example code are also included.
For a list of module specific pages, see @ref subdirs
"source tree structure" or direct links to submodules:<br>
<a href="nua/index.html">nua</a>
<a href="su/index.html">su</a>
<a href="features/index.html">features</a>
<a href="soa/index.html">soa</a>
<a href="sdp/index.html">sdp</a>
<a href="nta/index.html">nta</a>
<a href="tport/index.html">tport</a>
<a href="sresolv/index.html">sresolv</a>
<a href="sip/index.html">sip</a>
<a href="msg/index.html">msg</a>
<a href="url/index.html">url</a>
<a href="stun/index.html">stun</a>
<a href="iptsec/index.html">iptsec</a>
<a href="nea/index.html">nea</a>
<a href="nth/index.html">nth</a>
<a href="http/index.html">http</a>
<a href="bnf/index.html">bnf</a>
<a href="ipt/index.html">ipt</a>
@section who Contact Information
You can download latest Sofia SIP from the project
<a href="http://sofia-sip.sf.net">home page</a> at
<a href="sf.net">Sourceforge.net</a>.
Please contact us if you have questions regarding this software:
<ul>
<li>Pekka Pessi <Pekka.Pessi@nokia.com></li>
<li>Kai Vehmanen <Kai.Vehmanen@nokia.com></li>
</ul>
Or post to the Sofia-SIP mailing list:
<ul>
<li>mailto:sofia-sip-devel@lists.sourceforge.net</li>
<li>http://lists.sourceforge.net/lists/listinfo/sofia-sip-devel</li>
</ul>
*/
/**@page building Source Tree Structure
@section subdirs Directory Structure
In libsofia-sip-ua, there are subdirectories
Terminal and high-level libraries utilizing for both signaling and media:
Common runtime library:
- <a href="su/index.html">"su" - sockets, memory management, threads</a>
- <a href="sresolv/index.html">"sresolv" - Asynchronous DNS resolver</a>
- <a href="ipt/index.html">"ipt" - IPT utility library</a>
SIP Signaling:
- <a href="nua/index.html">"nua" - SIP User Agent library</a>
- <a href="nea/index.html">"nea" - SIP Event API</a>
- <a href="iptsec/index.html">"iptsec" -
Digest authentication for HTTP and SIP</a>
- <a href="nta/index.html">"nta" - SIP transaction engine</a>
- <a href="tport/index.html">"tport" - Message transport</a>
- <a href="sip/index.html">"sip" - SIP messages and headers</a>
- <a href="msg/index.html">"msg" - Message handling </a>
- <a href="url/index.html">"url" - URL handling</a>
- <a href="bnf/index.html">"url" - low level parsing</a>
HTTP subsystem:
- <a href="nth/index.html">"nth" - HTTP protocol engine</a>
- <a href="http/index.html">"http" - HTTP messages and headers</a>
SDP processing:
- <a href="soa/index.html">"soa" - SDP Offer/Answer engine for SIP</a>
- <a href="sdp/index.html">"sdp" - SDP parser</a>
Other:
- <a href="stun/index.html">"stun" - STUN library</a>
Features provided by Sofia-SIP library:
- <a href="features/index.html">"features" - Features provided by Sofia SIP</a>
Documentation:
- "docs" - Doxygen reference documentation
*/
/**
@page styleguide C Style Guide
This document gives general guidelines on generic C style and code
formatting within Sofia-SIP. The guidelines include identifier naming
conventions, indenting convention, and tool usage directions.
Please note that C style is always a matter of taste.
@section naming Naming Conventions
Generally, identifiers within each module are prefixed with the name of
that module. For instance, the functions within http parser module @b http
have prefix @c http_. Identifiers composed of multiple words have an
underscore "_" between the words, the words themselves are in lower
case. For instance, http_request_create().
Macros should be in upper case. File names should be in lower case using
underscore as delimiter if needed.
Normal typedefs have suffix @c _t, however, function types have suffix @c
_f. The enum names also sometimes have @c _e, struct names have @c _s and
union names @c _u.
It is recommended that type itself is typedef'ed, not a pointer to the
type. It should be clear from variable declaration if the variable is a
pointer or not.
@code
typedef struct foo_s foo_t;
typedef int f_fun(foo_t *f, char const *s);
@endcode
Struct and union members should have common prefix. For instance,
@code
struct foo_s {
int f_len;
char *f_name;
fun_f *f_fun;
};
@endcode
This prefix makes it easier to find where members are used.
@section formatting Indenting and Formatting code
Indentation in Sofia-SIP C code generally follows the @e K&R style with indent
of 2 characters (so you can use the default "GNU" c-style in Emacs). The
maximum line length should be 80 characters.
For example,
@code
void kluge(int foo)
{
if (foo) {
bar();
}
else {
switch (baz()) {
case a:
eeny();
break;
case b:
meeny();
break;
default:
moe();
break;
}
}
}
@endcode
The default indentation can be achieved with GNU indent with options
@code
-nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci2 -cli0 -cp33 -cs
-d0 -di1 -nfc1 -nfca -hnl -i2 -ip0 -l79 -lp -npcs -nprs -npsl -saf -sai
-saw -nsc -nsob -nss
@endcode
Loops without condition use @c for @c (;;) instead of @c while @c (1).
@code
for (;;) {
foo();
if (bar())
break;
baz();
}
@endcode
There should be whitespace on both sides of infix operators, except
<code>.</code> or <code>-></code>, which require no space, or
<code>,</code> (comma) which requires space only after). There should be
whitespace between a keyword and parenthesis following it, but no
whitespace between an identifier and parenthesis following it. E.g.,
@code
while (i++ < n)
baz();
for (;;) {
x->x_foo();
if (bar())
break;
z.z_baz++;
}
return (13 * i);
@endcode
*/
/**
@page programming Programming Guide
@section porting Writing Portable Code
Most of Sofia-SIP software is written as portable. All core modules are
(or at least should be) written in ANSI C 89 with some ANSI C 99
features. If there are platform specific parts, they are collected to
separate C files and isolated from the rest of the software with a
wrapper interface.
SU module handles abstraction to OS specific functionality such as
memory management, sockets, threads and time functions.
@subsection ansi_99 ANSI C 99 features
The following ANSI C 99 features are to be used in Sofia-SIP software:
- Integer types
- functions va_copy() and snprintf()
The following ANSI C 99 features shall not be used in Sofia-SIP software:
- definition of a variable in the middle of function code.
(so always define your variables in the beginning of the block)
@subsection port_ints Integer Types
As you should know, the length of native storage size depends on hardware,
OS and compiler. This means in practice that the length of int or long is
not necessarily 32 bits. As a consequence, you need to make sure that the
value you intend to store in the int, can actually fit in int on different
platforms. As a rule of thumb, if the integer value can exceed 8 bits, you
should use types that have a defined length.
Nevertheless its OK to use native integer types if you bear in mind
what was said above. The original reason for having only native
data type was performance. The int type is always stored in the
fastest (and usually biggest size) possible.
Never assume anything on the length of the type. Alway use sizeof()
operator to find out the length.
C 99 standard defines the following fixed length data types:
- int64_t
- uint64_t
- int32_t
- uint32_t
- int16_t
- uint16_t
- int8_t
- uint8_t
To use these data types you must include the <su_types.h> header, which
takes care of including correct file. If @b su includes are not available,
you must include the following code segment to each file where you plan to
use them:
@code
#if HAVE_STDINT_H
#include <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#else
#error Define HAVE_STDINT_H as 1 if you have <stdint.h>, \
or HAVE_INTTYPES_H if you have <inttypes.h>
#endif
@endcode
@subsection port_byte_sex Byte order
The host byte order on different platforms vary. When you do only
local processing, need not to worry about the byte order. But as
soon as you start writing code that send or receives anything to
the network, you need to start worrying.
If you wish to convert the byte order, it is simply done by calling
one the following functions:
The htonl() function converts the unsigned integer hostlong from
host byte order to network byte order.
The htons() function converts the unsigned short integer hostshort
from host byte order to network byte order.
The ntohl() function converts the unsigned integer netlong from
network byte order to host byte order.
The ntohs() function converts the unsigned short integer netshort
from network byte order to host byte order.
You need to include <netinet/in.h> or <su.h> to use these functions.
@subsection port_struct Packing structures
By default, compilers usually arrange structures so that they are
quick to access. This means that most fields in the structure start
at the 32 bit boundary. If you need to conserve memory, you may use
structure packing.
To tell the compiler that you only need certain amount of bits to
store a variable, you can use bit-fields. Compiler may or may not
pack the bit-fields.
@code
struct foo {
unsigned bar:5;
unsigned foo:2;
unsigned :0;
int something;
}
@endcode
If compiler decides to pack this structure, this code generates a
structure that has @a bar and @a foo in the first seven bits, and then
@a something beginning from the next 32 bit boundary.
One problem arises when using packed bit-fields: on ARM it is
generally not possible to access a 32 bit field that does not start from
the 32-bit boundary. Hence the example has the :0 padding member in the
structure. Seems handy but beware: initialization of this structure fails
on some ARM gcc compilers. (Ask Kai Vehmanen for details).
A way to force packing of a structure is to use preprocessor
directive @c @#pragma(pack). This directive is compiler specific, so if
you plan to write truly portable code, you cannot use it. We have
used it in some parts of the Sofia-SIP though. Only alternative is to
write functions that fetch the desired bits from a 32 bit field
with bit operations; not very handy and error prone.
The same aligment problem also arises if you cast for example char
buffer to a int32_t. You can only read int32_t from the 32bit boundary
on ARM platform. So be careful.
As a conclusion, when using bit-fields and stucture packing, beware
of the pitfalls. If you don't really need to use them (as in parsing
binary protocols), don't use them.
@section file_organization File and Directory Structure
A Sofia-SIP library module can be defined as a subdirectory under the
libsofia-sip-ua directory hierarchy that contains a file \<modulename\>.docs
(where the \<modulename\> of course referes to the actual name of
the module).
In case you like to start developing a new module, please
contact Sofia-SIP development team so that they can help you to set up
the basic module for you.
An overview of the contents of a module directory:
- file \<modulename\>.docs \n
Main documentation file for the module. See @ref module_docs
for more information
- subdirectory pictures \n
Contains any pictures/images
that are needed by the module documentation. The
file formats to use are GIF (for html pages) and
EPS (for latex). If some program (e.g. MS Visio) is
used to create the pictures, also the original
files must be stored here.\n
(Note that old modules may have "images" subdirectory instead of
"pictures")
- files Makefile.am \n
See section @ref build "dealing with GNU Autotools" below.
- (optionally) source code file(s) of the module and module tests.
The source code file(s) can also be located in subdirectories if necesary.
@section oo_with_c Writing Object-Oriented Code
While C does not provide any special object-oriented features on its own, it
is possible to program in object-oriented way using C, too. Sofia code make
use of many object-oriented features while being written entirely in C.
@subsection oo_hiding Data Hiding
Data hiding is a practice that makes separation between two modules very
clear. Outside code cannot directly access the data within a module, but it
has to use functions provided for that purpose. Data hiding also makes it
easier to define a protocol between two objects - all communication happens
using function calls.
How to implement data hiding in C? Easiest answer is to only declare data
structures in the header files, not to define them. We have a typedef #msg_t
for @link msg_s struct msg_s @endlink in <sofia-sip/msg.h>, but the actual
structure is defined in "msg_internal.h". Programs outside @b msg module
does not have access to the @link msg_s struct msg_s @endlink, but they have
to to access the #msg_t object through method functions provided in
<sofia-sip/msg.h>. The @b msg implementation is also free to change the
internal layout of the structure, only keeping the function interface
unmodified.
@subsection oo_interface Interfaces
Abstract interface is another object-oriented practice used in Sofia. Parser
headers, defined in <sofia-sip/msg_types.h>, is a good example of abstract
interface. The type for message headers, #msg_header_t, is defined using two
C structures @link msg_common_s struct msg_common_s @endlink
(#msg_common_t), and @link msg_hclass_s struct msg_hclass_s @endlink
(#msg_hclass_t).
Abstract interface is achieved using virtual function table in #msg_hclass_t
structure, bit like C++ typically implements abstract classes and virtual
functions. For implemenation of each header, the function table is
initialized with functions responsible for decoding, encoding and
manipulating the header structure. Unlike C++, the class of the object
(#msg_hclass_t) is represented by a real data structure which also contains
header-specific data, like header name.
@dontinclude sip_basic.c
@skipline msg_hclass_t sip_contact_class
@skip {{
@until }};
@subsection oo_derived Inheritance and Derived Objects
Inheritance is a object-oriented practice that has limited use in Sofia.
Most common example of inheritance is use of #su_home_t. Many objects are
derived from #su_home_t, which means that they can use the various
home-based memory management functions from <su_alloc.h>.
In this sence, inheritance means that a pointer to a derived object can be
casted as a pointer to a base object. In other words, the derived object
must have the base object at the beginning of its memory area:
@code
struct derived
{
struct base base[1];
int extra;
char *data;
};
@endcode
There are three alternatives to cast a pointer to derived to a pointer to
base:
@code
struct base *base1 = (struct base *)derived;
struct base *base2 = &derived->base;
struct base *base3 = derived->base;
@endcode
The third alternative works because base was used as a 1-element array.
@subsection oo_templates Templates
There are a few template types implemented as macros in Sofia libraries.
They include hash table, defined in <sofia-sip/htable.h>, which can be used
to define hash tables types and accessor functions for different object, and
red-black tree, defined in <sofia-sip/rbtree.h>.
@section memory Memory Management
The home-based memory management is useful when a lot of memory blocks are
allocated for given task. The allocations are done via the memory home,
which keeps a reference to each allocated memory block. When the memory
home is then freed, it will free all memory blocks to which it has
reference. This simplifies application logic because application code does
not need to keep track of the allocated memory and free every allocated block
separately.
See documentation of <su_alloc.h> and @ref su_alloc "memory managment tutorial"
for more information of memory management services.
@subsection contextdata Memory management of context data
A typical example of use of a memory home is to have a memory home structure
(#su_home_t) as part of operation context information structure.
@code
/* context info structure */
struct context {
su_home_t ctx_home[1]; /* memory home */
other_t *ctx_other_stuff; /* example of memory areas */
...
};
/* context pointer */
struct context *ctx;
/* Allocate memory for context structure and initialize memory home */
ctx = su_home_clone(NULL, sizeof (struct context));
/* Allocate memory and register it with memory home */
ctx->ctx_other_stuff = su_zalloc(ctx->ctx_home, sizeof(other_t));
... processing and allocating more memory ...
/* Release registered memory areas, home, and context structure */
su_home_zap(ctx->ctx_home);
@endcode
@subsection combining Combining allocations
Another place where home-based memory management makes programmers
life easier is case where a sub-procedure makes multiple memory allocations
and, in case the sub-procedure fails, all the allocations must be released
and, in case the sub-procedure is succesfull, all allocations must be
controlled by upper level memory management.
@code
/* example sub-procedure. top_home is upper-level memory home */
int sub_procedure( su_home_t *top_home, ... )
{
su_home_t temphome[1] = { SU_HOME_INIT(temphome) };
... allocations and other processing ...
/* was processing successfull ? */
if (success) {
/* ok -> move registered allocated memory to upper level memory home */
su_home_move( top_home, temphome );
}
/* destroy temporary memory home (and registered allocations) */
/* Note than in case processing was succesfull the memory */
/* registrations were already moved to upper level home. */
su_home_deinit(temphome);
/* return ok/not-ok */
return success;
}
@endcode
@section testing Testing Your Code
See <tstdef.h> for example of how to write module tests with macros provided
by Sofia.
Here are some ideas of what you should test:
- "Smoke test" \n
See that the module compiles, links and executes.
- Module API functions should be tested with\n
- valid args
- not valid args
- Aim for 100% line coverage\n
(If there is a line of code that you have not tested, you don't know
if its working.) \n
For selected part of code you should also aim for
100% branch/path coverage.\n
But be anyway reasonable with these because in practise complete
coverage is next to impossible to achive (so 80% is ok in practise).
- Create test to check assumptions and/or tricks used in code.\n
For example if you rely on some compiler feature, create a test that
will fail with a compiler that does not have that feature.
@subsection check Running Module Tests
Automake, which is used to build Sofia SIP, has builtin
support for unit tests. To add an automatically run test to your module,
you just have to add the following few lines to your module's Makefile.am
(of course, you have to write the test programs, too):
@code
TESTS = test_foo test_bar
check_PROGRAMS = test_foo test_bar
test_foo_SOURCES = foo.c foo.h
test_foo_LDADD = -L. -lmy
test_bar_SOURCES = bar.c bar.h
test_foo_LDADD = -L. -lmy
@endcode
Each test program should either return zero for success or a non-zero
error code in its main function. Now when you run "make check",
@b my_test_foo and @b my_test_bar will be built and then run.
Make will print a
summary of how the tests went. As these tests are run from the build
system, the tests must be non-interactive (no questions asked) and not
rely on any files that are not in version control system.
Sofia SIP's top-level makefile contains a recursive check target, so
you can use "cd sofia-sip ; make check" to run all the existing tests
with a single command.
@section build Dealing with GNU Autotools
Sofia-SIP build system is based on the GNU tools automake, autoconf and
libtool. This toolset has become the de-facto way of building Linux
software. Because of this there is a lot of publicly available documentation
about these tools, and of course, lots and lots of examples.
A good introduction to these tools is available at
<a href="http://developer.gnome.org/doc/books/WGA/generating-makefiles.html">
developer.gnome.org</a>. <a href="http://sources.redhat.com/autobook">Autobook</a>
provides more detailed documentation for autoconf and automake.
The <a href="http://www.gnu.org/manual/make/">GNU make manual</a>
is also a good source of information.
@subsection autogen_sh autogen.sh
At top-level there is a shell script called @b autogen.sh. It calls a
convenient tool called @b autoreconf which will generate configure script
for you. It also fixes the mode bits: the mode bits are not stored in
<a href="http://darcs.net">darcs</a> version control system.
@code
$ sh autogen.sh
$ ./configure ... with your configure options ...
@endcode
@subsection configure_ac configure.ac
The @b configure.ac file (older autoconf versions used also @b configure.in)
contains the primary configuration for autoconf. configure.ac contains
checks for all external libraries, non-standard language and compiler
features that are needed to build the target module.
This file is created by the developer of the module.
@subsection sofia_m4 m4 files
Sofia-SIP's own autoconf macros are stored in the top-level direcry called @b
m4. These macros, along with all other macros used by @b configure.ac, are
copied into the module-specific @b aclocal.m4 file by an utility called
aclocal.
Contact Sofia-SIP development team, if you need changes to these files.
@subsection aclocal_m4 aclocal.m4
The aclocal.m4 contains the definitions of the autoconf macros used in
@b configure.ac.
This file is generated by aclocal command.
@subsection Makefile_am Makefile.am
Makefile.am is where you define what programs and libraries should
be built, and also what source files are needed to create them.
When you run automake, it creates the file Makefile.in.
This file is created by the developer of the module.
@subsection configure configure
When you run configure script, it performs all the checks defined in
@b configure.ac and then replaces all @b xxx.in files with equivalent
@b xxx files. All @c @@FOO@@ variables in the source @b *.in files are
replaced with values found during the configuration process. For instance
the variable @c @@srcdir@@ in @b Makefile.in is replaced in @b Makefile
with the source directory path (useful when compiling outside the main
source tree).
This file is generated by autoconf command.
@subsection config_status config.status
This script stores the last parameters given to configre command.
If necessary you can rerun the last given configure script (with given
parameters) by using command "./config.status -r" or
"./config.status --recheck".
This file is generated by configure script.
@subsection config_cache config.cache
This file contains results of the various checks that configure script
performed. In case the configure script failed, you might try to
delete this file and run the configure script again.
This file is generated by configure script.
@subsection Makefile Makefile
The @b Makefile contains the actual rules how to build the target
libraries and program. It is used by the @c make program. @b Makefile
is generated from @b Makefile.in when you run @c autoconf command.
Ensure that "make dist" and "make install" targets work.
This file is generated by config.status and configure scripts.
@subsection config_h config.h
This file contains C language defines of various confurable issues.
This file is generated by config.status and configure script.
@subsection sofia_sip_configure_h sofia-sip/su_configure.h
This file contains C language defines describing how the Sofia SIP UA
library is configured.
This file is generated by config.status and configure script.
*/
/**
@page debug_logs Debugging Logs
The Sofia-SIP components can output various debugging information. The
detail of the debugging output is determined by the debugging level. The
level is usually module-specific and it can be modified by module-specific
environment variable. There is also a default level for all modules,
controlled by environment variable #SOFIA_DEBUG.
The environment variables controlling the logging and other debug output are
as follows:
- #SOFIA_DEBUG Default debug level (0..9)
- #NUA_DEBUG User Agent engine (<a href="nua/index.html">nua</a>) debug level (0..9)
- #SOA_DEBUG SDP Offer/Answer engine (<a href="soa/index.html">soa</a>) debug level (0..9)
- #NEA_DEBUG Event engine (<a href="nea/index.html">nea</a>) debug level (0..9)
- #IPTSEC_DEBUG HTTP/SIP autentication module debug level (0..9)
- #NTA_DEBUG Transaction engine debug level (0..9)
- #TPORT_DEBUG Transport event debug level (0..9)
- #TPORT_LOG If set, print out all parsed SIP messages on transport layer
- #TPORT_DUMP Filename for dumping unparsed messages from transport
- #SU_DEBUG <a href="nea/index.html">su</a> module debug level (0..9)
The defined debug output levels are:
- 0 SU_DEBUG_0() - fatal errors, panic
- 1 SU_DEBUG_1() - critical errors, minimal progress at subsystem level
- 2 SU_DEBUG_2() - non-critical errors
- 3 SU_DEBUG_3() - warnings, progress messages
- 5 SU_DEBUG_5() - signaling protocol actions (incoming packets, ...)
- 7 SU_DEBUG_7() - media protocol actions (incoming packets, ...)
- 9 SU_DEBUG_9() - entering/exiting functions, very verbatim progress
In addition to the macros mentioned above, there is also functions for
printing logging messages:
- su_llog(), su_vllog()
- su_perror(), su_perror2()
The log level can be set (to a level defined in a configuration file, for
instance) with following functions
- su_log_set_level(), su_log_soft_set_level()
The log output can be redirected to, e.g., system log or loggin server, with
su_log_redirect().
*/
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

@@ -0,0 +1,4 @@
<hr />
Sofia-SIP @VERSION@ -
Copyright (C) 2006 Nokia Corporation. All rights reserved.
Licensed under the terms of the GNU Lesser General Public License.
@@ -0,0 +1,32 @@
2005-10-27 Pekka Pessi <Pekka.Pessi@nokia.com>
* Fixed features.
Added libfeatures.la into .so. Renamed sofia_has_* as sofia_sip_has_*. Using
features in nua_cli.c
M ./libsofia-sip-ua/Makefile.am +1
M ./libsofia-sip-ua/features/Makefile.am -2 +2
M ./libsofia-sip-ua/features/sofia_sip_features.c -14 +14
M ./libsofia-sip-ua/features/sofia_sip_features.docs -10 +10
M ./libsofia-sip-ua/features/sofia_sip_features.h.in -10 +10
M ./libsofia-sip-ua/stun/stun.c -2 +2
M ./utils/Makefile.am -1 +2
M ./utils/nua_cli.c -2 +29
* Added "features" module.
./libsofia-sip-ua/nua/sofia_config.c -> ./libsofia-sip-ua/sofia/sofia_sip_features.c
./libsofia-sip-ua/nua/sofia_config.h.in -> ./libsofia-sip-ua/sofia/sofia_sip_features.h.in
./libsofia-sip-ua/sofia -> ./libsofia-sip-ua/features
M ./configure.ac -2 +3
M ./libsofia-sip-ua/Makefile.am -1 +1
A ./libsofia-sip-ua/features/Doxyfile
A ./libsofia-sip-ua/features/Makefile.am
M ./libsofia-sip-ua/features/sofia_sip_features.c -21 +78
A ./libsofia-sip-ua/features/sofia_sip_features.docs
M ./libsofia-sip-ua/features/sofia_sip_features.h.in -15 +20
M ./libsofia-sip-ua/nua/Makefile.am -4 +3
A ./libsofia-sip-ua/sofia/
M ./libsofia-sip-ua/stun/stun.c -1 +6
M ./libsofia-sip-ua/stun/stun.h +2
@@ -0,0 +1,22 @@
PROJECT_NAME = "features"
OUTPUT_DIRECTORY = ../docs/html/features
INPUT = features.docs sofia-sip .
@INCLUDE = ../docs/Doxyfile.conf
TAGFILES += ../docs/docs.doxytags=..
TAGFILES += ../docs/su.doxytags=../su
TAGFILES += ../docs/ipt.doxytags=../ipt
TAGFILES += ../docs/bnf.doxytags=../bnf
TAGFILES += ../docs/url.doxytags=../url
TAGFILES += ../docs/msg.doxytags=../msg
TAGFILES += ../docs/sip.doxytags=../sip
TAGFILES += ../docs/sresolv.doxytags=../sresolv
TAGFILES += ../docs/tport.doxytags=../tport
TAGFILES += ../docs/nta.doxytags=../nta
TAGFILES += ../docs/sdp.doxytags=../sdp
GENERATE_TAGFILE = ../docs/features.doxytags
ALIASES +=
@@ -0,0 +1,34 @@
#
# Makefile.am for sofia features module
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
# ----------------------------------------------------------------------
# Header paths
INCLUDES = $(INTERNAL_INCLUDES)
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES = libfeatures.la
# ----------------------------------------------------------------------
# Rules for building the targets
# This is used by platforms not supporting autoconf
nobase_include_sofia_HEADERS = sofia-sip/sofia_features.h
libfeatures_la_SOURCES = features.c
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST = Doxyfile features.docs
# ----------------------------------------------------------------------
# Sofia specific rules
include ../sofia.am
@@ -0,0 +1,588 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am for sofia features module
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
# ----------------------------------------------------------------------
# Header paths
# common Makefile targets for libsofia-sip-ua modules
# ---------------------------------------------------
SOURCES = $(libfeatures_la_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(nobase_include_sofia_HEADERS) $(srcdir)/../sofia.am \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
subdir = libsofia-sip-ua/features
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/sac-general.m4 \
$(top_srcdir)/m4/sac-openssl.m4 $(top_srcdir)/m4/sac-su.m4 \
$(top_srcdir)/m4/sac-su2.m4 $(top_srcdir)/m4/sac-tport.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h \
$(top_builddir)/libsofia-sip-ua/su/sofia-sip/su_configure.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libfeatures_la_LIBADD =
am_libfeatures_la_OBJECTS = features.lo
libfeatures_la_OBJECTS = $(am_libfeatures_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/libsofia-sip-ua/su/sofia-sip
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libfeatures_la_SOURCES)
DIST_SOURCES = $(libfeatures_la_SOURCES)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(include_sofiadir)"
nobase_include_sofiaHEADERS_INSTALL = $(install_sh_DATA)
HEADERS = $(nobase_include_sofia_HEADERS)
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COREFOUNDATION_FALSE = @COREFOUNDATION_FALSE@
COREFOUNDATION_TRUE = @COREFOUNDATION_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWFLAG = @CWFLAG@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOXYGEN = @DOXYGEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_COVERAGE_FALSE = @ENABLE_COVERAGE_FALSE@
ENABLE_COVERAGE_TRUE = @ENABLE_COVERAGE_TRUE@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
EXPENSIVE_CHECKS_FALSE = @EXPENSIVE_CHECKS_FALSE@
EXPENSIVE_CHECKS_TRUE = @EXPENSIVE_CHECKS_TRUE@
F77 = @F77@
FFLAGS = @FFLAGS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GLIB_VERSION = @GLIB_VERSION@
HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@
HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@
HAVE_GLIB_FALSE = @HAVE_GLIB_FALSE@
HAVE_GLIB_TRUE = @HAVE_GLIB_TRUE@
HAVE_MINGW32_FALSE = @HAVE_MINGW32_FALSE@
HAVE_MINGW32_TRUE = @HAVE_MINGW32_TRUE@
HAVE_NTLM_FALSE = @HAVE_NTLM_FALSE@
HAVE_NTLM_TRUE = @HAVE_NTLM_TRUE@
HAVE_TLS_FALSE = @HAVE_TLS_FALSE@
HAVE_TLS_TRUE = @HAVE_TLS_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBVER_SOFIA_SIP_UA_AGE = @LIBVER_SOFIA_SIP_UA_AGE@
LIBVER_SOFIA_SIP_UA_CUR = @LIBVER_SOFIA_SIP_UA_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_AGE = @LIBVER_SOFIA_SIP_UA_GLIB_AGE@
LIBVER_SOFIA_SIP_UA_GLIB_CUR = @LIBVER_SOFIA_SIP_UA_GLIB_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_REV = @LIBVER_SOFIA_SIP_UA_GLIB_REV@
LIBVER_SOFIA_SIP_UA_GLIB_SOVER = @LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
LIBVER_SOFIA_SIP_UA_REV = @LIBVER_SOFIA_SIP_UA_REV@
LIBVER_SOFIA_SIP_UA_SOVER = @LIBVER_SOFIA_SIP_UA_SOVER@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MINGW_ENVIRONMENT = @MINGW_ENVIRONMENT@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NDEBUG_FALSE = @NDEBUG_FALSE@
NDEBUG_TRUE = @NDEBUG_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
REPLACE_LIBADD = @REPLACE_LIBADD@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOFIA_CFLAGS = @SOFIA_CFLAGS@
SOFIA_GLIB_PKG_REQUIRES = @SOFIA_GLIB_PKG_REQUIRES@
STRIP = @STRIP@
TESTS_ENVIRONMENT = @TESTS_ENVIRONMENT@
VERSION = @VERSION@
VER_LIBSOFIA_SIP_UA_MAJOR_MINOR = @VER_LIBSOFIA_SIP_UA_MAJOR_MINOR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_LD = @ac_ct_LD@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
include_sofiadir = @include_sofiadir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
INCLUDES = $(INTERNAL_INCLUDES)
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES = libfeatures.la
# ----------------------------------------------------------------------
# Rules for building the targets
# This is used by platforms not supporting autoconf
nobase_include_sofia_HEADERS = sofia-sip/sofia_features.h
libfeatures_la_SOURCES = features.c
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST = Doxyfile features.docs
AM_CFLAGS = $(CWFLAG) $(SOFIA_CFLAGS)
DISTCLEANFILES = $(BUILT_SOURCES)
# rules for building tag files
TAG_AWK = $(top_srcdir)/libsofia-sip-ua/su/tag_dll.awk
INTERNAL_INCLUDES = \
-I$(srcdir)/../features -I../features \
-I$(srcdir)/../ipt -I../ipt \
-I$(srcdir)/../iptsec -I../iptsec \
-I$(srcdir)/../bnf -I../bnf \
-I$(srcdir)/../http -I../http \
-I$(srcdir)/../msg -I../msg \
-I$(srcdir)/../nth -I../nth \
-I$(srcdir)/../nta -I../nta \
-I$(srcdir)/../nea -I../nea \
-I$(srcdir)/../nua -I../nua \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sdp -I../sdp \
-I$(srcdir)/../sip -I../sip \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sresolv -I../sresolv \
-I$(srcdir)/../tport -I../tport \
-I$(srcdir)/../stun -I../stun \
-I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../sofia.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libsofia-sip-ua/features/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu libsofia-sip-ua/features/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*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);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libfeatures.la: $(libfeatures_la_OBJECTS) $(libfeatures_la_DEPENDENCIES)
$(LINK) $(libfeatures_la_LDFLAGS) $(libfeatures_la_OBJECTS) $(libfeatures_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/features.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-nobase_include_sofiaHEADERS: $(nobase_include_sofia_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(include_sofiadir)" || $(mkdir_p) "$(DESTDIR)$(include_sofiadir)"
@$(am__vpath_adj_setup) \
list='$(nobase_include_sofia_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__vpath_adj) \
echo " $(nobase_include_sofiaHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(include_sofiadir)/$$f'"; \
$(nobase_include_sofiaHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(include_sofiadir)/$$f"; \
done
uninstall-nobase_include_sofiaHEADERS:
@$(NORMAL_UNINSTALL)
@$(am__vpath_adj_setup) \
list='$(nobase_include_sofia_HEADERS)'; for p in $$list; do \
$(am__vpath_adj) \
echo " rm -f '$(DESTDIR)$(include_sofiadir)/$$f'"; \
rm -f "$(DESTDIR)$(include_sofiadir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(mkdir_p) $(distdir)/.. $(distdir)/sofia-sip
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(include_sofiadir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-nobase_include_sofiaHEADERS
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-nobase_include_sofiaHEADERS
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-nobase_include_sofiaHEADERS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-nobase_include_sofiaHEADERS
built-sources: $(BUILT_SOURCES)
clean-built-sources:
-rm -rf $(BUILT_SOURCES) $(BUILT_SOURCES:%=$(srcdir)/%)
*_tag_ref.c: $(TAG_AWK)
%_tag_ref.c: %_tag.c
$(AWK) -f $(TAG_AWK) NODLL=1 $(TAG_DLL_FLAGS) $<
@ENABLE_COVERAGE_TRUE@coverage:
@ENABLE_COVERAGE_TRUE@ @$(top_srcdir)/scripts/coverage $(COVERAGE_FLAGS) $(COVERAGE_INPUT)
../bnf/libbnf.la ../http/libhttp.la ../ipt/libipt.la ../iptsec/libiptsec.la \
../msg/libmsg.la ../nea/libnea.la ../nta/libnta.la ../nth/libnth.la \
../nua/libnua.la ../sdp/libsdp.la ../sip/libsip.la ../soa/libsoa.la \
../sresolv/libsresolv.la ../stun/libstun.la ../su/libsu.la \
../tport/libtport.la ../url/liburl.la:
$(MAKE) -C $(@D) $(@F)
# ----------------------------------------------------------------------
# Sofia specific rules
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
@@ -0,0 +1,138 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE features.c
* Provide features available through the sofia-sip library.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Mon Oct 24 14:51:32 2005 ppessi
*/
#include "config.h"
#include <stddef.h>
#include <sofia-sip/su_configure.h>
#include <tport_tls.h>
#include "sofia-sip/sofia_features.h"
/** The name and version of software package providing Sofia-SIP-UA library.
* @showinitializer
*/
char const * const sofia_sip_name_version = SOFIA_SIP_NAME_VERSION;
/** The name and version of software package providing S/MIME functionality,
* NULL if none.
*/
char const * sofia_sip_has_smime;
/** The name and version of software package providing TLS functionality,
* NULL if none.
*
* TLS over TCP is used as transport for SIP messages when using SIPS
* scheme. Using TLS over TCP with SIP is described in @RFC3261.
*/
#if HAVE_OPENSSL
char const * sofia_sip_has_tls = tls_version;
#else
char const * sofia_sip_has_tls;
#endif
/** The name and version of software package providing DTLS functionality,
* NULL if none.
*
* DTLS or TLS over datagram transport (UDP) can be used as transport for
* SIP messages.
*/
char const * sofia_sip_has_dtls;
/** The name and version of software package providing TLS over SCTP functionality,
* NULL if none.
*
* TLS over SCTP can be used as transport for SIP messages.
*/
char const * sofia_sip_has_tls_sctp;
#if HAVE_SOFIA_SIGCOMP
#include <sigcomp.h>
#endif
/** The name and version of software package providing SigComp functionality,
* NULL if none.
*
* SigComp can be used to compress SIP messages.
*/
#if HAVE_SOFIA_SIGCOMP
char const * sofia_sip_has_sigcomp = sigcomp_package_version;
#else
char const * sofia_sip_has_sigcomp;
#endif
/** The name and version of software package providing STUN functionality,
* NULL if none.
*
* STUN is a protocol used to traverse NATs with UDP.
*/
#if HAVE_SOFIA_STUN
extern char const stun_version[];
char const * sofia_sip_has_stun = stun_version;
#else
char const * sofia_sip_has_stun;
#endif
/** The name and version of software package providing TURN functionality,
* NULL if none.
*
* TURN is a protocol used to traverse NATs or firewalls with TCP or UDP.
*/
char const * sofia_sip_has_turn;
/** The name and version of software package providing UPnP functionality,
* NULL if none.
*
* UPnP (Universal Plug and Play) can be used to traverse NATs or firewalls.
*/
char const * sofia_sip_has_upnp;
/** The name and version of software package providing SCTP functionality,
* NULL if none.
*
* SCTP can be used as transport for SIP messages. The software providing it
* can be, for example, LKSCTP (Linux kernel SCTP) for Linux.
*/
char const * sofia_sip_has_sctp;
/* We don't have viable SCTP transport interface */
/** The name and version of software package providing IPv6 functionality,
* NULL if none.
*
* IPv6 can be used to send SIP messages.
*/
#if SU_HAVE_IN6
char const * sofia_sip_has_ipv6 = "IPv6";
#else
char const * sofia_sip_has_ipv6;
#endif
@@ -0,0 +1,41 @@
/* -*- text -*- */
/**@MODULEPAGE "features" Module
@section features_meta Module Meta Information
The @b features module provides application information about the various
features possibly available through the @ref subdirs "sofia-sip-ua" binary API.
@CONTACT Pekka Pessi <Pekka.Pessi@nokia.com>
@STATUS @SofiaSIP Core library
@LICENSE LGPL
@par Contributor(s):
- Pekka Pessi <Pekka.Pessi@nokia.com>
@section features_overview Overview
The #sofia_sip_name_version contains the name and release of currently
installed @a libsofia-sip-ua.so library. The macro #SOFIA_SIP_NAME_VERSION
contains the name and release of currently available include files.
The Sofia SIP binary API hides some protocols used under the SIP stack.
While the binary API stays the same, the features are not necessarily there.
These features are mainly related to encryption, compression and underlying
transports.
- #sofia_sip_has_smime
- #sofia_sip_has_tls
- #sofia_sip_has_dtls
- #sofia_sip_has_tls_sctp
- #sofia_sip_has_sigcomp
- #sofia_sip_has_stun
- #sofia_sip_has_turn
- #sofia_sip_has_upnp
- #sofia_sip_has_sctp
- #sofia_sip_has_ipv6
*/
@@ -0,0 +1,67 @@
/* This -*- C -*- file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/* @configure_input@ */
/**@file sofia-sip/sofia_features.h
* @brief Sofia-SIP Library Features
*
* Macros and string constants listing features supported or not supported
* by sofia-sip-ua library.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Wed Feb 14 17:09:44 2001 ppessi
*/
#ifndef SOFIA_SIP_FEATURES_H
/** Defined when <sofia-sip/sofia_features.h> has been included. */
#define SOFIA_SIP_FEATURES_H
/** Current Sofia version. @showinitializer */
#define SOFIA_SIP_VERSION "@PACKAGE_VERSION@"
/** Current Sofia package name and version. @showinitializer */
#define SOFIA_SIP_NAME_VERSION "@PACKAGE_NAME@-@PACKAGE_VERSION@"
#ifdef __cplusplus
extern "C" {
#endif
SOFIAPUBVAR char const * const sofia_sip_name_version;
SOFIAPUBVAR char const * sofia_sip_has_smime;
SOFIAPUBVAR char const * sofia_sip_has_tls;
SOFIAPUBVAR char const * sofia_sip_has_dtls;
SOFIAPUBVAR char const * sofia_sip_has_tls_sctp;
SOFIAPUBVAR char const * sofia_sip_has_sigcomp;
SOFIAPUBVAR char const * sofia_sip_has_stun;
SOFIAPUBVAR char const * sofia_sip_has_turn;
SOFIAPUBVAR char const * sofia_sip_has_upnp;
SOFIAPUBVAR char const * sofia_sip_has_sctp;
SOFIAPUBVAR char const * sofia_sip_has_ipv6;
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,7 @@
2005-11-08 Pekka Pessi <Pekka.Pessi@nokia.com>
* Renamed http_test.c as test_http.c
2005-07-18 Kai Vehmanen <kai.vehmanen@nokia.com>
* Initial import of the module to Sofia-SIP tree.
@@ -0,0 +1,18 @@
PROJECT_NAME = "http"
OUTPUT_DIRECTORY = ../docs/html/http
INPUT = http.docs sofia-sip .
@INCLUDE = ../docs/Doxyfile.conf
TAGFILES += \
../docs/su.doxytags=../su \
../docs/ipt.doxytags=../ipt \
../docs/bnf.doxytags=../bnf \
../docs/url.doxytags=../url \
../docs/msg.doxytags=../msg
GENERATE_TAGFILE = ../docs/http.doxytags
ALIASES += \
"HTTP_HEADER=@ingroup http_headers\n@defgroup" \
@@ -0,0 +1,93 @@
#
# Makefile.am for http module
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
# ----------------------------------------------------------------------
# Header paths
INCLUDES = -I$(srcdir)/../bnf -I../bnf \
-I$(srcdir)/../msg -I../msg \
-I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su -I../su
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES = libhttp.la
check_PROGRAMS = test_http
TESTS = test_http
# ----------------------------------------------------------------------
# Rules for building the targets
PUBLIC_H = sofia-sip/http.h sofia-sip/http_header.h \
sofia-sip/http_parser.h sofia-sip/http_tag_class.h \
sofia-sip/http_status.h sofia-sip/http_hclasses.h
BUILT_H = sofia-sip/http_protos.h sofia-sip/http_tag.h
BUILT_C = http_tag.c http_tag_ref.c http_parser_table.c
BUILT_SOURCES = $(BUILT_H) $(BUILT_C)
nobase_include_sofia_HEADERS = $(BUILT_H) $(PUBLIC_H)
libhttp_la_SOURCES = $(INTERNAL_H) \
http_parser.c http_header.c \
http_basic.c http_extra.c \
http_status.c http_tag_class.c \
$(BUILT_C)
COVERAGE_INPUT = $(libhttp_la_SOURCES) $(include_sofia_HEADERS)
LDADD = libhttp.la \
../bnf/libbnf.la \
../msg/libmsg.la \
../url/liburl.la \
../su/libsu.la
test_http_LDFLAGS = -static
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST = Doxyfile http.docs \
sofia-sip/http_protos.h.in \
sofia-sip/http_tag.h.in \
http_parser_table.c.in \
http_tag.c.in
# ----------------------------------------------------------------------
# Sofia specific rules
include ../sofia.am
TAG_DLL_FLAGS = DLLREF=1
MSG_PARSER_AWK = $(srcdir)/../msg/msg_parser.awk
AWK_HTTP_AWK = $(AWK) -f $(MSG_PARSER_AWK) module=http
sofia-sip/http_tag.h: sofia-sip/http_tag.h.in $(MSG_PARSER_AWK)
sofia-sip/http_protos.h: sofia-sip/http_protos.h.in $(MSG_PARSER_AWK)
http_tag.c: http_tag.c.in $(MSG_PARSER_AWK)
http_parser_table.c: http_parser_table.c.in $(MSG_PARSER_AWK)
sofia-sip/http_protos.h: sofia-sip/http.h
@-mkdir sofia-sip 2>/dev/null || true
$(AWK_HTTP_AWK) PR=$@ TEMPLATE=$(srcdir)/sofia-sip/http_protos.h.in $<
sofia-sip/http_tag.h: sofia-sip/http.h
@-mkdir sofia-sip 2>/dev/null || true
$(AWK_HTTP_AWK) PR=$@ TEMPLATE=$(srcdir)/sofia-sip/http_tag.h.in $<
http_tag.c: sofia-sip/http.h
$(AWK_HTTP_AWK) PR=$@ TEMPLATE=$(srcdir)/http_tag.c.in $<
http_parser_table.c: sofia-sip/http.h
$(AWK_HTTP_AWK) PT=$@ TEMPLATE=$(srcdir)/http_parser_table.c.in \
MC_HASH_SIZE=127 $<
@@ -0,0 +1,747 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am for http module
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
# ----------------------------------------------------------------------
# Header paths
# common Makefile targets for libsofia-sip-ua modules
# ---------------------------------------------------
SOURCES = $(libhttp_la_SOURCES) test_http.c
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
check_PROGRAMS = test_http$(EXEEXT)
DIST_COMMON = $(nobase_include_sofia_HEADERS) $(srcdir)/../sofia.am \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
subdir = libsofia-sip-ua/http
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/sac-general.m4 \
$(top_srcdir)/m4/sac-openssl.m4 $(top_srcdir)/m4/sac-su.m4 \
$(top_srcdir)/m4/sac-su2.m4 $(top_srcdir)/m4/sac-tport.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h \
$(top_builddir)/libsofia-sip-ua/su/sofia-sip/su_configure.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libhttp_la_LIBADD =
am__objects_1 = http_tag.lo http_tag_ref.lo http_parser_table.lo
am_libhttp_la_OBJECTS = http_parser.lo http_header.lo http_basic.lo \
http_extra.lo http_status.lo http_tag_class.lo \
$(am__objects_1)
libhttp_la_OBJECTS = $(am_libhttp_la_OBJECTS)
test_http_SOURCES = test_http.c
test_http_OBJECTS = test_http.$(OBJEXT)
test_http_LDADD = $(LDADD)
test_http_DEPENDENCIES = libhttp.la ../bnf/libbnf.la ../msg/libmsg.la \
../url/liburl.la ../su/libsu.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/libsofia-sip-ua/su/sofia-sip
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libhttp_la_SOURCES) test_http.c
DIST_SOURCES = $(libhttp_la_SOURCES) test_http.c
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(include_sofiadir)"
nobase_include_sofiaHEADERS_INSTALL = $(install_sh_DATA)
HEADERS = $(nobase_include_sofia_HEADERS)
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COREFOUNDATION_FALSE = @COREFOUNDATION_FALSE@
COREFOUNDATION_TRUE = @COREFOUNDATION_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWFLAG = @CWFLAG@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOXYGEN = @DOXYGEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_COVERAGE_FALSE = @ENABLE_COVERAGE_FALSE@
ENABLE_COVERAGE_TRUE = @ENABLE_COVERAGE_TRUE@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
EXPENSIVE_CHECKS_FALSE = @EXPENSIVE_CHECKS_FALSE@
EXPENSIVE_CHECKS_TRUE = @EXPENSIVE_CHECKS_TRUE@
F77 = @F77@
FFLAGS = @FFLAGS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GLIB_VERSION = @GLIB_VERSION@
HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@
HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@
HAVE_GLIB_FALSE = @HAVE_GLIB_FALSE@
HAVE_GLIB_TRUE = @HAVE_GLIB_TRUE@
HAVE_MINGW32_FALSE = @HAVE_MINGW32_FALSE@
HAVE_MINGW32_TRUE = @HAVE_MINGW32_TRUE@
HAVE_NTLM_FALSE = @HAVE_NTLM_FALSE@
HAVE_NTLM_TRUE = @HAVE_NTLM_TRUE@
HAVE_TLS_FALSE = @HAVE_TLS_FALSE@
HAVE_TLS_TRUE = @HAVE_TLS_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBVER_SOFIA_SIP_UA_AGE = @LIBVER_SOFIA_SIP_UA_AGE@
LIBVER_SOFIA_SIP_UA_CUR = @LIBVER_SOFIA_SIP_UA_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_AGE = @LIBVER_SOFIA_SIP_UA_GLIB_AGE@
LIBVER_SOFIA_SIP_UA_GLIB_CUR = @LIBVER_SOFIA_SIP_UA_GLIB_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_REV = @LIBVER_SOFIA_SIP_UA_GLIB_REV@
LIBVER_SOFIA_SIP_UA_GLIB_SOVER = @LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
LIBVER_SOFIA_SIP_UA_REV = @LIBVER_SOFIA_SIP_UA_REV@
LIBVER_SOFIA_SIP_UA_SOVER = @LIBVER_SOFIA_SIP_UA_SOVER@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MINGW_ENVIRONMENT = @MINGW_ENVIRONMENT@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NDEBUG_FALSE = @NDEBUG_FALSE@
NDEBUG_TRUE = @NDEBUG_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
REPLACE_LIBADD = @REPLACE_LIBADD@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOFIA_CFLAGS = @SOFIA_CFLAGS@
SOFIA_GLIB_PKG_REQUIRES = @SOFIA_GLIB_PKG_REQUIRES@
STRIP = @STRIP@
TESTS_ENVIRONMENT = @TESTS_ENVIRONMENT@
VERSION = @VERSION@
VER_LIBSOFIA_SIP_UA_MAJOR_MINOR = @VER_LIBSOFIA_SIP_UA_MAJOR_MINOR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_LD = @ac_ct_LD@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
include_sofiadir = @include_sofiadir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
INCLUDES = -I$(srcdir)/../bnf -I../bnf \
-I$(srcdir)/../msg -I../msg \
-I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su -I../su
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES = libhttp.la
TESTS = test_http
# ----------------------------------------------------------------------
# Rules for building the targets
PUBLIC_H = sofia-sip/http.h sofia-sip/http_header.h \
sofia-sip/http_parser.h sofia-sip/http_tag_class.h \
sofia-sip/http_status.h sofia-sip/http_hclasses.h
BUILT_H = sofia-sip/http_protos.h sofia-sip/http_tag.h
BUILT_C = http_tag.c http_tag_ref.c http_parser_table.c
BUILT_SOURCES = $(BUILT_H) $(BUILT_C)
nobase_include_sofia_HEADERS = $(BUILT_H) $(PUBLIC_H)
libhttp_la_SOURCES = $(INTERNAL_H) \
http_parser.c http_header.c \
http_basic.c http_extra.c \
http_status.c http_tag_class.c \
$(BUILT_C)
COVERAGE_INPUT = $(libhttp_la_SOURCES) $(include_sofia_HEADERS)
LDADD = libhttp.la \
../bnf/libbnf.la \
../msg/libmsg.la \
../url/liburl.la \
../su/libsu.la
test_http_LDFLAGS = -static
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST = Doxyfile http.docs \
sofia-sip/http_protos.h.in \
sofia-sip/http_tag.h.in \
http_parser_table.c.in \
http_tag.c.in
AM_CFLAGS = $(CWFLAG) $(SOFIA_CFLAGS)
DISTCLEANFILES = $(BUILT_SOURCES)
# rules for building tag files
TAG_AWK = $(top_srcdir)/libsofia-sip-ua/su/tag_dll.awk
INTERNAL_INCLUDES = \
-I$(srcdir)/../features -I../features \
-I$(srcdir)/../ipt -I../ipt \
-I$(srcdir)/../iptsec -I../iptsec \
-I$(srcdir)/../bnf -I../bnf \
-I$(srcdir)/../http -I../http \
-I$(srcdir)/../msg -I../msg \
-I$(srcdir)/../nth -I../nth \
-I$(srcdir)/../nta -I../nta \
-I$(srcdir)/../nea -I../nea \
-I$(srcdir)/../nua -I../nua \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sdp -I../sdp \
-I$(srcdir)/../sip -I../sip \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sresolv -I../sresolv \
-I$(srcdir)/../tport -I../tport \
-I$(srcdir)/../stun -I../stun \
-I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su
# ----------------------------------------------------------------------
# Sofia specific rules
TAG_DLL_FLAGS = DLLREF=1
MSG_PARSER_AWK = $(srcdir)/../msg/msg_parser.awk
AWK_HTTP_AWK = $(AWK) -f $(MSG_PARSER_AWK) module=http
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../sofia.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libsofia-sip-ua/http/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu libsofia-sip-ua/http/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*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);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libhttp.la: $(libhttp_la_OBJECTS) $(libhttp_la_DEPENDENCIES)
$(LINK) $(libhttp_la_LDFLAGS) $(libhttp_la_OBJECTS) $(libhttp_la_LIBADD) $(LIBS)
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
test_http$(EXEEXT): $(test_http_OBJECTS) $(test_http_DEPENDENCIES)
@rm -f test_http$(EXEEXT)
$(LINK) $(test_http_LDFLAGS) $(test_http_OBJECTS) $(test_http_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_basic.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_extra.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_header.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_parser.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_parser_table.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_status.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_tag.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_tag_class.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http_tag_ref.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_http.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-nobase_include_sofiaHEADERS: $(nobase_include_sofia_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(include_sofiadir)" || $(mkdir_p) "$(DESTDIR)$(include_sofiadir)"
@$(am__vpath_adj_setup) \
list='$(nobase_include_sofia_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__vpath_adj) \
echo " $(nobase_include_sofiaHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(include_sofiadir)/$$f'"; \
$(nobase_include_sofiaHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(include_sofiadir)/$$f"; \
done
uninstall-nobase_include_sofiaHEADERS:
@$(NORMAL_UNINSTALL)
@$(am__vpath_adj_setup) \
list='$(nobase_include_sofia_HEADERS)'; for p in $$list; do \
$(am__vpath_adj) \
echo " rm -f '$(DESTDIR)$(include_sofiadir)/$$f'"; \
rm -f "$(DESTDIR)$(include_sofiadir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list='$(TESTS)'; \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
;; \
*) \
echo "PASS: $$tst"; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
*) \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
echo "SKIP: $$tst"; \
fi; \
done; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="All $$all tests passed"; \
else \
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all tests failed"; \
else \
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
skipped="($$skip tests were not run)"; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
echo "$$dashes"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
$(mkdir_p) $(distdir)/.. $(distdir)/sofia-sip
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(include_sofiadir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
clean-noinstLTLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-nobase_include_sofiaHEADERS
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-nobase_include_sofiaHEADERS
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool \
clean-noinstLTLIBRARIES ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man \
install-nobase_include_sofiaHEADERS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-nobase_include_sofiaHEADERS
built-sources: $(BUILT_SOURCES)
clean-built-sources:
-rm -rf $(BUILT_SOURCES) $(BUILT_SOURCES:%=$(srcdir)/%)
*_tag_ref.c: $(TAG_AWK)
%_tag_ref.c: %_tag.c
$(AWK) -f $(TAG_AWK) NODLL=1 $(TAG_DLL_FLAGS) $<
@ENABLE_COVERAGE_TRUE@coverage:
@ENABLE_COVERAGE_TRUE@ @$(top_srcdir)/scripts/coverage $(COVERAGE_FLAGS) $(COVERAGE_INPUT)
../bnf/libbnf.la ../http/libhttp.la ../ipt/libipt.la ../iptsec/libiptsec.la \
../msg/libmsg.la ../nea/libnea.la ../nta/libnta.la ../nth/libnth.la \
../nua/libnua.la ../sdp/libsdp.la ../sip/libsip.la ../soa/libsoa.la \
../sresolv/libsresolv.la ../stun/libstun.la ../su/libsu.la \
../tport/libtport.la ../url/liburl.la:
$(MAKE) -C $(@D) $(@F)
sofia-sip/http_tag.h: sofia-sip/http_tag.h.in $(MSG_PARSER_AWK)
sofia-sip/http_protos.h: sofia-sip/http_protos.h.in $(MSG_PARSER_AWK)
http_tag.c: http_tag.c.in $(MSG_PARSER_AWK)
http_parser_table.c: http_parser_table.c.in $(MSG_PARSER_AWK)
sofia-sip/http_protos.h: sofia-sip/http.h
@-mkdir sofia-sip 2>/dev/null || true
$(AWK_HTTP_AWK) PR=$@ TEMPLATE=$(srcdir)/sofia-sip/http_protos.h.in $<
sofia-sip/http_tag.h: sofia-sip/http.h
@-mkdir sofia-sip 2>/dev/null || true
$(AWK_HTTP_AWK) PR=$@ TEMPLATE=$(srcdir)/sofia-sip/http_tag.h.in $<
http_tag.c: sofia-sip/http.h
$(AWK_HTTP_AWK) PR=$@ TEMPLATE=$(srcdir)/http_tag.c.in $<
http_parser_table.c: sofia-sip/http.h
$(AWK_HTTP_AWK) PT=$@ TEMPLATE=$(srcdir)/http_parser_table.c.in \
MC_HASH_SIZE=127 $<
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
@@ -0,0 +1,48 @@
accept Accept
accept_charset Accept-Charset
accept_encoding Accept-Encoding
accept_language Accept-Language
accept_ranges Accept-Ranges
age Age
allow Allow
authorization Authorization
cache_control Cache-Control
connection Connection
content_encoding Content-Encoding
content_language Content-Language
content_length Content-Length
content_location Content-Location
content_md5 Content-MD5
content_range Content-Range
content_type Content-Type
date Date
etag ETag
expect Expect
expires Expires
from From
host Host
if_match If-Match
if_modified_since If-Modified-Since
if_none_match If-None-Match
if_range If-Range
if_unmodified_since If-Unmodified-Since
last_modified Last-Modified
location Location
max_forwards Max-Forwards
mime_version MIME-Version
pragma Pragma
pr_authenticate Proxy-Authenticate
pr_authorization Proxy-Authorization
range Range
referer Referer
retry_after Retry-After
server Server
te TE
trailer Trailer
transfer_encoding Transfer-Encoding
upgrade Upgrade
user_agent User-Agent
vary Vary
via Via
warning Warning
www_authenticate WWW-Authenticate
@@ -0,0 +1,17 @@
; Template for http.def
LIBRARY "http"
DESCRIPTION 'HTTP Win32 Dynamic Link Library'
EXPORTS
; Explicit exports can go here
http_default_mclass
sip_#xxxxxx#_class
sip_#xxxxxx#_p
sip_#xxxxxx#_dup
sip_#xxxxxx#_copy
sip_#xxxxxx#_make
@@ -0,0 +1,40 @@
/* -*- c -*- */
/**@MODULEPAGE "http" - HTTP Parser Module
*
* @section http_meta Module Meta Information
*
* The @b http module contains interface to the HTTP parser and the header
* and message objects.
*
* @CONTACT Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @STATUS @SofiaSIP Core library
*
* @LICENSE LGPL
*
* @section http_overview Overview
*
* Each HTTP header has a structure defined for it in <http.h>. All the
* variables, objects and functions related to a particular HTTP header are
* documented in a <a href="modules.html">submodule</a> for the header. In
* addition to the header structure, there is defined a @em header @em class
* structure and some standard functions for each header in the
* <http_header.h> include file. For header @c X, there are types,
* functions, macros and header class as follows:
*
* - @c http_X_t is the structure used to store parsed header,
* - @c HTTP_X_INIT() initializes a static instance of http_X_t,
* - @c http_X_p() tests if header object is instance of header X,
* - @c http_X_make() is a macro that creates a header X object by
decoding given string,
* - @c http_X_dup() duplicates (deeply copies) the header X (macro),
* - @c http_X_copy() is a macro that copies the header X (macro),
* - @c #msg_hclass_t http_X_class[] contains the @em header @em class
* for header X.
*
* In addition to this interface, the parser provider interface is
* documented in the <a href="../sip/group__sip__parser.html">SIP Parser module</a>.
* The parser provider interface makes it possible to extend HTTP parser with
* new headers or extend existing ones.
*/
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,469 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE http_extra.c
*
* Extra HTTP headers
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Jun 13 02:57:51 2000 ppessi
*/
#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
/* Avoid casting http_t to msg_pub_t and http_header_t to msg_header_t */
#define MSG_PUB_T struct http_s
#define MSG_HDR_T union http_header_u
#include "sofia-sip/http_parser.h"
/* ========================================================================== */
/**@HTTP_HEADER http_proxy_connection Proxy-Connection extension header. */
#define http_proxy_connection_d msg_list_d
#define http_proxy_connection_e msg_list_e
msg_hclass_t http_proxy_connection_class[] =
HTTP_HEADER_CLASS_LIST(proxy_connection, "Proxy-Connection", list);
/* ====================================================================== */
/**@HTTP_HEADER http_cookie Cookie extension header.
*
* The Cookie header is used to transmit state information from server
* back to the http client. Its syntax is defined in RFC 2109 section 4.3.4
* as follows:
*
* @code
* cookie = "Cookie:" cookie-version
* 1*((";" | ",") cookie-value)
* cookie-value = NAME "=" VALUE [";" path] [";" domain]
* cookie-version = "$Version" "=" value
* NAME = attr
* VALUE = value
* path = "$Path" "=" value
* domain = "$Domain" "=" value
* @endcode
*
*/
/**@ingroup http_cookie
*
* @typedef typedef struct http_cookie_s http_cookie_t;
*
* The structure http_cookie_t contains representation of @b Cookie
* header. Please note that a single http_cookie_t can contain many
* cookies.
*
* The http_cookie_t is defined as follows:
* @code
* typedef struct http_cookie_s
* {
* } http_cookie_t;
* @endcode
*/
/**Update Cookie parameters.
*
* The function http_cookie_update() updates a @b Cookie parameter
* shortcuts.
*
* @param sc pointer to a @c http_cookie_t object
*/
static inline
void http_cookie_update(http_cookie_t *c)
{
size_t i;
c->c_name = NULL;
c->c_version = NULL, c->c_domain = NULL, c->c_path = NULL;
if (!c->c_params)
return;
if (!(MSG_PARAM_MATCH(c->c_version, c->c_params[0], "$Version")))
return;
if (!c->c_params[1] || c->c_params[1][0] == '$')
return;
c->c_name = c->c_params[1];
for (i = 2; ; i++) {
msg_param_t p = c->c_params[i];
if (!p || *p++ != '$')
break;
switch (p[0]) {
case 'd': case 'D':
MSG_PARAM_MATCH(c->c_domain, p, "Domain");
break;
case 'p': case 'P':
MSG_PARAM_MATCH(c->c_path, p, "Path");
break;
}
}
}
/* Scan a cookie parameter */
static issize_t cookie_scanner(char *s)
{
char *p = s;
size_t tlen;
skip_token(&s);
if (s == p) /* invalid parameter name */
return -1;
tlen = s - p;
if (IS_LWS(*s)) { *s++ = '\0'; skip_lws(&s); }
if (*s == '=') {
char *v;
s++;
skip_lws(&s);
v = s;
/* get value */
if (*s == '"') {
size_t qlen = span_quoted(s);
if (!qlen)
return -1;
s += qlen;
}
else {
s += strcspn(s, ",;" LWS);
if (s == v)
return -1;
}
if (p + tlen + 1 != v) {
memmove(p + tlen + 1, v, s - v);
p[tlen] = '=';
p[tlen + 1 + (s - v)] = '\0';
}
}
if (IS_LWS(*s)) { *s++ = '\0'; skip_lws(&s); }
return s - p;
}
/** Decode (parse) a Cookie header */
issize_t http_cookie_d(su_home_t *home, msg_header_t *h, char *s, isize_t slen)
{
http_cookie_t *c = (http_cookie_t *)h;
assert(h); assert(sizeof(*h));
for (;*s;) {
/* Ignore empty entries (comma-whitespace) */
if (*s == ',') { *s++ = '\0'; skip_lws(&s); continue; }
if (msg_any_list_d(home, &s, (msg_param_t **)&c->c_params,
cookie_scanner, ';') == -1)
return -1;
if (*s != '\0' && *s != ',')
return -1;
if (!c->c_params)
return -1;
}
http_cookie_update(c);
return 0;
}
/** Encode (print) a Cookie header */
issize_t http_cookie_e(char b[], isize_t bsiz, msg_header_t const *h, int flags)
{
char *b0 = b, *end = b + bsiz;
http_cookie_t const *c = (http_cookie_t *)h;
size_t i;
if (c->c_params) {
for (i = 0; c->c_params[i]; i++) {
if (i > 0) MSG_CHAR_E(b, end, ';');
MSG_STRING_E(b, end, c->c_params[i]);
}
}
MSG_TERM_E(b, end);
return b - b0;
}
/** Calculate extra storage used by Cookie header field */
isize_t http_cookie_dup_xtra(msg_header_t const *h, isize_t offset)
{
http_cookie_t const *c = (http_cookie_t *)h;
MSG_PARAMS_SIZE(offset, c->c_params);
return offset;
}
/** Duplicate a Cookie header field */
char *http_cookie_dup_one(msg_header_t *dst, msg_header_t const *src,
char *b, isize_t xtra)
{
http_cookie_t *c = (http_cookie_t *)dst;
http_cookie_t const *o = (http_cookie_t const *)src;
char *end = b + xtra;
b = msg_params_dup(&c->c_params, o->c_params, b, xtra);
http_cookie_update(c);
assert(b <= end); (void)end;
return b;
}
msg_hclass_t http_cookie_class[] =
HTTP_HEADER_CLASS(cookie, "Cookie", c_params, append, cookie);
/* ====================================================================== */
/**@HTTP_HEADER http_set_cookie Set-Cookie extension header.
*
* The Set-Cookie header is used to transmit state information from server
* back to the http client. Its syntax is defined in RFC 2109 section 4.2.2
* as follows:
*
* @code
* set-cookie = "Set-Cookie:" cookies
* cookies = 1#cookie
* cookie = NAME "=" VALUE *(";" cookie-av)
* NAME = attr
* VALUE = value
* cookie-av = "Comment" "=" value
* | "Domain" "=" value
* | "Max-Age" "=" value
* | "Path" "=" value
* | "Secure"
* | "Version" "=" 1*DIGIT
*
* @endcode
*
*/
/**@ingroup http_set_cookie
*
* @typedef typedef struct http_set_cookie_s http_set_cookie_t;
*
* The structure http_set_cookie_t contains representation of @b Set-Cookie
* header.
*
* The http_set_cookie_t is defined as follows:
* @code
* typedef struct http_set_cookie_s
* {
* } http_set_cookie_t;
* @endcode
*/
/**Update Set-Cookie parameters.
*
* The function http_set_cookie_update() updates a @b Set-Cookie parameter
* shortcuts.
*
* @param sc pointer to a @c http_set_cookie_t object
*/
static inline
void http_set_cookie_update(http_set_cookie_t *sc)
{
size_t i;
sc->sc_name = NULL;
sc->sc_version = NULL, sc->sc_domain = NULL, sc->sc_path = NULL;
sc->sc_comment = NULL, sc->sc_max_age = NULL, sc->sc_secure = 0;
if (!sc->sc_params)
return;
sc->sc_name = sc->sc_params[0];
for (i = 1; sc->sc_params[i]; i++) {
msg_param_t p = sc->sc_params[i];
switch (p[0]) {
case 'c': case 'C':
MSG_PARAM_MATCH(sc->sc_comment, p, "Comment");
break;
case 'd': case 'D':
MSG_PARAM_MATCH(sc->sc_domain, p, "Domain");
break;
case 'm': case 'M':
MSG_PARAM_MATCH(sc->sc_max_age, p, "Max-Age");
break;
case 'p': case 'P':
MSG_PARAM_MATCH(sc->sc_path, p, "Path");
break;
case 's': case 'S':
MSG_PARAM_MATCH_P(sc->sc_secure, p, "Secure");
break;
case 'v': case 'V':
MSG_PARAM_MATCH(sc->sc_version, p, "Version");
break;
}
}
}
#include <sofia-sip/msg_date.h>
/* Scan a cookie parameter */
static issize_t set_cookie_scanner(char *s)
{
char *rest;
#define LOOKING_AT(s, what) \
(strncasecmp((s), what, strlen(what)) == 0 && (rest = s + strlen(what)))
/* Special cases from Netscape spec */
if (LOOKING_AT(s, "expires=")) {
msg_time_t value;
msg_date_d((char const **)&rest, &value);
} else if (LOOKING_AT(s, "path=/")) {
for (;;) {
rest += span_unreserved(rest);
if (*rest != '/')
break;
rest++;
}
} else {
return msg_attribute_value_scanner(s);
}
#undef LOOKING_AT
if (IS_LWS(*rest)) {
*rest++ = '\0'; skip_lws(&rest);
}
return rest - s;
}
/** Decode (parse) Set-Cookie header */
issize_t http_set_cookie_d(su_home_t *home, msg_header_t *h, char *s, isize_t slen)
{
msg_header_t **hh = &h->sh_succ, *h0 = h;
http_set_cookie_t *sc = (http_set_cookie_t *)h;
msg_param_t *params;
assert(h); assert(sizeof(*h));
for (;*s;) {
/* Ignore empty entries (comma-whitespace) */
if (*s == ',') { *s++ = '\0'; skip_lws(&s); continue; }
if (!h) { /* Allocate next header structure */
if (!(h = msg_header_alloc(home, h0->sh_class, 0)))
return -1;
*hh = h; h->sh_prev = hh; hh = &h->sh_succ;
sc = sc->sc_next = (http_set_cookie_t *)h;
}
/* "Set-Cookie:" 1#(NAME "=" VALUE *(";" cookie-av))) */
params = su_zalloc(home, MSG_PARAMS_NUM(1) * sizeof(msg_param_t));
if (!params)
return -1;
params[0] = s, sc->sc_params = params;
s += strcspn(s, ",;" LWS);
if (*s) {
*s++ = '\0';
skip_lws(&s);
if (*s && msg_any_list_d(home, &s, (msg_param_t **)&sc->sc_params,
set_cookie_scanner, ';') == -1)
return -1;
}
if (*s != '\0' && *s != ',')
return -1;
if (sc->sc_params)
http_set_cookie_update(sc);
h = NULL;
}
return 0;
}
/** Encode (print) Set-Cookie header */
issize_t http_set_cookie_e(char b[], isize_t bsiz, msg_header_t const *h, int flags)
{
char *b0 = b, *end = b + bsiz;
http_set_cookie_t const *sc = (http_set_cookie_t *)h;
size_t i;
if (sc->sc_params) {
for (i = 0; sc->sc_params[i]; i++) {
if (i > 0) MSG_CHAR_E(b, end, ';');
MSG_STRING_E(b, end, sc->sc_params[i]);
}
}
MSG_TERM_E(b, end);
return b - b0;
}
/** Calculate extra storage used by Set-Cookie header field */
isize_t http_set_cookie_dup_xtra(msg_header_t const *h, isize_t offset)
{
http_set_cookie_t const *sc = (http_set_cookie_t *)h;
MSG_PARAMS_SIZE(offset, sc->sc_params);
return offset;
}
/** Duplicate a Set-Cookie header field */
char *http_set_cookie_dup_one(msg_header_t *dst, msg_header_t const *src,
char *b, isize_t xtra)
{
http_set_cookie_t *sc = (http_set_cookie_t *)dst;
http_set_cookie_t const *o = (http_set_cookie_t const *)src;
char *end = b + xtra;
b = msg_params_dup(&sc->sc_params, o->sc_params, b, xtra);
http_set_cookie_update(sc);
assert(b <= end); (void)end;
return b;
}
msg_hclass_t http_set_cookie_class[] =
HTTP_HEADER_CLASS(set_cookie, "Set-Cookie", sc_params, append, set_cookie);
@@ -0,0 +1,307 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE http_header.c
*
* HTTP header handling.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Jun 13 02:57:51 2000 ppessi
*/
#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <stdarg.h>
#include <assert.h>
#include <sofia-sip/su_alloc.h>
/* Avoid casting http_t to msg_pub_t and http_header_t to msg_header_t */
#define MSG_PUB_T struct http_s
#define MSG_HDR_T union http_header_u
#define HTTP_STATIC_INLINE
#include "sofia-sip/http_parser.h"
#include <sofia-sip/http_header.h>
#include <sofia-sip/http_status.h>
#ifndef UINT32_MAX
#define UINT32_MAX (0xffffffffU)
#endif
/** Complete a HTTP request. */
int http_request_complete(msg_t *msg)
{
size_t len = 0;
http_t *http = http_object(msg);
http_payload_t const *pl;
su_home_t *home = msg_home(msg);
if (!http)
return -1;
if (!http->http_request)
return -1;
if (!http->http_host)
return -1;
for (pl = http->http_payload; pl; pl = pl->pl_next)
len += pl->pl_len;
if (len > UINT32_MAX)
return -1;
if (!http->http_content_length) {
http->http_content_length = http_content_length_create(home, (uint32_t)len);
}
else {
if (http->http_content_length->l_length != len) {
http->http_content_length->l_length = (uint32_t)len;
msg_fragment_clear(http->http_content_length->l_common);
}
}
if (!http->http_separator)
http->http_separator = http_separator_create(home);
return 0;
}
/** Remove schema, host, port, and fragment from HTTP/HTTPS URL */
int http_strip_hostport(url_t *url)
{
if (url->url_type == url_http || url->url_type == url_https) {
url->url_type = url_unknown;
url->url_scheme = NULL;
url->url_user = NULL;
url->url_password = NULL;
url->url_host = NULL;
url->url_port = NULL;
if (url->url_path == NULL) {
url->url_root = '/';
url->url_path = "";
}
}
url->url_fragment = NULL;
return 0;
}
/** Add a Content-Length and separator to a message */
int http_message_complete(msg_t *msg, http_t *http)
{
#if 1
if (!http->http_content_length) {
http_content_length_t *l;
http_payload_t *pl;
size_t len = 0;
for (pl = http->http_payload; pl; pl = pl->pl_next)
len += pl->pl_len;
if (len > UINT32_MAX)
return -1;
l = http_content_length_create(msg_home(msg), (uint32_t)len);
if (msg_header_insert(msg, http, (http_header_t *)l) < 0)
return -1;
}
#endif
if (!http->http_separator) {
http_separator_t *sep = http_separator_create(msg_home(msg));
if (msg_header_insert(msg, http, (http_header_t *)sep) < 0)
return -1;
}
return 0;
}
/** Add headers from the request to the response message. */
int http_complete_response(msg_t *msg,
int status, char const *phrase,
http_t const *request)
{
su_home_t *home = msg_home(msg);
http_t *http = msg_object(msg);
if (!http || !request || !request->http_request)
return -1;
if (!http->http_status)
http->http_status = http_status_create(home, status, phrase, NULL);
if (!http->http_status)
return -1;
if (!http->http_separator) {
http_separator_t *sep = http_separator_create(msg_home(msg));
if (msg_header_insert(msg, http, (http_header_t *)sep) < 0)
return -1;
}
return 0;
}
/** Copy a HTTP header. */
http_header_t *http_header_copy(su_home_t *home, http_header_t const *h)
{
if (h == NULL || h == HTTP_NONE)
return NULL;
return msg_header_copy_as(home, h->sh_class, h);
}
/** Duplicate a HTTP header. */
http_header_t *http_header_dup(su_home_t *home, http_header_t const *h)
{
if (h == NULL || h == HTTP_NONE)
return NULL;
return msg_header_dup_as(home, h->sh_class, h);
}
/** Decode a HTTP header. */
http_header_t *http_header_d(su_home_t *home, msg_t const *msg, char const *b)
{
return msg_header_d(home, msg, b);
}
/** Encode a HTTP header. */
int http_header_e(char b[], int bsiz, http_header_t const *h, int flags)
{
return msg_header_e(b, bsiz, h, flags);
}
/** Encode HTTP header contents. */
int http_header_field_e(char b[], int bsiz, http_header_t const *h, int flags)
{
assert(h); assert(h->sh_class);
return h->sh_class->hc_print(b, bsiz, h, flags);
}
http_header_t *http_header_format(su_home_t *home,
msg_hclass_t *hc,
char const *fmt,
...)
{
http_header_t *h;
va_list ap;
va_start(ap, fmt);
h = http_header_vformat(home, hc, fmt, ap);
va_end(ap);
return h;
}
/** Add a duplicate of header object to a HTTP message. */
int http_add_dup(msg_t *msg,
http_t *http,
http_header_t const *o)
{
if (o == HTTP_NONE)
return 0;
if (msg == NULL || o == NULL)
return -1;
return msg_header_insert(msg, http, msg_header_dup(msg_home(msg), o));
}
int http_add_make(msg_t *msg,
http_t *http,
msg_hclass_t *hc,
char const *s)
{
if (s == NULL)
return 0;
if (msg == NULL)
return -1;
return msg_header_insert(msg, http, msg_header_make(msg_home(msg), hc, s));
}
int http_add_format(msg_t *msg,
http_t *http,
msg_hclass_t *hc,
char const *fmt,
...)
{
http_header_t *h;
va_list ap;
if (fmt == NULL)
return 0;
if (msg == NULL)
return -1;
va_start(ap, fmt);
h = http_header_vformat(msg_home(msg), hc, fmt, ap);
va_end(ap);
return msg_header_insert(msg, http, h);
}
/** Compare two HTTP URLs. */
int http_url_cmp(url_t const *a, url_t const *b)
{
int rv;
if ((rv = url_cmp(a, b)))
return rv;
if (a->url_path != b->url_path) {
if (a->url_path == NULL) return -1;
if (b->url_path == NULL) return +1;
if ((rv = strcmp(a->url_path, b->url_path)))
return rv;
}
/* Params? */
/* Query */
if (a->url_headers != b->url_headers) {
if (a->url_headers == NULL) return -1;
if (b->url_headers == NULL) return +1;
if ((rv = strcmp(a->url_headers, b->url_headers)))
return rv;
}
return 0;
}
@@ -0,0 +1,573 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE http_parser.c
*
* HTTP parser.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Thu Oct 5 14:01:24 2000 ppessi
*/
#include "config.h"
/* Avoid casting http_t to msg_pub_t and http_header_t to msg_header_t */
#define MSG_PUB_T struct http_s
#define MSG_HDR_T union http_header_u
#include <sofia-sip/su_alloc.h>
#include "sofia-sip/http_parser.h"
#include <sofia-sip/msg_parser.h>
#include <sofia-sip/http_header.h>
#include <sofia-sip/http_status.h>
#include <sofia-sip/msg_mclass.h>
#include <sofia-sip/su_tagarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <limits.h>
#include <stdarg.h>
/** HTTP version 1.1. */
char const http_version_1_1[] = "HTTP/1.1";
/** HTTP version 1.0. */
char const http_version_1_0[] = "HTTP/1.0";
/** HTTP version 0.9 is an empty string. */
char const http_version_0_9[] = "";
msg_mclass_t *http_default_mclass(void)
{
extern msg_mclass_t http_mclass[];
return http_mclass;
}
static
issize_t http_extract_chunk(msg_t *, http_t *, char b[], isize_t bsiz, int eos);
/** Calculate length of line ending (0, 1 or 2) */
#define CRLF_TEST(s) \
(((s)[0]) == '\r' ? (((s)[1]) == '\n') + 1 : ((s)[0])=='\n')
/** Extract the HTTP message body, including separator line.
*
* @retval -1 error
* @retval 0 cannot proceed
* @retval other number of bytes extracted
*/
issize_t http_extract_body(msg_t *msg, http_t *http, char b[], isize_t bsiz, int eos)
{
issize_t m = 0;
size_t body_len;
int flags = http->http_flags;
if (eos && bsiz == 0) {
msg_mark_as_complete(msg, MSG_FLG_COMPLETE);
return 0;
}
if (flags & MSG_FLG_TRAILERS) {
/* The empty line after trailers */
if (!eos && (bsiz == 0 || (bsiz == 1 && b[0] == '\r')))
return 0;
m = CRLF_TEST(b);
assert(m > 0 || eos); /* We should be looking at an empty line */
/* We have completed trailers */
msg_mark_as_complete(msg, MSG_FLG_COMPLETE);
return m;
}
if (flags & MSG_FLG_CHUNKS)
return http_extract_chunk(msg, http, b, bsiz, eos);
if (!(flags & MSG_FLG_BODY)) {
/* We are looking at a potential empty line */
m = msg_extract_separator(msg, http, b, bsiz, eos);
if (m == 0) /* Not yet */
return 0;
http->http_flags |= MSG_FLG_BODY;
b += m, bsiz -= m;
}
/* body_len is determined by rules in RFC2616 sections 4.3 and 4.4 */
/* 1XX, 204, 304 do not have message-body, ever */
if (http->http_status) {
int status = http->http_status->st_status;
if (status < 200 || status == 204 || status == 304)
flags |= HTTP_FLG_NO_BODY;
}
if (flags & HTTP_FLG_NO_BODY) {
msg_mark_as_complete(msg, MSG_FLG_COMPLETE);
return m;
}
if (http->http_transfer_encoding) {
if (/* NOTE - there is really no Transfer-Encoding: identity in RFC 2616
* but it was used in drafts...
*/
http->http_transfer_encoding->k_items &&
http->http_transfer_encoding->k_items[0] &&
strcasecmp(http->http_transfer_encoding->k_items[0],
"identity") != 0) {
http->http_flags |= MSG_FLG_CHUNKS;
if (http->http_flags & MSG_FLG_STREAMING)
msg_set_streaming(msg, msg_start_streaming);
if (m)
return m;
return http_extract_chunk(msg, http, b, bsiz, eos);
}
}
if (http->http_content_length)
body_len = http->http_content_length->l_length;
/* We cannot parse multipart/byteranges ... */
else if (http->http_content_type && http->http_content_type->c_type &&
strcasecmp(http->http_content_type->c_type, "multipart/byteranges")
== 0)
return -1;
else if (MSG_IS_MAILBOX(flags)) /* message fragments */
body_len = 0;
else if (http->http_request)
body_len = 0;
else if (eos)
body_len = bsiz;
else
return 0; /* XXX */
if (body_len == 0) {
msg_mark_as_complete(msg, MSG_FLG_COMPLETE);
return m;
}
if (http->http_flags & MSG_FLG_STREAMING)
msg_set_streaming(msg, msg_start_streaming);
if (m)
return m;
m = msg_extract_payload(msg, http, NULL, body_len, b, bsiz, eos);
if (m == -1)
return -1;
/* We have now all message fragments in place */
http->http_flags |= MSG_FLG_FRAGS;
if (bsiz >= body_len) {
msg_mark_as_complete(msg, MSG_FLG_COMPLETE);
}
return m;
}
/** Extract a chunk.
*
* @retval -1 error
* @retval 0 cannot proceed
* @retval other number of bytes extracted
*/
issize_t http_extract_chunk(msg_t *msg, http_t *http, char b[], isize_t bsiz, int eos)
{
size_t n;
unsigned crlf, chunk_len;
char *b0 = b, *s;
union {
msg_header_t *header;
msg_payload_t *chunk;
} h = { NULL };
size_t bsiz0 = bsiz;
if (bsiz == 0)
return 0;
/* We should be looking at an empty line followed by the chunk header */
while ((crlf = CRLF_TEST(b))) {
if (bsiz == 1 && crlf == 1 && b[0] == '\r' && !eos)
return 0;
if (crlf == bsiz) {
if (eos) {
msg_mark_as_complete(msg, MSG_FLG_COMPLETE | MSG_FLG_FRAGS);
return (b - b0) + crlf;
}
else
return 0;
}
assert(crlf < bsiz);
/* Skip crlf */
b += crlf; bsiz -= crlf;
}
/* Now, looking at the chunk header */
n = strcspn(b, CRLF);
if (!eos && n == bsiz)
return 0;
crlf = CRLF_TEST(b + n);
if (n == 0) {
if (crlf == bsiz && eos) {
msg_mark_as_complete(msg, MSG_FLG_COMPLETE | MSG_FLG_FRAGS);
return crlf;
}
else
return -1; /* XXX - should we be more liberal? */
}
if (!eos && n + crlf == bsiz && (crlf == 0 || (crlf == 1 && b[n] == '\r')))
return 0;
chunk_len = strtoul(b, &s, 16);
if (s == b)
return -1;
skip_ws(&s);
if (s != b + n && s[0] != ';') /* Extra stuff that is not parameter */
return -1;
if (chunk_len == 0) { /* We found last-chunk */
b += n + crlf, bsiz -= n + crlf;
crlf = bsiz > 0 ? CRLF_TEST(b) : 0;
if ((eos && bsiz == 0) || crlf == 2 ||
(crlf == 1 && (bsiz > 1 || b[0] == '\n'))) {
/* Shortcut - We got empty trailers */
b += crlf;
msg_mark_as_complete(msg, MSG_FLG_COMPLETE | MSG_FLG_FRAGS);
} else {
/* We have to parse trailers */
http->http_flags |= MSG_FLG_TRAILERS;
}
return b - b0;
}
else {
issize_t chunk;
b += n + crlf, bsiz -= n + crlf;
/* Extract chunk */
chunk = msg_extract_payload(msg, http,
&h.header, chunk_len + (b - b0),
b0, bsiz0, eos);
if (chunk != -1 && h.header) {
assert(h.chunk->pl_data);
h.chunk->pl_data += (b - b0);
h.chunk->pl_len -= (b - b0);
}
return chunk;
}
}
/** Parse HTTP version.
*
* The function http_version_d() parses a HTTP method.
*
* @retval 0 when successful,
* @retval -1 upon an error.
*/
int http_version_d(char **ss, char const **ver)
{
char *s = *ss;
char const *result;
int const version_size = sizeof(http_version_1_1) - 1;
if (strncasecmp(s, http_version_1_1, version_size) == 0 &&
!IS_TOKEN(s[version_size])) {
result = http_version_1_1;
s += version_size;
}
else if (strncasecmp(s, http_version_1_0, version_size) == 0 &&
!IS_TOKEN(s[version_size])) {
result = http_version_1_0;
s += version_size;
}
else if (s[0] == '\0') {
result = http_version_0_9;
} else {
/* Version consists of one or two tokens, separated by / */
size_t l1 = 0, l2 = 0, n;
result = s;
l1 = span_token(s);
for (n = l1; IS_LWS(s[n]); n++)
s[n] = '\0';
if (s[n] == '/') {
for (n = n + 1; IS_LWS(s[n]); n++);
l2 = span_token(s + n);
n += l2;
}
if (l1 == 0)
return -1;
/* If there is extra ws between tokens, compact version */
if (l2 > 0 && n > l1 + 1 + l2) {
s[l1] = '/';
memmove(s + l1 + 1, s + n - l2, l2);
s[l1 + 1 + l2] = 0;
/* Compare again with compacted version */
if (strcasecmp(s, http_version_1_1) == 0)
result = http_version_1_1;
else if (strcasecmp(s, http_version_1_0) == 0)
result = http_version_1_0;
}
s += n;
}
while (IS_LWS(*s)) *s++ = '\0';
*ss = s;
if (ver)
*ver = result;
return 0;
}
/** Calculate extra space required by version string */
isize_t http_version_xtra(char const *version)
{
if (version == http_version_1_1)
return 0;
else if (version == http_version_1_0)
return 0;
else
return MSG_STRING_SIZE(version);
}
/** Duplicate a transport string */
void http_version_dup(char **pp, char const **dd, char const *s)
{
if (s == http_version_1_1)
*dd = s;
else if (s == http_version_1_0)
*dd = s;
else
MSG_STRING_DUP(*pp, *dd, s);
}
/** Well-known HTTP method names. */
static char const * const methods[] = {
"<UNKNOWN>",
http_method_name_get,
http_method_name_post,
http_method_name_head,
http_method_name_options,
http_method_name_put,
http_method_name_delete,
http_method_name_trace,
http_method_name_connect,
NULL,
/* If you add something here, add also them to http_method_d! */
};
char const http_method_name_get[] = "GET";
char const http_method_name_post[] = "POST";
char const http_method_name_head[] = "HEAD";
char const http_method_name_options[] = "OPTIONS";
char const http_method_name_put[] = "PUT";
char const http_method_name_delete[] = "DELETE";
char const http_method_name_trace[] = "TRACE";
char const http_method_name_connect[] = "CONNECT";
char const *http_method_name(http_method_t method, char const *name)
{
if (method > 0 && (size_t)method < sizeof(methods)/sizeof(methods[0]))
return methods[method];
else if (method == 0)
return name;
else
return NULL;
}
/**Parse a HTTP method name.
*
* The function @c http_method_d() parses a HTTP method, and returns a code
* corresponding to the method. It stores the address of the first non-LWS
* character after method name in @c *ss.
*
* @param ss pointer to pointer to string to be parsed
* @param nname pointer to value-result parameter formethod name
*
* @note
* If there is no whitespace after method name, the value in @a *nname
* may not be NUL-terminated. The calling function @b must NUL terminate
* the value by setting the @a **ss to NUL after first examining its value.
*
* @return The function @c http_method_d returns the method code if method
* was identified, 0 (@c http_method_unknown) if method is not known, or @c -1
* (@c http_method_invalid) if an error occurred.
*
* If the value-result argument @a nname is not @c NULL, http_method_d()
* stores a pointer to the method name to it.
*/
http_method_t http_method_d(char **ss, char const **nname)
{
char *s = *ss, c = *s;
char const *name;
int code = http_method_unknown;
size_t n = 0;
#define MATCH(s, m) (strncasecmp(s, m, n = sizeof(m) - 1) == 0)
if (c >= 'a' && c <= 'z')
c += 'A' - 'a';
switch (c) {
case 'C': if (MATCH(s, "CONNECT")) code = http_method_connect; break;
case 'D': if (MATCH(s, "DELETE")) code = http_method_delete; break;
case 'G': if (MATCH(s, "GET")) code = http_method_get; break;
case 'H': if (MATCH(s, "HEAD")) code = http_method_head; break;
case 'O': if (MATCH(s, "OPTIONS")) code = http_method_options; break;
case 'P': if (MATCH(s, "POST")) code = http_method_post;
else
if (MATCH(s, "PUT")) code = http_method_put; break;
case 'T': if (MATCH(s, "TRACE")) code = http_method_trace; break;
}
#undef MATCH
if (!code || IS_NON_WS(s[n])) {
/* Unknown method */
code = http_method_unknown;
name = s;
for (n = 0; IS_UNRESERVED(s[n]); n++)
;
if (s[n]) {
if (!IS_LWS(s[n]))
return http_method_invalid;
if (nname)
s[n++] = '\0';
}
}
else {
name = methods[code];
}
while (IS_LWS(s[n]))
n++;
*ss = (s + n);
if (nname) *nname = name;
return code;
}
/** Get method enum corresponding to method name */
http_method_t http_method_code(char const *name)
{
/* Note that http_method_d() does not change string if nname is NULL */
return http_method_d((char **)&name, NULL);
}
/**Parse HTTP query string.
*
* The function http_query_parse() searches for the given keys in HTTP @a
* query. For each key, a query element (in the form name=value) is searched
* from the query string. If a query element has a beginning matching with
* the key, a copy of the rest of the element is returned in corresponding
* return_value argument.
*
* @note The @a query string will be modified.
*
* @return
* The function http_query_parse() returns number keys that matched within
* the @a query string.
*/
issize_t http_query_parse(char *query,
/* char const *key, char **return_value, */
...)
{
va_list ap;
char *q, *q_next;
char *name, *value, **return_value;
char const *key;
size_t namelen, valuelen, keylen;
isize_t N;
int has_value;
if (!query)
return -1;
for (q = query, N = 0; *q; q = q_next) {
namelen = strcspn(q, "=&");
valuelen = namelen + strcspn(q + namelen, "&");
q_next = q + valuelen;
if (*q_next)
*q_next++ = '\0';
value = q + namelen;
has_value = (*value) != '\0'; /* is the part in form of name=value? */
if (has_value)
*value++ = '\0';
name = url_unescape(q, q);
if (has_value) {
namelen = strlen(name);
name[namelen] = '=';
url_unescape(name + namelen + 1, value);
}
va_start(ap, query);
while ((key = va_arg(ap, char const *))) {
return_value = va_arg(ap, char **);
keylen = strlen(key);
if (strncmp(key, name, keylen) == 0) {
*return_value = name + keylen;
N++;
}
}
va_end(ap);
}
return N;
}
@@ -0,0 +1,59 @@
/** -*- C -*-
* @IFILE http_parser_table.c.in
*
* Template for <http_parser_table.c>.
*
* @date Created: Tue Oct 1 20:37:52 2002 ppessi
*/
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@internal
* @CFILE http_parser_table.c
* @brief HTTP parser table
*
* #AUTO#
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Oct 1 20:37:52 2002 ppessi
*/
#include "config.h"
#include <stddef.h>
#include <string.h>
/* Avoid casting http_t to msg_pub_t and http_header_t to msg_header_t */
#define MSG_PUB_T struct http_s
#define MSG_HDR_T union http_header_u
#include <sofia-sip/http_parser.h>
#include <sofia-sip/msg_mclass.h>
#define HTTP_PARSER_FLAGS (MSG_FLG_CHUNKING)
@@ -0,0 +1,130 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE http_status.c HTTP status codes.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Sep 18 18:58:21 2001 ppessi
*/
#include "config.h"
#include <stddef.h>
#include <sofia-sip/http_status.h>
char const
http_100_continue[] = "Continue",
http_101_switching[] = "Switching Protocols",
http_200_ok[] = "OK",
http_201_created[] = "Created",
http_202_accepted[] = "Accepted",
http_203_non_auth_info[] = "Non-Authoritative Information",
http_204_no_content[] = "No Content",
http_205_reset_content[] = "Reset Content",
http_206_partial_content[] = "Partial Content",
http_300_multiple_choices[] = "Multiple Choices",
http_301_moved_permanently[] = "Moved Permanently",
http_302_found[] = "Found",
http_303_see_other[] = "See Other",
http_304_not_modified[] = "Not Modified",
http_305_use_proxy[] = "Use Proxy",
http_307_temporary_redirect[] = "Temporary Redirect",
http_400_bad_request[] = "Bad Request",
http_401_unauthorized[] = "Unauthorized",
http_402_payment_required[] = "Payment Required",
http_403_forbidden[] = "Forbidden",
http_404_not_found[] = "Not Found",
http_405_not_allowed[] = "Method Not Allowed",
http_406_not_acceptable[] = "Not Acceptable",
http_407_proxy_auth[] = "Proxy Authentication Required",
http_408_timeout[] = "Request Timeout",
http_409_conflict[] = "Conflict",
http_410_gone[] = "Gone",
http_411_no_length[] = "Length Required",
http_412_precondition[] = "Precondition Failed",
http_413_entity_too_large[] = "Request Entity Too Large",
http_414_uri_too_long[] = "Request-URI Too Long",
http_415_media_type[] = "Unsupported Media Type",
http_416_requested_range[] = "Requested Range Not Satisfiable",
http_417_expectation[] = "Expectation Failed",
http_426_upgrade[] = "Upgrade Required",
http_500_internal_server[] = "Internal Server Error",
http_501_not_implemented[] = "Not Implemented",
http_502_bad_gateway[] = "Bad Gateway",
http_503_no_service[] = "Service Unavailable",
http_504_gateway_timeout[] = "Gateway Timeout",
http_505_http_version[] = "HTTP Version Not Supported";
char const *http_status_phrase(int status)
{
if (status < 100 || status > 699)
return NULL;
switch (status) {
case 100: return http_100_continue;
case 101: return http_101_switching;
case 200: return http_200_ok;
case 201: return http_201_created;
case 202: return http_202_accepted;
case 203: return http_203_non_auth_info;
case 204: return http_204_no_content;
case 205: return http_205_reset_content;
case 206: return http_206_partial_content;
case 300: return http_300_multiple_choices;
case 301: return http_301_moved_permanently;
case 302: return http_302_found;
case 303: return http_303_see_other;
case 304: return http_304_not_modified;
case 305: return http_305_use_proxy;
case 307: return http_307_temporary_redirect;
case 400: return http_400_bad_request;
case 401: return http_401_unauthorized;
case 402: return http_402_payment_required;
case 403: return http_403_forbidden;
case 404: return http_404_not_found;
case 405: return http_405_not_allowed;
case 406: return http_406_not_acceptable;
case 407: return http_407_proxy_auth;
case 408: return http_408_timeout;
case 409: return http_409_conflict;
case 410: return http_410_gone;
case 411: return http_411_no_length;
case 412: return http_412_precondition;
case 413: return http_413_entity_too_large;
case 414: return http_414_uri_too_long;
case 415: return http_415_media_type;
case 416: return http_416_requested_range;
case 417: return http_417_expectation;
case 426: return http_426_upgrade;
case 500: return http_500_internal_server;
case 501: return http_501_not_implemented;
case 502: return http_502_bad_gateway;
case 503: return http_503_no_service;
case 504: return http_504_gateway_timeout;
case 505: return http_505_http_version;
}
return " ";
}
@@ -0,0 +1,68 @@
/**@HTTP
* @IFILE http_tag.c.in
*
* Template for <http_tag.c>.
*
* @date Created: Wed Feb 21 11:01:45 2001 ppessi
*/
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@file http_tag.c HTTP Tag classes
*
* This file is autogenerated from <http_tag.c.in>.
*
* #AUTO#
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*/
#include "config.h"
#define TAG_NAMESPACE "http"
#include <assert.h>
#include <stddef.h>
#include <string.h>
#include <sofia-sip/su.h>
#include <sofia-sip/http.h>
#include <sofia-sip/http_protos.h>
#include <sofia-sip/http_tag.h>
#include <sofia-sip/http_tag_class.h>
tag_typedef_t httptag_any = NSTAG_TYPEDEF(*);
tag_typedef_t httptag_http = HTTPMSGTAG_TYPEDEF(http);
tag_typedef_t httptag_version = STRTAG_TYPEDEF(version);
tag_typedef_t httptag_header =
{{ TAG_NAMESPACE, "header", httphdrtag_class, 0 }};
tag_typedef_t httptag_header_str = STRTAG_TYPEDEF(header_str);
tag_typedef_t httptag_#xxxxxx# = HTTPHDRTAG_TYPEDEF(#xxxxxx#);
tag_typedef_t httptag_#xxxxxx#_str = HTTPSTRTAG_TYPEDEF(#xxxxxx#);
@@ -0,0 +1,222 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE http_tag_class.c HTTP tag classes
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Fri Feb 23 12:46:42 2001 ppessi
*/
#include "config.h"
#include <assert.h>
#include <stddef.h>
#include <string.h>
#include <sofia-sip/su.h>
/* Avoid casting http_t to msg_pub_t and http_header_t to msg_header_t */
#define MSG_PUB_T struct http_s
#define MSG_HDR_T union http_header_u
#include <sofia-sip/http_parser.h>
#include <sofia-sip/http_tag.h>
#include <sofia-sip/su_tag_class.h>
#include <sofia-sip/su_tag_inline.h>
#include <sofia-sip/http_tag_class.h>
#include <sofia-sip/su_tagarg.h>
tag_class_t httphdrtag_class[1] =
{{
sizeof(httphdrtag_class),
/* tc_next */ NULL,
/* tc_len */ NULL,
/* tc_move */ NULL,
/* tc_xtra */ msghdrtag_xtra,
/* tc_dup */ msghdrtag_dup,
/* tc_free */ NULL,
/* tc_find */ NULL,
/* tc_snprintf */ msghdrtag_snprintf,
/* tc_filter */ httptag_filter,
/* tc_ref_set */ t_ptr_ref_set,
/* tc_scan */ msghdrtag_scan,
}};
tag_class_t httpstrtag_class[1] =
{{
sizeof(httpstrtag_class),
/* tc_next */ NULL,
/* tc_len */ NULL,
/* tc_move */ NULL,
/* tc_xtra */ t_str_xtra,
/* tc_dup */ t_str_dup,
/* tc_free */ NULL,
/* tc_find */ NULL,
/* tc_snprintf */ t_str_snprintf,
/* tc_filter */ NULL /* msgtag_str_filter */,
/* tc_ref_set */ t_ptr_ref_set,
/* tc_scan */ msghdrtag_scan,
}};
tag_class_t httpmsgtag_class[1] =
{{
sizeof(httpmsgtag_class),
/* tc_next */ NULL,
/* tc_len */ NULL,
/* tc_move */ NULL,
/* tc_xtra */ msgobjtag_xtra,
/* tc_dup */ msgobjtag_dup,
/* tc_free */ NULL,
/* tc_find */ NULL,
/* tc_snprintf */ msgobjtag_snprintf,
/* tc_filter */ NULL /* httptag_http_filter */,
/* tc_ref_set */ t_ptr_ref_set,
/* tc_scan */ t_str_scan
}};
/** Filter a HTTP header structure. */
tagi_t *httptag_filter(tagi_t *dst,
tagi_t const f[],
tagi_t const *src,
void **bb)
{
tagi_t stub[2] = {{ NULL }};
tag_type_t sctt, tt = f->t_tag;
msg_hclass_t *hc = (msg_hclass_t *)tt->tt_magic;
assert(src);
sctt = src->t_tag;
if (sctt && sctt->tt_class == httpmsgtag_class) {
http_t const *http;
msg_mclass_t const *mc;
http_header_t const *h, **hh;
http = (http_t const *)src->t_value;
mc = (void *)http->http_common->h_class;
hh = (void *)msg_hclass_offset(mc, http, hc);
if (http == NULL ||
(char *)hh >= ((char *)http + http->http_size) ||
(char *)hh < (char *)&http->http_request)
return dst;
h = *hh;
if (h == NULL)
return dst;
stub[0].t_tag = tt;
stub[0].t_value = (tag_value_t)h;
src = stub; sctt = tt;
}
if (tt != sctt)
return dst;
if (!src->t_value)
return dst;
else if (dst) {
return t_dup(dst, src, bb);
}
else {
*bb = (char *)*bb + t_xtra(src, (size_t)*bb);
return dst + 1;
}
}
/** Duplicate headers from taglist and add them to the HTTP message.
*
* Return the number of headers added to the HTTP message.
*/
int http_add_tl(msg_t *msg, http_t *http,
tag_type_t tag, tag_value_t value, ...)
{
tagi_t const *t;
ta_list ta;
int retval = 0;
if (msg == NULL)
return -1;
if (http == NULL)
http = msg_object(msg);
ta_start(ta, tag, value);
for (t = ta_args(ta); t; t = tl_next(t)) {
if (!(tag = t->t_tag) || !(value = t->t_value))
continue;
if (HTTPTAG_P(tag)) {
msg_hclass_t *hc = (msg_hclass_t *)tag->tt_magic;
http_header_t *h = (http_header_t *)value, **hh;
if (h == HTTP_NONE) { /* Remove header(s) */
if (hc == NULL)
break;
hh = msg_hclass_offset(msg_mclass(msg), http, hc);
if (!hh)
break;
while (*hh) {
msg_header_remove(msg, http, *hh);
}
}
else if (h == NULL) {
continue;
} else {
if (tag == httptag_header)
hc = h->sh_class;
if (msg_header_add_dup_as(msg, http, hc, h) < 0)
break;
}
}
else if (HTTPTAG_STR_P(tag)) {
msg_hclass_t *hc = (msg_hclass_t *)tag->tt_magic;
char const *s = (char const *)value;
if (s && msg_header_add_make(msg, http, hc, s) < 0)
break;
}
else if (tag == httptag_header_str) {
if (msg_header_add_str(msg, http, (char const *)value) < 0)
break;
}
else
continue;
retval++;
}
ta_end(ta);
if (t)
return -1;
return retval;
}
@@ -0,0 +1,482 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef HTTP_H
/** Defined when <sofia-sip/http.h> has been included. */
#define HTTP_H
/**@file sofia-sip/http.h
*
* HTTP message, methods, headers.
*
* @sa <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</a>
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>.
*
* @date Created : Thu Jun 8 19:28:55 2000 ppessi
*/
#ifndef MSG_H
#include <sofia-sip/msg.h>
#endif
#ifndef URL_H
#include <sofia-sip/url.h>
#endif
#ifndef MSG_MIME_H
#include <sofia-sip/msg_mime.h>
#endif
SOFIA_BEGIN_DECLS
/* ----------------------------------------------------------------------
* 1) Constants
*/
#define HTTP_NONE ((http_header_t *)MSG_HEADER_NONE)
#define HTTP_DEFAULT_PORT (80)
#define HTTP_DEFAULT_SERV "80"
/** HTTP protocol identifier */
#define HTTP_PROTOCOL_TAG ((void *)0x48545450) /* 'HTTP' */
/** HTTP parser flags */
enum {
HTTP_FLG_NO_BODY = (1 << 15)
};
/** IDs for well-known HTTP methods. */
typedef enum {
http_method_invalid = -1, /**< Invalid method name */
http_method_unknown = 0, /**< Unknown method, use @c method_name */
http_method_get, /**< GET */
http_method_post, /**< POST */
http_method_head, /**< HEAD */
http_method_options, /**< OPTIONS */
http_method_put, /**< PUT */
http_method_delete, /**< DELETE */
http_method_trace, /**< TRACE */
http_method_connect, /**< CONNECT */
} http_method_t;
#define HTTP_METHOD(s) http_method_unknown, #s
#define HTTP_NO_METHOD http_method_unknown, NULL
#define HTTP_METHOD_GET http_method_get, "GET"
#define HTTP_METHOD_POST http_method_post, "POST"
#define HTTP_METHOD_HEAD http_method_head, "HEAD"
#define HTTP_METHOD_OPTIONS http_method_options, "OPTIONS"
#define HTTP_METHOD_PUT http_method_put, "PUT"
#define HTTP_METHOD_DELETE http_method_delete, "DELETE"
#define HTTP_METHOD_TRACE http_method_trace, "TRACE"
#define HTTP_METHOD_CONNECT http_method_connect, "CONNECT"
/* ----------------------------------------------------------------------
* 2) Type declarations
*/
/** HTTP message object. */
typedef struct http_s http_t;
/** Any HTTP header - union of all possible HTTP headers. */
typedef union http_header_u http_header_t;
typedef struct http_request_s http_request_t;
typedef struct http_status_s http_status_t;
typedef msg_accept_t http_accept_t;
typedef msg_accept_charset_t http_accept_charset_t;
typedef msg_accept_encoding_t http_accept_encoding_t;
typedef msg_accept_language_t http_accept_language_t;
typedef msg_list_t http_accept_ranges_t;
typedef msg_numeric_t http_age_t;
typedef msg_list_t http_allow_t;
typedef msg_auth_info_t http_authentication_info_t;
typedef msg_auth_t http_authorization_t;
typedef msg_list_t http_cache_control_t;
typedef msg_list_t http_connection_t;
typedef msg_content_encoding_t http_content_encoding_t;
typedef msg_content_language_t http_content_language_t;
typedef msg_content_length_t http_content_length_t;
typedef msg_content_location_t http_content_location_t;
typedef msg_generic_t http_content_md5_t;
typedef struct http_content_range_s http_content_range_t;
typedef msg_content_type_t http_content_type_t;
typedef struct http_date_s http_date_t;
typedef msg_generic_t http_etag_t;
typedef msg_generic_t http_expect_t;
typedef http_date_t http_expires_t;
typedef msg_generic_t http_from_t;
typedef struct http_host_s http_host_t;
typedef msg_list_t http_if_match_t;
typedef http_date_t http_if_modified_since_t;
typedef msg_list_t http_if_none_match_t;
typedef struct http_if_range_s http_if_range_t;
typedef http_date_t http_if_unmodified_since_t;
typedef http_date_t http_last_modified_t;
typedef struct http_location_s http_location_t;
typedef struct http_max_forwards_s http_max_forwards_t;
typedef msg_generic_t http_mime_version_t;
typedef msg_list_t http_pragma_t;
typedef msg_auth_t http_proxy_authenticate_t;
typedef msg_auth_t http_proxy_authorization_t;
typedef struct http_range_s http_range_t;
typedef struct http_location_s http_referer_t;
typedef struct http_retry_after_s http_retry_after_t;
typedef msg_generic_t http_server_t;
typedef struct http_te_s http_te_t;
typedef msg_list_t http_trailer_t;
typedef msg_list_t http_transfer_encoding_t;
typedef msg_list_t http_upgrade_t;
typedef msg_generic_t http_user_agent_t;
typedef msg_list_t http_vary_t;
typedef struct http_via_s http_via_t;
typedef msg_warning_t http_warning_t;
typedef msg_auth_t http_www_authenticate_t;
typedef msg_list_t http_proxy_connection_t;
typedef struct http_set_cookie_s http_set_cookie_t;
typedef struct http_cookie_s http_cookie_t;
/** Erroneous header. */
typedef msg_error_t http_error_t;
/** Unknown header. */
typedef msg_generic_t http_unknown_t;
/** Separator line between headers and message contents */
typedef msg_separator_t http_separator_t;
/** Entity-body */
typedef msg_payload_t http_payload_t;
/** Time in seconds since 01-Jan-1900. */
typedef unsigned long http_time_t;
/** Range offset. */
typedef unsigned long http_off_t;
/* ----------------------------------------------------------------------
* 3) Structure definitions
*/
/** HTTP request line */
struct http_request_s {
msg_common_t rq_common[1];
http_error_t *rq_next;
http_method_t rq_method; /** Method enum. */
char const *rq_method_name; /** Method name. */
url_t rq_url[1]; /** URL. */
char const *rq_version; /** Protocol version. */
};
/** HTTP status line */
struct http_status_s {
msg_common_t st_common[1];
http_error_t *st_next;
char const *st_version;
int st_status;
char const *st_phrase;
};
/**@ingroup http_authentication_info
* @brief Structure for @b Authentication-Info header.
*
* @deprecated Use struct msg_auth_info_s instead.
*/
struct http_authentication_info_s
{
msg_common_t ai_common[1]; /**< Common fragment info */
msg_error_t *ai_next; /**< Dummy link to next */
msg_param_t const *ai_params; /**< List of authentication info */
};
/** Content-Range */
struct http_content_range_s {
msg_common_t cr_common[1];
http_error_t *cr_next;
http_off_t cr_first; /**< First-byte-pos */
http_off_t cr_last; /**< Last-byte-pos */
http_off_t cr_length; /**< Instance-length */
};
/** Date, Expires, If-Modified-Since, If-Unmodified-Since, Last-Modified */
struct http_date_s {
msg_common_t d_common[1];
http_error_t *d_next;
http_time_t d_time; /**< Seconds since Jan 1, 1900 */
};
/** Host */
struct http_host_s {
msg_common_t h_common[1];
http_error_t *h_next;
char const *h_host;
char const *h_port;
};
/** If-Range */
struct http_if_range_s {
msg_common_t ifr_common[1];
http_error_t *ifr_next;
char const *ifr_tag; /**< Tag */
http_time_t ifr_time; /**< Timestamp */
};
/** Location, Referer */
struct http_location_s {
msg_common_t loc_common[1];
http_error_t *loc_next;
url_t loc_url[1];
};
/** Max-Forwards */
struct http_max_forwards_s {
msg_common_t mf_common[1];
http_error_t *mf_next;
unsigned long mf_count;
};
/** Range */
struct http_range_s
{
msg_common_t rng_common[1];
http_error_t *rng_next;
char const *rng_unit;
char const **rng_specs;
};
/** Retry-After. */
struct http_retry_after_s {
msg_common_t ra_common[1]; /**< Common fragment info */
http_error_t *ra_next; /**< Link to next (dummy) */
http_time_t ra_date; /**< When to retry */
http_time_t ra_delta; /**< Seconds to before retry */
};
/** TE */
struct http_te_s {
msg_common_t te_common[1]; /**< Common fragment info */
http_te_t *te_next; /**< Link to next t-coding */
char const *te_extension; /**< Transfer-Extension */
msg_param_t const *te_params; /**< List of parameters */
char const *te_q; /**< Q-value */
};
/** Via */
struct http_via_s {
msg_common_t v_common[1];
http_via_t *v_next;
char const *v_version;
char const *v_host;
char const *v_port;
char const *v_comment;
};
/** Cookie */
struct http_cookie_s {
msg_common_t c_common[1];
http_cookie_t *c_next;
msg_param_t const *c_params;
char const *c_version;
char const *c_name;
char const *c_domain;
char const *c_path;
};
/** Set-Cookie */
struct http_set_cookie_s {
msg_common_t sc_common[1];
http_set_cookie_t *sc_next;
msg_param_t const *sc_params;
char const *sc_name;
char const *sc_version;
char const *sc_domain;
char const *sc_path;
char const *sc_comment;
char const *sc_max_age;
unsigned sc_secure;
};
/**HTTP message object.
*
* This structure contains a HTTP message object. It is used to access the
* headers and payload within the message. The generic transport aspects of
* the message, like network address, is accessed using a @b msg_t object
* directly.
*/
struct http_s {
msg_common_t http_common[1]; /**< For recursive inclusion */
msg_pub_t *http_next; /**< Dummy pointer to next part */
void *http_user; /**< Application data */
unsigned http_size; /**< Size of this structure */
int http_flags; /**< Flags */
http_error_t *http_error; /**< Erroneous headers */
http_request_t *http_request; /**< Request line */
http_status_t *http_status; /**< Status line */
/* === Headers start here */
http_accept_t *http_accept; /**< Accept */
http_accept_charset_t *http_accept_charset; /**< Accept-Charset */
http_accept_encoding_t *http_accept_encoding; /**< Accept-Encoding */
http_accept_language_t *http_accept_language; /**< Accept-Language */
http_accept_ranges_t *http_accept_ranges; /**< Accept-Ranges */
http_allow_t *http_allow; /**< Allow */
http_authentication_info_t*http_authentication_info;/**<Authentication-Info*/
http_authorization_t *http_authorization; /**< Authorization */
http_age_t *http_age; /**< Age */
http_cache_control_t *http_cache_control; /**< Cache-Control */
http_connection_t *http_connection; /**< Connection */
http_date_t *http_date; /**< Date */
http_etag_t *http_etag; /**< ETag */
http_expect_t *http_expect; /**< Expect */
http_expires_t *http_expires; /**< Expires */
http_from_t *http_from; /**< From */
http_host_t *http_host; /**< Host */
http_if_match_t *http_if_match; /**< If-Match */
http_if_modified_since_t *http_if_modified_since; /**< If-Modified-Since */
http_if_none_match_t *http_if_none_match; /**< If-None-Match */
http_if_range_t *http_if_range; /**< If-Range */
http_if_unmodified_since_t*http_if_unmodified_since;/**<If-Unmodified-Since*/
http_last_modified_t *http_last_modified; /**< Last-Modified */
http_location_t *http_location; /**< Location */
http_max_forwards_t *http_max_forwards; /**< Max-Forwards */
http_pragma_t *http_pragma; /**< Pragma */
http_proxy_authenticate_t *http_proxy_authenticate;/**< Proxy-Authenticate */
http_proxy_authorization_t*http_proxy_authorization;/**<Proxy-Authorization*/
http_range_t *http_range; /**< Range */
http_referer_t *http_referer; /**< Referer */
http_retry_after_t *http_retry_after; /**< Retry-After */
http_server_t *http_server; /**< Server */
http_te_t *http_te; /**< TE */
http_trailer_t *http_trailer; /**< Trailer */
http_transfer_encoding_t *http_transfer_encoding; /**< Transfer-Encoding */
http_upgrade_t *http_upgrade; /**< Upgrade */
http_user_agent_t *http_user_agent; /**< User-Agent */
http_vary_t *http_vary; /**< Vary */
http_via_t *http_via; /**< Via */
http_warning_t *http_warning; /**< Warning */
http_www_authenticate_t *http_www_authenticate; /**< WWW-Authenticate */
http_proxy_connection_t *http_proxy_connection; /**< Proxy-Connection */
http_set_cookie_t *http_set_cookie; /**< Set-Cookie */
http_cookie_t *http_cookie; /**< Cookie */
http_mime_version_t *http_mime_version; /**< MIME-Version */
http_content_encoding_t *http_content_encoding; /**< Content-Encoding */
http_content_language_t *http_content_language; /**< Content-Language */
http_content_length_t *http_content_length; /**< Content-Length */
http_content_location_t *http_content_location; /**< Content-Location */
http_content_md5_t *http_content_md5; /**< Content-MD5 */
http_content_range_t *http_content_range; /**< Content-Range */
http_content_type_t *http_content_type; /**< Content-Type */
/* === Headers end here */
http_header_t *http_unknown; /**< Unknown headers. */
http_separator_t *http_separator;
/**< Separator between message and payload */
http_payload_t *http_payload; /**< Message entity-body */
};
/**Union representing any HTTP header.
*
* Each different header is an array of size 1.
*
* @deprecated
*/
union http_header_u {
msg_common_t sh_common[1];
struct {
msg_common_t shn_common;
http_header_t *shn_next;
} sh_header_next[1];
msg_auth_t sh_auth[1];
msg_generic_t sh_generic[1];
msg_numeric_t sh_numeric[1];
http_request_t sh_request[1];
http_status_t sh_status[1];
http_error_t sh_error[1];
http_unknown_t sh_unknown[1];
http_separator_t sh_separator[1];
http_payload_t sh_payload[1];
/* Proper headers */
http_via_t sh_via[1];
http_host_t sh_host[1];
http_from_t sh_from[1];
http_referer_t sh_referer[1];
http_connection_t sh_connection[1];
http_accept_t sh_accept[1];
http_accept_charset_t sh_accept_charset[1];
http_accept_encoding_t sh_accept_encoding[1];
http_accept_language_t sh_accept_language[1];
http_accept_ranges_t sh_accept_ranges[1];
http_allow_t sh_allow[1];
http_te_t sh_te[1];
http_authentication_info_t sh_authentication_info[1];
http_authorization_t sh_authorization[1];
http_www_authenticate_t sh_www_authenticate[1];
http_proxy_authenticate_t sh_proxy_authenticate[1];
http_proxy_authorization_t sh_proxy_authorization[1];
http_age_t sh_age[1];
http_cache_control_t sh_cache_control[1];
http_date_t sh_date[1];
http_expires_t sh_expires[1];
http_if_match_t sh_if_match[1];
http_if_modified_since_t sh_if_modified_since[1];
http_if_none_match_t sh_if_none_match[1];
http_if_range_t sh_if_range[1];
http_if_unmodified_since_t sh_if_unmodified_since[1];
http_etag_t sh_etag[1];
http_expect_t sh_expect[1];
http_last_modified_t sh_last_modified[1];
http_location_t sh_location[1];
http_max_forwards_t sh_max_forwards[1];
http_pragma_t sh_pragma[1];
http_range_t sh_range[1];
http_retry_after_t sh_retry_after[1];
http_trailer_t sh_trailer[1];
http_upgrade_t sh_upgrade[1];
http_vary_t sh_vary[1];
http_warning_t sh_warning[1];
http_user_agent_t sh_user_agent[1];
http_server_t sh_server[1];
http_mime_version_t sh_mime_version[1];
http_content_language_t sh_content_language[1];
http_content_location_t sh_content_location[1];
http_content_md5_t sh_content_md5[1];
http_content_range_t sh_content_range[1];
http_content_encoding_t sh_content_encoding[1];
http_transfer_encoding_t sh_transfer_encoding[1];
http_content_type_t sh_content_type[1];
http_content_length_t sh_content_length[1];
};
SOFIA_END_DECLS
#endif /* !defined(HTTP_H) */
@@ -0,0 +1,70 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef HTTP_HCLASSES_H
/** Defined when <sofia-sip/http_hclasses.h> has been included. */
#define HTTP_HCLASSES_H
/**@file sofia-sip/http_hclasses.h
* @brief HTTP header classes.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
*/
#ifndef MSG_TYPES_H
#include <sofia-sip/msg_types.h>
#endif
SOFIA_BEGIN_DECLS
/* Use directly these header classes */
#define http_accept_class msg_accept_class
#define http_accept_charset_class msg_accept_charset_class
#define http_accept_encoding_class msg_accept_encoding_class
#define http_accept_language_class msg_accept_language_class
#define http_content_encoding_class msg_content_encoding_class
#define http_content_length_class msg_content_length_class
#define http_content_md5_class msg_content_md5_class
#define http_content_type_class msg_content_type_class
#define http_content_id_class msg_content_id_class
#define http_content_location_class msg_content_location_class
#define http_content_language_class msg_content_language_class
#define http_mime_version_class msg_mime_version_class
#define http_error_class msg_error_class
#define http_unknown_class msg_unknown_class
#define http_separator_class msg_separator_class
#define http_payload_class msg_payload_class
SOFIA_END_DECLS
#ifndef HTTP_PROTOS_H
#define HTTP_HCLASSES_ONLY
#include <sofia-sip/http_protos.h>
#undef HTTP_HCLASSES_ONLY
#endif
#endif /* !defined HTTP_HCLASSES_H */
@@ -0,0 +1,271 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef HTTP_HEADER_H
/** Defined when <sofia-sip/http_header.h> has been included.*/
#define HTTP_HEADER_H
/**@file sofia-sip/http_header.h
*
* HTTP library prototypes.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Jun 13 02:58:26 2000 ppessi
*/
#ifndef SU_ALLOC_H
#include <sofia-sip/su_alloc.h>
#endif
#ifndef SU_TAG_H
#include <sofia-sip/su_tag.h>
#endif
#ifndef HTTP_H
#include <sofia-sip/http.h>
#endif
#ifndef MSG_HEADER_H
#include <sofia-sip/msg_header.h>
#endif
SOFIA_BEGIN_DECLS
/* ----------------------------------------------------------------------
* 1) Macros
*/
/** Initialize a HTTP header structure. */
#define HTTP_HEADER_INIT(h, http_class, size) \
((void)memset((h), 0, (size)), \
(void)(((msg_common_t *)(h))->h_class = (http_class)), \
(h))
#define HTTP_METHOD_NAME(method, name) \
((method) == http_method_unknown ? (name) : http_method_name(method, name))
/* ----------------------------------------------------------------------
* 2) Variables
*/
SOFIAPUBVAR char const http_method_name_get[];
SOFIAPUBVAR char const http_method_name_post[];
SOFIAPUBVAR char const http_method_name_head[];
SOFIAPUBVAR char const http_method_name_options[];
SOFIAPUBVAR char const http_method_name_put[];
SOFIAPUBVAR char const http_method_name_delete[];
SOFIAPUBVAR char const http_method_name_trace[];
SOFIAPUBVAR char const http_method_name_connect[];
/** HTTP 0.9 */
SOFIAPUBVAR char const http_version_0_9[];
/** HTTP 1.0 */
SOFIAPUBVAR char const http_version_1_0[];
/** HTTP 1.1 version. */
SOFIAPUBVAR char const http_version_1_1[];
#define HTTP_VERSION_CURRENT http_version_1_1
/* ----------------------------------------------------------------------
* 3) Prototypes
*/
/** HTTP parser description. */
SOFIAPUBFUN msg_mclass_t *http_default_mclass(void);
/** Complete a HTTP request. */
SOFIAPUBFUN int http_request_complete(msg_t *msg);
/** Complete a HTTP message. */
SOFIAPUBFUN int http_message_complete(msg_t *msg, http_t *http);
/** Add a duplicate of header object to a HTTP message. */
SOFIAPUBFUN int http_add_dup(msg_t *, http_t *, http_header_t const *);
/** Add a header to the HTTP message. */
SOFIAPUBFUN int http_add_make(msg_t *msg, http_t *http,
msg_hclass_t *hc, char const *s);
/** Add a header to the HTTP message. */
SOFIAPUBFUN int http_add_format(msg_t *msg, http_t *http, msg_hclass_t *hc,
char const *fmt, ...);
/** Add tagged headers to the HTTP message */
SOFIAPUBFUN int http_add_tl(msg_t *msg, http_t *http,
tag_type_t tag, tag_value_t value, ...);
/** Remove schema, host, and port from URL */
SOFIAPUBFUN int http_strip_hostport(url_t *url);
/** Add required headers to the response message */
SOFIAPUBFUN int http_complete_response(msg_t *msg,
int status, char const *phrase,
http_t const *request);
/** Return string corresponding to the method. */
SOFIAPUBFUN char const *http_method_name(http_method_t method,
char const *name);
/** Return enum corresponding to the method name */
SOFIAPUBFUN http_method_t http_method_code(char const *name);
#if !SU_HAVE_INLINE
SOFIAPUBFUN http_t *http_object(msg_t *msg);
SOFIAPUBFUN int http_header_insert(msg_t *msg, http_t *http, http_header_t *h);
SOFIAPUBFUN int http_header_remove(msg_t *msg, http_t *http, http_header_t *h);
SOFIAPUBFUN char const *http_header_name(http_header_t const *h, int compact);
SOFIAPUBFUN void *http_header_data(http_header_t *h);
SOFIAPUBFUN http_content_length_t *http_content_length_create(su_home_t *home,
uint32_t n);
SOFIAPUBFUN http_payload_t *http_payload_create(su_home_t *home,
void const *data, usize_t len);
SOFIAPUBFUN http_separator_t *http_separator_create(su_home_t *home);
#endif
SOFIAPUBFUN http_header_t *http_header_format(su_home_t *home, msg_hclass_t *,
char const *fmt, ...);
/** Create a request line object. */
SOFIAPUBFUN http_request_t *http_request_create(su_home_t *home,
http_method_t method,
const char *name,
url_string_t const *url,
char const *version);
/** Create a status line object. */
SOFIAPUBFUN http_status_t *http_status_create(su_home_t *home,
unsigned status,
char const *phrase,
char const *version);
/** Create an @b Host header object. */
SOFIAPUBFUN http_host_t *http_host_create(su_home_t *home,
char const *host,
char const *port);
/** Create an @b Date header object. */
SOFIAPUBFUN http_date_t *http_date_create(su_home_t *home, http_time_t t);
/** Create an @b Expires header object. */
SOFIAPUBFUN http_expires_t *http_expires_create(su_home_t *home,
http_time_t delta);
/** Compare two HTTP URLs. */
SOFIAPUBFUN int http_url_cmp(url_t const *a, url_t const *b);
/** Parse query part in HTTP URL. */
SOFIAPUBFUN issize_t http_query_parse(char *query,
/* char const *key, char **return_value, */
...);
/* ----------------------------------------------------------------------
* 4) Inlined functions
*/
#if SU_HAVE_INLINE
/** Get HTTP structure from msg. */
su_inline
http_t *http_object(msg_t *msg)
{
return (http_t *)msg_public(msg, HTTP_PROTOCOL_TAG);
}
/** Insert a (list of) header(s) to the header structure and fragment chain.
*
* The function @c http_header_insert() inserts header or list of headers
* into a HTTP message. It also inserts them into the the message fragment
* chain, if it exists.
*
* When inserting headers into the fragment chain, a request (or status) is
* inserted first and replaces the existing request (or status). The Via
* headers are inserted after the request or status, and rest of the headers
* after request, status, or Via headers.
*
* If the header is a singleton, existing headers with the same class are
* removed.
*
* @param msg message owning the fragment chain
* @param http HTTP message structure to which header is added
* @param h list of header(s) to be added
*/
su_inline
int http_header_insert(msg_t *msg, http_t *http, http_header_t *h)
{
return msg_header_insert(msg, (msg_pub_t *)http, (msg_header_t *)h);
}
/** Remove a header from a HTTP message. */
su_inline
int http_header_remove(msg_t *msg, http_t *http, http_header_t *h)
{
return msg_header_remove(msg, (msg_pub_t *)http, (msg_header_t *)h);
}
/** Return name of the header. */
su_inline
char const *http_header_name(http_header_t const *h, int compact)
{
if (compact && h->sh_class->hc_short[0])
return h->sh_class->hc_short;
else
return h->sh_class->hc_name;
}
/** Return data after header structure. */
su_inline
void *http_header_data(http_header_t *h)
{
return h && h != HTTP_NONE ? h->sh_class->hc_size + (char *)h : NULL;
}
su_inline
http_content_length_t *http_content_length_create(su_home_t *home, uint32_t n)
{
return msg_content_length_create(home, n);
}
su_inline
http_payload_t *http_payload_create(su_home_t *home, void const *data, isize_t len)
{
return msg_payload_create(home, data, len);
}
su_inline
http_separator_t *http_separator_create(su_home_t *home)
{
return msg_separator_create(home);
}
#endif
SOFIA_END_DECLS
#ifndef HTTP_PROTOS_H
#include <sofia-sip/http_protos.h>
#endif
#endif /* !defined(HTTP_HEADER_H) */
@@ -0,0 +1,110 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef HTTP_PARSER_H
/**Defined when <sofia-sip/http_parser.h> has been included.*/
#define HTTP_PARSER_H
/**@file sofia-sip/http_parser.h
* @brief Typedefs and prototypes used by HTTP parser.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Jun 13 02:58:26 2000 ppessi
*/
#ifndef SU_ALLOC_H
#include <sofia-sip/su_alloc.h>
#endif
#ifndef MSG_H
#include <sofia-sip/msg.h>
#endif
#ifndef MSG_PARSER_H
#include <sofia-sip/msg_parser.h>
#endif
#ifndef HTTP_H
#include <sofia-sip/http.h>
#endif
#ifndef HTTP_HEADER_H
#include <sofia-sip/http_header.h>
#endif
SOFIA_BEGIN_DECLS
/* ---------------------------------------------------------------------------
* 1) Macros for defining boilerplate functions and structures for each header
*/
#define HTTP_HCLASS_TAG HTTP_PROTOCOL_TAG
#define HTTP_HCLASS_TEST(x) ((x) && (x)->hc_tag == HTTP_PROTOCOL_TAG)
#define HTTP_HDR_TEST(x) ((x)->sh_class && HTTP_HCLASS_TEST((x)->sh_class))
/** Define a header class for a HTTP header. */
#define HTTP_HEADER_CLASS(c, l, params, kind, dup) \
MSG_HEADER_CLASS(http_, c, l, "", params, kind, http_ ## dup, http_no)
/** This is used by headers with no extra data in copy */
#define HTTP_HEADER_CLASS_G(c, l, kind) \
MSG_HEADER_CLASS(http_, c, l, "", g_common, kind, msg_generic, http_no)
/** Define a header class for a msg_list_t kind of header */
#define HTTP_HEADER_CLASS_LIST(c, l, kind) \
MSG_HEADER_CLASS(http_, c, l, "", k_items, kind, msg_list, http_no)
/** Define a authorization header class */
#define HTTP_HEADER_CLASS_AUTH(c, l, kind) \
MSG_HEADER_CLASS(http_, c, l, "", au_params, kind, msg_auth, http_no)
#define http_numeric_dup_xtra msg_default_dup_xtra
#define http_numeric_dup_one msg_default_dup_one
#define http_default_dup_xtra msg_default_dup_xtra
#define http_default_dup_one msg_default_dup_one
#define http_no_update NULL
/* ---------------------------------------------------------------------------
* 2) Prototypes for HTTP-specific decoding/encoding functions
*/
/* Version strings */
SOFIAPUBFUN int http_version_d(char **ss, char const **ver);
SOFIAPUBFUN isize_t http_version_xtra(char const *version);
SOFIAPUBFUN void http_version_dup(char **pp, char const **dd, char const *s);
/* Method */
SOFIAPUBFUN http_method_t http_method_d(char **ss, char const **nname);
SOFIAPUBFUN char const *http_method_name(http_method_t method,
char const *name);
/** Extract HTTP message body */
SOFIAPUBFUN issize_t http_extract_body(msg_t *, http_t *,
char b[], isize_t bsiz, int eos);
SOFIA_END_DECLS
#endif /* !defined(HTTP_PARSER_H) */
@@ -0,0 +1,311 @@
/** -*- C -*-
* @file sofia-sip/http_protos.h.in
*
* Template for <http_protos.h>.
*/
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef HTTP_PROTOS_H
/** Defined when <sofia-sip/http_protos.h> has been included. */
#define HTTP_PROTOS_H
/**@file sofia-sip/http_protos.h
*
* Macros for each HTTP header.
*
* #AUTO#
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*/
#include <sofia-sip/su_config.h>
#ifndef HTTP_HEADER_H
#include <sofia-sip/http_header.h>
#endif
#ifndef HTTP_HCLASSES_H
#include <sofia-sip/http_hclasses.h>
#endif
#define http_header_make(h, c, s) \
((http_header_t *)msg_header_make((h), (c), (s)))
#define http_header_vformat(h, c, f, a) \
((http_header_t *)msg_header_vformat((h), (c), (f), (a)))
SOFIA_BEGIN_DECLS
/* Declare internal prototypes for #xxxxxxx_xxxxxxx# */
/**@addtogroup http_#xxxxxx#*/ /** @{ */
enum {
/** Hash of #xxxxxxx_xxxxxxx#. @internal*/
http_#xxxxxx#_hash = #hash#
};
/**Header class for HTTP #xxxxxxx_xxxxxxx#.
*
* The header class http_#xxxxxx#_class defines how a HTTP
* #xxxxxxx_xxxxxxx# is parsed and printed. It also
* contains methods used by HTTP parser and other functions
* to manipulate the http_#xxxxxx#_t header structure.
*
*/
SOFIAPUBVAR msg_hclass_t http_#xxxxxx#_class[];
#ifndef HTTP_HCLASSES_ONLY
/** Decode (parse) a #xxxxxxx_xxxxxxx#. @internal */
SOFIAPUBFUN msg_parse_f http_#xxxxxx#_d;
/** Encode (print) a #xxxxxxx_xxxxxxx#. @internal */
SOFIAPUBFUN msg_print_f http_#xxxxxx#_e;
/**Initializer for structure http_#xxxxxx#_t.
*
* A static http_#xxxxxx#_t structure must be initialized
* with the HTTP_#XXXXXX#_INIT() macro. For instance,
* @code
*
* http_#xxxxxx#_t http_#xxxxxx# = HTTP_#XXXXXX#_INIT;
*
* @endcode
* @HI
*/
#define HTTP_#XXXXXX#_INIT() HTTP_HDR_INIT(#xxxxxx#)
/**Initialize a structure http_#xxxxxx#_t.
*
* An http_#xxxxxx#_t structure can be initialized with the
* http_#xxxxxx#_init() function/macro. For instance,
* @code
*
* http_#xxxxxx#_t http_#xxxxxx#;
*
* http_#xxxxxx#_init(&http_#xxxxxx#);
*
* @endcode
* @HI
*/
#if SU_HAVE_INLINE
su_inline http_#xxxxxx#_t *http_#xxxxxx#_init(http_#xxxxxx#_t x[1])
{
return HTTP_HEADER_INIT(x, http_#xxxxxx#_class, sizeof(http_#xxxxxx#_t));
}
#else
#define http_#xxxxxx#_init(x) \
HTTP_HEADER_INIT(x, http_#xxxxxx#_class, sizeof(http_#xxxxxx#_t))
#endif
/**Test if header object is instance of http_#xxxxxx#_t.
*
* The function http_is_#xxxxxx#() returns true (nonzero) if
* the header class is an instance of #xxxxxxx_xxxxxxx#
* object and false (zero) otherwise.
*
* @param header pointer to the header structure to be tested
*
* @return
* The function http_is_x#xxxxxx#() returns true (nonzero) if
* the header object is an instance of header #xxxxxx# and
* false (zero) otherwise.
*/
#if SU_HAVE_INLINE
su_inline
int http_is_#xxxxxx#(http_header_t const *header)
{
return header && header->sh_class->hc_hash == http_#xxxxxx#_hash;
}
#else
#define http_is_#xxxxxx#(h) \
((h) && ((msg_common_t *)(h))->h_class->hc_hash == http_#xxxxxx#_hash)
#endif
/**Duplicate (deep copy) @c http_#xxxxxx#_t.
*
* The function http_#xxxxxx#_dup() duplicates a header
* structure @a hdr. If the header structure @a hdr
* contains a reference (@c hdr->x_next) to a list of
* headers, all the headers in the list are duplicated, too.
*
* @param home memory home used to allocate new structure
* @param hdr header structure to be duplicated
*
* When duplicating, all parameter lists and non-constant
* strings attached to the header are copied, too. The
* function uses given memory @a home to allocate all the
* memory areas used to copy the header.
*
* @par Example
* @code
*
* #xxxxxx# = http_#xxxxxx#_dup(home, http->http_#xxxxxx#);
*
* @endcode
*
* @return
* The function http_#xxxxxx#_dup() returns a pointer to the
* newly duplicated http_#xxxxxx#_t header structure, or NULL
* upon an error.
*/
#if SU_HAVE_INLINE
su_inline
#endif
http_#xxxxxx#_t *http_#xxxxxx#_dup(su_home_t *home,
http_#xxxxxx#_t const *hdr)
__attribute__((__malloc__));
/**Copy a http_#xxxxxx#_t header structure.
*
* The function http_#xxxxxx#_copy() copies a header structure @a
* hdr. If the header structure @a hdr contains a reference (@c
* hdr->h_next) to a list of headers, all the headers in that
* list are copied, too. The function uses given memory @a home
* to allocate all the memory areas used to copy the header
* structure @a hdr.
*
* @param home memory home used to allocate new structure
* @param hdr pointer to the header structure to be duplicated
*
* When copying, only the header structure and parameter lists
* attached to it are duplicated. The new header structure
* retains all the references to the strings within the old @a
* header, including the encoding of the old header, if present.
*
* @par Example
* @code
*
* #xxxxxx# = http_#xxxxxx#_copy(home, http->http_#xxxxxx#);
*
* @endcode
*
* @return
* The function http_#xxxxxx#_copy() returns a pointer to
* newly copied header structure, or NULL upon an error.
*/
#if SU_HAVE_INLINE
su_inline
#endif
http_#xxxxxx#_t *http_#xxxxxx#_copy(su_home_t *home,
http_#xxxxxx#_t const *hdr)
__attribute__((__malloc__));
/**Make a header structure http_#xxxxxx#_t.
*
* The function http_#xxxxxx#_make() makes a new
* http_#xxxxxx#_t header structure. It allocates a new
* header structure, and decodes the string @a s as the
* value of the structure.
*
* @param home memory home used to allocate new header structure.
* @param s string to be decoded as value of the new header structure
*
* @note This function is usually implemented as a macro calling
* http_header_make().
*
* @return
* The function http_#xxxxxx#_make() returns a pointer to
* newly maked http_#xxxxxx#_t header structure, or NULL upon
* an error.
*/
#if SU_HAVE_INLINE
su_inline
#endif
http_#xxxxxx#_t *http_#xxxxxx#_make(su_home_t *home, char const *s)
__attribute__((__malloc__));
/**Make a #xxxxxxx_xxxxxxx# from formatting result.
*
* The function http_#xxxxxx#_format() makes a new
* #xxxxxxx_xxxxxxx# object using formatting result as its
* value. The function first prints the arguments according to
* the format @a fmt specified. Then it allocates a new header
* structure, and uses the formatting result as the header
* value.
*
* @param home memory home used to allocate new header structure.
* @param fmt string used as a printf()-style format
* @param ... argument list for format
*
* @note This function is usually implemented as a macro calling
* msg_header_format().
*
* @return
* The function http_#xxxxxx#_format() returns a pointer to newly
* makes header structure, or NULL upon an error.
*
* @HIDE
*/
#if SU_HAVE_INLINE
su_inline
#endif
http_#xxxxxx#_t *http_#xxxxxx#_format(su_home_t *home, char const *fmt, ...)
__attribute__((__malloc__, __format__ (printf, 2, 3)));
/* Inlined functions */
#if SU_HAVE_INLINE
su_inline
http_#xxxxxx#_t *http_#xxxxxx#_format(su_home_t *home, char const *fmt, ...)
{
http_header_t *h;
va_list ap;
va_start(ap, fmt);
h = http_header_vformat(home, http_#xxxxxx#_class, fmt, ap);
va_end(ap);
return (http_#xxxxxx#_t *)h;
}
su_inline
http_#xxxxxx#_t *http_#xxxxxx#_dup(su_home_t *home, http_#xxxxxx#_t const *o)
{
return (http_#xxxxxx#_t *)
msg_header_dup_as(home, http_#xxxxxx#_class, (msg_header_t const *)o);
}
su_inline
http_#xxxxxx#_t *http_#xxxxxx#_copy(su_home_t *home, http_#xxxxxx#_t const *o)
{
return (http_#xxxxxx#_t *)
msg_header_copy_as(home, http_#xxxxxx#_class, (msg_header_t const *)o);
}
su_inline
http_#xxxxxx#_t *http_#xxxxxx#_make(su_home_t *home, char const *s)
{
return (http_#xxxxxx#_t *)http_header_make(home, http_#xxxxxx#_class, s);
}
#endif
#endif /* !define HTTP_HCLASSES_ONLY */
/** @} */
SOFIA_END_DECLS
#endif /* !defined(HTTP_PROTOS_H) */
@@ -0,0 +1,129 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef HTTP_STATUS_H
#define HTTP_STATUS_H
/**@file sofia-sip/http_status.h
*
* HTTP status codes.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Sep 18 18:55:09 2001 ppessi
*/
#include <sofia-sip/su_config.h>
SOFIA_BEGIN_DECLS
SOFIAPUBFUN char const *http_status_phrase(int status);
#define HTTP_100_CONTINUE 100, http_100_continue
#define HTTP_101_SWITCHING 101, http_101_switching
#define HTTP_200_OK 200, http_200_ok
#define HTTP_201_CREATED 201, http_201_created
#define HTTP_202_ACCEPTED 202, http_202_accepted
#define HTTP_203_NON_AUTH_INFO 203, http_203_non_auth_info
#define HTTP_204_NO_CONTENT 204, http_204_no_content
#define HTTP_205_RESET_CONTENT 205, http_205_reset_content
#define HTTP_206_PARTIAL_CONTENT 206, http_206_partial_content
#define HTTP_300_MULTIPLE_CHOICES 300, http_300_multiple_choices
#define HTTP_301_MOVED_PERMANENTLY 301, http_301_moved_permanently
#define HTTP_302_FOUND 302, http_302_found
#define HTTP_303_SEE_OTHER 303, http_303_see_other
#define HTTP_304_NOT_MODIFIED 304, http_304_not_modified
#define HTTP_305_USE_PROXY 305, http_305_use_proxy
#define HTTP_307_TEMPORARY_REDIRECT 307, http_307_temporary_redirect
#define HTTP_400_BAD_REQUEST 400, http_400_bad_request
#define HTTP_401_UNAUTHORIZED 401, http_401_unauthorized
#define HTTP_402_PAYMENT_REQUIRED 402, http_402_payment_required
#define HTTP_403_FORBIDDEN 403, http_403_forbidden
#define HTTP_404_NOT_FOUND 404, http_404_not_found
#define HTTP_405_NOT_ALLOWED 405, http_405_not_allowed
#define HTTP_406_NOT_ACCEPTABLE 406, http_406_not_acceptable
#define HTTP_407_PROXY_AUTH 407, http_407_proxy_auth
#define HTTP_408_TIMEOUT 408, http_408_timeout
#define HTTP_409_CONFLICT 409, http_409_conflict
#define HTTP_410_GONE 410, http_410_gone
#define HTTP_411_NO_LENGTH 411, http_411_no_length
#define HTTP_412_PRECONDITION 412, http_412_precondition
#define HTTP_413_ENTITY_TOO_LARGE 413, http_413_entity_too_large
#define HTTP_414_URI_TOO_LONG 414, http_414_uri_too_long
#define HTTP_415_MEDIA_TYPE 415, http_415_media_type
#define HTTP_416_REQUESTED_RANGE 416, http_416_requested_range
#define HTTP_417_EXPECTATION 417, http_417_expectation
#define HTTP_426_UPGRADE 426, http_426_upgrade
#define HTTP_500_INTERNAL_SERVER 500, http_500_internal_server
#define HTTP_501_NOT_IMPLEMENTED 501, http_501_not_implemented
#define HTTP_502_BAD_GATEWAY 502, http_502_bad_gateway
#define HTTP_503_NO_SERVICE 503, http_503_no_service
#define HTTP_504_GATEWAY_TIMEOUT 504, http_504_gateway_timeout
#define HTTP_505_HTTP_VERSION 505, http_505_http_version
SOFIAPUBVAR char const http_100_continue[];
SOFIAPUBVAR char const http_101_switching[];
SOFIAPUBVAR char const http_200_ok[];
SOFIAPUBVAR char const http_201_created[];
SOFIAPUBVAR char const http_202_accepted[];
SOFIAPUBVAR char const http_203_non_auth_info[];
SOFIAPUBVAR char const http_204_no_content[];
SOFIAPUBVAR char const http_205_reset_content[];
SOFIAPUBVAR char const http_206_partial_content[];
SOFIAPUBVAR char const http_300_multiple_choices[];
SOFIAPUBVAR char const http_301_moved_permanently[];
SOFIAPUBVAR char const http_302_found[];
SOFIAPUBVAR char const http_303_see_other[];
SOFIAPUBVAR char const http_304_not_modified[];
SOFIAPUBVAR char const http_305_use_proxy[];
SOFIAPUBVAR char const http_307_temporary_redirect[];
SOFIAPUBVAR char const http_400_bad_request[];
SOFIAPUBVAR char const http_401_unauthorized[];
SOFIAPUBVAR char const http_402_payment_required[];
SOFIAPUBVAR char const http_403_forbidden[];
SOFIAPUBVAR char const http_404_not_found[];
SOFIAPUBVAR char const http_405_not_allowed[];
SOFIAPUBVAR char const http_406_not_acceptable[];
SOFIAPUBVAR char const http_407_proxy_auth[];
SOFIAPUBVAR char const http_408_timeout[];
SOFIAPUBVAR char const http_409_conflict[];
SOFIAPUBVAR char const http_410_gone[];
SOFIAPUBVAR char const http_411_no_length[];
SOFIAPUBVAR char const http_412_precondition[];
SOFIAPUBVAR char const http_413_entity_too_large[];
SOFIAPUBVAR char const http_414_uri_too_long[];
SOFIAPUBVAR char const http_415_media_type[];
SOFIAPUBVAR char const http_416_requested_range[];
SOFIAPUBVAR char const http_417_expectation[];
SOFIAPUBVAR char const http_426_upgrade[];
SOFIAPUBVAR char const http_500_internal_server[];
SOFIAPUBVAR char const http_501_not_implemented[];
SOFIAPUBVAR char const http_502_bad_gateway[];
SOFIAPUBVAR char const http_503_no_service[];
SOFIAPUBVAR char const http_504_gateway_timeout[];
SOFIAPUBVAR char const http_505_http_version[];
SOFIA_END_DECLS
#endif /* HTTP_STATUS_H */
@@ -0,0 +1,236 @@
/**@file sofia-sip/http_tag.h.in
*
* Template for <http_tag.h>.
*
* @date Created: Wed Feb 21 11:01:45 2001 ppessi
*/
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef HTTP_TAG_H
/** Defined when <sofia-sip/http_tag.h> has been included. */
#define HTTP_TAG_H
/**@file sofia-sip/http_tag.h
* @brief Tag class for HTTP headers
*
* #AUTO#
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
*/
#ifndef SU_TAG_H
#include <sofia-sip/su_tag.h>
#endif
#ifndef SU_TAG_CLASS_H
#include <sofia-sip/su_tag_class.h>
#endif
#ifndef SU_TAG_CLASS_H
#include <sofia-sip/su_tag_class.h>
#endif
#ifndef HTTP_H
#include <sofia-sip/http.h>
#endif
SOFIA_BEGIN_DECLS
#define HTTPTAG(c, x) httptag_##c, httptag_##c##_v(x)
#define HTTPTAG_REF(c, x) httptag_##c##_ref, httptag_##c##_vr(&(x))
#define HTTPTAG_STR(c, s) httptag_##c##_str, tag_str_v(s)
#define HTTPTAG_STR_REF(c, s) httptag_##c##_str_ref, tag_str_vr(&(s))
/** Test if tag type marks a http_t structure. @HIDE */
#define HTTPTAG_P(tt) ((tt)->tt_class == httphdrtag_class)
/** Test if tag type marks a HTTP header string. @HIDE */
#define HTTPTAG_STR_P(tt) ((tt)->tt_class == httpstrtag_class)
/** Test if tag type marks a HTTP header structure. @HIDE */
#define HTTPTAG_HTTP_P(tt) ((tt)->tt_class == httpmsgtag_class)
/** Test if tag item contains http_t structure. @HIDE */
#define HTTPTAGI_P(t) (HTTPTAG_P((t)->t_tag))
/** Test if tag item contains a HTTP header string. @HIDE */
#define HTTPTAGI_STR_P(t) (HTTPTAG_STR_P((t)->t_tag))
/** Test if tag item contains a HTTP header structure. @HIDE */
#define HTTPTAGI_HTTP_P(t) (HTTPTAG_HTTP_P((t)->t_tag))
SOFIAPUBVAR tag_class_t httphdrtag_class[1];
SOFIAPUBVAR tag_class_t httpstrtag_class[1];
SOFIAPUBVAR tag_class_t httpmsgtag_class[1];
/** Filter tag matching any http tag. */
#define HTTPTAG_ANY() httptag_any, ((tag_value_t)0)
SOFIAPUBVAR tag_typedef_t httptag_any;
/**Tag list item for @c http_t object.
*
* The HTTPTAG_HTTP() macro is used to include a tag item for a http_t object
* in the tag list.
*
* @param x pointer to a http_t message object, or NULL.
*
* @HIDE
*/
#define HTTPTAG_HTTP(x) httptag_http, httptag_http_v((x))
/** Tag for @c http_t */
SOFIAPUBVAR tag_typedef_t httptag_http;
#define HTTPTAG_HTTP_REF(x) httptag_http_ref, httptag_http_vr(&(x))
SOFIAPUBVAR tag_typedef_t httptag_http_ref;
#if SU_HAVE_INLINE
static inline
tag_value_t httptag_http_v(http_t const *v) { return (tag_value_t)v; }
static inline
tag_value_t httptag_http_vr(http_t const **vp) { return (tag_value_t)vp; }
#else
#define httptag_http_v(v) (tag_value_t)(v)
#define httptag_http_vr(vp) (tag_value_t)(vp)
#endif
/**Tag list item for http protocol version.
*
* The HTTPTAG_VERSION() macro is used to include a tag item for a HTTP
* protocol version in the tag list.
*
* @param x pointer to a http_t message object, or NULL.
*/
#define HTTPTAG_VERSION(x) httptag_http, (tag_value_t)x
extern tag_typedef_t httptag_version;
/** Reference to HTTPTAG_VERSION */
#define HTTPTAG_VERSION_REF(x) httptag_http_ref, (tag_value_t)&(x)
extern tag_typedef_t httptag_version_ref;
/**Tag list item for header string.
*
* The HTTPTAG_HEADER() macro is used to include a tag item containing an
* unknown HTTP header in the tag list, e.g.,
* @code
* http_header_t *hdr;
*
* HTTPTAG_HEADER(hdr).
* @endcode
*
* @param x pointer to a header structure, or NULL.
*
* @HIDE
*/
#define HTTPTAG_HEADER(x) httptag_header, httptag_header_v((x))
/** Tag for header string */
SOFIAPUBVAR tag_typedef_t httptag_header;
#define HTTPTAG_HEADER_REF(x) httptag_header_ref, httptag_header_vr(&(x))
SOFIAPUBVAR tag_typedef_t httptag_header_ref;
#if SU_HAVE_INLINE
static inline tag_value_t
httptag_header_v(http_header_t const *v)
{ return (tag_value_t)v; }
static inline tag_value_t
httptag_header_vr(http_header_t const **vp)
{ return (tag_value_t)vp; }
#else
#define httptag_header_v(v) (tag_value_t)(v)
#define httptag_header_vr(vp) (tag_value_t)(vp)
#endif
/**Tag list item for header string.
*
* The HTTPTAG_HEADER_STR() macro is used to include a tag item containing a
* header string in the tag list.
*
* @param x pointer to a string, or NULL.
*
* @HIDE
*/
#define HTTPTAG_HEADER_STR(x) httptag_header_str, tag_str_v((x))
/** Tag for header string */
SOFIAPUBVAR tag_typedef_t httptag_header_str;
#define HTTPTAG_HEADER_STR_REF(x) httptag_header_str_ref, tag_str_vr(&(x))
SOFIAPUBVAR tag_typedef_t httptag_header_str_ref;
/**@ingroup http_#xxxxxx#
*
* Tag list item for pointer to a #xxxxxxx_xxxxxxx# object.
*
* The HTTPTAG_#XXXXXX#() macro is used to include a tag item with a
* pointer to a http_#xxxxxx#_t object in a tag list.
*
* @param x pointer to a http_#xxxxxx#_t header structure, or NULL.
*
* @HIDE
*/
#define HTTPTAG_#XXXXXX#(x) HTTPTAG(#xxxxxx#, x)
SOFIAPUBVAR tag_typedef_t httptag_#xxxxxx#;
/**@ingroup http_#xxxxxx#
*
* Tag list item for string with #xxxxxxx_xxxxxxx# value.
*
* The HTTPTAG_#XXXXXX#_STR() macro is used to include a tag item with a
* string containing value of a http_#xxxxxx#_t header in a tag list.
*
* @param s pointer to a string containing http_#xxxxxx#_t value, or NULL.
*
* The HTTPTAG_#XXXXXX#_STR string can be converted to a
* http_#xxxxxx#_t header structure by giving the string @a s has
* second argument to function http_#xxxxxx#_make().
*
* @HIDE
*/
#define HTTPTAG_#XXXXXX#_STR(s) HTTPTAG_STR(#xxxxxx#, s)
SOFIAPUBVAR tag_typedef_t httptag_#xxxxxx#_str;
#define HTTPTAG_#XXXXXX#_REF(x) HTTPTAG_REF(#xxxxxx#, x)
SOFIAPUBVAR tag_typedef_t httptag_#xxxxxx#_ref;
#define HTTPTAG_#XXXXXX#_STR_REF(x) HTTPTAG_STR_REF(#xxxxxx#, x)
SOFIAPUBVAR tag_typedef_t httptag_#xxxxxx#_str_ref;
#if SU_HAVE_INLINE
static inline tag_value_t
httptag_#xxxxxx#_v(http_#xxxxxx#_t const *v)
{ return (tag_value_t)v; }
static inline tag_value_t
httptag_#xxxxxx#_vr(http_#xxxxxx#_t const **vp)
{ return (tag_value_t)vp; }
#else
#define httptag_#xxxxxx#_v(v) (tag_value_t)(v)
#define httptag_#xxxxxx#_vr(vp) (tag_value_t)(vp)
#endif
SOFIA_END_DECLS
#endif /* !defined(HTTP_TAG_H) */
@@ -0,0 +1,72 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef HTTP_TAG_CLASS_H
/**Defined when http_tag_class.h have been included*/
#define HTTP_TAG_CLASS_H
/**@file sofia-sip/http_tag_class.h
* @brief Tag classes for HTTP headers.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Wed Feb 21 11:01:45 2001 ppessi
*/
#ifndef SU_TAG_CLASS_H
#include <sofia-sip/su_tag_class.h>
#endif
#ifndef MSG_TAG_CLASS_H
#include <sofia-sip/msg_tag_class.h>
#endif
SOFIA_BEGIN_DECLS
/** Define a named tag type for HTTP header @a t. */
#define HTTPHDRTAG_NAMED_TYPEDEF(n, t) \
{{ TAG_NAMESPACE, #n, httphdrtag_class, \
(tag_value_t)http_##t##_class }}
/** Define a tag type for HTTP header @a t. */
#define HTTPHDRTAG_TYPEDEF(t) HTTPHDRTAG_NAMED_TYPEDEF(t, t)
/** Define a string tag type for HTTP header @a t. */
#define HTTPSTRTAG_TYPEDEF(t) \
{{ TAG_NAMESPACE, #t "_str", httpstrtag_class, \
(tag_value_t)http_##t##_class }}
/** Define a tag type for HTTP message @a t. */
#define HTTPMSGTAG_TYPEDEF(t) \
{{ TAG_NAMESPACE, #t, httpmsgtag_class, \
(tag_value_t)HTTP_PROTOCOL_TAG }}
/**@internal Filter HTTP header tag items. */
SOFIAPUBFUN tagi_t *httptag_filter(tagi_t *dst, tagi_t const f[],
tagi_t const *src,
void **bb);
SOFIA_END_DECLS
#endif /* !defined(HTTP_TAG_CLASS_H) */
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,14 @@
2005-10-27 Pekka Pessi <Pekka.Pessi@nokia.com>
* Fixed token64_e() prototype in ipt/token64.[hc].
M ./libsofia-sip-ua/ipt/token64.c -1 +1
M ./libsofia-sip-ua/ipt/token64.h -1 +1
2005-07-24 Pekka Pessi <Pekka.Pessi@nokia.com>
* sha1.c: Added RFC 3174 copyright notice.
2005-07-18 Kai Vehmanen <kai.vehmanen@nokia.com>
* Initial import of the module to Sofia-SIP tree.
@@ -0,0 +1,12 @@
PROJECT_NAME = "ipt"
OUTPUT_DIRECTORY = ../docs/html/ips
INPUT = ipt.docs sofia-sip .
@INCLUDE = ../docs/Doxyfile.conf
TAGFILES += ../docs/su.doxytags=../su
GENERATE_TAGFILE = ../docs/ipt.doxytags
ALIASES +=
@@ -0,0 +1,54 @@
#
# Makefile.am for ipt module
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
# ----------------------------------------------------------------------
# Header paths
INCLUDES = -I$(srcdir)/../su -I../su
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES = libipt.la
check_PROGRAMS = torture_base64
TESTS = torture_base64
# ----------------------------------------------------------------------
# Rules for building the targets
nobase_include_sofia_HEADERS = \
sofia-sip/rc4.h \
sofia-sip/base64.h \
sofia-sip/string0.h sofia-sip/token64.h \
sofia-sip/uniqueid.h
libipt_la_SOURCES = base64.c string0.c token64.c
EXTRA_DIST = sofia-sip/utf8.h \
utf8internal.h \
utf8.c ucs2.c ucs4.c rc4.c \
utf8test.c
COVERAGE_INPUT = $(libipt_la_SOURCES) $(include_sofia_HEADERS)
LDADD = libipt.la \
../sresolv/libsresolv.la \
../su/libsu.la
torture_base64_LDFLAGS = -static
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST += Doxyfile ipt.docs
# ----------------------------------------------------------------------
# Sofia specific rules
include ../sofia.am
@@ -0,0 +1,694 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am for ipt module
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
# ----------------------------------------------------------------------
# Header paths
# common Makefile targets for libsofia-sip-ua modules
# ---------------------------------------------------
SOURCES = $(libipt_la_SOURCES) torture_base64.c
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
check_PROGRAMS = torture_base64$(EXEEXT)
DIST_COMMON = $(nobase_include_sofia_HEADERS) $(srcdir)/../sofia.am \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
subdir = libsofia-sip-ua/ipt
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/sac-general.m4 \
$(top_srcdir)/m4/sac-openssl.m4 $(top_srcdir)/m4/sac-su.m4 \
$(top_srcdir)/m4/sac-su2.m4 $(top_srcdir)/m4/sac-tport.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h \
$(top_builddir)/libsofia-sip-ua/su/sofia-sip/su_configure.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libipt_la_LIBADD =
am_libipt_la_OBJECTS = base64.lo string0.lo token64.lo
libipt_la_OBJECTS = $(am_libipt_la_OBJECTS)
torture_base64_SOURCES = torture_base64.c
torture_base64_OBJECTS = torture_base64.$(OBJEXT)
torture_base64_LDADD = $(LDADD)
torture_base64_DEPENDENCIES = libipt.la ../sresolv/libsresolv.la \
../su/libsu.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/libsofia-sip-ua/su/sofia-sip
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libipt_la_SOURCES) torture_base64.c
DIST_SOURCES = $(libipt_la_SOURCES) torture_base64.c
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(include_sofiadir)"
nobase_include_sofiaHEADERS_INSTALL = $(install_sh_DATA)
HEADERS = $(nobase_include_sofia_HEADERS)
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COREFOUNDATION_FALSE = @COREFOUNDATION_FALSE@
COREFOUNDATION_TRUE = @COREFOUNDATION_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWFLAG = @CWFLAG@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOXYGEN = @DOXYGEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_COVERAGE_FALSE = @ENABLE_COVERAGE_FALSE@
ENABLE_COVERAGE_TRUE = @ENABLE_COVERAGE_TRUE@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
EXPENSIVE_CHECKS_FALSE = @EXPENSIVE_CHECKS_FALSE@
EXPENSIVE_CHECKS_TRUE = @EXPENSIVE_CHECKS_TRUE@
F77 = @F77@
FFLAGS = @FFLAGS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GLIB_VERSION = @GLIB_VERSION@
HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@
HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@
HAVE_GLIB_FALSE = @HAVE_GLIB_FALSE@
HAVE_GLIB_TRUE = @HAVE_GLIB_TRUE@
HAVE_MINGW32_FALSE = @HAVE_MINGW32_FALSE@
HAVE_MINGW32_TRUE = @HAVE_MINGW32_TRUE@
HAVE_NTLM_FALSE = @HAVE_NTLM_FALSE@
HAVE_NTLM_TRUE = @HAVE_NTLM_TRUE@
HAVE_TLS_FALSE = @HAVE_TLS_FALSE@
HAVE_TLS_TRUE = @HAVE_TLS_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBVER_SOFIA_SIP_UA_AGE = @LIBVER_SOFIA_SIP_UA_AGE@
LIBVER_SOFIA_SIP_UA_CUR = @LIBVER_SOFIA_SIP_UA_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_AGE = @LIBVER_SOFIA_SIP_UA_GLIB_AGE@
LIBVER_SOFIA_SIP_UA_GLIB_CUR = @LIBVER_SOFIA_SIP_UA_GLIB_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_REV = @LIBVER_SOFIA_SIP_UA_GLIB_REV@
LIBVER_SOFIA_SIP_UA_GLIB_SOVER = @LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
LIBVER_SOFIA_SIP_UA_REV = @LIBVER_SOFIA_SIP_UA_REV@
LIBVER_SOFIA_SIP_UA_SOVER = @LIBVER_SOFIA_SIP_UA_SOVER@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MINGW_ENVIRONMENT = @MINGW_ENVIRONMENT@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NDEBUG_FALSE = @NDEBUG_FALSE@
NDEBUG_TRUE = @NDEBUG_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
REPLACE_LIBADD = @REPLACE_LIBADD@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOFIA_CFLAGS = @SOFIA_CFLAGS@
SOFIA_GLIB_PKG_REQUIRES = @SOFIA_GLIB_PKG_REQUIRES@
STRIP = @STRIP@
TESTS_ENVIRONMENT = @TESTS_ENVIRONMENT@
VERSION = @VERSION@
VER_LIBSOFIA_SIP_UA_MAJOR_MINOR = @VER_LIBSOFIA_SIP_UA_MAJOR_MINOR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_LD = @ac_ct_LD@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
include_sofiadir = @include_sofiadir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
INCLUDES = -I$(srcdir)/../su -I../su
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES = libipt.la
TESTS = torture_base64
# ----------------------------------------------------------------------
# Rules for building the targets
nobase_include_sofia_HEADERS = \
sofia-sip/rc4.h \
sofia-sip/base64.h \
sofia-sip/string0.h sofia-sip/token64.h \
sofia-sip/uniqueid.h
libipt_la_SOURCES = base64.c string0.c token64.c
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST = sofia-sip/utf8.h utf8internal.h utf8.c ucs2.c ucs4.c \
rc4.c utf8test.c Doxyfile ipt.docs
COVERAGE_INPUT = $(libipt_la_SOURCES) $(include_sofia_HEADERS)
LDADD = libipt.la \
../sresolv/libsresolv.la \
../su/libsu.la
torture_base64_LDFLAGS = -static
AM_CFLAGS = $(CWFLAG) $(SOFIA_CFLAGS)
DISTCLEANFILES = $(BUILT_SOURCES)
# rules for building tag files
TAG_AWK = $(top_srcdir)/libsofia-sip-ua/su/tag_dll.awk
INTERNAL_INCLUDES = \
-I$(srcdir)/../features -I../features \
-I$(srcdir)/../ipt -I../ipt \
-I$(srcdir)/../iptsec -I../iptsec \
-I$(srcdir)/../bnf -I../bnf \
-I$(srcdir)/../http -I../http \
-I$(srcdir)/../msg -I../msg \
-I$(srcdir)/../nth -I../nth \
-I$(srcdir)/../nta -I../nta \
-I$(srcdir)/../nea -I../nea \
-I$(srcdir)/../nua -I../nua \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sdp -I../sdp \
-I$(srcdir)/../sip -I../sip \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sresolv -I../sresolv \
-I$(srcdir)/../tport -I../tport \
-I$(srcdir)/../stun -I../stun \
-I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../sofia.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libsofia-sip-ua/ipt/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu libsofia-sip-ua/ipt/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*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);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libipt.la: $(libipt_la_OBJECTS) $(libipt_la_DEPENDENCIES)
$(LINK) $(libipt_la_LDFLAGS) $(libipt_la_OBJECTS) $(libipt_la_LIBADD) $(LIBS)
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
torture_base64$(EXEEXT): $(torture_base64_OBJECTS) $(torture_base64_DEPENDENCIES)
@rm -f torture_base64$(EXEEXT)
$(LINK) $(torture_base64_LDFLAGS) $(torture_base64_OBJECTS) $(torture_base64_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string0.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/token64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/torture_base64.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-nobase_include_sofiaHEADERS: $(nobase_include_sofia_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(include_sofiadir)" || $(mkdir_p) "$(DESTDIR)$(include_sofiadir)"
@$(am__vpath_adj_setup) \
list='$(nobase_include_sofia_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__vpath_adj) \
echo " $(nobase_include_sofiaHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(include_sofiadir)/$$f'"; \
$(nobase_include_sofiaHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(include_sofiadir)/$$f"; \
done
uninstall-nobase_include_sofiaHEADERS:
@$(NORMAL_UNINSTALL)
@$(am__vpath_adj_setup) \
list='$(nobase_include_sofia_HEADERS)'; for p in $$list; do \
$(am__vpath_adj) \
echo " rm -f '$(DESTDIR)$(include_sofiadir)/$$f'"; \
rm -f "$(DESTDIR)$(include_sofiadir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list='$(TESTS)'; \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
;; \
*) \
echo "PASS: $$tst"; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
*) \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
echo "SKIP: $$tst"; \
fi; \
done; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="All $$all tests passed"; \
else \
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all tests failed"; \
else \
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
skipped="($$skip tests were not run)"; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
echo "$$dashes"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
$(mkdir_p) $(distdir)/.. $(distdir)/sofia-sip
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(include_sofiadir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
clean-noinstLTLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-nobase_include_sofiaHEADERS
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-nobase_include_sofiaHEADERS
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool \
clean-noinstLTLIBRARIES ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man \
install-nobase_include_sofiaHEADERS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-nobase_include_sofiaHEADERS
built-sources: $(BUILT_SOURCES)
clean-built-sources:
-rm -rf $(BUILT_SOURCES) $(BUILT_SOURCES:%=$(srcdir)/%)
*_tag_ref.c: $(TAG_AWK)
%_tag_ref.c: %_tag.c
$(AWK) -f $(TAG_AWK) NODLL=1 $(TAG_DLL_FLAGS) $<
@ENABLE_COVERAGE_TRUE@coverage:
@ENABLE_COVERAGE_TRUE@ @$(top_srcdir)/scripts/coverage $(COVERAGE_FLAGS) $(COVERAGE_INPUT)
../bnf/libbnf.la ../http/libhttp.la ../ipt/libipt.la ../iptsec/libiptsec.la \
../msg/libmsg.la ../nea/libnea.la ../nta/libnta.la ../nth/libnth.la \
../nua/libnua.la ../sdp/libsdp.la ../sip/libsip.la ../soa/libsoa.la \
../sresolv/libsresolv.la ../stun/libstun.la ../su/libsu.la \
../tport/libtport.la ../url/liburl.la:
$(MAKE) -C $(@D) $(@F)
# ----------------------------------------------------------------------
# Sofia specific rules
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+251
View File
@@ -0,0 +1,251 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE base64.c
*
* Implementation of BASE64 encoding and decoding functions.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
*/
#include "config.h"
#include <stdio.h>
#include <string.h>
#include "sofia-sip/base64.h"
static unsigned char const code[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
#define B64NOP 128
#define B64EOF 64
/**Decode a BASE64-encoded string.
*
* The function base64_d() decodes a string @a b64s encoded with BASE64. It
* stores the result in the buffer @a buf of @a bsiz bytes.
*
* If the @a buf is NULL, the function just returns the length of decoded
* data. In any case, no decoded data is stored in @a buf beyond @a bsiz.
* The function always returns the full length of decodable data.
*
* @param buf Buffer to store decoded data
* @param bsiz Size of @a buf
* @param b64s Base64-encoded string.
*
* @return Length of data that can be decoded in bytes.
*
* @sa <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>,
* <i>"Multipurpose Internet Mail Extensions (MIME) Part One:
* Format of Internet Message Bodies"</i>,
* N. Freed, N. Borenstein, November 1996.
*
* @par Example
* The following example code decodes a string of BASE64 data into a
* memory area allocated from heap:
* @code
* int decoder(char const *encoded, void **return_decoded)
* {
* int len = base64_d(NULL, 0, encoded);
* void *decoded = malloc(len);
* base64_d(decoded, len, encoded);
* *return_decoded = decoded;
* return len;
* }
* @endcode
*/
isize_t base64_d(char buf[], isize_t bsiz, char const *b64s)
{
static unsigned char decode[256] = "";
unsigned char const *s = (unsigned char const *)b64s;
unsigned char c, b1, b2 = B64EOF, b3 = B64EOF, b4 = B64EOF;
unsigned long w;
isize_t i, len = 0, total_len = 0;
if (b64s == NULL)
return 0;
if (decode['\0'] != B64EOF) {
/* Prepare decoding table */
for (i = 1; i < 256; i++)
decode[i] = B64NOP;
for (i = 0; i < 64; i++) {
decode[code[i]] = (unsigned char)i;
}
decode['='] = B64EOF;
decode['\0'] = B64EOF;
}
/* Calculate length */
while ((c = decode[*s++]) != B64EOF) {
if (c != B64NOP)
len++;
}
total_len = len = len * 3 / 4;
if (buf == NULL || bsiz == 0)
return total_len;
if (len > bsiz)
len = bsiz;
for (i = 0, s = (unsigned char const *)b64s; i < len; ) {
while ((b1 = decode[*s++]) == B64NOP)
;
if (b1 != B64EOF)
while ((b2 = decode[*s++]) == B64NOP)
;
if (b2 != B64EOF)
while ((b3 = decode[*s++]) == B64NOP)
;
if (b3 != B64EOF)
while ((b4 = decode[*s++]) == B64NOP)
;
if (((b1 | b2 | b3 | b4) & (B64NOP|B64EOF)) == 0) {
/* Normal case, 4 B64 chars to 3 data bytes */
w = (b1 << 18) | (b2 << 12) | (b3 << 6) | b4;
buf[i++] = (unsigned char)(w >> 16);
buf[i++] = (unsigned char)(w >> 8);
buf[i++] = (unsigned char)(w);
continue;
}
else {
/* EOF */
if ((b1 | b2) & B64EOF) {
/* fputs("base64dec: strange eof ===\n", stderr); */
break;
}
buf[i++] = (b1 << 2) | (b2 >> 4);
if (b3 != B64EOF) {
buf[i++] = ((b2 & 15) << 4) | ((b3 >> 2) & 15);
if (b4 != B64EOF) {
buf[i++] = ((b3 & 3) << 6) | b4;
}
}
break;
}
}
#if 0
printf("base64_d returns, decoded %d bytes\n", total_len);
for (i = 0; i < len; i++)
printf("%02x", buf[i]);
printf("\n");
#endif
return total_len;
}
/**Encode data with BASE64.
*
* The function base64_e() encodes @a dsiz bytes of @a data into @a buf.
*
* @note The function base64_e() uses at most @a bsiz bytes from @a buf.
*
* If @a bsiz is zero, the function just returns the length of BASE64
* encoding, excluding the final @c NUL.
*
* If encoded string is longer than that @a bsiz, the function terminates
* string with @c NUL at @a buf[bsiz-1], but returns the length of encoding as
* usual.
*
* @param buf buffer for encoded data
* @param bsiz size of @a buffer
* @param data data to be encoded
* @param dsiz size of @a data
*
* @return The function base64_e() return length of encoded string,
* excluding the final NUL.
*
* @sa <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>,
* <i>"Multipurpose Internet Mail Extensions (MIME) Part One:
* Format of Internet Message Bodies"</i>,
* N. Freed, N. Borenstein, November 1996.
*
*/
isize_t base64_e(char buf[], isize_t bsiz, void *data, isize_t dsiz)
{
unsigned char *s = (unsigned char *)buf;
unsigned char *b = (unsigned char *)data;
unsigned long w;
isize_t i, n, slack = (unsigned)dsiz % 3;
isize_t dsize = dsiz - slack, bsize = bsiz;
if (bsize == 0)
s = NULL;
for (i = 0, n = 0; i < dsize; i += 3, n += 4) {
w = (b[i] << 16) | (b[i+1] << 8) | b[i+2];
if (s) {
if (n + 4 < bsize) {
s[n + 0] = code[(w >> 18) & 63];
s[n + 1] = code[(w >> 12) & 63];
s[n + 2] = code[(w >> 6) & 63];
s[n + 3] = code[(w) & 63];
} else {
if (n + 1 < bsize)
s[n + 0] = code[(w >> 18) & 63];
if (n + 2 < bsize)
s[n + 1] = code[(w >> 12) & 63];
if (n + 3 < bsize)
s[n + 2] = code[(w >> 6) & 63];
s[bsize - 1] = '\0';
s = NULL;
}
}
}
if (slack) {
if (s) {
if (slack == 2)
w = (b[i] << 16) | (b[i+1] << 8);
else
w = (b[i] << 16);
if (n + 1 < bsize)
s[n + 0] = code[(w >> 18) & 63];
if (n + 2 < bsize)
s[n + 1] = code[(w >> 12) & 63];
if (n + 3 < bsize)
s[n + 2] = (slack == 2) ? code[(w >> 6) & 63] : '=';
if (n + 3 < bsize)
s[n + 3] = '=';
if (n + 4 >= bsize)
s[bsize - 1] = '\0', s = NULL;
}
n += 4;
}
if (s)
s[n] = '\0';
return n;
}
@@ -0,0 +1,23 @@
/* -*- c -*- */
/**@MODULEPAGE "ipt" - Utility Module
*
* @section ipt_meta Module Meta Information
*
* Utility library for IP Telephony applications.
*
* @CONTACT Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @STATUS @SofiaSIP Core library
*
* @LICENSE LGPL
*
* @section ipt_overview Overview
*
* This module contain some routines useful for IPT applications, like
* - base64.h BASE64 encoding/decoding,
* - token64.h encoding/decoding binary as SIP/HTTP token,
* - utf8.h UTF8 encoding/decoding,
* - sha1.h SHA1 hash routines, and
* - rc4.h arcfour random number generator.
*/
+264
View File
@@ -0,0 +1,264 @@
/**@CFILE rc4.c Arcfour pseudorandom generator.
*
* @author Pekka Pessi <ppessi@hut.fi>
*
* Copyright (c) 1996 Pekka Pessi. All rights reserved.
*
* This source code is provided for unrestricted use. Users may copy or
* modify this source code without charge.
*
* THIS SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND
* INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A
* PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE
* PRACTICE.
*
* This source code is provided with no support and without any obligation
* on the part of author to assist in its use, correction, modification or
* enhancement.
*
* AUTHOR SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT OF
* COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE OR ANY PART
* THEREOF.
*
* In no event will author be liable for any lost revenue or profits or
* other special, indirect and consequential damages, even if author has
* been advised of the possibility of such damages.
*
* @date Created: Sun Jun 9 12:43:17 1996 ppessi
*/
#include "config.h"
#include "sofia-sip/rc4.h"
void rc4_init(const void *vseed, isize_t seed_len, rc4_t *state) {
short i; rc4_u8 j; rc4_u8 k;
const rc4_u8 *seed = (const rc4_u8 *)vseed;
rc4_u8 *array = state->rc4_array;
state->rc4_i = 0;
state->rc4_j = 0;
for (i = 0; i < 256; i++)
array[i] = (rc4_u8) i;
for (i = 0, j = 0, k = 0;
i < 256;
i++, k++, k >= seed_len ? k = 0 : 0) {
rc4_u8 a = array[i];
rc4_u8 b = array[j += a + seed[k]];
array[i] = b;
array[j] = a;
}
}
void rc4(void *buffer, isize_t len, rc4_t *state) {
rc4_u8 *buf = (rc4_u8 *)buffer;
rc4_u8 *array = state->rc4_array;
rc4_u8 i = state->rc4_i;
rc4_u8 j = state->rc4_j;
while (len-- > 0) {
rc4_u8 a = array[++i];
rc4_u8 b = array[j += a];
array[i] = b;
array[j] = a;
*buf++ ^= array[(a + b) & 255];
}
state->rc4_i = i;
state->rc4_j = j;
}
#ifdef RC4_TESTING
rc4_u8 key_0[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef};
rc4_u8 input_0[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
rc4_u8 output_0[] = { 0x75, 0xb7, 0x87, 0x80, 0x99, 0xe0, 0xc5, 0x96 };
rc4_u8 key_1[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, };
rc4_u8 input_1[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
rc4_u8 output_1[] = { 0x74, 0x94, 0xc2, 0xe7, 0x10, 0x4b, 0x08, 0x79, };
rc4_u8 key_2[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
rc4_u8 input_2[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
rc4_u8 output_2[] = { 0xde, 0x18, 0x89, 0x41, 0xa3, 0x37, 0x5d, 0x3a, };
rc4_u8 key_3[] = { 0xef, 0x01, 0x23, 0x45, };
rc4_u8 input_3[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
rc4_u8 output_3[] = { 0xd6, 0xa1, 0x41, 0xa7, 0xec, 0x3c, 0x38, 0xdf, 0xbd, 0x61, };
rc4_u8 key_4[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, };
rc4_u8 input_4[] = {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, };
rc4_u8 output_4[] = {
0x75, 0x95, 0xc3, 0xe6, 0x11, 0x4a, 0x09, 0x78, 0x0c, 0x4a, 0xd4,
0x52, 0x33, 0x8e, 0x1f, 0xfd, 0x9a, 0x1b, 0xe9, 0x49, 0x8f,
0x81, 0x3d, 0x76, 0x53, 0x34, 0x49, 0xb6, 0x77, 0x8d, 0xca,
0xd8, 0xc7, 0x8a, 0x8d, 0x2b, 0xa9, 0xac, 0x66, 0x08, 0x5d,
0x0e, 0x53, 0xd5, 0x9c, 0x26, 0xc2, 0xd1, 0xc4, 0x90, 0xc1,
0xeb, 0xbe, 0x0c, 0xe6, 0x6d, 0x1b, 0x6b, 0x1b, 0x13, 0xb6,
0xb9, 0x19, 0xb8, 0x47, 0xc2, 0x5a, 0x91, 0x44, 0x7a, 0x95,
0xe7, 0x5e, 0x4e, 0xf1, 0x67, 0x79, 0xcd, 0xe8, 0xbf, 0x0a,
0x95, 0x85, 0x0e, 0x32, 0xaf, 0x96, 0x89, 0x44, 0x4f, 0xd3,
0x77, 0x10, 0x8f, 0x98, 0xfd, 0xcb, 0xd4, 0xe7, 0x26, 0x56,
0x75, 0x00, 0x99, 0x0b, 0xcc, 0x7e, 0x0c, 0xa3, 0xc4, 0xaa,
0xa3, 0x04, 0xa3, 0x87, 0xd2, 0x0f, 0x3b, 0x8f, 0xbb, 0xcd,
0x42, 0xa1, 0xbd, 0x31, 0x1d, 0x7a, 0x43, 0x03, 0xdd, 0xa5,
0xab, 0x07, 0x88, 0x96, 0xae, 0x80, 0xc1, 0x8b, 0x0a, 0xf6,
0x6d, 0xff, 0x31, 0x96, 0x16, 0xeb, 0x78, 0x4e, 0x49, 0x5a,
0xd2, 0xce, 0x90, 0xd7, 0xf7, 0x72, 0xa8, 0x17, 0x47, 0xb6,
0x5f, 0x62, 0x09, 0x3b, 0x1e, 0x0d, 0xb9, 0xe5, 0xba, 0x53,
0x2f, 0xaf, 0xec, 0x47, 0x50, 0x83, 0x23, 0xe6, 0x71, 0x32,
0x7d, 0xf9, 0x44, 0x44, 0x32, 0xcb, 0x73, 0x67, 0xce, 0xc8,
0x2f, 0x5d, 0x44, 0xc0, 0xd0, 0x0b, 0x67, 0xd6, 0x50, 0xa0,
0x75, 0xcd, 0x4b, 0x70, 0xde, 0xdd, 0x77, 0xeb, 0x9b, 0x10,
0x23, 0x1b, 0x6b, 0x5b, 0x74, 0x13, 0x47, 0x39, 0x6d, 0x62,
0x89, 0x74, 0x21, 0xd4, 0x3d, 0xf9, 0xb4, 0x2e, 0x44, 0x6e,
0x35, 0x8e, 0x9c, 0x11, 0xa9, 0xb2, 0x18, 0x4e, 0xcb, 0xef,
0x0c, 0xd8, 0xe7, 0xa8, 0x77, 0xef, 0x96, 0x8f, 0x13, 0x90,
0xec, 0x9b, 0x3d, 0x35, 0xa5, 0x58, 0x5c, 0xb0, 0x09, 0x29,
0x0e, 0x2f, 0xcd, 0xe7, 0xb5, 0xec, 0x66, 0xd9, 0x08, 0x4b,
0xe4, 0x40, 0x55, 0xa6, 0x19, 0xd9, 0xdd, 0x7f, 0xc3, 0x16,
0x6f, 0x94, 0x87, 0xf7, 0xcb, 0x27, 0x29, 0x12, 0x42, 0x64,
0x45, 0x99, 0x85, 0x14, 0xc1, 0x5d, 0x53, 0xa1, 0x8c, 0x86,
0x4c, 0xe3, 0xa2, 0xb7, 0x55, 0x57, 0x93, 0x98, 0x81, 0x26,
0x52, 0x0e, 0xac, 0xf2, 0xe3, 0x06, 0x6e, 0x23, 0x0c, 0x91,
0xbe, 0xe4, 0xdd, 0x53, 0x04, 0xf5, 0xfd, 0x04, 0x05, 0xb3,
0x5b, 0xd9, 0x9c, 0x73, 0x13, 0x5d, 0x3d, 0x9b, 0xc3, 0x35,
0xee, 0x04, 0x9e, 0xf6, 0x9b, 0x38, 0x67, 0xbf, 0x2d, 0x7b,
0xd1, 0xea, 0xa5, 0x95, 0xd8, 0xbf, 0xc0, 0x06, 0x6f, 0xf8,
0xd3, 0x15, 0x09, 0xeb, 0x0c, 0x6c, 0xaa, 0x00, 0x6c, 0x80,
0x7a, 0x62, 0x3e, 0xf8, 0x4c, 0x3d, 0x33, 0xc1, 0x95, 0xd2,
0x3e, 0xe3, 0x20, 0xc4, 0x0d, 0xe0, 0x55, 0x81, 0x57, 0xc8,
0x22, 0xd4, 0xb8, 0xc5, 0x69, 0xd8, 0x49, 0xae, 0xd5, 0x9d,
0x4e, 0x0f, 0xd7, 0xf3, 0x79, 0x58, 0x6b, 0x4b, 0x7f, 0xf6,
0x84, 0xed, 0x6a, 0x18, 0x9f, 0x74, 0x86, 0xd4, 0x9b, 0x9c,
0x4b, 0xad, 0x9b, 0xa2, 0x4b, 0x96, 0xab, 0xf9, 0x24, 0x37,
0x2c, 0x8a, 0x8f, 0xff, 0xb1, 0x0d, 0x55, 0x35, 0x49, 0x00,
0xa7, 0x7a, 0x3d, 0xb5, 0xf2, 0x05, 0xe1, 0xb9, 0x9f, 0xcd,
0x86, 0x60, 0x86, 0x3a, 0x15, 0x9a, 0xd4, 0xab, 0xe4, 0x0f,
0xa4, 0x89, 0x34, 0x16, 0x3d, 0xdd, 0xe5, 0x42, 0xa6, 0x58,
0x55, 0x40, 0xfd, 0x68, 0x3c, 0xbf, 0xd8, 0xc0, 0x0f, 0x12,
0x12, 0x9a, 0x28, 0x4d, 0xea, 0xcc, 0x4c, 0xde, 0xfe, 0x58,
0xbe, 0x71, 0x37, 0x54, 0x1c, 0x04, 0x71, 0x26, 0xc8, 0xd4,
0x9e, 0x27, 0x55, 0xab, 0x18, 0x1a, 0xb7, 0xe9, 0x40, 0xb0,
0xc0, };
#include <stdio.h>
void printout(const char *title, rc4_u8 *data, int len) {
int i;
puts(title);
for (i = 0; i < len; i++) {
printf("0x%02x ", data[i]);
}
putchar('\n');
}
int main() {
int failed = 0;
rc4_t state[1];
rc4_init(key_0, sizeof key_0, state);
rc4(input_0, sizeof input_0, state);
if (memcmp(input_0, output_0, sizeof input_0)) {
printout("Test 0 output", input_0, sizeof input_0);
failed = 1;
}
if (!failed) {
puts("RC4 seems to work\n");
}
rc4_prepare_key(key_1, sizeof key_1, state);
rc4(input_1, sizeof input_1, state);
if (memcmp(input_1, output_1, sizeof input_1)) {
printout("Test 1 output", input_1, sizeof input_1);
failed = 1;
}
rc4_prepare_key(key_2, sizeof key_2, state);
rc4(input_2, sizeof input_2, state);
if (memcmp(input_2, output_2, sizeof input_2)) {
printout("Test 2 output", input_2, sizeof input_2);
failed = 1;
}
rc4_prepare_key(key_3, sizeof key_3, state);
rc4(input_3, sizeof input_3, state);
if (memcmp(input_3, output_3, sizeof input_3)) {
printout("Test 3 output", input_3, sizeof input_3);
failed = 1;
}
rc4_prepare_key(key_4, sizeof key_4, state);
rc4(input_4, sizeof input_4, state);
if (memcmp(input_4, output_4, sizeof input_4)) {
printout("Test 4 output", input_4, sizeof input_4);
failed = 1;
}
exit(failed);
}
#endif
@@ -0,0 +1,62 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef BASE64_H
#define BASE64_H
/**@file sofia-sip/base64.h
*
* @brief Base64 encoding and decoding functions.
*
* This module contains base64 encoding and decoding functions. Base64
* encodes arbitrary octet strings as strings containing characters @c
* [A-Za-z0-9+/=]. Base64 is defined as part of MIME mail format, but it is
* used widely by other text-based protocols as well.
*
* @sa <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>,
* <i>"Multipurpose Internet Mail Extensions (MIME) Part One:
* Format of Internet Message Bodies"</i>,
* N. Freed, N. Borenstein,
* November 1996.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*/
#ifndef SU_TYPES_H
#include <sofia-sip/su_types.h>
#endif
SOFIA_BEGIN_DECLS
/** Decode a BASE64-encoded string. */
SOFIAPUBFUN isize_t base64_d(char buf[], isize_t bsiz, char const *b64s);
/** Encode data with BASE64. */
SOFIAPUBFUN isize_t base64_e(char buf[], isize_t bsiz, void *data, isize_t dsiz);
/** Calculate size of n bytes encoded in base64 */
#define BASE64_SIZE(n) ((((n) + 2) / 3) * 4)
SOFIA_END_DECLS
#endif /* !BASE_64 */
@@ -0,0 +1,69 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef RC4_H
/** Defined when <sofia-sip/rc4.h> has been included. */
#define RC4_H
/**@file sofia-sip/rc4.h
* @brief Arcfour random number generator.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Sun Jun 9 14:32:58 1996 ppessi
*/
#if defined(__cplusplus)
extern "C" {
#endif
#ifndef SU_TYPES_H
#include <sofia-sip/su_types.h>
#endif
/** Byte. */
typedef uint8_t rc4_u8;
/** RC4 context.
*
* The RC4 context is accessed and modified through rc4_init() and rc4()
* functions only.
*/
typedef struct {
uint8_t rc4_i;
uint8_t rc4_j;
uint8_t rc4_array[256];
} rc4_t;
/** Key RC4 context. */
SOFIAPUBFUN void rc4_init(const void *seed, isize_t seed_len, rc4_t *state);
/** Generate RC4 stream. */
SOFIAPUBFUN void rc4(void *buffer, isize_t len, rc4_t *state);
#if defined(__cplusplus)
}
#endif
#endif /* !defined RC4_H */
@@ -0,0 +1,162 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef STRING0_H
/** Defined when <sofia-sip/string0.h> is included. */
#define STRING0_H
/**@file sofia-sip/string0.h
*
* @brief String comparison functions accepting NULL pointers
*
* This module contains string comparison functions that can be called
* with NULL pointer as argument.
*
*/
#ifndef SU_CONFIG_H
#include <sofia-sip/su_config.h>
#endif
#include <string.h>
SOFIA_BEGIN_DECLS
#if SU_HAVE_INLINE
su_inline
#else
SOFIAPUBFUN
#endif
int
str0cmp(char const *a, char const *b),
str0ncmp(char const *a, char const *b, size_t n),
str0casecmp(char const *a, char const *b),
str0ncasecmp(char const *a, char const *b, size_t n);
#if SU_HAVE_INLINE
su_inline
#else
SOFIAPUBFUN
#endif
size_t
strnspn(char const *s, size_t size, char const *term),
strncspn(char const *s, size_t ssize, char const *reject);
#if SU_HAVE_INLINE
int str0cmp(char const *a, char const *b)
{
if (a == NULL) a = "";
if (b == NULL) b = "";
return strcmp(a, b);
}
int str0ncmp(char const *a, char const *b, size_t n)
{
if (a == NULL) a = "";
if (b == NULL) b = "";
return strncmp(a, b, n);
}
int str0casecmp(char const *a, char const *b)
{
if (a == NULL) a = "";
if (b == NULL) b = "";
return strcasecmp(a, b);
}
int str0ncasecmp(char const *a, char const *b, size_t n)
{
if (a == NULL) a = "";
if (b == NULL) b = "";
return strncasecmp(a, b, n);
}
size_t strnspn(char const *s, size_t ssize, char const *term)
{
size_t n;
size_t tsize = strlen(term);
if (tsize == 0) {
return 0;
}
else if (tsize == 1) {
char c, t = term[0];
for (n = 0; n < ssize && (c = s[n]) && c == t; n++)
;
}
else if (tsize == 2) {
char c, t1 = term[0], t2 = term[1];
for (n = 0; n < ssize && (c = s[n]) && (c == t1 || c == t2); n++)
;
}
else {
size_t i;
char c, t1 = term[0], t2 = term[1];
for (n = 0; n < ssize && (c = s[n]) && (c == t1 || c == t2); n++) {
for (i = 2; i < tsize; i++)
if (c == term[i])
return n;
}
}
return n;
}
size_t strncspn(char const *s, size_t ssize, char const *reject)
{
size_t n;
size_t rsize = strlen(reject);
if (rsize == 0) {
for (n = 0; n < ssize && s[n]; n++)
;
}
else if (rsize == 1) {
char c, rej = reject[0];
for (n = 0; n < ssize && (c = s[n]) && c != rej; n++)
;
}
else if (rsize == 2) {
char c, rej1 = reject[0], rej2 = reject[1];
for (n = 0; n < ssize && (c = s[n]) && c != rej1 && c != rej2; n++)
;
}
else {
size_t i;
char c, rej1 = reject[0], rej2 = reject[1];
for (n = 0; n < ssize && (c = s[n]) && c != rej1 && c != rej2; n++) {
for (i = 2; i < rsize; i++)
if (c == reject[i])
return n;
}
}
return n;
}
#endif
SOFIA_END_DECLS
#endif /* !STRING0_H */
@@ -0,0 +1,52 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef TOKEN64_H
#define TOKEN64_H
/**@file sofia-sip/token64.h
*
* @brief Token64 encoding.
*
* This module contains token64 encoding functions. Token64 encodes
* arbitrary octet strings as http header tokens containing only characters
* in range @c [-+A-Za-z0-9].
*
*/
#ifndef SU_TYPES_H
#include <sofia-sip/su_types.h>
#endif
SOFIA_BEGIN_DECLS
SOFIAPUBFUN isize_t token64_e(char b[], isize_t bsiz,
void const *data, isize_t dlen);
/** Calculate size of n bytes encoded in token-64 */
#define TOKEN64_SIZE(n) (((n + 2) / 3) * 4)
SOFIA_END_DECLS
#endif /* !TOKEN64_H */
@@ -0,0 +1,51 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef UNIQUEID_H
/** Defined when <sofia-sip/uniqueid.h> has been included. */
#define UNIQUEID_H
/**@file sofia-sip/uniqueid.h
*
* Compatibility functions to handle GloballyUniqueID.
*
* This file just includes <su_uniqueid.h>.
*
* @author Pekka Pessi <pessi@research.nokia.com>
*
* @date Created: Tue Apr 15 06:31:41 1997 pessi
*/
/* Compatibility functionality */
#define guid_t su_guid_t
#define guid_generate su_guid_generate
#define guid_sprintf su_guid_sprintf
#define guid_strlen su_guid_strlen
#define randint su_randint
#define randmem su_randmem
#include <sofia-sip/su_uniqueid.h>
#endif
@@ -0,0 +1,178 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@file sofia-sip/utf8.h
* Encoding/Decoding Functions for UCS Transformation Format UTF-8.
*
* UTF-8 encoding codes the ISO 10646 (Unicode, UCS2 and UCS4) characters as
* variable length (1 - 6 bytes) strings of 8-bit characters.
*
* @author Pekka Pessi <pekka.pessi@nokia.com>
*
* @date Created: Tue Apr 21 15:32:38 1998 pessi
* @sa <a href="ftp://ftp.ietf.org/rfc/rfc2279.txt">RFC 2279</a>,
* <i>"UTF-8, a transformation format of ISO 10646"</i>,
* F. Yergeau. January 1998.
*
*/
#ifndef UTF8_H
/** Defined when <sofia-sip/utf8.h> has been included */
#define UTF8_H
#ifndef SU_TYPES_H
#include <sofia-sip/su_types.h>
#endif
SOFIA_BEGIN_DECLS
typedef unsigned char utf8;
typedef unsigned short utf16;
typedef unsigned char ucs1;
typedef unsigned short ucs2;
typedef unsigned int ucs4;
SOFIAPUBFUN size_t utf8_width(const utf8 *);
/* Latin-1 encoding/decoding */
SOFIAPUBFUN size_t ucs18decode(char *dst, size_t dst_size, const utf8 *s);
SOFIAPUBFUN size_t ucs1encode(utf8 *dst, const ucs1 *s, size_t n,
const char quote[128]);
SOFIAPUBFUN size_t ucs1declen(const utf8 *s);
SOFIAPUBFUN size_t ucs1enclen(const ucs1 *s, size_t n, const char quote[128]);
/* UCS2 (BMP) encoding/decoding */
size_t ucs2decode(ucs2 *dst, size_t dst_size, const utf8 *s);
size_t ucs2encode(utf8 *dst, const ucs2 *s, size_t n, const char quote[128]);
size_t ucs2declen(const utf8 *s);
size_t ucs2enclen(const ucs2 *s, size_t n, const char quote[128]);
size_t ucs4decode(ucs4 *dst, size_t dst_size, const utf8 *s);
size_t ucs4encode(utf8 *dst, const ucs4 *s, size_t n, const char quote[128]);
size_t ucs4declen(const utf8 *s);
size_t ucs4enclen(const ucs4 *s, size_t n, const char quote[128]);
size_t ucs2len(ucs2 const *s);
int ucs2cmp(ucs2 const *s1, ucs2 const *s2);
int ucs2ncmp(ucs2 const *s1, ucs2 const *s2, size_t n);
size_t ucs4len(ucs4 const *s);
int ucs4cmp(ucs4 const *s1, ucs4 const *s2);
int ucs4ncmp(ucs4 const *s1, ucs4 const *s2, size_t n);
/*
* IS_UCS4_n tests whether UCS4 character should be represented
* with 'n' byte utf8 string
*/
#define IS_UCS4_1(x) ((ucs4)(x) <= 0x7fu)
#define IS_UCS4_2(x) (0x80u <= (ucs4)(x) && (ucs4)(x) <= 0x7ffu)
#define IS_UCS4_3(x) (0x800u <= (ucs4)(x) && (ucs4)(x) <= 0xffffu)
#define IS_UCS4_4(x) (0x10000u <= (ucs4)(x) && (ucs4)(x) <= 0x1fFFFFu)
#define IS_UCS4_5(x) (0x200000u <= (ucs4)(x) && (ucs4)(x) <= 0x3ffFFFFu)
#define IS_UCS4_6(x) (0x4000000u <= (ucs4)(x) && (ucs4)(x) <= 0x7fffFFFFu)
/* Special test for ISO-8859-1 characters */
#define IS_UCS4_I(x) (0x80u <= (ucs4)(x) && (ucs4)(x) <= 0xffu)
/* Length of an UCS4 character in UTF8 encoding */
#define UTF8_LEN4(x) (IS_UCS4_1(x) || IS_UCS4_2(x) && 2 || \
IS_UCS4_3(x) && 3 || IS_UCS4_4(x) && 4 || \
IS_UCS4_5(x) && 5 || IS_UCS4_6(x) && 6)
/* Length of an UCS2 character in UTF8 encoding */
#define UTF8_LEN2(x) (IS_UCS4_1(x) || IS_UCS4_2(x) && 2 || IS_UCS4_3(x) && 3)
/*
* IS_UTF8_n tests the length of the next wide character
*/
#define IS_UTF8_1(c) (0x00 == ((c) & 0x80))
#define IS_UTF8_2(c) (0xc0 == ((c) & 0xe0))
#define IS_UTF8_3(c) (0xe0 == ((c) & 0xf0))
#define IS_UTF8_4(c) (0xf0 == ((c) & 0xf8))
#define IS_UTF8_5(c) (0xf8 == ((c) & 0xfc))
#define IS_UTF8_6(c) (0xfc == ((c) & 0xfe))
/* Extension byte? */
#define IS_UTF8_X(c) (0x80 == ((c) & 0xc0))
/* ISO-8859-1 character? */
#define IS_UTF8_I(c) (0xc0 == ((c) & 0xfc))
#define IS_UTF8_S1(s) \
(IS_UTF8_1(s[0]))
#define IS_UTF8_S2(s) \
(IS_UTF8_2(s[0])&&((s)[1]&192)==128)
#define IS_UTF8_SI(s) \
(IS_UTF8_I(s[0])&&((s)[1]&192)==128)
#define IS_UTF8_S3(s) \
(IS_UTF8_3(s[0])&& ((s)[1]&192)==128&&((s)[2]&192)==128)
#define IS_UTF8_S4(s) \
(IS_UTF8_4(s[0])&& ((s)[1]&192)==128&&((s)[2]&192)==128&&((s)[3]&192)==128)
#define IS_UTF8_S5(s) \
(IS_UTF8_5(s[0])&& ((s)[1]&192)==128&&((s)[2]&192)==128&&\
((s)[3]&192)==128&&((s)[4]&192)==128)
#define IS_UTF8_S6(s) \
(IS_UTF8_6(s[0])&& ((s)[1]&192)==128&&((s)[2]&192)==128&&((s)[3]&192)==128&&\
((s)[4]&192)==128&&((s)[5]&192)==128)
#define UCS4_S1(s) ((ucs4)(s[0]))
#define UCS4_S2(s) ((ucs4)\
(((s[0])&31)<<6)|((s[1])&63))
#define UCS4_S3(s) ((ucs4)\
(((s[0])&15)<<12)|(((s[1])&63)<<6)|((s[2])&63))
#define UCS4_S4(s) ((ucs4)\
(((s[0])&7)<<18)|(((s[1])&63)<<12)|(((s[2])&63)<<6)|\
((s[3])&63))
#define UCS4_S5(s) ((ucs4)\
(((s[0])&3)<<24)|(((s[1])&63)<<18)|(((s[2])&63)<<12)|\
(((s[3])&63)<<6)|((s[4])&63))
#define UCS4_S6(s) ((ucs4)\
(((s[0])&1)<<30)|(((s[1])&63)<<24)|(((s[2])&63)<<18)|\
(((s[3])&63)<<12)|(((s[4])&63)<<6)|((s[5])&63))
#define UTF8_S1(s,c) ((s)[0]=(c))
#define UTF8_S2(s,c) ((s)[0]=(((c)>>6)&31)|0xc0,\
(s)[1]=((c)&63)|128)
#define UTF8_S3(s,c) ((s)[0]=(((c)>>12)&15)|0xe0,\
(s)[1]=((c>>6)&63)|128,\
(s)[2]=((c)&63)|128)
#define UTF8_S4(s,c) ((s)[0]=(((c)>>18)&7)|0xf0,\
(s)[1]=((c>>12)&63)|128,\
(s)[2]=((c>>6)&63)|128,\
(s)[3]=((c)&63)|128)
#define UTF8_S5(s,c) ((s)[0]=(((c)>>24)&3)|0xf8,\
(s)[1]=((c>>18)&63)|128,\
(s)[2]=((c>>12)&63)|128,\
(s)[3]=((c>>6)&63)|128,\
(s)[4]=((c)&63)|128)
#define UTF8_S6(s,c) ((s)[0]=(((c)>>30)&1)|0xfc,\
(s)[1]=((c>>24)&63)|128,\
(s)[2]=((c>>18)&63)|128,\
(s)[3]=((c>>12)&63)|128,\
(s)[4]=((c>>6)&63)|128,\
(s)[5]=((c)&63)|128)
SOFIA_END_DECLS
#endif /* UTF8_H */
@@ -0,0 +1,42 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE string0.c
*
* Expand string0 functions non-inline.
*
*/
#include "config.h"
#include <string.h>
#include <sofia-sip/su_config.h>
#undef SU_HAVE_INLINE
#undef su_inline
#define SU_HAVE_INLINE 1
#define su_inline
#include "sofia-sip/string0.h"
@@ -0,0 +1,102 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE token64.c
*
* Token encoding.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Wed Apr 3 10:45:47 2002 ppessi
*/
#include "config.h"
#include <stddef.h>
#include <assert.h>
#include "sofia-sip/token64.h"
static const char code[65] =
"0123456789-abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ";
/** Encode data as an http token.
*
* @note
* A token is case-independent, so this is really not a good idea.
* Use msg_random_token() instead.
*/
isize_t token64_e(char b[], isize_t bsiz, void const *data, isize_t dlen)
{
size_t i, n, slack;
unsigned char const *h = data;
char *s = b, *end = b + bsiz;
long w;
if (dlen <= 0) {
if (bsiz && b) *b = '\0';
return 0;
}
n = (8 * dlen + 5) / 6;
if (bsiz == 0 || b == NULL)
return n;
if (b + n >= end)
dlen = 6 * bsiz / 8;
else
end = b + n + 1;
slack = dlen % 3;
dlen -= slack;
for (i = 0; i < dlen; i += 3, s += 4) {
unsigned char h0 = h[i], h1 = h[i + 1], h2 = h[i + 2];
s[0] = code[h0 >> 2];
s[1] = code[((h0 << 4)|(h1 >> 4)) & 63];
s[2] = code[((h1 << 4)|(h2 >> 6)) & 63];
s[3] = code[(h2) & 63];
}
if (slack) {
if (slack == 2)
w = (h[i] << 16) | (h[i+1] << 8);
else
w = (h[i] << 16);
if (s < end) *s++ = code[(w >> 18) & 63];
if (s < end) *s++ = code[(w >> 12) & 63];
if (s < end && slack == 2) *s++ = code[(w >> 6) & 63];
}
if (s < end)
*s++ = '\0';
else
end[-1] = '\0';
assert(end == s);
return n;
}
@@ -0,0 +1,187 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**
* @file torture_base64.c
* @brief Test BASE64 encoding/decoding
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com> \n
*
* @date Created: Tue Feb 1 13:29:09 EET 2005 ppessi
*
*/
#include "config.h"
#include <stddef.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include "sofia-sip/base64.h"
int tstflags = 0;
#define TSTFLAGS tstflags
char const *name = "torture_base64";
#include <sofia-sip/tstdef.h>
char const constant[] = "not changed";
int test_encoding(void)
{
char buffer[32];
BEGIN();
TEST_SIZE(base64_e(buffer, sizeof buffer, "\0\020\203", 3), 4);
TEST_S(buffer, "ABCD");
strcpy(buffer + 5, "not changed");
TEST_SIZE(base64_e(buffer, 5, "\0\020\203", 3), 4);
TEST_S(buffer + 5, "not changed");
TEST_S(buffer, "ABCD");
strcpy(buffer + 4, "not changed");
TEST_SIZE(base64_e(buffer, 4, "\0\020\203", 3), 4);
TEST_S(buffer + 4, "not changed");
TEST_S(buffer, "ABC");
strcpy(buffer + 3, "not changed");
TEST_SIZE(base64_e(buffer, 3, "\0\020\203", 3), 4);
TEST_S(buffer + 3, "not changed");
TEST_S(buffer, "AB");
strcpy(buffer + 2, "not changed");
TEST_SIZE(base64_e(buffer, 2, "\0\020\203", 3), 4);
TEST_S(buffer + 2, "not changed");
TEST_S(buffer, "A");
strcpy(buffer + 1, "not changed");
TEST_SIZE(base64_e(buffer, 1, "\0\020\203", 3), 4);
TEST_S(buffer + 1, "not changed");
TEST_S(buffer, "");
strcpy(buffer + 5, "not changed");
TEST_SIZE(base64_e(buffer, 5, "\0\020", 2), 4);
TEST_S(buffer + 5, "not changed");
TEST_S(buffer, "ABA=");
strcpy(buffer + 4, "not changed");
TEST_SIZE(base64_e(buffer, 4, "\0\020", 2), 4);
TEST_S(buffer + 4, "not changed");
TEST_S(buffer, "ABA");
strcpy(buffer + 3, "not changed");
TEST_SIZE(base64_e(buffer, 3, "\0\020", 2), 4);
TEST_S(buffer + 3, "not changed");
TEST_S(buffer, "AB");
strcpy(buffer + 2, "not changed");
TEST_SIZE(base64_e(buffer, 2, "\0\020", 2), 4);
TEST_S(buffer + 2, "not changed");
TEST_S(buffer, "A");
strcpy(buffer + 1, "not changed");
TEST_SIZE(base64_e(buffer, 1, "\0\020", 2), 4);
TEST_S(buffer + 1, "not changed");
TEST_S(buffer, "");
strcpy(buffer + 5, "not changed");
TEST_SIZE(base64_e(buffer, 5, "\0", 1), 4);
TEST_S(buffer + 5, "not changed");
TEST_S(buffer, "AA==");
strcpy(buffer + 4, "not changed");
TEST_SIZE(base64_e(buffer, 4, "\0", 1), 4);
TEST_S(buffer + 4, "not changed");
TEST_S(buffer, "AA=");
strcpy(buffer + 3, "not changed");
TEST_SIZE(base64_e(buffer, 3, "\0", 1), 4);
TEST_S(buffer + 3, "not changed");
TEST_S(buffer, "AA");
strcpy(buffer + 2, "not changed");
TEST_SIZE(base64_e(buffer, 2, "\0", 1), 4);
TEST_S(buffer + 2, "not changed");
TEST_S(buffer, "A");
strcpy(buffer + 1, "not changed");
TEST_SIZE(base64_e(buffer, 1, "\0", 1), 4);
TEST_S(buffer + 1, "not changed");
TEST_S(buffer, "");
END();
}
int test_decoding(void)
{
char buffer[32];
BEGIN();
strcpy(buffer + 0, "not changed");
TEST_SIZE(base64_d((void *)buffer, 0, "ABCD"), 3);
TEST_S(buffer + 0, "not changed");
TEST_SIZE(base64_d((void *)buffer, 3, "ABCD"), 3);
TEST_M(buffer, "\0\020\203", 3);
TEST_SIZE(base64_d(NULL, 3, "ABCD"), 3);
TEST_SIZE(base64_d((void *)buffer, 3, "A B C D !!"), 3);
TEST_M(buffer, "\0\020\203", 3);
END();
}
void usage(void)
{
fprintf(stderr,
"usage: %s [-v]\n",
name);
}
int main(int argc, char *argv[])
{
int retval = 0;
int i;
for (i = 1; argv[i]; i++) {
if (strcmp(argv[i], "-v") == 0)
tstflags |= tst_verbatim;
else
usage();
}
retval |= test_encoding(); fflush(stdout);
retval |= test_decoding(); fflush(stdout);
return retval;
}
+192
View File
@@ -0,0 +1,192 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE ucs2.c UCS2 (Unicode, ISO Basic Multilingual Plane) string handling.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Apr 21 15:32:02 1998 pessi
*
*/
#include "config.h"
#include <sofia-sip/utf8.h>
#include "utf8internal.h"
/*
* Decode utf8 string into ucs2 string,
* return number of ucs2 characters decoded
*/
size_t ucs2decode(ucs2 *dst, size_t dst_size, const utf8 *s)
{
ucs2 v, *d = dst;
if (s) do {
if (dst_size == 0)
break;
if (IS_UTF8_S1(s))
v = UCS4_S1(s), s += 1;
else if (IS_UTF8_S2(s))
v = UCS4_S2(s), s += 2;
else if (IS_UTF8_S3(s))
v = UCS4_S3(s), s += 3;
else {
s++;
continue; /* skip illegal characters */
}
*d++ = v;
dst_size--;
} while (*s);
if (dst_size)
*d = 0;
return d - dst;
}
/*
* Encode ucs2 string into utf8 string,
* return number of utf8 bytes encoded including final zero
*
* 'quote' may contain an optional quoting table containing
* non-zero for all ASCII characters to quote
*
*/
size_t ucs2encode(utf8 *dst, const ucs2 *s, size_t n, const char quote[128])
{
utf8 *d = dst;
ucs2 c;
if (s) while (n-- > 0) {
c = *s++;
if (IS_UCS4_1(c)) {
if (quote && quote[c]) {
UTF8_S2(d, c);
d += 2;
}
else {
if (!c) /* zero must be represented as UTF8_2 */
break;
UTF8_S1(d, (utf8) c);
d += 1;
}
}
else if (IS_UCS4_2(c)) {
UTF8_S2(d, c);
d += 2;
}
else /* if (IS_UCS4_3(c)) */ {
UTF8_S3(d, c);
d += 3;
}
}
*d++ = 0;
return d - dst;
}
/*
* Length of UCS2 (BMP, Unicode) string decoded from UTF8
*/
size_t ucs2declen(const utf8 *s)
{
size_t len = 0;
size_t errors = 0; /* errors */
UTF8_ANALYZE(s, len, len, len, errors, errors);
if (errors)
return 0;
return len;
}
/*
* Length of UTF8 encoding of a UCS2 string, including final zero
*/
size_t ucs2enclen(const ucs2 *s, size_t n, const char quote[128])
{
size_t len = 1;
ucs2 c;
while (n-- > 0) {
c = *s++;
if (c < 0x80u)
if (quote && quote[c])
len += 2;
else {
if (!c) break;
len += 1;
}
else if (c < 0x800u)
len += 2;
else /* if (c < 0x10000u) */
len += 3;
}
return len;
}
/*
* Length of UCS2 string (number of non-zero UCS2 characters before zero)
*/
size_t ucs2len(ucs2 const *s)
{
size_t len = 0;
if (s) while (*s++)
len++;
return len;
}
/*
* Compare UCS2 (BMP, Unicode) string
*/
int ucs2cmp(ucs2 const *s1, ucs2 const *s2)
{
int retval = s1 - s2;
if (s1 && s2)
while ((retval = (*s1 - *s2)) && (*s1++) && (*s2++))
;
return retval;
}
/*
* Compare UCS2 (BMP, Unicode) string
*/
int ucs2ncmp(ucs2 const *s1, ucs2 const *s2, size_t n)
{
int retval = 0;
if (s1 && s2)
while (n-- > 0 && (retval = (*s1 - *s2)) && (*s1++) && (*s2++))
;
return retval;
}
+216
View File
@@ -0,0 +1,216 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE ucs4.c UCS-4 routines
*
* @author Pekka Pessi <pessi@research.nokia.com>
*
* @date Created: Tue Apr 21 15:32:02 1998 pessi
*/
#include "config.h"
#include <sofia-sip/utf8.h>
#include "utf8internal.h"
/*
* Decode utf8 string into ucs4 string,
* return number of ucs4 characters decoded
*/
size_t ucs4decode(ucs4 *dst, size_t dst_size, const utf8 *s)
{
ucs4 v, *d = dst;
if (s) while (*s) {
if (dst_size == 0)
break;
if (IS_UTF8_S1(s))
v = UCS4_S1(s), s += 1;
else if (IS_UTF8_S2(s))
v = UCS4_S2(s), s += 2;
else if (IS_UTF8_S3(s))
v = UCS4_S3(s), s += 3;
else if (IS_UTF8_S4(s))
v = UCS4_S4(s), s += 4;
else if (IS_UTF8_S5(s))
v = UCS4_S5(s), s += 5;
else if (IS_UTF8_S6(s))
v = UCS4_S6(s), s += 6;
else {
s++;
continue; /* skip illegal characters */
}
*d++ = v;
dst_size--;
};
if (dst_size)
*d = 0;
return d - dst;
}
/*
* Encode ucs4 string into utf8 string,
* return number of utf8 bytes encoded including final zero
*
* 'quote' may contain an optional quoting table containing
* non-zero for all ASCII characters to quote
*
*/
size_t ucs4encode(utf8 *dst, const ucs4 *s, size_t n, const char quote[128])
{
utf8 *d = dst;
ucs4 c;
if (s) while (n-- > 0) {
c = *s++;
if (IS_UCS4_1(c)) {
if (quote && quote[c]) {
UTF8_S2(d, c);
d += 2;
}
else {
if (!c) /* zero must be represented as UTF8_2 */
break;
UTF8_S1(d, c);
d += 1;
}
}
else if (IS_UCS4_2(c)) {
UTF8_S2(d, c);
d += 2;
}
else if (IS_UCS4_3(c)) {
UTF8_S3(d, c);
d += 3;
}
else if (IS_UCS4_4(c)) {
UTF8_S4(d, c);
d += 4;
}
else if (IS_UCS4_5(c)) {
UTF8_S5(d, c);
d += 5;
}
else if (IS_UCS4_6(c)) {
UTF8_S6(d, c);
d += 6;
}
else {
/* skip illegal (negative) characters */
}
}
*d++ = 0;
return d - dst;
}
/*
* Length of UCS4 string decoded from UTF8
*/
size_t ucs4declen(const utf8 *s)
{
size_t len = 0;
size_t errors = 0; /* errors */
UTF8_ANALYZE(s, len, len, len, len, errors);
if (errors)
return 0;
return len;
}
/*
* Length of UTF8 encoding of a UCS4 string, including final zero
*/
size_t ucs4enclen(const ucs4 *s, size_t n, const char quote[128])
{
size_t len = 1;
ucs4 c;
while (n-- > 0) {
c = *s++;
if (c < 0x80u)
if (quote && quote[c])
len += 2;
else {
if (!c) break;
len += 1;
}
else if (c < 0x800u)
len += 2;
else if (c < 0x10000u)
len += 3;
else if (c < 0x200000u)
len += 4;
else if (c < 0x4000000u)
len += 5;
else if (c < 0x80000000u)
len += 6;
}
return len;
}
/*
* Length of UCS4 string (number of non-zero UCS4 characters before zero)
*/
size_t ucs4len(ucs4 const *s)
{
size_t len = 0;
if (s) while (*s++)
len++;
return len;
}
/*
* Compare UCS4 string
*/
int ucs4cmp(ucs4 const *s1, ucs4 const *s2)
{
int retval;
while ((retval = (*s1 - *s2)) && (*s1++) && (*s2++))
;
return retval;
}
/*
* Compare UCS4 string prefix
*/
int ucs4ncmp(ucs4 const *s1, ucs4 const *s2, size_t n)
{
int retval = 0;
while (n-- > 0 && (retval = (*s1 - *s2)) && (*s1++) && (*s2++))
;
return retval;
}
+91
View File
@@ -0,0 +1,91 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE utf8.c
*
* utf8 string handling.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Apr 21 15:32:02 1998 pessi
*/
#include "config.h"
#include <sofia-sip/utf8.h>
#include "utf8internal.h"
#ifndef _WIN32
#include <assert.h>
#endif
/** Width of an UTF8 character cell (1, 2 or 4 bytes) */
size_t utf8_width(const utf8 *s)
{
size_t w8 = 0, w16 = 0, w32 = 0;
size_t errors = 0; /* errors */
UTF8_ANALYZE(s, w8, w8, w16, w32, errors);
if (errors)
return 0;
return w32 ? 4 : (w16 ? 2 : 1);
}
/** Convert UTF8 string @a s to ISO-Latin-1 string @a dst. */
size_t ucs18decode(char *dst, size_t dst_size, const utf8 *s)
{
#ifndef _WIN32
assert(!"implemented");
#endif
return 0;
}
/** Convert ISO-Latin-1 string @a s to UTF8 string in @a dst. */
size_t ucs1encode(utf8 *dst, const ucs1 *s, size_t n, const char quote[128])
{
#ifndef _WIN32
assert(!"implemented");
#endif
return 0;
}
/** Calculate number of characters in UTF8 string @a s. */
size_t ucs1declen(const utf8 *s)
{
#ifndef _WIN32
assert(!"implemented");
#endif
return 0;
}
/** Calculate length of UTF8 encoding of string @a s. */
size_t ucs1enclen(const ucs1 *s, size_t n, const char quote[128])
{
#ifndef _WIN32
assert(!"implemented");
#endif
return 0;
}
@@ -0,0 +1,85 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef UTF8INTERNAL_H
#define UTF8INTERNAL_H
/**@IFILE utf8internal.h
* UTF-8 macros.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Apr 21 15:32:02 1998 pessi
*/
#define UTF8_ANALYZE(s, ascii, latin1, ucs2, ucs4, errors) \
do { \
if (s) while (*s) { \
utf8 c = *s++; \
if (IS_UTF8_1(c)) \
ascii++; \
else if (IS_UTF8_I(c)) { \
if (IS_UTF8_X(s[0])) \
latin1++, s++; \
else \
errors++; \
} \
else if (IS_UTF8_2(c)) { \
if (IS_UTF8_X(s[0])) \
ucs2++, s++; \
else \
errors++; \
} \
else if (IS_UTF8_3(c)) { \
if (IS_UTF8_X(s[0]) && IS_UTF8_X(s[1])) \
ucs2++, s++, s++; \
else \
errors++; \
} \
else if (IS_UTF8_4(c)) { \
if (IS_UTF8_X(s[0]) && IS_UTF8_X(s[1]) && IS_UTF8_X(s[2])) \
ucs4++, s++, s++, s++; \
else \
errors++; \
} \
else if (IS_UTF8_5(c)) { \
if (IS_UTF8_X(s[0]) && IS_UTF8_X(s[1]) && \
IS_UTF8_X(s[2]) && IS_UTF8_X(s[3])) \
ucs4++, s++, s++, s++, s++; \
else \
errors++; \
} \
else if (IS_UTF8_6(c)) { \
if (IS_UTF8_X(s[0]) && IS_UTF8_X(s[1]) && \
IS_UTF8_X(s[2]) && IS_UTF8_X(s[3]) && IS_UTF8_X(s[4])) \
ucs4++, s++, s++, s++, s++, s++; \
else \
errors++; \
} \
else \
errors++; \
} \
} while(0)
#endif /* UTF8INTERNAL_H */
@@ -0,0 +1,188 @@
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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 this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@internal
* @CFILE utf8test.c UTF8 encoding - decoding tests
*
* @author Pekka Pessi <pessi@research.nokia.com>
*
* @date Created: Tue Apr 21 15:32:38 1998 pessi
*/
#include "config.h"
#include <sofia-sip/utf8.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
static ucs4 ucs4test0[] = {
0x41u, 0xC1u, 0x841u, 0x10041u, 0x200041u, 0x4000041u, 0
};
static utf8 ucs4test1[] =
"A"
"\303\201"
"\340\241\201"
"\360\220\201\201"
"\370\210\200\201\201"
"\374\204\200\200\201\201";
static ucs2 ucs2test0[] = {
0x41u, 0xC1u, 0x841u, 0
};
static utf8 ucs2test1[] =
"A"
"\303\201"
"\340\241\201";
ucs4 ucs4s[1024] = { 0 };
ucs2 ucs2s[1024] = { 0 };
utf8 utf8s[1024] = { 0 };
size_t len;
int result = 0;
int i;
puts("testing ucs4len(ucs4test0)");
len = ucs4len(ucs4test0);
if (len != 6) {
printf("ucs4len(ucs4test0) returns %u\n", len);
result = 1;
}
else puts("OK");
puts("testing ucs4declen(ucs4test1)");
len = ucs4declen(ucs4test1);
if (len != 6) {
printf("ucs4declen(ucs4test1) returns %u\n", len);
result = 1;
}
else puts("OK");
puts("testing ucs4enclen(ucs4test0, 6, NULL)");
len = ucs4enclen(ucs4test0, 6, NULL);
if (len != 22) {
printf("ucs4enclen(ucs4test0, 6, NULL) returns %u\n", len);
result = 1;
}
else puts("OK");
puts("testing ucs4enclen(ucs4test0, 5, NULL)");
len = ucs4enclen(ucs4test0, 5, NULL);
if (len != 16) {
printf("ucs4enclen(ucs4test0, 5, NULL) returns %u\n", len);
result = 1;
}
else puts("OK");
puts("testing ucs4encode(utf8s, ucs4test0, 6, NULL)");
if (ucs4encode(utf8s, ucs4test0, 6, NULL) != 22 ||
strcmp((char *)utf8s, (char*)ucs4test1)) {
printf("ucs4encode(utf8s, ucs4test0, 6, NULL) fails\n");
result = 1;
printf("\tutf8s=\"%s\"\n", utf8s);
}
else puts("OK");
puts("testing ucs4decode(ucs4s, sizeof(ucs4s), ucs4test1)");
if (ucs4decode(ucs4s, sizeof(ucs4s)/sizeof(*ucs4s), ucs4test1) != 6
|| ucs4cmp(ucs4s, ucs4test0)) {
printf("ucs4decode(ucs4s, sizeof(ucs4s), ucs4test1) fails\n");
result = 1;
for (i = 0; i < 8; i++) {
printf("\tucs4s[%d]=0x%x\n", i, ucs4s[i]);
}
}
else puts("OK");
/* UCS2 */
puts("testing ucs2len(ucs2test0)");
len = ucs2len(ucs2test0);
if (len != 3) {
printf("ucs2len(ucs2test0) returns %u\n", len);
result = 1;
}
else puts("OK");
puts("testing ucs2declen(ucs2test1)");
len = ucs2declen(ucs2test1);
if (len != 3) {
printf("ucs2declen(ucs2test1) returns %u\n", len);
result = 1;
}
else puts("OK");
puts("testing ucs2enclen(ucs2test0, 3, NULL)");
len = ucs2enclen(ucs2test0, 3, NULL);
if (len != 7) {
printf("ucs2enclen(ucs2test1, 3, NULL) returns %u\n", len);
result = 1;
}
else puts("OK");
puts("testing ucs2enclen(ucs2test0, 2, NULL)");
len = ucs2enclen(ucs2test0, 2, NULL);
if (len != 4) {
printf("ucs2enclen(ucs2test1, NULL) returns %u\n", len);
result = 1;
}
else puts("OK");
puts("testing ucs2encode(utf8s, ucs2test0, 3, NULL)");
if (ucs2encode(utf8s, ucs2test0, 3, NULL) != 7 ||
strcmp((char *)utf8s, (char*)ucs2test1)) {
printf("ucs2encode(utf8s, ucs2test0, 3, NULL) fails\n");
result = 1;
printf("\tutf8s=\"%s\"\n", utf8s);
}
else puts("OK");
puts("testing ucs2decode(ucs2s, sizeof(ucs2s)/sizeof(*ucs2s), ucs2test1)");
if (ucs2decode(ucs2s, sizeof(ucs2s)/sizeof(*ucs2s), ucs2test1) != 3 ||
ucs2cmp(ucs2s, ucs2test0)) {
printf("ucs2decode(ucs2s, sizeof(ucs2s)/sizeof(*ucs2s), ucs2test1) fails\n");
result = 1;
for (i = 0; i < 8; i++) {
printf("\tucs2s[%d]=0x%x\n", i, ucs2s[i]);
}
}
else puts("OK");
return result;
}
@@ -0,0 +1,24 @@
2005-11-08 Pekka Pessi <Pekka.Pessi@nokia.com>
* Renamed auth_digest_test.c as test_auth_digest.c.
2005-10-21 Pekka Pessi <Pekka.Pessi@nokia.com>
* Generate opaque only if opaque parameter has value "*".
M ./libsofia-sip-ua/iptsec/auth_module.c -14 +20
2005-09-06 Pekka Pessi <Pekka.Pessi@nokia.com>
* auth_digest_test.c: Using opaque to match credentials (as per
auth_digest_credentials()).
* auth_plugin.h, auth_module.c: Added auth_digest_credentials.
2005-08-10 Pekka Pessi <Pekka.Pessi@nokia.com>
* auth_module.c: Using unsigned as type of hash!
2005-07-18 Kai Vehmanen <kai.vehmanen@nokia.com>
* Initial import of the module to Sofia-SIP tree.
@@ -0,0 +1,20 @@
PROJECT_NAME = "iptsec"
OUTPUT_DIRECTORY = ../docs/html/iptsec
INPUT = iptsec.docs sofia-sip .
@INCLUDE = ../docs/Doxyfile.conf
TAGFILES += ../docs/su.doxytags=../su
TAGFILES += ../docs/ipt.doxytags=../ipt
TAGFILES += ../docs/bnf.doxytags=../bnf
TAGFILES += ../docs/url.doxytags=../url
TAGFILES += ../docs/msg.doxytags=../msg
TAGFILES += ../docs/sip.doxytags=../sip
TAGFILES += ../docs/sresolv.doxytags=../sresolv
TAGFILES += ../docs/tport.doxytags=../tport
TAGFILES += ../docs/nta.doxytags=../nta
GENERATE_TAGFILE = ../docs/iptsec.doxytags
ALIASES +=
@@ -0,0 +1,80 @@
#
# Makefile.am for iptsec module
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
# ----------------------------------------------------------------------
# Header paths
INCLUDES = -I$(srcdir)/../bnf -I../bnf \
-I$(srcdir)/../ipt -I../ipt \
-I$(srcdir)/../http -I../http \
-I$(srcdir)/../msg -I../msg \
-I$(srcdir)/../nta -I../nta \
-I$(srcdir)/../sip -I../sip \
-I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES = libiptsec.la
check_PROGRAMS = test_auth_digest
TESTS = test_auth_digest
# ----------------------------------------------------------------------
# Rules for building the targets
BUILT_SOURCES = auth_tag_ref.c
nobase_include_sofia_HEADERS = \
sofia-sip/auth_common.h \
sofia-sip/auth_client.h sofia-sip/auth_digest.h \
sofia-sip/auth_module.h sofia-sip/auth_plugin.h \
sofia-sip/auth_client_plugin.h \
$(NTLM_HEADER)
libiptsec_la_SOURCES = iptsec_debug.h \
auth_client.c auth_common.c auth_digest.c \
auth_module.c auth_tag.c auth_tag_ref.c \
auth_plugin.c auth_plugin_delayed.c \
auth_module_http.c auth_module_sip.c \
$(NTLM_SOURCE) \
iptsec_debug.c
NTLM_HEADER = sofia-sip/auth_ntlm.h
if HAVE_NTLM
NTLM_SOURCE = auth_ntlm.c auth_client_ntlm.c auth_plugin_ntlm.c
endif
EXTRA_libiptsec_la_SOURCES = \
auth_ntlm.c auth_client_ntlm.c auth_plugin_ntlm.c
COVERAGE_INPUT = $(libiptsec_la_SOURCES) $(include_sofia_HEADERS)
LDADD = libiptsec.la \
../http/libhttp.la \
../nta/libnta.la \
../sip/libsip.la \
../msg/libmsg.la \
../url/liburl.la \
../bnf/libbnf.la \
../ipt/libipt.la \
../su/libsu.la
test_auth_digest_LDFLAGS = -static
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST = Doxyfile iptsec.docs testpasswd \
auth_module_sip.c auth_module_http.c $(BUILT_SOURCES)
# ----------------------------------------------------------------------
# Sofia specific rules
include ../sofia.am
@@ -0,0 +1,752 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am for iptsec module
#
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
# ----------------------------------------------------------------------
# Header paths
# common Makefile targets for libsofia-sip-ua modules
# ---------------------------------------------------
SOURCES = $(libiptsec_la_SOURCES) $(EXTRA_libiptsec_la_SOURCES) test_auth_digest.c
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
check_PROGRAMS = test_auth_digest$(EXEEXT)
DIST_COMMON = $(nobase_include_sofia_HEADERS) $(srcdir)/../sofia.am \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
subdir = libsofia-sip-ua/iptsec
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/sac-general.m4 \
$(top_srcdir)/m4/sac-openssl.m4 $(top_srcdir)/m4/sac-su.m4 \
$(top_srcdir)/m4/sac-su2.m4 $(top_srcdir)/m4/sac-tport.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h \
$(top_builddir)/libsofia-sip-ua/su/sofia-sip/su_configure.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libiptsec_la_LIBADD =
am__libiptsec_la_SOURCES_DIST = iptsec_debug.h auth_client.c \
auth_common.c auth_digest.c auth_module.c auth_tag.c \
auth_tag_ref.c auth_plugin.c auth_plugin_delayed.c \
auth_module_http.c auth_module_sip.c auth_ntlm.c \
auth_client_ntlm.c auth_plugin_ntlm.c iptsec_debug.c
@HAVE_NTLM_TRUE@am__objects_1 = auth_ntlm.lo auth_client_ntlm.lo \
@HAVE_NTLM_TRUE@ auth_plugin_ntlm.lo
am_libiptsec_la_OBJECTS = auth_client.lo auth_common.lo auth_digest.lo \
auth_module.lo auth_tag.lo auth_tag_ref.lo auth_plugin.lo \
auth_plugin_delayed.lo auth_module_http.lo auth_module_sip.lo \
$(am__objects_1) iptsec_debug.lo
libiptsec_la_OBJECTS = $(am_libiptsec_la_OBJECTS)
test_auth_digest_SOURCES = test_auth_digest.c
test_auth_digest_OBJECTS = test_auth_digest.$(OBJEXT)
test_auth_digest_LDADD = $(LDADD)
test_auth_digest_DEPENDENCIES = libiptsec.la ../http/libhttp.la \
../nta/libnta.la ../sip/libsip.la ../msg/libmsg.la \
../url/liburl.la ../bnf/libbnf.la ../ipt/libipt.la \
../su/libsu.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/libsofia-sip-ua/su/sofia-sip
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libiptsec_la_SOURCES) $(EXTRA_libiptsec_la_SOURCES) \
test_auth_digest.c
DIST_SOURCES = $(am__libiptsec_la_SOURCES_DIST) \
$(EXTRA_libiptsec_la_SOURCES) test_auth_digest.c
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(include_sofiadir)"
nobase_include_sofiaHEADERS_INSTALL = $(install_sh_DATA)
HEADERS = $(nobase_include_sofia_HEADERS)
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
COREFOUNDATION_FALSE = @COREFOUNDATION_FALSE@
COREFOUNDATION_TRUE = @COREFOUNDATION_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWFLAG = @CWFLAG@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DOXYGEN = @DOXYGEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_COVERAGE_FALSE = @ENABLE_COVERAGE_FALSE@
ENABLE_COVERAGE_TRUE = @ENABLE_COVERAGE_TRUE@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
EXPENSIVE_CHECKS_FALSE = @EXPENSIVE_CHECKS_FALSE@
EXPENSIVE_CHECKS_TRUE = @EXPENSIVE_CHECKS_TRUE@
F77 = @F77@
FFLAGS = @FFLAGS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GLIB_VERSION = @GLIB_VERSION@
HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@
HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@
HAVE_GLIB_FALSE = @HAVE_GLIB_FALSE@
HAVE_GLIB_TRUE = @HAVE_GLIB_TRUE@
HAVE_MINGW32_FALSE = @HAVE_MINGW32_FALSE@
HAVE_MINGW32_TRUE = @HAVE_MINGW32_TRUE@
HAVE_NTLM_FALSE = @HAVE_NTLM_FALSE@
HAVE_NTLM_TRUE = @HAVE_NTLM_TRUE@
HAVE_TLS_FALSE = @HAVE_TLS_FALSE@
HAVE_TLS_TRUE = @HAVE_TLS_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBVER_SOFIA_SIP_UA_AGE = @LIBVER_SOFIA_SIP_UA_AGE@
LIBVER_SOFIA_SIP_UA_CUR = @LIBVER_SOFIA_SIP_UA_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_AGE = @LIBVER_SOFIA_SIP_UA_GLIB_AGE@
LIBVER_SOFIA_SIP_UA_GLIB_CUR = @LIBVER_SOFIA_SIP_UA_GLIB_CUR@
LIBVER_SOFIA_SIP_UA_GLIB_REV = @LIBVER_SOFIA_SIP_UA_GLIB_REV@
LIBVER_SOFIA_SIP_UA_GLIB_SOVER = @LIBVER_SOFIA_SIP_UA_GLIB_SOVER@
LIBVER_SOFIA_SIP_UA_REV = @LIBVER_SOFIA_SIP_UA_REV@
LIBVER_SOFIA_SIP_UA_SOVER = @LIBVER_SOFIA_SIP_UA_SOVER@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MINGW_ENVIRONMENT = @MINGW_ENVIRONMENT@
MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
NDEBUG_FALSE = @NDEBUG_FALSE@
NDEBUG_TRUE = @NDEBUG_TRUE@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
REPLACE_LIBADD = @REPLACE_LIBADD@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOFIA_CFLAGS = @SOFIA_CFLAGS@
SOFIA_GLIB_PKG_REQUIRES = @SOFIA_GLIB_PKG_REQUIRES@
STRIP = @STRIP@
TESTS_ENVIRONMENT = @TESTS_ENVIRONMENT@
VERSION = @VERSION@
VER_LIBSOFIA_SIP_UA_MAJOR_MINOR = @VER_LIBSOFIA_SIP_UA_MAJOR_MINOR@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_LD = @ac_ct_LD@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
include_sofiadir = @include_sofiadir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
INCLUDES = -I$(srcdir)/../bnf -I../bnf \
-I$(srcdir)/../ipt -I../ipt \
-I$(srcdir)/../http -I../http \
-I$(srcdir)/../msg -I../msg \
-I$(srcdir)/../nta -I../nta \
-I$(srcdir)/../sip -I../sip \
-I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su
# ----------------------------------------------------------------------
# Build targets
noinst_LTLIBRARIES = libiptsec.la
TESTS = test_auth_digest
# ----------------------------------------------------------------------
# Rules for building the targets
BUILT_SOURCES = auth_tag_ref.c
nobase_include_sofia_HEADERS = \
sofia-sip/auth_common.h \
sofia-sip/auth_client.h sofia-sip/auth_digest.h \
sofia-sip/auth_module.h sofia-sip/auth_plugin.h \
sofia-sip/auth_client_plugin.h \
$(NTLM_HEADER)
libiptsec_la_SOURCES = iptsec_debug.h \
auth_client.c auth_common.c auth_digest.c \
auth_module.c auth_tag.c auth_tag_ref.c \
auth_plugin.c auth_plugin_delayed.c \
auth_module_http.c auth_module_sip.c \
$(NTLM_SOURCE) \
iptsec_debug.c
NTLM_HEADER = sofia-sip/auth_ntlm.h
@HAVE_NTLM_TRUE@NTLM_SOURCE = auth_ntlm.c auth_client_ntlm.c auth_plugin_ntlm.c
EXTRA_libiptsec_la_SOURCES = \
auth_ntlm.c auth_client_ntlm.c auth_plugin_ntlm.c
COVERAGE_INPUT = $(libiptsec_la_SOURCES) $(include_sofia_HEADERS)
LDADD = libiptsec.la \
../http/libhttp.la \
../nta/libnta.la \
../sip/libsip.la \
../msg/libmsg.la \
../url/liburl.la \
../bnf/libbnf.la \
../ipt/libipt.la \
../su/libsu.la
test_auth_digest_LDFLAGS = -static
# ----------------------------------------------------------------------
# Install and distribution rules
EXTRA_DIST = Doxyfile iptsec.docs testpasswd \
auth_module_sip.c auth_module_http.c $(BUILT_SOURCES)
AM_CFLAGS = $(CWFLAG) $(SOFIA_CFLAGS)
DISTCLEANFILES = $(BUILT_SOURCES)
# rules for building tag files
TAG_AWK = $(top_srcdir)/libsofia-sip-ua/su/tag_dll.awk
INTERNAL_INCLUDES = \
-I$(srcdir)/../features -I../features \
-I$(srcdir)/../ipt -I../ipt \
-I$(srcdir)/../iptsec -I../iptsec \
-I$(srcdir)/../bnf -I../bnf \
-I$(srcdir)/../http -I../http \
-I$(srcdir)/../msg -I../msg \
-I$(srcdir)/../nth -I../nth \
-I$(srcdir)/../nta -I../nta \
-I$(srcdir)/../nea -I../nea \
-I$(srcdir)/../nua -I../nua \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sdp -I../sdp \
-I$(srcdir)/../sip -I../sip \
-I$(srcdir)/../soa -I../soa \
-I$(srcdir)/../sresolv -I../sresolv \
-I$(srcdir)/../tport -I../tport \
-I$(srcdir)/../stun -I../stun \
-I$(srcdir)/../url -I../url \
-I$(srcdir)/../su -I../su
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../sofia.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libsofia-sip-ua/iptsec/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu libsofia-sip-ua/iptsec/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*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);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libiptsec.la: $(libiptsec_la_OBJECTS) $(libiptsec_la_DEPENDENCIES)
$(LINK) $(libiptsec_la_LDFLAGS) $(libiptsec_la_OBJECTS) $(libiptsec_la_LIBADD) $(LIBS)
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
test_auth_digest$(EXEEXT): $(test_auth_digest_OBJECTS) $(test_auth_digest_DEPENDENCIES)
@rm -f test_auth_digest$(EXEEXT)
$(LINK) $(test_auth_digest_LDFLAGS) $(test_auth_digest_OBJECTS) $(test_auth_digest_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_client.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_client_ntlm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_common.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_digest.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_module.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_module_http.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_module_sip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_ntlm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_plugin.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_plugin_delayed.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_plugin_ntlm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_tag.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_tag_ref.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iptsec_debug.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_auth_digest.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-nobase_include_sofiaHEADERS: $(nobase_include_sofia_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(include_sofiadir)" || $(mkdir_p) "$(DESTDIR)$(include_sofiadir)"
@$(am__vpath_adj_setup) \
list='$(nobase_include_sofia_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__vpath_adj) \
echo " $(nobase_include_sofiaHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(include_sofiadir)/$$f'"; \
$(nobase_include_sofiaHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(include_sofiadir)/$$f"; \
done
uninstall-nobase_include_sofiaHEADERS:
@$(NORMAL_UNINSTALL)
@$(am__vpath_adj_setup) \
list='$(nobase_include_sofia_HEADERS)'; for p in $$list; do \
$(am__vpath_adj) \
echo " rm -f '$(DESTDIR)$(include_sofiadir)/$$f'"; \
rm -f "$(DESTDIR)$(include_sofiadir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list='$(TESTS)'; \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
;; \
*) \
echo "PASS: $$tst"; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*" $$tst "*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
*) \
failed=`expr $$failed + 1`; \
echo "FAIL: $$tst"; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
echo "SKIP: $$tst"; \
fi; \
done; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="All $$all tests passed"; \
else \
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all tests failed"; \
else \
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
skipped="($$skip tests were not run)"; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
echo "$$dashes"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
$(mkdir_p) $(distdir)/.. $(distdir)/sofia-sip
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(include_sofiadir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
clean-noinstLTLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-nobase_include_sofiaHEADERS
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-nobase_include_sofiaHEADERS
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool \
clean-noinstLTLIBRARIES ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man \
install-nobase_include_sofiaHEADERS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-nobase_include_sofiaHEADERS
built-sources: $(BUILT_SOURCES)
clean-built-sources:
-rm -rf $(BUILT_SOURCES) $(BUILT_SOURCES:%=$(srcdir)/%)
*_tag_ref.c: $(TAG_AWK)
%_tag_ref.c: %_tag.c
$(AWK) -f $(TAG_AWK) NODLL=1 $(TAG_DLL_FLAGS) $<
@ENABLE_COVERAGE_TRUE@coverage:
@ENABLE_COVERAGE_TRUE@ @$(top_srcdir)/scripts/coverage $(COVERAGE_FLAGS) $(COVERAGE_INPUT)
../bnf/libbnf.la ../http/libhttp.la ../ipt/libipt.la ../iptsec/libiptsec.la \
../msg/libmsg.la ../nea/libnea.la ../nta/libnta.la ../nth/libnth.la \
../nua/libnua.la ../sdp/libsdp.la ../sip/libsip.la ../soa/libsoa.la \
../sresolv/libsresolv.la ../stun/libstun.la ../su/libsu.la \
../tport/libtport.la ../url/liburl.la:
$(MAKE) -C $(@D) $(@F)
# ----------------------------------------------------------------------
# Sofia specific rules
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
Loaded 100 of 719 files, more files were not shown because too many files have changed in this diff. Show more