libnftnl  1.0.2
expr_ops.c
1 #include <string.h>
2 #include <linux_list.h>
3 
4 #include "expr_ops.h"
5 
6 static LIST_HEAD(expr_ops_list);
7 
8 void nft_expr_ops_register(struct expr_ops *ops)
9 {
10  list_add_tail(&ops->head, &expr_ops_list);
11 }
12 
13 struct expr_ops *nft_expr_ops_lookup(const char *name)
14 {
15  struct expr_ops *ops;
16 
17  list_for_each_entry(ops, &expr_ops_list, head) {
18  if (strcmp(ops->name, name) == 0)
19  return ops;
20  }
21 
22  return NULL;
23 }