1 /*
2  * This file is part of the Sofia-SIP package
3  *
4  * Copyright (C) 2005 Nokia Corporation.
5  *
6  * Contact: Pekka Pessi <pekka.pessi@nokia.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24 
25 #ifndef NTA_TPORT_H
26 /** Defined when <sofia-sip/nta_tport.h> has been included. */
27 #define NTA_TPORT_H
28 
29 /**
30  * @file sofia-sip/nta_tport.h
31  * @brief Transport and SigComp handling
32  *
33  * @author Pekka Pessi <Pekka.Pessi@nokia.com>
34  *
35  * @date Created: Thu Oct  7 20:04:39 2004 ppessi
36  *
37  */
38 
39 #ifndef NTA_H
40 #include <sofia-sip/nta.h>
41 #endif
42 
43 SOFIA_BEGIN_DECLS
44 
45 struct tport_s;
46 
47 #ifndef TPORT_T
48 #define TPORT_T struct tport_s
49 typedef TPORT_T tport_t;
50 #endif
51 
52 #ifndef NTA_UPDATE_MAGIC_T
53 #define NTA_UPDATE_MAGIC_T void
54 #endif
55 typedef NTA_UPDATE_MAGIC_T nta_update_magic_t;
56 
57 #ifndef NTA_ERROR_MAGIC_T
58 #define NTA_ERROR_MAGIC_T void
59 #endif
60 typedef NTA_ERROR_MAGIC_T nta_error_magic_t;
61 
62 struct sigcomp_compartment;
63 struct sigcomp_udvm;
64 
65 #define nta_transport nta_incoming_transport
66 
67 SOFIAPUBFUN tport_t *nta_agent_tports(nta_agent_t *agent);
68 
69 SOFIAPUBFUN
70 tport_t *nta_incoming_transport(nta_agent_t *, nta_incoming_t *, msg_t *msg);
71 
72 SOFIAPUBFUN
73 struct sigcomp_compartment *nta_incoming_compartment(nta_incoming_t *irq);
74 
75 SOFIAPUBFUN tport_t *nta_outgoing_transport(nta_outgoing_t *orq);
76 
77 SOFIAPUBFUN
78 struct sigcomp_compartment *
79 nta_outgoing_compartment(nta_outgoing_t *orq);
80 
81 SOFIAPUBFUN void nta_compartment_decref(struct sigcomp_compartment **);
82 
83 typedef void nta_update_tport_f(nta_update_magic_t *, nta_agent_t *);
84 
85 typedef void nta_error_tport_f(nta_error_magic_t *, nta_agent_t *, tport_t *);
86 
87 SOFIAPUBFUN
88 int nta_agent_bind_tport_update(nta_agent_t *agent,
89 				nta_update_magic_t *magic,
90 				nta_update_tport_f *);
91 
92 SOFIAPUBFUN
93 int nta_agent_bind_tport_error(nta_agent_t *agent,
94 				nta_error_magic_t *magic,
95 			    nta_error_tport_f *callback);
96 
97 SOFIA_END_DECLS
98 
99 #endif /* !defined NTA_TPORT_H */
100