1 /*
2 The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3 Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20
21 #ifndef _OSIP_VIA_H_
22 #define _OSIP_VIA_H_
23
25
42
48 {
55 };
56
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61
96 #define osip_via_set_version via_set_version
97
102 #define osip_via_get_version via_get_version
103
109 #define osip_via_set_protocol via_set_protocol
110
115 #define osip_via_get_protocol via_get_protocol
116
122 #define osip_via_set_host via_set_host
123
128 #define osip_via_get_host via_get_host
129
135 #define osip_via_set_port via_set_port
136
141 #define osip_via_get_port via_get_port
142
148 #define osip_via_set_comment via_set_comment
149
154 #define osip_via_get_comment via_get_comment
155
160 #define osip_via_set_hidden(header) osip_generic_param_add((&(header)->via_params),osip_strdup("hidden"),NULL)
161
166 #define osip_via_set_ttl(header,value) osip_generic_param_add((&(header)->via_params),osip_strdup("ttl"),value)
167
172 #define osip_via_set_maddr(header,value) osip_generic_param_add((&(header)->via_params),osip_strdup("maddr"),value)
173
178 #define osip_via_set_received(header,value) osip_generic_param_add((&(header)->via_params),osip_strdup("received"),value)
179
184 #define osip_via_set_branch(header,value) osip_generic_param_add((&(header)->via_params),osip_strdup("branch"),value)
185
192 #define osip_via_param_add(header,name,value) osip_generic_param_add((&(header)->via_params),name,value)
193
199 #define osip_via_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->via_params),name,dest)
200
208
209 #ifdef __cplusplus
210 }
211 #endif
212
215 #endif
char * via_get_host(osip_via_t *header)
Get the host from a Via header.
Structure for referencing a list of elements.
char * via_get_version(osip_via_t *header)
Get the SIP version from a Via header.
void via_set_host(osip_via_t *header, char *value)
Set the host in the Via element.
void osip_via_free(osip_via_t *header)
Free a Via element.
int osip_via_clone(const osip_via_t *header, osip_via_t **dest)
Clone a Via element.
char * port
Port where to send answers.
char * via_get_protocol(osip_via_t *header)
Get the protocol from a Via header.
int osip_via_parse(osip_via_t *header, const char *hvalue)
Parse a Via element.
void via_set_port(osip_via_t *header, char *value)
Set the port in the Via element.
int osip_via_match(osip_via_t *via1, osip_via_t *via2)
Check if the Via headers match.
char * via_get_port(osip_via_t *header)
Get the port from a Via header.
char * via_get_comment(osip_via_t *header)
Get the comment from a Via header.
char * version
SIP Version.
osip_list_t via_params
Via parameters.
int osip_via_init(osip_via_t **header)
Allocate a Via element.
void via_set_protocol(osip_via_t *header, char *value)
Set the protocol in the Via element.
Definition of the Via header.
char * comment
Comments about SIP Agent.
char * protocol
Protocol used by SIP Agent.
void via_set_comment(osip_via_t *header, char *value)
Set the comment in the Via element.
char * host
Host where to send answers.
void via_set_version(osip_via_t *header, char *value)
Set the SIP version in the Via element.
int osip_via_to_str(const osip_via_t *header, char **dest)
Get a string representation of a Via element.