⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 osip_parser.h

📁 SIP协议栈实现
💻 H
📖 第 1 页 / 共 2 页
字号:
 * Get the To header. * @param sip The element to work on. */  osip_to_t *osip_message_get_to (const osip_message_t * sip);/** * Set the Via header. * @param sip The element to work on. * @param hvalue The string describing the element. */  int osip_message_set_via (osip_message_t * sip, const char *hvalue);/** * Get one Via header. * @param sip The element to work on. * @param pos The index of the element to get. * @param dest A pointer on the header found. */  int osip_message_get_via (const osip_message_t * sip, int pos, osip_via_t ** dest);/** * Set the Www-authenticate header. * @param sip The element to work on. * @param hvalue The string describing the element. */  int osip_message_set_www_authenticate (osip_message_t * sip, const char *hvalue);/** * Get one Www-authenticate header. * @param sip The element to work on. * @param pos The index of the element to get. * @param dest A pointer on the header found. */  int osip_message_get_www_authenticate (const osip_message_t * sip, int pos,			       osip_www_authenticate_t ** dest);/** * Allocate and Add an "unknown" header (not defined in oSIP). * @param sip The element to work on. * @param hname The token name. * @param hvalue The token value. */  int osip_message_set_header (osip_message_t * sip, const char *hname,		     const char *hvalue);/** * Allocate and Add an "unknown" header (not defined in oSIP). * The element is add on the top of the unknown header list.  * @param sip The element to work on. * @param hname The token name. * @param hvalue The token value. */  int osip_message_set_topheader (osip_message_t * sip, const char *hname,			const char *hvalue);/** * Find an "unknown" header. (not defined in oSIP) * @param sip The element to work on. * @param hname The name of the header to find. * @param pos The index where to start searching for the header. * @param dest A pointer to the header found. */  int osip_message_header_get_byname (const osip_message_t * sip, const char *hname, int pos,			    osip_header_t ** dest);/** * Get one "unknown" header. * @param sip The element to work on. * @param pos The index of the element to get. * @param dest A pointer on the header found. */  int osip_message_get_header (const osip_message_t * sip, int pos, osip_header_t ** dest);/** * Set the Body of the SIP message. * @param sip The element to work on. * @param buf The string containing the body. */  int osip_message_set_body (osip_message_t * sip, const char *buf);/** * Set a type for a body. (NOT TESTED! use with care) * @param sip The element to work on. * @param buf the mime type of body. */  int osip_message_set_body_mime (osip_message_t * sip, const char *buf);/** * Get one body header. * @param sip The element to work on. * @param pos The index of the element to get. * @param dest A pointer on the body found. */  int osip_message_get_body (const osip_message_t * sip, int pos, osip_body_t ** dest);/* trace facilities */#ifndef DOXYGEN			/* avoid DOXYGEN warning */#ifdef ENABLE_TRACE  void msg_logrequest (osip_message_t * sip, char *fmt);  void msg_logresponse (osip_message_t * sip, char *fmt);#else  #define msg_logrequest(P,Q) ;  #define msg_logresponse(P,Q) ;#endif#endif/** * Allocate and Add a new Date header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_date(sip,value)            osip_message_set_header((osip_message_t *)sip,(const char *)"Date",value)/** * Find a Date header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Encryption header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_encryption(sip,value)      osip_message_set_header((osip_message_t *)sip,(const char *)"Encryption",value)/** * Find an Encryption header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Organization header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_organization(sip,value)    osip_message_set_header((osip_message_t *)sip,(const char *)"Organization",value)/** * Find an Organization header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Require header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_require(sip,value)         osip_message_set_header((osip_message_t *)sip,(const char *)"Require",value)/** * Find a Require header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Supported header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_supported(sip,value)       osip_message_set_header((osip_message_t *)sip,(const char *)"Supported",value)/** * Find a Supported header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Timestamp header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_timestamp(sip,value)       osip_message_set_header((osip_message_t *)sip,(const char *)"Timestamp",value)/** * Find a Timestamp header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new User-Agent header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_user_agent(sip,value)      osip_message_set_header((osip_message_t *)sip,(const char *)"User-Agent",value)/** * Find a User-Agent header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Content-Language header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_content_language(sip,value) osip_message_set_header((osip_message_t *)sip,(const char *)"Content-Language",value)/** * Find a Content-Language header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Expires header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_expires(sip,value)         osip_message_set_header((osip_message_t *)sip,(const char *)"Expires",value)/** * Find a Expires header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new In-Reply-To header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_in_reply_to(sip,value)     osip_message_set_header((osip_message_t *)sip,(const char *)"In-Reply-To",value)/** * Find a In-Reply-To header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Max-Forward header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_max_forwards(sip,value)     osip_message_set_header((osip_message_t *)sip,(const char *)"Max-Forwards",value)/** * Find a Max-Forward header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Priority header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_priority(sip,value)        osip_message_set_header((osip_message_t *)sip,(const char *)"Priority",value)/** * Find a Priority header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Proxy-Require header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_proxy_require(sip,value)   osip_message_set_header((osip_message_t *)sip,(const char *)"Proxy-Require",value)/** * Find a Proxy-Require header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Response-Key header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_response_key(sip,value)    osip_message_set_header((osip_message_t *)sip,(const char *)"Response-Key",value)/** * Find a Response-Key header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Subject header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_subject(sip,value)         osip_message_set_header((osip_message_t *)sip,(const char *)"Subject",value)/** * Find a Subject header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Retry-After header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_retry_after(sip,value)     osip_message_set_header((osip_message_t *)sip,(const char *)"Retry-After",value)/** * Find a Retry-After header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Server header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_server(sip,value)          osip_message_set_header((osip_message_t *)sip,(const char *)"Server",value)/** * Find a Server header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Unsupported header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_unsupported(sip,value)     osip_message_set_header((osip_message_t *)sip,(const char *)"Unsupported",value)/** * Find a Unsupported header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** * Allocate and Add a new Warning header. * @param sip The element to work on. * @param value the value of the new header. */#define osip_message_set_warning(sip,value)         osip_message_set_header((osip_message_t *)sip,(const char *)"Warning",value)/** * Find a Warning header. * @param sip The element to work on. * @param pos The index of the header in the list of unknown header. * @param dest A pointer on the element found. */#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)/** @} */#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -