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代码分析之异常日志设计 错误异常是面向对象开发中的记录提示程序执行问题的一种重要机制,在程序执行发生问题的条件下,异常会在中断程序执行,同时会沿着代码的执行路径一步一步的向上抛出异常,最 ...
随机推荐
- Android-做个性化的进度条
1.案例效果图 2.准备素材 progress1.png(78*78) progress2.png(78*78) ...
- linux c 笔记-3 c语言基础知识
关键字 数据类型: 简单(7):int long short float double char enum 复杂(2):struct union 类型修饰符(8):auto unsigned sign ...
- 告别我的OI生涯
本文章写于2008年12月15日. 随着2008noip的结束,我也结束了我的OI生涯. 信息竞赛也许是从小到大让我最最努力的一件事.我记得参加2006noip初赛前,每天中午为了上信息课都吃不上中午 ...
- UIImage加载本地图片的两种方式
UIImage加载图片方式一般有两种: (1)imagedNamed初始化:默认加载图片成功后会内存中缓存图片,这个方法用一个指定的名字在系统缓存中查找并返回一个图片对象.如果缓存中没有找到相应的图片 ...
- PHP面向对象讲解
面向对象 类<------>对象 面向对象例题 理解: 减少 变量的重新定义 比如 变量前的 var $ 思路更加明确 class Yuan ----后面不加() ...
- .NET LINQ 筛选数据
筛选数据 筛选指将结果集限制为只包含那些满足指定条件的元素的操作. 它又称为选择. 方法 方法名 说明 C# 查询表达式语法 Visual Basic 查询表达式语法 更多信息 OfType ...
- 全选、取消、2级 checkbox的选中切换
需求:点击父级checkbox的时候,子级出现全选或全取消:点击子级时,如:子级都是在未选中时,点击某一个子级,则父级选中:如:子级中只有一个选中状态(其他子级都是未选中),点击该子级,则父级也改为未 ...
- 【Java EE 学习 48】【Hibernate学习第五天】【抓取策略】【二级缓存】【HQL】
一.抓取策略. 1.hibernate中提供了三种抓取策略. (1)连接抓取(Join Fetch):这种抓取方式是默认的抓取方式.使用这种抓取方式hibernate会在select中内连接的方式获取 ...
- 利用python的双向队列(Deque)数据结构实现回文检测的算法
#!/usr/bin/env python # -*- coding: utf-8 -*- # learn <<Problem Solving with Algorithms and Da ...
- Linux下安装JDK多种方式
一.环境说明: 操作系统:Linux xx- -.el6.x86_64 # SMP Thu Jul :: UTC x86_64 x86_64 x86_64 GNU/Linux jdk版本:java-- ...