| 1 |
#ifndef LIBNFTNL_STR_ARRAY_H |
| 2 |
#define LIBNFTNL_STR_ARRAY_H 1 |
| 3 |
|
| 4 |
#include <stdint.h> |
| 5 |
|
| 6 |
struct nlattr; |
| 7 |
|
| 8 |
struct nftnl_str_array { |
| 9 |
char **array; |
| 10 |
uint32_t len; |
| 11 |
}; |
| 12 |
|
| 13 |
void nftnl_str_array_clear(struct nftnl_str_array *sa); |
| 14 |
int nftnl_str_array_set(struct nftnl_str_array *sa, const char * const *array); |
| 15 |
int nftnl_parse_devs(struct nftnl_str_array *sa, const struct nlattr *nest); |
| 16 |
|
| 17 |
#define nftnl_str_array_foreach(ptr, sa, idx) \ |
| 18 |
for (idx = 0, ptr = (sa)->array[idx]; \ |
| 19 |
idx < (sa)->len; \ |
| 20 |
ptr = (sa)->array[++idx]) |
| 21 |
|
| 22 |
#endif /* LIBNFTNL_STR_ARRAY_H */ |