主要类型定义:

1、struct eXtl_protocol

struct eXtl_protocol {
int enabled; int proto_port;
char proto_name[];
char proto_ifs[];
int proto_num;
int proto_family;
int proto_secure;
int proto_reliable; int (*tl_init) (void);
int (*tl_free) (void);
int (*tl_open) (void);
int (*tl_set_fdset) (fd_set * osip_fdset, fd_set * osip_wrset, int *fd_max);
int (*tl_read_message) (fd_set * osip_fdset, fd_set * osip_wrset);
int (*tl_send_message) (osip_transaction_t * tr, osip_message_t * sip,
char *host, int port, int out_socket);
int (*tl_keepalive) (void);
int (*tl_set_socket) (int socket);
int (*tl_masquerade_contact) (const char *ip, int port);
int (*tl_get_masquerade_contact) (char *ip, int ip_size, char *port,
int port_size);
}; struct eXtl_protocol eXtl_udp = {
,
,
"UDP",
"0.0.0.0",
IPPROTO_UDP,
AF_INET,
,
, &udp_tl_init,
&udp_tl_free,
&udp_tl_open,
&udp_tl_set_fdset,
&udp_tl_read_message,
&udp_tl_send_message,
&udp_tl_keepalive,
&udp_tl_set_socket,
&udp_tl_masquerade_contact,
&udp_tl_get_masquerade_contact
}; struct eXtl_protocol eXtl_tcp = {
,
,
"TCP",
"0.0.0.0",
IPPROTO_TCP,
AF_INET,
,
, &tcp_tl_init,
&tcp_tl_free,
&tcp_tl_open,
&tcp_tl_set_fdset,
&tcp_tl_read_message,
&tcp_tl_send_message,
&tcp_tl_keepalive,
&tcp_tl_set_socket,
&tcp_tl_masquerade_contact,
&tcp_tl_get_masquerade_contact
}; struct eXtl_protocol eXtl_dtls = {
,
,
"DTLS-UDP",
"0.0.0.0",
IPPROTO_UDP,
AF_INET,
,
, &dtls_tl_init,
&dtls_tl_free,
&dtls_tl_open,
&dtls_tl_set_fdset,
&dtls_tl_read_message,
&dtls_tl_send_message,
&dtls_tl_keepalive,
&dtls_tl_set_socket,
&dtls_tl_masquerade_contact,
&dtls_tl_get_masquerade_contact
}; struct eXtl_protocol eXtl_tls = {
,
,
"TLS",
"0.0.0.0",
IPPROTO_TCP,
AF_INET,
,
, &tls_tl_init,
&tls_tl_free,
&tls_tl_open,
&tls_tl_set_fdset,
&tls_tl_read_message,
&tls_tl_send_message,
&tls_tl_keepalive,
&tls_tl_set_socket,
&tls_tl_masquerade_contact,
&tls_tl_get_masquerade_contact
};

2、typedef struct eXosip_t eXosip_t;

    struct eXosip_t {
struct eXtl_protocol *eXtl;
char transport[];
char *user_agent; eXosip_call_t *j_calls; /* my calls */
#ifndef MINISIZE
eXosip_subscribe_t *j_subscribes; /* my friends */
eXosip_notify_t *j_notifies; /* my susbscribers */
#endif
osip_list_t j_transactions; eXosip_reg_t *j_reg; /* my registrations */
#ifndef MINISIZE
eXosip_pub_t *j_pub; /* my publications */
#endif #ifdef OSIP_MT
void *j_cond;
void *j_mutexlock;
#endif osip_t *j_osip;
int j_stop_ua;
#ifdef OSIP_MT
void *j_thread;
jpipe_t *j_socketctl;
jpipe_t *j_socketctl_event;
#endif osip_fifo_t *j_events; jauthinfo_t *authinfos; int keep_alive;
int keep_alive_options;
int learn_port;
#ifndef MINISIZE
int http_port;
char http_proxy[];
char http_outbound_proxy[];
int dontsend_101;
#endif
int use_rport;
int dns_capabilities;
int dscp;
char ipv4_for_gateway[];
char ipv6_for_gateway[];
#ifndef MINISIZE
char event_package[];
#endif
struct eXosip_dns_cache dns_entries[MAX_EXOSIP_DNS_ENTRY];
struct eXosip_account_info account_entries[MAX_EXOSIP_ACCOUNT_INFO];
struct eXosip_http_auth http_auths[MAX_EXOSIP_HTTP_AUTH]; CbSipCallback cbsipCallback;
};

3、eXosip_event_t

 /**
 * Structure for event description
 * @struct eXosip_event
 */
  struct eXosip_event
  {
    eXosip_event_type_t type;               /**< type of the event */
    char textinfo[256];                     /**< text description of event */
    void *external_reference;               /**< external reference (for calls) */     osip_message_t *request;       /**< request within current transaction */
    osip_message_t *response;      /**< last response within current transaction */
    osip_message_t *ack;           /**< ack within current transaction */     int tid; /**< unique id for transactions (to be used for answers) */
    int did; /**< unique id for SIP dialogs */     int rid; /**< unique id for registration */
    int cid; /**< unique id for SIP calls (but multiple dialogs!) */
    int sid; /**< unique id for outgoing subscriptions */
    int nid; /**< unique id for incoming subscriptions */     int ss_status;  /**< current Subscription-State for subscription */
    int ss_reason;  /**< current Reason status for subscription */
  };

主要函数说明:

1、eXosip_init

/**
* Initiate the eXtented oSIP library.
*
*/
int eXosip_init (void);

2、eXosip_listen_addr

/**
* Listen on a specified socket.
*
* @param transport IPPROTO_UDP for udp. (soon to come: TCP/TLS?)
* @param addr the address to bind (NULL for all interface)
* @param port the listening port. (0 for random port)
* @param family the IP family (AF_INET or AF_INET6).
* @param secure 0 for UDP or TCP, 1 for TLS (with TCP).
*/
int eXosip_listen_addr (int transport, const char *addr, int port, int family,
int secure);

3、eXosip_execute

/**
* Process (non-threaded mode ONLY) eXosip events.
*
*/
int eXosip_execute (void);

4、eXosip_lock、eXosip_unlock

#ifdef OSIP_MT

/**
* Lock the eXtented oSIP library.
*
*/
int eXosip_lock (void); /**
* UnLock the eXtented oSIP library.
*
*/
int eXosip_unlock (void); #else

5、__eXosip_wakeup_event

/**
* Wake Up the eXosip_event_wait method.
*
*/
#ifdef OSIP_MT
void __eXosip_wakeup_event (void);
#else
#define __eXosip_wakeup_event() ;
#endif

6、eXosip_event_wait

/**
* Wait for an eXosip event.
*
* @param tv_s timeout value (seconds).
* @param tv_ms timeout value (mseconds).
*/
eXosip_event_t *eXosip_event_wait (int tv_s, int tv_ms);

aa

eXosip2代码分析的更多相关文章

  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. Jam的计数法(codevs 1140)

    题目描述 Description Jam是个喜欢标新立异的科学怪人.他不使用阿拉伯数字计数,而是使用小写英文字母计数,他觉得这样做,会使世界更加丰富多彩.在他的计数法中,每个数字的位数都是相同的(使用 ...

  2. CocoaPods报错及解决方法记录

    [!] Oh no, an error occurred. Search for existing GitHub issues similar to yours: https://github.com ...

  3. pycharm上运行django服务器端、以及创建app方法

     快来加入群[python爬虫交流群](群号570070796),发现精彩内容. 安装Django  下载Django包,解压缩. CMD 进入解压路径下. 执行:python setup.py in ...

  4. 《JavaScript高级程序设计》学习笔记

    系统学习JS, 从<JavaScript高级程序设计>入门,通过学习jQuery或者angularJS源码来进阶. 第1章 JavaScript简介 1.JS问世的目的是处理以前由服务器端 ...

  5. iOS通过ASIHTTPRequest提交JSON数据

    先验知识——什么是ASIHTTPRequest? 使用iOS SDK中的HTTP网络请求API,相当的复杂,调用很繁琐,ASIHTTPRequest就是一个对CFNetwork API进行了封装,并且 ...

  6. WPF入口Application

    1.WPF和 传统的WinForm 类似, WPF 同样需要一个 Application 来统领一些全局的行为和操作,并且每个 Domain (应用程序域)中只能有一个 Application 实例存 ...

  7. C++的那些事:const用法面面观

    一.const是什么 在 C/C++ 语言中,const关键字是一种修饰符.所谓“修饰符”,就是在编译器进行编译的过程中,给编译器一些“要求”或“提示”,但修饰符本身,并不产生任何实际代码.就 con ...

  8. 浅谈c++ new and delete or new [] and delete []

    http://www.cnblogs.com/hazir/p/new_and_delete.html 在 C++ 中,你也许经常使用 new 和 delete 来动态申请和释放内存,但你可曾想过以下问 ...

  9. Unrecognized Windows Sockets error: 0: JVM_Bind

    Unrecognized Windows Sockets error: 0: JVM_Bind [转帖]今天很是奇怪,在运行服务器端的时候,经常遇到这个异常: java.net.SocketExcep ...

  10. Xamarin.iOS模拟器调试找不到资源文件

    Xamarin.iOS模拟器调试找不到资源文件 在Visual Studio 2015中,运行Xamarin.iOS项目,出现找不到资源文件的错误.错误信息:System.IO.FileNotFoun ...