亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? osip.c

?? libosip2-3.0.3最新版本
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/*  The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)  Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@atosc.org    This library is free software; you can redistribute it and/or  modify it under the terms of the GNU Lesser General Public  License as published by the Free Software Foundation; either  version 2.1 of the License, or (at your option) any later version.    This library is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  Lesser General Public License for more details.    You should have received a copy of the GNU Lesser General Public  License along with this library; if not, write to the Free Software  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#include <osip2/internal.h>#include <osip2/osip.h>#include "fsm.h"#include "xixt.h"#ifdef OSIP_MTstatic struct osip_mutex *ict_fastmutex;static struct osip_mutex *ist_fastmutex;static struct osip_mutex *nict_fastmutex;static struct osip_mutex *nist_fastmutex;#endif#include <osip2/osip_dialog.h>#ifdef OSIP_MTstatic struct osip_mutex *ixt_fastmutex;#endifstatic int __osip_global_init (void);static void __osip_global_free (void);static int increase_ref_count (void);static void decrease_ref_count (void);static int__osip_global_init (){  /* load the fsm configuration */#ifndef MINISIZE  __ict_load_fsm ();  __ist_load_fsm ();  __nict_load_fsm ();  __nist_load_fsm ();#endif  /* load the parser configuration */  parser_init ();#ifdef OSIP_MT  ict_fastmutex = osip_mutex_init ();  ist_fastmutex = osip_mutex_init ();  nict_fastmutex = osip_mutex_init ();  nist_fastmutex = osip_mutex_init ();  ixt_fastmutex = osip_mutex_init ();#endif  return 0;}static void__osip_global_free (){#ifndef MINISIZE  __ict_unload_fsm ();  __ist_unload_fsm ();  __nict_unload_fsm ();  __nist_unload_fsm ();#endif#ifdef OSIP_MT  osip_mutex_destroy (ict_fastmutex);  osip_mutex_destroy (ist_fastmutex);  osip_mutex_destroy (nict_fastmutex);  osip_mutex_destroy (nist_fastmutex);  osip_mutex_destroy (ixt_fastmutex);#endif}voidosip_response_get_destination (osip_message_t * response, char **address,                               int *portnum){  osip_via_t *via;  char *host = NULL;  int port = 0;  via = (osip_via_t *) osip_list_get (&response->vias, 0);  if (via)    {      osip_generic_param_t *maddr;      osip_generic_param_t *received;      osip_generic_param_t *rport;      osip_via_param_get_byname (via, "maddr", &maddr);      osip_via_param_get_byname (via, "received", &received);      osip_via_param_get_byname (via, "rport", &rport);      /* 1: user should not use the provided information         (host and port) if they are using a reliable         transport. Instead, they should use the already         open socket attached to this transaction. */      /* 2: check maddr and multicast usage */      if (maddr != NULL)        host = maddr->gvalue;      /* we should check if this is a multicast address and use         set the "ttl" in this case. (this must be done in the         UDP message (not at the SIP layer) */      else if (received != NULL)        host = received->gvalue;      else        host = via->host;      if (rport == NULL || rport->gvalue == NULL)        {          if (via->port != NULL)            port = osip_atoi (via->port);          else            port = 5060;      } else        port = osip_atoi (rport->gvalue);    }  *portnum = port;  if (host != NULL)    *address = osip_strdup (host);  else    *address = NULL;}intosip_ixt_lock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_lock (ixt_fastmutex);#else  return 0;#endif}intosip_ixt_unlock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_unlock (ixt_fastmutex);#else  return 0;#endif}/* these are for transactions that would need retransmission not handled by state machines */voidosip_add_ixt (osip_t * osip, ixt_t * ixt){  /* add in list osip_t->ixt */  osip_ixt_lock (osip);  osip_list_add (&osip->ixt_retransmissions, (void *) ixt, 0);  osip_ixt_unlock (osip);}voidosip_remove_ixt (osip_t * osip, ixt_t * ixt){  int i;  int found = 0;  ixt_t *tmp;  /* add in list osip_t->ixt */  osip_ixt_lock (osip);  for (i = 0; !osip_list_eol (&osip->ixt_retransmissions, i); i++)    {      tmp = (ixt_t *) osip_list_get (&osip->ixt_retransmissions, i);      if (tmp == ixt)        {          osip_list_remove (&osip->ixt_retransmissions, i);          found = 1;          break;        }    }  osip_ixt_unlock (osip);}intixt_init (ixt_t ** ixt){  ixt_t *pixt;  *ixt = pixt = (ixt_t *) osip_malloc (sizeof (ixt_t));  if (pixt == NULL)    return -1;  pixt->dialog = NULL;  pixt->msg2xx = NULL;  pixt->ack = NULL;  pixt->interval = DEFAULT_T1;  osip_gettimeofday(&pixt->start, NULL);  add_gettimeofday(&pixt->start, pixt->interval+10);  pixt->counter = 10;  pixt->dest = NULL;  pixt->port = 5060;  pixt->sock = -1;  return 0;}voidixt_free (ixt_t * ixt){  osip_message_free (ixt->ack);  osip_message_free (ixt->msg2xx);  osip_free (ixt->dest);  osip_free (ixt);}/* usefull for UAs */voidosip_start_200ok_retransmissions (osip_t * osip, osip_dialog_t * dialog,                                  osip_message_t * msg200ok, int sock){  ixt_t *ixt;  ixt_init (&ixt);  ixt->dialog = dialog;  osip_message_clone (msg200ok, &ixt->msg2xx);  ixt->sock = sock;  osip_response_get_destination (msg200ok, &ixt->dest, &ixt->port);  osip_add_ixt (osip, ixt);}voidosip_start_ack_retransmissions (osip_t * osip, osip_dialog_t * dialog,                                osip_message_t * ack, char *dest, int port,                                int sock){  int i;  ixt_t *ixt;  i = ixt_init (&ixt);  if (i != 0)    return;  ixt->dialog = dialog;  osip_message_clone (ack, &ixt->ack);  ixt->dest = osip_strdup (dest);  ixt->port = port;  ixt->sock = sock;  osip_add_ixt (osip, ixt);}/* we stop the 200ok when receiving the corresponding ack */struct osip_dialog *osip_stop_200ok_retransmissions (osip_t * osip, osip_message_t * ack){  osip_dialog_t *dialog = NULL;  int i;  ixt_t *ixt;  osip_ixt_lock (osip);  for (i = 0; !osip_list_eol (&osip->ixt_retransmissions, i); i++)    {      ixt = (ixt_t *) osip_list_get (&osip->ixt_retransmissions, i);      if (osip_dialog_match_as_uas (ixt->dialog, ack) == 0)        {          osip_list_remove (&osip->ixt_retransmissions, i);          dialog = ixt->dialog;          ixt_free (ixt);          break;        }    }  osip_ixt_unlock (osip);  return dialog;}/* when a dialog is destroyed by the application,   it is safer to remove all ixt that are related to it */voidosip_stop_retransmissions_from_dialog (osip_t * osip, osip_dialog_t * dialog){  int i;  ixt_t *ixt;  osip_ixt_lock (osip);  for (i = 0; !osip_list_eol (&osip->ixt_retransmissions, i); i++)    {      ixt = (ixt_t *) osip_list_get (&osip->ixt_retransmissions, i);      if (ixt->dialog == dialog)        {          osip_list_remove (&osip->ixt_retransmissions, i);          ixt_free (ixt);          i--;        }    }  osip_ixt_unlock (osip);}voidixt_retransmit (osip_t * osip, ixt_t * ixt, struct timeval *current){  if (osip_timercmp(current, &ixt->start, >))    {      ixt->interval = ixt->interval * 2;      if (ixt->interval > 4000)         ixt->interval = 4000;      add_gettimeofday (&ixt->start, ixt->interval);      if (ixt->ack != NULL)        osip->cb_send_message (NULL, ixt->ack, ixt->dest, ixt->port, ixt->sock);      else if (ixt->msg2xx != NULL)        osip->cb_send_message (NULL, ixt->msg2xx, ixt->dest, ixt->port, ixt->sock);      ixt->counter--;    }}voidosip_retransmissions_execute (osip_t * osip){  int i;  ixt_t *ixt;  struct timeval current;  osip_gettimeofday (&current, NULL);  osip_ixt_lock (osip);  for (i = 0; !osip_list_eol (&osip->ixt_retransmissions, i); i++)    {      ixt = (ixt_t *) osip_list_get (&osip->ixt_retransmissions, i);      ixt_retransmit (osip, ixt, &current);      if (ixt->counter == 0)        {          /* remove it */          osip_list_remove (&osip->ixt_retransmissions, i);          ixt_free (ixt);          i--;        }    }  osip_ixt_unlock (osip);}intosip_ict_lock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_lock (ict_fastmutex);#else  return 0;#endif}intosip_ict_unlock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_unlock (ict_fastmutex);#else  return 0;#endif}intosip_ist_lock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_lock (ist_fastmutex);#else  return 0;#endif}intosip_ist_unlock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_unlock (ist_fastmutex);#else  return 0;#endif}intosip_nict_lock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_lock (nict_fastmutex);#else  return 0;#endif}intosip_nict_unlock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_unlock (nict_fastmutex);#else  return 0;#endif}intosip_nist_lock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_lock (nist_fastmutex);#else  return 0;#endif}intosip_nist_unlock (osip_t * osip){#ifdef OSIP_MT  return osip_mutex_unlock (nist_fastmutex);#else  return 0;#endif}#if defined(HAVE_DICT_DICT_H)#define HSIZE           200unsigned s_hash (const unsigned char *p);unsigneds_hash (const unsigned char *p){  unsigned hash = 0;  while (*p)    {      hash *= 31;      hash ^= *p++;    }  return hash;}#endifint__osip_add_ict (osip_t * osip, osip_transaction_t * ict){#ifdef OSIP_MT  osip_mutex_lock (ict_fastmutex);#endif#if defined(HAVE_DICT_DICT_H)  {    osip_generic_param_t *b_request = NULL;    int rv = -99;    osip_via_param_get_byname (ict->topvia, "branch", &b_request);    if (b_request != NULL && b_request->gvalue != NULL)      rv = dict_insert (osip->osip_ict_hastable,                        b_request->gvalue, (void *) ict, FALSE);#if 0    else      rv = dict_insert (osip->osip_ict_hastable,                        b_request->gvalue, (void *) ict, FALSE);#endif    if (rv == 0)      {        OSIP_TRACE (osip_trace                    (__FILE__, __LINE__, OSIP_INFO1, NULL,                     "New key inserted in ict hastable `%s'\n",                     b_request->gvalue));    } else if (rv != -99)      {        OSIP_TRACE (osip_trace                    (__FILE__, __LINE__, OSIP_WARNING, NULL,                     "already inserted `%s'\n", b_request->gvalue));      }  }#endif  osip_list_add (&osip->osip_ict_transactions, ict, -1);#ifdef OSIP_MT  osip_mutex_unlock (ict_fastmutex);#endif  return 0;}int__osip_add_ist (osip_t * osip, osip_transaction_t * ist){#ifdef OSIP_MT  osip_mutex_lock (ist_fastmutex);#endif#if defined(HAVE_DICT_DICT_H)  {    osip_generic_param_t *b_request = NULL;    int rv = -99;    osip_via_param_get_byname (ist->topvia, "branch", &b_request);    if (b_request != NULL && b_request->gvalue != NULL)      rv = dict_insert (osip->osip_ist_hastable,                        b_request->gvalue, (void *) ist, FALSE);    else#if 0      rv = dict_insert (osip->osip_ist_hastable,                        b_request->gvalue, (void *) ist, FALSE);#endif    if (rv == 0)      {        OSIP_TRACE (osip_trace                    (__FILE__, __LINE__, OSIP_INFO1, NULL,                     "New key inserted in ist hastable `%s'\n",                     b_request->gvalue));    } else if (rv != -99)      {        OSIP_TRACE (osip_trace                    (__FILE__, __LINE__, OSIP_WARNING, NULL,                     "already inserted `%s'\n", b_request->gvalue));      }  }#endif  osip_list_add (&osip->osip_ist_transactions, ist, -1);#ifdef OSIP_MT  osip_mutex_unlock (ist_fastmutex);#endif  return 0;}int__osip_add_nict (osip_t * osip, osip_transaction_t * nict){#ifdef OSIP_MT  osip_mutex_lock (nict_fastmutex);#endif#if defined(HAVE_DICT_DICT_H)  {    osip_generic_param_t *b_request = NULL;    int rv = -99;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美国av一区二区| 日本不卡视频在线| 国产在线视频不卡二| 色婷婷av一区二区三区大白胸| 欧美一区二区三区在线观看视频| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 日韩成人午夜电影| 在线观看亚洲精品视频| 中文字幕成人av| 国产一区二区在线看| 欧美另类z0zxhd电影| 亚洲欧美色综合| 成人午夜看片网址| 亚洲精品在线免费观看视频| 午夜欧美一区二区三区在线播放| 一本大道综合伊人精品热热| 欧美激情一区二区在线| 国内精品免费**视频| 91精品国产欧美一区二区| 亚洲综合一区二区三区| 91丨porny丨中文| 国产精品久久久久一区二区三区 | 日韩限制级电影在线观看| 亚洲精品免费一二三区| 99久久国产免费看| 国产精品美女www爽爽爽| 国产一区二区不卡在线| 日韩精品一区二区三区老鸭窝| 日韩激情中文字幕| 欧美精品久久一区| 五月激情综合婷婷| 欧美日韩大陆在线| 五月激情综合网| 宅男在线国产精品| 日韩精品视频网站| 91精品国产乱| 免费在线一区观看| 日韩午夜激情av| 蜜桃视频在线一区| 日韩欧美亚洲一区二区| 精品一区二区三区的国产在线播放| 欧美一区2区视频在线观看| 日韩高清一区二区| 欧美va亚洲va香蕉在线| 九色porny丨国产精品| 精品国产凹凸成av人网站| 国内久久婷婷综合| 欧美激情综合网| 91一区一区三区| 一区二区在线观看免费| 欧美日韩一区在线| 视频一区在线播放| 日韩你懂的在线播放| 激情五月播播久久久精品| 久久精品男人天堂av| 成人午夜免费电影| 一区二区在线观看视频| 99re热视频这里只精品| 亚洲一区二区三区四区的| 555夜色666亚洲国产免| 麻豆精品新av中文字幕| 久久九九久精品国产免费直播| 懂色av中文一区二区三区| 亚洲日本韩国一区| 欧美精品久久一区二区三区| 精品一区二区在线观看| 欧美高清在线视频| 91蜜桃在线观看| 日韩成人伦理电影在线观看| 精品成人在线观看| 99久久婷婷国产综合精品电影 | 国产精品免费视频一区| 色呦呦网站一区| 免费观看在线综合色| 久久久国产综合精品女国产盗摄| 成人国产精品免费观看视频| 亚洲午夜日本在线观看| 欧美一区二区三区影视| 国产成人免费网站| 一区二区三区高清| 欧美mv日韩mv| 91视频国产观看| 秋霞av亚洲一区二区三| 国产精品水嫩水嫩| 欧美精品亚洲二区| 国产成人精品午夜视频免费| 一区二区三区精品视频在线| 日韩免费视频一区二区| 91色综合久久久久婷婷| 男人的j进女人的j一区| 欧美国产日韩亚洲一区| 欧美日韩国产色站一区二区三区| 精品一区二区三区香蕉蜜桃| 亚洲视频一区二区在线| 欧美一区二区三区免费| aaa国产一区| 久久国产精品区| 亚洲激情图片小说视频| 久久综合成人精品亚洲另类欧美| 91麻豆高清视频| 国模少妇一区二区三区| 亚洲午夜免费福利视频| 国产精品美女久久久久久2018| 91精品国产高清一区二区三区| av网站一区二区三区| 六月丁香综合在线视频| 亚洲精品视频一区二区| 亚洲va欧美va国产va天堂影院| 久久精品亚洲乱码伦伦中文 | 成人午夜av电影| 视频在线观看91| 亚洲欧美另类小说| 国产日韩视频一区二区三区| 欧美乱妇一区二区三区不卡视频| av电影在线观看不卡| 国产中文字幕精品| 日韩在线卡一卡二| 亚洲综合免费观看高清在线观看| 国产网站一区二区| 日韩一级成人av| 欧美日韩国产小视频在线观看| av一二三不卡影片| 国产精品亚洲一区二区三区妖精| 日本成人在线看| 亚洲自拍偷拍综合| 亚洲少妇最新在线视频| 国产欧美综合在线观看第十页| 日韩欧美在线观看一区二区三区| 日本大香伊一区二区三区| 成人免费视频caoporn| 国产一区二区美女| 六月丁香婷婷久久| 日本不卡视频在线观看| 亚洲成人av一区二区| 一区二区三区高清不卡| 亚洲日本在线看| 欧美极品xxx| 国产午夜精品在线观看| 精品99久久久久久| 精品久久免费看| 欧美电影免费观看高清完整版| 欧美狂野另类xxxxoooo| 欧美三区免费完整视频在线观看| 日本韩国精品在线| 91在线精品一区二区| 99久久精品国产毛片| 丁香六月综合激情| 粉嫩aⅴ一区二区三区四区五区| 国产精品1024久久| 成人免费视频一区二区| 粉嫩av一区二区三区| 成人黄色小视频在线观看| 国产69精品一区二区亚洲孕妇| 国产一区 二区| 国产精品香蕉一区二区三区| 国产suv精品一区二区6| 国产精品18久久久| 成人爱爱电影网址| 99精品久久久久久| 在线精品国精品国产尤物884a| 在线视频中文字幕一区二区| 欧美午夜影院一区| 欧美在线播放高清精品| 精品视频一区三区九区| 91精品国产综合久久福利软件| 91精品国产全国免费观看| 日韩免费高清视频| 久久久不卡网国产精品一区| 国产欧美一区视频| 亚洲三级在线看| 亚洲美女偷拍久久| 亚洲国产精品影院| 日本不卡中文字幕| 国产成人在线观看免费网站| 成人午夜av电影| 欧美在线你懂的| 91精品一区二区三区久久久久久| 欧美成人国产一区二区| 久久久久久久久久久黄色| 国产精品久99| 亚洲国产精品一区二区久久恐怖片| 视频一区二区三区入口| 经典一区二区三区| fc2成人免费人成在线观看播放| 色av一区二区| 日韩午夜激情av| 国产精品女同一区二区三区| 亚洲一区二区av电影| 久久精品99国产国产精| 成人午夜电影网站| 欧美亚洲动漫精品| 精品国产青草久久久久福利| 国产精品免费视频观看| 午夜精品在线看| 国产精品亚洲专一区二区三区| 色哟哟在线观看一区二区三区| 日韩欧美在线网站| 自拍av一区二区三区| 日韩av中文字幕一区二区| 丰满少妇久久久久久久|