libosip  5.3.0
osip_from.h
Go to the documentation of this file.
1 /*
2  The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3  Copyright (C) 2001-2020 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 #ifndef _OSIP_FROM_H_
21 #define _OSIP_FROM_H_
22 
23 #include <osipparser2/osip_list.h>
24 #include <osipparser2/osip_uri.h>
25 
41 typedef struct osip_from osip_from_t;
42 
47 struct osip_from {
48  char *displayname;
51 };
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
61 int osip_from_init(osip_from_t **header);
66 void osip_from_free(osip_from_t *header);
72 int osip_from_parse(osip_from_t *header, const char *hvalue);
78 int osip_from_to_str(const osip_from_t *header, char **dest);
84 int osip_from_clone(const osip_from_t *header, osip_from_t **dest);
90 void osip_from_set_displayname(osip_from_t *header, char *value);
101 void osip_from_set_url(osip_from_t *header, osip_uri_t *url);
113 int osip_from_param_get(osip_from_t *header, int pos, osip_generic_param_t **dest);
120 #define osip_from_param_add(header, name, value) osip_generic_param_add((&(header)->gen_params), name, value)
127 #define osip_from_param_get_byname(header, name, dest) osip_generic_param_get_byname((&(header)->gen_params), name, dest)
128 
134 #define osip_from_get_tag(header, dest) osip_generic_param_get_byname((&(header)->gen_params), "tag", dest)
140 #define osip_from_set_tag(header, value) osip_generic_param_add((&(header)->gen_params), osip_strdup("tag"), value)
141 
142 #ifndef DOXYGEN /* avoid DOXYGEN warning */
143 /* Compare the username, host and tag part (if exist) of the two froms */
144 int osip_from_compare(osip_from_t *header1, osip_from_t *header2);
145 #endif
146 
153 int osip_from_tag_match(osip_from_t *from1, osip_from_t *from2);
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
161 #endif
osip_uri_t * osip_from_get_url(osip_from_t *header)
Definition: osip_from.c:405
void osip_from_set_url(osip_from_t *header, osip_uri_t *url)
Definition: osip_from.c:412
void osip_from_free(osip_from_t *header)
Definition: osip_from.c:82
void osip_from_set_displayname(osip_from_t *header, char *value)
Definition: osip_from.c:401
int osip_from_clone(const osip_from_t *header, osip_from_t **dest)
Definition: osip_from.c:429
int osip_from_tag_match(osip_from_t *from1, osip_from_t *from2)
Definition: osip_from.c:744
char * osip_from_get_displayname(osip_from_t *header)
Definition: osip_from.c:394
int osip_from_param_get(osip_from_t *header, int pos, osip_generic_param_t **dest)
Definition: osip_from.c:416
int osip_from_to_str(const osip_from_t *header, char **dest)
Definition: osip_from.c:323
int osip_from_init(osip_from_t **header)
Definition: osip_from.c:66
int osip_from_parse(osip_from_t *header, const char *hvalue)
Definition: osip_from.c:101
oSIP list Routines
oSIP url parser Routines
Definition: osip_from.h:47
osip_list_t gen_params
Definition: osip_from.h:50
osip_uri_t * url
Definition: osip_from.h:49
char * displayname
Definition: osip_from.h:48
Definition: osip_list.h:87
Definition: osip_uri.h:55
Definition: osip_uri.h:167