主要类型定义:

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 代码分析的更多相关文章

  1. Android代码分析工具lint学习

    1 lint简介 1.1 概述 lint是随Android SDK自带的一个静态代码分析工具.它用来对Android工程的源文件进行检查,找出在正确性.安全.性能.可使用性.可访问性及国际化等方面可能 ...

  2. pmd静态代码分析

    在正式进入测试之前,进行一定的静态代码分析及code review对代码质量及系统提高是有帮助的,以上为数据证明 Pmd 它是一个基于静态规则集的Java源码分析器,它可以识别出潜在的如下问题:– 可 ...

  3. [Asp.net 5] DependencyInjection项目代码分析-目录

    微软DI文章系列如下所示: [Asp.net 5] DependencyInjection项目代码分析 [Asp.net 5] DependencyInjection项目代码分析2-Autofac [ ...

  4. [Asp.net 5] DependencyInjection项目代码分析4-微软的实现(5)(IEnumerable<>补充)

    Asp.net 5的依赖注入注入系列可以参考链接: [Asp.net 5] DependencyInjection项目代码分析-目录 我们在之前讲微软的实现时,对于OpenIEnumerableSer ...

  5. 完整全面的Java资源库(包括构建、操作、代码分析、编译器、数据库、社区等等)

    构建 这里搜集了用来构建应用程序的工具. Apache Maven:Maven使用声明进行构建并进行依赖管理,偏向于使用约定而不是配置进行构建.Maven优于Apache Ant.后者采用了一种过程化 ...

  6. STM32启动代码分析 IAR 比较好

    stm32启动代码分析 (2012-06-12 09:43:31) 转载▼     最近开始使用ST的stm32w108芯片(也是一款zigbee芯片).开始看他的启动代码看的晕晕呼呼呼的. 还好在c ...

  7. 常用 Java 静态代码分析工具的分析与比较

    常用 Java 静态代码分析工具的分析与比较 简介: 本文首先介绍了静态代码分析的基 本概念及主要技术,随后分别介绍了现有 4 种主流 Java 静态代码分析工具 (Checkstyle,FindBu ...

  8. SonarQube-5.6.3 代码分析平台搭建使用

    python代码分析 官网主页: http://docs.sonarqube.org/display/PLUG/Python+Plugin Windows下安装使用: 快速使用: 1.下载jdk ht ...

  9. angular代码分析之异常日志设计

    angular代码分析之异常日志设计 错误异常是面向对象开发中的记录提示程序执行问题的一种重要机制,在程序执行发生问题的条件下,异常会在中断程序执行,同时会沿着代码的执行路径一步一步的向上抛出异常,最 ...

随机推荐

  1. poj 1170

    很高兴,这道题刚编译成功提交就AC了. 简单的多重背包,标算估计是5.6维动规.其实可以通过6进制压成一维.判定是一个特价方式是否可行只需自己推一下就行了,很简单(对应位上的数目标不小于特价所需条件) ...

  2. WPF 线程 Dispatcher

    WPF 应用程序从两个线程开始: 一个用于处理呈现 一个用于管理 UI 呈现线程有效地隐藏在后台运行,而UI线程则接收输入.处理事件.绘制屏幕以及运行应用程序代码. 大多数应用程序都使用一个 UI 线 ...

  3. mysql状态取反(0变1,1变0)

    如果要改变status状态 update   table_name   status=ABS(status-1);   //取绝对值 则0-->1   1-->0

  4. java学习第四天 类和变量

    java也属于面向对象的编程 面向对象的三大特征:  封装 继承 多态 类 对象 对象:真实存在的唯一的事物 面向对象编程(oop)思想力图使对计算机语言中的事物的描述和自然界中的事物尽可能保持一致 ...

  5. React学习笔记-3-非dom属性介绍

    非dom属性?dangerouslySetInnerHTML,ref,key非dom标准属性,也就是说dom标准里面没有规定的属性,react引入了三个非dom属性,如上.dangerouslySet ...

  6. October 24th Week 44th Monday 2016

    True love stories never have endings. 真正的爱情故事永远没有结局. It seems I have been customed to the single lif ...

  7. ios原声音频播放AVAudioSession 总结

    //音频播放/*英译:record:录音 */ 1 导入头文件#import<AVFoundation/AVFoundation.h>//AVAudioSession是一个单例模式.在IO ...

  8. iOS 编码转换

    - (NSString *)SaveFileToDocuments:(NSString *)url { // NSString *url = @"http://172.28.250.70/a ...

  9. 【Java EE 学习 33 上】【JQuery样式操作】【JQuery中的Ajax操作】【JQuery中的XML操作】

    一.JQuery中样式的操作 1.给id=mover的div采用属性增加样式.one $("#b1").click(function(){ $("#mover" ...

  10. 算法系列:FFT 002

    转载自http://blog.jobbole.com/58246/ 快速傅里叶变换(Fast Fourier Transform)是信号处理与数据分析领域里最重要的算法之一.没有正规计算机科学课程背景 ...