32 #ifndef _NETLABEL_ADDRLIST_H
33 #define _NETLABEL_ADDRLIST_H
35 #include <linux/types.h>
37 #include <linux/list.h>
38 #include <linux/in6.h>
39 #include <linux/audit.h>
71 #define __af4list_entry(ptr) container_of(ptr, struct netlbl_af4list, list)
78 while (i != h && !n->
valid) {
90 while (i != h && !n->
valid) {
97 #define netlbl_af4list_foreach(iter, head) \
98 for (iter = __af4list_valid((head)->next, head); \
99 &iter->list != (head); \
100 iter = __af4list_valid(iter->list.next, head))
102 #define netlbl_af4list_foreach_rcu(iter, head) \
103 for (iter = __af4list_valid_rcu((head)->next, head); \
104 &iter->list != (head); \
105 iter = __af4list_valid_rcu(iter->list.next, head))
107 #define netlbl_af4list_foreach_safe(iter, tmp, head) \
108 for (iter = __af4list_valid((head)->next, head), \
109 tmp = __af4list_valid(iter->list.next, head); \
110 &iter->list != (head); \
111 iter = tmp, tmp = __af4list_valid(iter->list.next, head))
125 void netlbl_af4list_audit_addr(
struct audit_buffer *audit_buf,
129 static inline void netlbl_af4list_audit_addr(
struct audit_buffer *audit_buf,
136 #if IS_ENABLED(CONFIG_IPV6)
138 #define __af6list_entry(ptr) container_of(ptr, struct netlbl_af6list, list)
145 while (i != h && !n->
valid) {
147 n = __af6list_entry(i);
157 while (i != h && !n->
valid) {
159 n = __af6list_entry(i);
164 #define netlbl_af6list_foreach(iter, head) \
165 for (iter = __af6list_valid((head)->next, head); \
166 &iter->list != (head); \
167 iter = __af6list_valid(iter->list.next, head))
169 #define netlbl_af6list_foreach_rcu(iter, head) \
170 for (iter = __af6list_valid_rcu((head)->next, head); \
171 &iter->list != (head); \
172 iter = __af6list_valid_rcu(iter->list.next, head))
174 #define netlbl_af6list_foreach_safe(iter, tmp, head) \
175 for (iter = __af6list_valid((head)->next, head), \
176 tmp = __af6list_valid(iter->list.next, head); \
177 &iter->list != (head); \
178 iter = tmp, tmp = __af6list_valid(iter->list.next, head))
193 void netlbl_af6list_audit_addr(
struct audit_buffer *audit_buf,
199 static inline void netlbl_af6list_audit_addr(
struct audit_buffer *audit_buf,