Chinaunix首页 | 论坛 | 博客
  • 博客访问: 121638
  • 博文数量: 40
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 173
  • 用 户 组: 普通用户
  • 注册时间: 2013-08-28 10:24
文章分类
文章存档

2014年(4)

2013年(36)

我的朋友

分类: LINUX

2013-12-12 10:09:27

原文地址:wide-dhcp 作者:abin9630

最近察看wide-dhcp相关的代码时候有一个结构体:struct dhcp6_list,定义一直没找到

搜索后发现是用宏定义实现的:

点击(此处)折叠或打开


  1. #define TAILQ_HEAD(name, type) \
  2. struct name { \
  3. struct type *tqh_first; /* first element */ \
  4. struct type **tqh_last; /* addr of last next element */ \
  5. }

  6. #define TAILQ_ENTRY(type) \
  7. struct { \
  8. struct type *tqe_next; /* next element */ \
  9. struct type **tqe_prev; /* address of previous next element */ \
  10. }

  11. TAILQ_HEAD(dhcp6_list, dhcp6_listval);
  12. struct dhcp6_listval {
  13. TAILQ_ENTRY(dhcp6_listval) link;
  14. dhcp6_listval_type_t type;
  15. union {
  16. int uv_num;
  17. u_int16_t uv_num16;
  18. struct in6_addr uv_addr6;
  19. struct dhcp6_prefix uv_prefix6;
  20. struct dhcp6_statefuladdr uv_statefuladdr6;
  21. struct dhcp6_ia uv_ia;
  22. struct dhcp6_vbuf uv_vbuf;
  23. struct dhcp6_vendor_opt vendor_opt;
  24. } uv;
  25. struct dhcp6_list sublist;
  26. };

阅读(1684) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~