Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

osip_parser.h

Go to the documentation of this file.
00001 /*
00002   The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
00003   Copyright (C) 2001,2002,2003,2004  Aymeric MOIZARD jack@atosc.org
00004   
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Lesser General Public
00007   License as published by the Free Software Foundation; either
00008   version 2.1 of the License, or (at your option) any later version.
00009   
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Lesser General Public License for more details.
00014   
00015   You should have received a copy of the GNU Lesser General Public
00016   License along with this library; if not, write to the Free Software
00017   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 
00021 #ifndef _OSIP_PARSER_H_
00022 #define _OSIP_PARSER_H_
00023 
00024 #include <osipparser2/osip_message.h>
00025 
00038 #ifdef __cplusplus
00039 extern "C"
00040 {
00041 #endif
00042 
00046   int parser_init (void);
00047 
00052   int osip_message_fix_last_via_header (osip_message_t * request,
00053                                         const char *ip_addr, int port);
00054 
00055 
00066   int osip_message_get__property (const osip_message_t * sip);
00067 
00072   int osip_message_force_update (osip_message_t * sip);
00073 
00078   const char *osip_message_get_reason (int status_code);
00079 
00085   int osip_message_set_accept (osip_message_t * sip, const char *hvalue);
00092   int osip_message_get_accept (const osip_message_t * sip, int pos,
00093                                osip_accept_t ** dest);
00099   int osip_message_set_accept_encoding (osip_message_t * sip,
00100                                         const char *hvalue);
00107   int osip_message_get_accept_encoding (const osip_message_t * sip, int pos,
00108                                         osip_accept_encoding_t ** dest);
00114   int osip_message_set_accept_language (osip_message_t * sip,
00115                                         const char *hvalue);
00122   int osip_message_get_accept_language (const osip_message_t * sip, int pos,
00123                                         osip_accept_language_t ** dest);
00129   int osip_message_set_alert_info (osip_message_t * sip, const char *hvalue);
00136   int osip_message_get_alert_info (const osip_message_t * sip, int pos,
00137                                    osip_alert_info_t ** dest);
00143   int osip_message_set_allow (osip_message_t * sip, const char *hvalue);
00150   int osip_message_get_allow (const osip_message_t * sip, int pos,
00151                               osip_allow_t ** dest);
00157   int osip_message_set_authentication_info (osip_message_t * sip, const char *hvalue);
00164   int osip_message_get_authentication_info (const osip_message_t * sip, int pos,
00165                                osip_authentication_info_t ** dest);
00171   int osip_message_set_authorization (osip_message_t * sip,
00172                                       const char *hvalue);
00179   int osip_message_get_authorization (const osip_message_t * sip, int pos,
00180                                       osip_authorization_t ** dest);
00186   int osip_message_set_call_id (osip_message_t * sip, const char *hvalue);
00191   osip_call_id_t *osip_message_get_call_id (const osip_message_t * sip);
00197   int osip_message_set_call_info (osip_message_t * sip, const char *hvalue);
00204   int osip_message_get_call_info (const osip_message_t * sip, int pos,
00205                                   osip_call_info_t ** dest);
00211   int osip_message_set_contact (osip_message_t * sip, const char *hvalue);
00218   int osip_message_get_contact (const osip_message_t * sip, int pos,
00219                                 osip_contact_t ** dest);
00225   int osip_message_set_content_disposition (osip_message_t * sip,
00226                                             const char *hvalue);
00233   int osip_message_get_content_disposition (const osip_message_t * sip,
00234                                             int pos,
00235                                             osip_content_disposition_t **
00236                                             dest);
00242   int osip_message_set_content_encoding (osip_message_t * sip,
00243                                          const char *hvalue);
00250   int osip_message_get_content_encoding (const osip_message_t * sip, int pos,
00251                                          osip_content_encoding_t ** dest);
00257   int osip_message_set_content_length (osip_message_t * sip,
00258                                        const char *hvalue);
00263   osip_content_length_t *osip_message_get_content_length (const osip_message_t
00264                                                           * sip);
00270   int osip_message_set_content_type (osip_message_t * sip,
00271                                      const char *hvalue);
00276   osip_content_type_t *osip_message_get_content_type (const osip_message_t *
00277                                                       sip);
00283   int osip_message_set_cseq (osip_message_t * sip, const char *hvalue);
00288   osip_cseq_t *osip_message_get_cseq (const osip_message_t * sip);
00294   int osip_message_set_error_info (osip_message_t * sip, const char *hvalue);
00301   int osip_message_get_error_info (const osip_message_t * sip, int pos,
00302                                    osip_error_info_t ** dest);
00308   int osip_message_set_from (osip_message_t * sip, const char *hvalue);
00313   osip_from_t *osip_message_get_from (const osip_message_t * sip);
00319   int osip_message_set_mime_version (osip_message_t * sip,
00320                                      const char *hvalue);
00325   osip_mime_version_t *osip_message_get_mime_version (const osip_message_t *
00326                                                       sip);
00332   int osip_message_set_proxy_authenticate (osip_message_t * sip,
00333                                            const char *hvalue);
00340   int osip_message_get_proxy_authenticate (const osip_message_t * sip,
00341                                            int pos,
00342                                            osip_proxy_authenticate_t ** dest);
00348   int osip_message_set_proxy_authorization (osip_message_t * sip,
00349                                             const char *hvalue);
00356   int osip_message_get_proxy_authorization (const osip_message_t * sip,
00357                                             int pos,
00358                                             osip_proxy_authorization_t **
00359                                             dest);
00365   int osip_message_set_proxy_authentication_info (osip_message_t * sip,
00366                                           const char *hvalue);
00373   int osip_message_get_proxy_authentication_info (const osip_message_t * sip,
00374                                       int pos,
00375                                       osip_proxy_authentication_info_t ** dest);
00381   int osip_message_set_record_route (osip_message_t * sip,
00382                                      const char *hvalue);
00389   int osip_message_get_record_route (const osip_message_t * sip, int pos,
00390                                      osip_record_route_t ** dest);
00396   int osip_message_set_route (osip_message_t * sip, const char *hvalue);
00403   int osip_message_get_route (const osip_message_t * sip, int pos,
00404                               osip_route_t ** dest);
00410   int osip_message_set_to (osip_message_t * sip, const char *hvalue);
00415   osip_to_t *osip_message_get_to (const osip_message_t * sip);
00421   int osip_message_set_via (osip_message_t * sip, const char *hvalue);
00427   int osip_message_append_via (osip_message_t * sip, const char *hvalue);
00434   int osip_message_get_via (const osip_message_t * sip, int pos,
00435                             osip_via_t ** dest);
00441   int osip_message_set_www_authenticate (osip_message_t * sip,
00442                                          const char *hvalue);
00449   int osip_message_get_www_authenticate (const osip_message_t * sip, int pos,
00450                                          osip_www_authenticate_t ** dest);
00457   int osip_message_set_header (osip_message_t * sip, const char *hname,
00458                                const char *hvalue);
00466   int osip_message_set_topheader (osip_message_t * sip, const char *hname,
00467                                   const char *hvalue);
00468 
00476   int osip_message_header_get_byname (const osip_message_t * sip,
00477                                       const char *hname, int pos,
00478                                       osip_header_t ** dest);
00485   int osip_message_get_header (const osip_message_t * sip, int pos,
00486                                osip_header_t ** dest);
00487 
00494   int osip_message_set_body (osip_message_t * sip, const char *buf, size_t length);
00501   int osip_message_set_body_mime (osip_message_t * sip, const char *buf, size_t length);
00508   int osip_message_get_body (const osip_message_t * sip, int pos,
00509                              osip_body_t ** dest);
00510 
00511 
00512 
00513 /* trace facilities */
00514 #ifndef DOXYGEN                 /* avoid DOXYGEN warning */
00515 #ifdef ENABLE_TRACE
00516   void msg_logrequest (osip_message_t * sip, char *fmt);
00517   void msg_logresponse (osip_message_t * sip, char *fmt);
00518 #else
00519 #define msg_logrequest(P,Q) ;
00520 #define msg_logresponse(P,Q) ;
00521 #endif
00522 #endif
00523 
00529 #define osip_message_set_date(sip,value)            osip_message_set_header((osip_message_t *)sip,(const char *)"Date",value)
00530 
00536 #define osip_message_get_date(sip,pos,dest)          osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"date",pos,(osip_header_t **)dest)
00537 
00542 #define osip_message_set_encryption(sip,value)      osip_message_set_header((osip_message_t *)sip,(const char *)"Encryption",value)
00543 
00549 #define osip_message_get_encryption(sip,pos,dest)    osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"encryption",pos,(osip_header_t **)dest)
00550 
00555 #define osip_message_set_organization(sip,value)    osip_message_set_header((osip_message_t *)sip,(const char *)"Organization",value)
00556 
00562 #define osip_message_get_organization(sip,pos,dest)  osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"organization",pos,(osip_header_t **)dest)
00563 
00568 #define osip_message_set_require(sip,value)         osip_message_set_header((osip_message_t *)sip,(const char *)"Require",value)
00569 
00575 #define osip_message_get_require(sip,pos,dest)       osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"require",pos,(osip_header_t **)dest)
00576 
00581 #define osip_message_set_supported(sip,value)       osip_message_set_header((osip_message_t *)sip,(const char *)"Supported",value)
00582 
00588 #define osip_message_get_supported(sip,pos,dest)     osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"supported",pos,(osip_header_t **)dest)
00589 
00594 #define osip_message_set_timestamp(sip,value)       osip_message_set_header((osip_message_t *)sip,(const char *)"Timestamp",value)
00595 
00601 #define osip_message_get_timestamp(sip,pos,dest)     osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"timestamp",pos,(osip_header_t **)dest)
00602 
00607 #define osip_message_set_user_agent(sip,value)      osip_message_set_header((osip_message_t *)sip,(const char *)"User-Agent",value)
00608 
00614 #define osip_message_get_user_agent(sip,pos,dest)    osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"user-agent",pos,(osip_header_t **)dest)
00615 
00620 #define osip_message_set_content_language(sip,value) osip_message_set_header((osip_message_t *)sip,(const char *)"Content-Language",value)
00621 
00627 #define osip_message_get_content_language(sip,pos,dest) osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"content-language",pos,(osip_header_t **)dest)
00628 
00633 #define osip_message_set_expires(sip,value)         osip_message_set_header((osip_message_t *)sip,(const char *)"Expires",value)
00634 
00640 #define osip_message_get_expires(sip,pos,dest)       osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"expires",pos,(osip_header_t **)dest)
00641 
00646 #define osip_message_set_in_reply_to(sip,value)     osip_message_set_header((osip_message_t *)sip,(const char *)"In-Reply-To",value)
00647 
00653 #define osip_message_get_in_reply_to(sip,pos,dest)   osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"in-reply-to",pos,(osip_header_t **)dest)
00654 
00659 #define osip_message_set_max_forwards(sip,value)     osip_message_set_header((osip_message_t *)sip,(const char *)"Max-Forwards",value)
00660 
00666 #define osip_message_get_max_forwards(sip,pos,dest)   osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"max-forwards",pos,(osip_header_t **)dest)
00667 
00672 #define osip_message_set_priority(sip,value)        osip_message_set_header((osip_message_t *)sip,(const char *)"Priority",value)
00673 
00679 #define osip_message_get_priority(sip,pos,dest)      osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"priority",pos,(osip_header_t **)dest)
00680 
00685 #define osip_message_set_proxy_require(sip,value)   osip_message_set_header((osip_message_t *)sip,(const char *)"Proxy-Require",value)
00686 
00692 #define osip_message_get_proxy_require(sip,pos,dest) osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"proxy-require",pos,(osip_header_t **)dest)
00693 
00698 #define osip_message_set_response_key(sip,value)    osip_message_set_header((osip_message_t *)sip,(const char *)"Response-Key",value)
00699 
00705 #define osip_message_get_response_key(sip,pos,dest)  osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"response-key",pos,(osip_header_t **)dest)
00706 
00711 #define osip_message_set_subject(sip,value)         osip_message_set_header((osip_message_t *)sip,(const char *)"Subject",value)
00712 
00718 #define osip_message_get_subject(sip,pos,dest)       osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"subject",pos,(osip_header_t **)dest)
00719 
00724 #define osip_message_set_retry_after(sip,value)     osip_message_set_header((osip_message_t *)sip,(const char *)"Retry-After",value)
00725 
00731 #define osip_message_get_retry_after(sip,pos,dest)   osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"retry-after",pos,(osip_header_t **)dest)
00732 
00737 #define osip_message_set_server(sip,value)          osip_message_set_header((osip_message_t *)sip,(const char *)"Server",value)
00738 
00744 #define osip_message_get_server(sip,pos,dest)        osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"server",pos,(osip_header_t **)dest)
00745 
00750 #define osip_message_set_unsupported(sip,value)     osip_message_set_header((osip_message_t *)sip,(const char *)"Unsupported",value)
00751 
00757 #define osip_message_get_unsupported(sip,pos,dest)   osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"unsupported",pos,(osip_header_t **)dest)
00758 
00763 #define osip_message_set_warning(sip,value)         osip_message_set_header((osip_message_t *)sip,(const char *)"Warning",value)
00764 
00770 #define osip_message_get_warning(sip,pos,dest)       osip_message_header_get_byname(( osip_message_t *)sip,(const char *)"warning",pos,(osip_header_t **)dest)
00771 
00775 #ifdef __cplusplus
00776 }
00777 #endif
00778 
00779 #endif

Generated on Tue Feb 22 00:59:47 2005 for libosip by  doxygen 1.4.1