osip2 代码分析
主要类型定义:
1、osip_t
/**
* Structure for osip handling.
* In order to use osip, you have to manage at least one global instance
* of an osip_t element. Then, you'll register a set of required callbacks
* and a set of optional ones.
* @var osip_t
*/
typedef struct osip osip_t; /**
* Structure for osip handling.
* @struct osip
*/
struct osip { void *application_context;
/**< User defined Pointer */ /* list of transactions for ict, ist, nict, nist */
osip_list_t osip_ict_transactions;
/**< list of ict transactions */
osip_list_t osip_ist_transactions;
/**< list of ist transactions */
osip_list_t osip_nict_transactions;
/**< list of nict transactions */
osip_list_t osip_nist_transactions;
/**< list of nist transactions */ osip_list_t ixt_retransmissions;/**< list of ixt elements */ osip_message_cb_t msg_callbacks[OSIP_MESSAGE_CALLBACK_COUNT]; /**@internal */
osip_kill_transaction_cb_t kill_callbacks[OSIP_KILL_CALLBACK_COUNT];
/**@internal */
osip_transport_error_cb_t
tp_error_callbacks[OSIP_TRANSPORT_ERROR_CALLBACK_COUNT];
/**@internal */ int (*cb_send_message) (osip_transaction_t *, osip_message_t *, char *,
int, int);
/**@internal */ #if defined(HAVE_DICT_DICT_H)
dict *osip_ict_hastable; /**< htable of ict transactions */
dict *osip_ist_hastable; /**< htable of ist transactions */
dict *osip_nict_hastable; /**< htable of nict transactions */
dict *osip_nist_hastable; /**< htable of nist transactions */
#endif
}; 注意:
、ict, ist, nict, nist是osip的四种状态机
2、osip_fsm_type_t
/**
* Enumeration for transaction type.
* A transaction can be either of:
* ICT,
* IST,
* NICT,
* NIST,
*/
typedef enum osip_fsm_type_t {
ICT,
/**< Invite Client (outgoing) Transaction */
IST,
/**< Invite Server (incoming) Transaction */
NICT,
/**< Non-Invite Client (outgoing) Transaction */
NIST
/**< Non-Invite Server (incoming) Transaction */
} osip_fsm_type_t;
主要函数定义:
1、osip 4中状态机ict, ist, nict, nist事务处理核心函数osip_*_execute:
/**
* Consume ALL pending osip_event_t previously added in the fifos of ict transactions.
* @param osip The element to work on.
*/
int osip_ict_execute(osip_t * osip);
/**
* Consume ALL pending osip_event_t previously added in the fifos of ist transactions.
* @param osip The element to work on.
*/
int osip_ist_execute(osip_t * osip);
/**
* Consume ALL pending osip_event_t previously added in the fifos of nict transactions.
* @param osip The element to work on.
*/
int osip_nict_execute(osip_t * osip);
/**
* Consume ALL pending osip_event_t previously added in the fifos of nist transactions.
* @param osip The element to work on.
*/
int osip_nist_execute(osip_t * osip);
2、osip_timers_gettimeout
/**
* Retreive the minimum timer value to be used by an application
* so that the osip_timer_*_execute method don't have to be called
* often.
*
* @param osip The element to work on.
* @param lower_tv The minimum timer when the application should wake up.
*/
void osip_timers_gettimeout(osip_t * osip, struct timeval *lower_tv);
3、osip_timers_*_execute
/**
* Check if an ict transactions needs a timer event.
* @param osip The element to work on.
*/
void osip_timers_ict_execute(osip_t * osip);
/**
* Check if an ist transactions needs a timer event.
* @param osip The element to work on.
*/
void osip_timers_ist_execute(osip_t * osip);
/**
* Check if a nict transactions needs a timer event.
* @param osip The element to work on.
*/
void osip_timers_nict_execute(osip_t * osip);
/**
* Check if a nist transactions needs a timer event.
* @param osip The element to work on.
*/
void osip_timers_nist_execute(osip_t * osip);
aa
osip_fsm_type_t
osip2 代码分析的更多相关文章
- Android代码分析工具lint学习
1 lint简介 1.1 概述 lint是随Android SDK自带的一个静态代码分析工具.它用来对Android工程的源文件进行检查,找出在正确性.安全.性能.可使用性.可访问性及国际化等方面可能 ...
- pmd静态代码分析
在正式进入测试之前,进行一定的静态代码分析及code review对代码质量及系统提高是有帮助的,以上为数据证明 Pmd 它是一个基于静态规则集的Java源码分析器,它可以识别出潜在的如下问题:– 可 ...
- [Asp.net 5] DependencyInjection项目代码分析-目录
微软DI文章系列如下所示: [Asp.net 5] DependencyInjection项目代码分析 [Asp.net 5] DependencyInjection项目代码分析2-Autofac [ ...
- [Asp.net 5] DependencyInjection项目代码分析4-微软的实现(5)(IEnumerable<>补充)
Asp.net 5的依赖注入注入系列可以参考链接: [Asp.net 5] DependencyInjection项目代码分析-目录 我们在之前讲微软的实现时,对于OpenIEnumerableSer ...
- 完整全面的Java资源库(包括构建、操作、代码分析、编译器、数据库、社区等等)
构建 这里搜集了用来构建应用程序的工具. Apache Maven:Maven使用声明进行构建并进行依赖管理,偏向于使用约定而不是配置进行构建.Maven优于Apache Ant.后者采用了一种过程化 ...
- STM32启动代码分析 IAR 比较好
stm32启动代码分析 (2012-06-12 09:43:31) 转载▼ 最近开始使用ST的stm32w108芯片(也是一款zigbee芯片).开始看他的启动代码看的晕晕呼呼呼的. 还好在c ...
- 常用 Java 静态代码分析工具的分析与比较
常用 Java 静态代码分析工具的分析与比较 简介: 本文首先介绍了静态代码分析的基 本概念及主要技术,随后分别介绍了现有 4 种主流 Java 静态代码分析工具 (Checkstyle,FindBu ...
- SonarQube-5.6.3 代码分析平台搭建使用
python代码分析 官网主页: http://docs.sonarqube.org/display/PLUG/Python+Plugin Windows下安装使用: 快速使用: 1.下载jdk ht ...
- angular代码分析之异常日志设计
angular代码分析之异常日志设计 错误异常是面向对象开发中的记录提示程序执行问题的一种重要机制,在程序执行发生问题的条件下,异常会在中断程序执行,同时会沿着代码的执行路径一步一步的向上抛出异常,最 ...
随机推荐
- 在vs中char类型的实参与LPCWSTR类型的形参类型不兼容怎么解决?
今天在做 COS脚本解释器的时候,遇到了这个问题 先了解一下 LPCTCHAR 这个东东 LPCTSTR用来表示你的字符是否使用UNICODE, 如果你的程序定义了UNICODE或者其他相关的宏,那么 ...
- 一个国家专利查询demo
写了一下午,借鉴apache的 httpclient 源码 调用 写的,拿出来分享一下,可以用作其他不同平台的项目post/get数据上面. package cn.shb.test; import o ...
- POI导出excel日期格式
参考帖子: [1]http://www.ithao123.cn/content-2028409.html [2]http://javacrazyer.iteye.com/blog/894850 再读本 ...
- Unity3D LuaComponent(基于ulua)
LuaComponent可以支持配一个需要执行在这个gameObject上的lua脚本,并且每个gameObject上的lua都是一个实例 using UnityEngine; using LuaIn ...
- Ubuntu 14.4 配置
1.安装 Orcal Java 使用下面的命令安装,只需一些时间,它就会下载许多的文件,所及你要确保你的网络环境良好: sudo add-apt-repository ppa:webupd8team/ ...
- 自动换行 lable换行 div换行 span换行 label换行
label word-break: break-all; white-space: normal;
- SqlServer性能检测和优化工具使用详细(转)
转载链接:http://www.cnblogs.com/knowledgesea/p/3683505.html 工具概要 如果你的数据库应用系统中,存在有大量表,视图,索引,触发器,函数,存储过程,s ...
- 注解:【基于主键的】Hibernate1->1关联
参考:http://blog.sina.com.cn/s/blog_674b23220100hjb5.html Husband.java package org.crazyit.app.domain; ...
- dcraw源码解析
dcraw源码解析 Author:Maddock Date:2015-04-22 转载请注明出处: 首先吐槽一点: 程序中使用了相当多的全局变量, 看的人头大.全局变量的坏处参看 http://wen ...
- TodoMVC中的Backbone+MarionetteJS+RequireJS例子源码分析之三 Views
这个版本的TodoMVC中的视图组织划分比较细,更加易于理解,这也得益于Marionette为我们带来了丰富的视图选择,原生的backbone只有views,而Marionette则有itemview ...