最近察看wide-dhcp相关的代码时候有一个结构体:struct dhcp6_list,定义一直没找到
搜索后发现是用宏定义实现的:
- #define TAILQ_HEAD(name, type) \
- struct name { \
- struct type *tqh_first; /* first element */ \
- struct type **tqh_last; /* addr of last next element */ \
- }
-
- #define TAILQ_ENTRY(type) \
- struct { \
- struct type *tqe_next; /* next element */ \
- struct type **tqe_prev; /* address of previous next element */ \
- }
- TAILQ_HEAD(dhcp6_list, dhcp6_listval);
- struct dhcp6_listval {
- TAILQ_ENTRY(dhcp6_listval) link;
- dhcp6_listval_type_t type;
- union {
- int uv_num;
- u_int16_t uv_num16;
- struct in6_addr uv_addr6;
- struct dhcp6_prefix uv_prefix6;
- struct dhcp6_statefuladdr uv_statefuladdr6;
- struct dhcp6_ia uv_ia;
- struct dhcp6_vbuf uv_vbuf;
- struct dhcp6_vendor_opt vendor_opt;
- } uv;
- struct dhcp6_list sublist;
- };
阅读(3214) | 评论(0) | 转发(1) |