Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1155323
  • 博文数量: 115
  • 博客积分: 950
  • 博客等级: 准尉
  • 技术积分: 1734
  • 用 户 组: 普通用户
  • 注册时间: 2011-12-08 20:46
文章分类

全部博文(115)

文章存档

2015年(5)

2014年(28)

2013年(42)

2012年(40)

分类: LINUX

2012-10-04 21:16:54

最近察看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. };

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