主要类型定义:

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. touch移动触屏滑动事件

    移动端触屏滑动的效果其实就是图片轮播,在PC的页面上很好实现,绑定click和mouseover等事件来完成.但是在移动设备上,要实现这种轮播的效果,就需要用到核心的touch事件.处理touch事件 ...

  2. 【Python基础学习四】字符串(string)

    Python 字符串 字符串是 Python 中最常用的数据类型.可以使用引号('或")来创建字符串. 创建字符串很简单,只要为变量分配一个值即可.例如: var1 = 'hello' va ...

  3. python file

    >>> help(open) Help on built-in function open in module __builtin__: open(...) open(name[, ...

  4. python基础五

    列表生成式 将列表data=[1,2,3]里的元素都乘2 方法一 data=[1,2,3] for index,i in enumerate(data): data[index] *=2 print( ...

  5. 调整 ANTD 组件菜单的字体大小。

    调整 ANTD 组件菜单的字体大小:经过多次试验,原有字体太小,只有12px,通过下列CSS 强制加大. 1.分组子菜单(标题) .ant-menu-inline > .ant-menu-sub ...

  6. spring aop 环绕通知around和其他通知的区别

    前言: spring 的环绕通知和前置通知,后置通知有着很大的区别,主要有两个重要的区别: 1) 目标方法的调用由环绕通知决定,即你可以决定是否调用目标方法,而前置和后置通知   是不能决定的,他们只 ...

  7. Select标签下拉列表二级联动级联

    首先从服务器端,绑定下拉列表,二级下拉的text命名按照一定规则加上一级下拉的ID. var options=new Array(); $(document).ready(function(){ // ...

  8. WCF X.509验证

    1.证书的制作 makecert.exe -sr LocalMachine -ss My -a sha1 -n CN=ParkingServer -sky exchange -pe makecert. ...

  9. Git配置姓名和邮箱问题

    今天在安装Git for windows完成后,配置姓名和邮箱.按照廖雪峰老师的步骤,在开始菜单里找到"Git"->"Git Bash",单击后并没有跳出 ...

  10. Win10 Build9926 更新问题解决

    将Dns 改为 4.2.2.2 备用 4.2.2.1