Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
sofia-sip
Commits
c4ae89dc
Commit
c4ae89dc
authored
Feb 23, 2006
by
Pekka Pessi
Browse files
Added NTATAG_UPDATE_TPORT().
darcs-hash:20060223202454-65a35-01f7dc4871f9b2b3dcf514827393a27165ba05be.gz
parent
0eab7f8a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
2 deletions
+35
-2
libsofia-sip-ua/nta/nta.c
libsofia-sip-ua/nta/nta.c
+20
-1
libsofia-sip-ua/nta/nta_internal.h
libsofia-sip-ua/nta/nta_internal.h
+2
-1
libsofia-sip-ua/nta/nta_tag.c
libsofia-sip-ua/nta/nta_tag.c
+2
-0
libsofia-sip-ua/nta/sofia-sip/nta_tag.h
libsofia-sip-ua/nta/sofia-sip/nta_tag.h
+9
-0
libsofia-sip-ua/nta/sofia-sip/nta_tport.h
libsofia-sip-ua/nta/sofia-sip/nta_tport.h
+2
-0
No files found.
libsofia-sip-ua/nta/nta.c
View file @
c4ae89dc
...
...
@@ -787,6 +787,7 @@ static
int
agent_set_params
(
nta_agent_t
*
agent
,
tagi_t
*
tags
)
{
int
n
,
m
;
nta_update_tport_f
*
update_tport
=
agent
->
sa_update_tport
;
unsigned
bad_req_mask
=
agent
->
sa_bad_req_mask
;
unsigned
bad_resp_mask
=
agent
->
sa_bad_resp_mask
;
unsigned
maxsize
=
agent
->
sa_maxsize
;
...
...
@@ -832,6 +833,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
n
=
tl_gets
(
tags
,
NTATAG_MCLASS_REF
(
mclass
),
NTATAG_UPDATE_TPORT_REF
(
update_tport
),
NTATAG_BAD_REQ_MASK_REF
(
bad_req_mask
),
NTATAG_BAD_RESP_MASK_REF
(
bad_resp_mask
),
NTATAG_ALIASES_REF
(
aliases
),
...
...
@@ -880,6 +882,8 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
if
(
mclass
!=
NONE
)
agent
->
sa_mclass
=
mclass
?
mclass
:
sip_default_mclass
();
agent
->
sa_update_tport
=
update_tport
;
m
=
0
;
for
(
tport
=
agent
->
sa_tports
;
tport
;
tport
=
tport_next
(
tport
))
{
m
=
tport_set_params
(
tport
,
TAG_NEXT
(
tags
));
...
...
@@ -1287,6 +1291,7 @@ static void agent_tp_error(nta_agent_t *agent,
tport_t
*
tport
,
int
errcode
,
char
const
*
remote
);
static
void
agent_update_tport
(
nta_agent_t
*
agent
,
tport_t
*
);
/**For each transport, we have name used by tport module, SRV prefixes used
* for resolving, and NAPTR service/conversion.
...
...
@@ -1322,7 +1327,8 @@ static tport_stack_class_t nta_agent_class[1] =
agent_recv_message
,
agent_tp_error
,
(
void
*
)
nta_msg_create_for_transport
,
agent_sigcomp_accept
agent_sigcomp_accept
,
agent_update_tport
,
}};
...
...
@@ -1854,6 +1860,19 @@ void agent_tp_error(nta_agent_t *agent,
su_strerror
(
errcode
));
}
/** Handle updated transport addresses */
static
void
agent_update_tport
(
nta_agent_t
*
self
,
tport_t
*
tport
)
{
agent_init_via
(
self
,
0
);
if
(
self
->
sa_update_tport
)
{
self
->
sa_update_tport
(
self
->
sa_magic
,
self
);
}
else
{
/* XXX - we should do something else? */
SU_DEBUG_3
((
"nta(%p): transport address updated
\n
"
,
self
));
}
}
/* ====================================================================== */
/* 3) Message dispatch */
...
...
libsofia-sip-ua/nta/nta_internal.h
View file @
c4ae89dc
...
...
@@ -94,13 +94,14 @@ struct nta_agent_s
su_timer_t
*
sa_timer
;
nta_agent_magic_t
*
sa_magic
;
nta_message_f
*
sa_callback
;
nta_update_tport_f
*
sa_update_tport
;
su_time_t
sa_now
;
/**< Timestamp in microsecond resolution. */
uint32_t
sa_millisec
;
/**< Timestamp in milliseconds resolution. */
uint32_t
sa_flags
;
/**< Message flags */
msg_mclass_t
*
sa_mclass
;
sip_contact_t
*
sa_contact
;
sip_via_t
*
sa_vias
;
/**< Via headers for all transports */
sip_contact_t
*
sa_aliases
;
/**< List of aliases for agent */
...
...
libsofia-sip-ua/nta/nta_tag.c
View file @
c4ae89dc
...
...
@@ -50,6 +50,8 @@
tag_typedef_t
ntatag_any
=
NSTAG_TYPEDEF
(
*
);
tag_typedef_t
ntatag_mclass
=
PTRTAG_TYPEDEF
(
mclass
);
tag_typedef_t
ntatag_update_tport
=
PTRTAG_TYPEDEF
(
update_tport
);
tag_typedef_t
ntatag_bad_req_mask
=
UINTTAG_TYPEDEF
(
bad_req_mask
);
tag_typedef_t
ntatag_bad_resp_mask
=
UINTTAG_TYPEDEF
(
bad_resp_mask
);
...
...
libsofia-sip-ua/nta/sofia-sip/nta_tag.h
View file @
c4ae89dc
...
...
@@ -63,6 +63,15 @@ NTA_DLL extern tag_typedef_t ntatag_mclass;
NTA_DLL
extern
tag_typedef_t
ntatag_mclass_ref
;
#define NTATAG_MCLASS_REF(x) ntatag_mclass_ref, tag_ptr_vr(&(x), (x))
NTA_DLL
extern
tag_typedef_t
ntatag_update_tport
;
/** Transport update callback. @HI */
#define NTATAG_UPDATE_TPORT(x) \
ntatag_update_tport, tag_ptr_v((x))
NTA_DLL
extern
tag_typedef_t
ntatag_update_tport_ref
;
#define NTATAG_UPDATE_TPORT_REF(x) \
ntatag_update_tport_ref, tag_ptr_vr(&(x), (x))
NTA_DLL
extern
tag_typedef_t
ntatag_bad_req_mask
;
/** Mask for bad request messages.
*
...
...
libsofia-sip-ua/nta/sofia-sip/nta_tport.h
View file @
c4ae89dc
...
...
@@ -65,6 +65,8 @@ nta_outgoing_compartment(nta_outgoing_t *orq);
void
nta_compartment_decref
(
struct
sigcomp_compartment
**
);
typedef
void
nta_update_tport_f
(
nta_agent_magic_t
*
,
nta_agent_t
*
);
SOFIA_END_DECLS
#endif
/* !defined NTA_TPORT_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment