2 The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3 Copyright (C) 2001 Aymeric MOIZARD jack@atosc.org
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.
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.
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
21 #ifndef _OSIP_HEADER_H_
22 #define _OSIP_HEADER_H_
24 #include <osipparser2/osip_uri.h>
28 * @brief oSIP osip_header definition.
33 * @defgroup oSIP_HEADER oSIP header definition.
34 * @ingroup oSIP_HEADERS
39 * Structure for 'unknown' headers.
40 * NOTE: 'unknown' header' are used in oSIP for all header that are not
41 * defined by oSIP in the osip_message_t structure. This means that all
42 * 'unknown' header has to be handled with the API related to this
44 * @defvar osip_header_t
46 typedef struct osip_header osip_header_t;
55 * Structure for generic parameter headers.
56 * Generic parameter are used in a lot of headers. (To, From, Route,
57 * Record-Route...) All those headers use a common API but this is
58 * hidden by MACROs that you can be found in smsg.h.
61 typedef osip_uri_param_t osip_generic_param_t;
69 * Allocate a header element.
70 * @param header The element to work on.
72 int osip_header_init (osip_header_t ** header);
74 * Free a header element.
75 * @param header The element to work on.
77 void osip_header_free (osip_header_t * header);
79 * Get a string representation of a header element.
80 * @param header The element to work on.
81 * @param dest A pointer on the new allocated buffer.
83 int osip_header_to_str (const osip_header_t * header, char **dest);
85 * Get the token name a header element.
86 * @param header The element to work on.
88 char *osip_header_get_name (const osip_header_t * header);
90 * Set the token name a header element.
91 * @param header The element to work on.
92 * @param pname The token name to set.
94 void osip_header_set_name (osip_header_t * header, char *pname);
96 * Get the token value a header element.
97 * @param header The element to work on.
99 char *osip_header_get_value (const osip_header_t * header);
101 * Set the token value a header element.
102 * @param header The element to work on.
103 * @param pvalue The token value to set.
105 void osip_header_set_value (osip_header_t * header, char *pvalue);
107 * Clone a header element.
108 * @param header The element to work on.
109 * @param dest A pointer on the copy of the element.
111 int osip_header_clone (const osip_header_t * header, osip_header_t ** dest);