Commit 1ae8798f authored by Pekka Pessi's avatar Pekka Pessi

Added nta_outgoing_default(), nta_incoming_default().

Stateless response processing can be done with default transactions.
Also added nta_incoming_method_name(), nta_incoming_method_name() and
nta_incoming_gettag(). Deprecated nta_msg_response_complete().
Updated API tests.

darcs-hash:20051215205523-65a35-c8a64a209b2ba00ce0491fd54f8ac2c0f20e6ff3.gz
parent 96cf78d4
......@@ -11,6 +11,7 @@ INCLUDES = -I$(srcdir)/../ipt \
-I$(srcdir)/../sresolv \
-I$(srcdir)/../tport \
-I$(srcdir)/../url \
-I$(srcdir)/../features \
-I$(srcdir)/../su
# ----------------------------------------------------------------------
......@@ -18,10 +19,10 @@ INCLUDES = -I$(srcdir)/../ipt \
noinst_LTLIBRARIES = libnta.la
noinst_PROGRAMS = test_nta portbind
dist_noinst_SCRIPTS = run_test_nta
noinst_PROGRAMS = test_nta_api test_nta portbind
dist_noinst_SCRIPTS = run_test_nta_api run_test_nta
TESTS = run_test_nta
TESTS = run_test_nta_api run_test_nta
TESTS_ENVIRONMENT = $(SHELL)
# ----------------------------------------------------------------------
......@@ -42,6 +43,7 @@ COVERAGE_INPUT = $(libnta_la_SOURCES) $(include_sofia_HEADERS)
LDADD = libnta.la \
../ipt/libipt.la \
../sip/libsip.la \
../features/libfeatures.la \
../sresolv/libsresolv.la \
../tport/libtport.la \
../stun/libstun.la \
......
This diff is collapsed.
......@@ -232,6 +232,8 @@ nta_incoming_t *nta_incoming_create(nta_agent_t *agent,
sip_t *sip,
tag_type_t tag, tag_value_t value, ...);
nta_incoming_t *nta_incoming_default(nta_agent_t *agent);
typedef int nta_ack_cancel_f(nta_incoming_magic_t *imagic,
nta_incoming_t *irq,
sip_t const *sip);
......@@ -248,9 +250,11 @@ nta_incoming_t *nta_incoming_find(nta_agent_t const *agent,
sip_via_t const *v);
char const *nta_incoming_tag(nta_incoming_t *irq, char const *tag);
char const *nta_incoming_gettag(nta_incoming_t const *irq);
int nta_incoming_status(nta_incoming_t const *irq);
sip_method_t nta_incoming_method(nta_incoming_t const *irq);
char const *nta_incoming_method_name(nta_incoming_t const *irq);
url_t const *nta_incoming_url(nta_incoming_t const *irq);
uint32_t nta_incoming_cseq(nta_incoming_t const *irq);
......@@ -298,6 +302,10 @@ nta_outgoing_t *nta_outgoing_mcreate(nta_agent_t *agent,
msg_t *msg,
tag_type_t tag, tag_value_t value, ...);
nta_outgoing_t *nta_outgoing_default(nta_agent_t *agent,
nta_response_f *callback,
nta_outgoing_magic_t *magic);
int nta_outgoing_status(nta_outgoing_t const *orq);
sip_method_t nta_outgoing_method(nta_outgoing_t const *orq);
char const *nta_outgoing_method_name(nta_outgoing_t const *orq);
......
......@@ -283,8 +283,10 @@ struct nta_agent_s
leg_htable_t sa_defaults[1];
/** Hash table for outgoing transactions */
outgoing_htable_t sa_outgoing[1];
nta_outgoing_t *sa_default_outgoing;
/** Hash table for incoming transactions */
incoming_htable_t sa_incoming[1];
nta_incoming_t *sa_default_incoming;
/* Queues (states) for outgoing client transactions */
struct {
......@@ -404,6 +406,7 @@ struct nta_incoming_s
short irq_status;
unsigned irq_retries : 8;
unsigned irq_default : 1; /**< Default transaction */
unsigned irq_canceled : 1; /**< Transaction is canceled */
unsigned irq_completed : 1; /**< Transaction is completed */
unsigned irq_confirmed : 1; /**< Response has been acked */
......@@ -412,7 +415,7 @@ struct nta_incoming_s
unsigned irq_destroyed :1; /**< Transaction is destroyed */
unsigned irq_in_callback:1; /**< Callback is being invoked */
unsigned irq_reliable_tp:1; /**< Transport is reliable */
unsigned irq_sigcomp_zap:1;/**< Reset SigComp */
unsigned irq_sigcomp_zap:1; /**< Reset SigComp */
unsigned irq_must_100rel:1; /**< 100rel is required */
unsigned irq_tag_set:1; /**< Tag is not from request */
unsigned :0;
......@@ -478,6 +481,7 @@ struct nta_outgoing_s
unsigned short orq_status;
unsigned char orq_retries; /**< Number of tries this far */
unsigned orq_default : 1; /**< This is default transaction */
unsigned orq_inserted : 1;
unsigned orq_resolved : 1;
unsigned orq_prepared : 1; /**< outgoing_prepare() called */
......
#! /bin/bash
#
# Run test_nta_api
#
# --------------------------------------------------------------------
#
# 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
#
# --------------------------------------------------------------------
#
# Author: Pekka Pessi <Pekka.Pessi@nokia.com>.
#
#set -x
s=${0%/*}
exec $VALGRIND ./test_nta_api "$@"
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment