samba开发篇—general purpose库(top_level)
samba 是由source3,source4,top_level,Infrastructure components,Autogenerated code组成,本章主要是分析top_level下的General purpose库(lib)分析,由于samba下的虽然架构,层次清晰,但是很多库还是紧扣相连,一个库里伴随着另一个库里的调用。耦合性比较紧密。
文章目录
- samba开发篇---general purpose库(top_level)
- 前言
- 一、general purpose库介绍
- 二、general purpose 库(lib)源码分析
-
- 1.talloc库
-
- talloc 内存池介绍
- 性能
- 搭建环境
- talloc使用教程
-
- 1.零长度上下文
- 2.顶级上下文
- 3.释放上下文
- 4.talloc内存池的API函数
-
- 1.void* talloc_new (const void * ctx)
- 2.void* talloc(const void * ctx,#type)
- 3.char *talloc_strdup(const void * p , const char *t)
- 4.void *talloc_array(const void *ctx, #type, unsigned count)
- 5.char *talloc_asprintf(const void *t, const char *fmt, ...)
- 6.void *talloc_realloc(const void *ctx, void *ptr, #type, size_t count);
- 5.案例分析
- 上下文区别
- talloc 高级使用
- 2.smbconf库
- 总结
前言
本次讲解和开发,使用环境为ubuntu20.04,默认你已经用apt-get 安装了samba-413.17以及samba-dev,并且用git下载了samba源码。
一、general purpose库介绍
从框架篇讲解到,samba下的top_level 库下有很多库。
addns async_req compression dbwrap krb5_wrap ldb-samba mscat printer_driver README smbconf talloc tdb_wrap tevent torture uti