aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libfilter/bsc_msg_acc.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-04-04 22:28:32 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-03 21:42:28 +0200
commitd7e04b9956bb7d579697604fff6ba67fc6b9e52d (patch)
treef5ae2caf4e286972e5630e80b4fe7ded73ace9ef /openbsc/src/libfilter/bsc_msg_acc.c
parentd04d009f473d89a426c16dd24e5a4c692caf0017 (diff)
filter: Cease out "struct bsc_nat" from the API
This means we need to require a talloc context and simply operate on the list. I had considered creating a structure to hold the list head but I didn't find any other members so omitted it for now.
Diffstat (limited to 'openbsc/src/libfilter/bsc_msg_acc.c')
-rw-r--r--openbsc/src/libfilter/bsc_msg_acc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/openbsc/src/libfilter/bsc_msg_acc.c b/openbsc/src/libfilter/bsc_msg_acc.c
index 947a7b2ed..cc6c44405 100644
--- a/openbsc/src/libfilter/bsc_msg_acc.c
+++ b/openbsc/src/libfilter/bsc_msg_acc.c
@@ -52,29 +52,29 @@ int bsc_nat_lst_check_allow(struct bsc_nat_acc_lst *lst, const char *mi_string)
return 1;
}
-struct bsc_nat_acc_lst *bsc_nat_acc_lst_find(struct bsc_nat *nat, const char *name)
+struct bsc_nat_acc_lst *bsc_nat_acc_lst_find(struct llist_head *head, const char *name)
{
struct bsc_nat_acc_lst *lst;
if (!name)
return NULL;
- llist_for_each_entry(lst, &nat->access_lists, list)
+ llist_for_each_entry(lst, head, list)
if (strcmp(lst->name, name) == 0)
return lst;
return NULL;
}
-struct bsc_nat_acc_lst *bsc_nat_acc_lst_get(struct bsc_nat *nat, const char *name)
+struct bsc_nat_acc_lst *bsc_nat_acc_lst_get(void *ctx, struct llist_head *head, const char *name)
{
struct bsc_nat_acc_lst *lst;
- lst = bsc_nat_acc_lst_find(nat, name);
+ lst = bsc_nat_acc_lst_find(head, name);
if (lst)
return lst;
- lst = talloc_zero(nat, struct bsc_nat_acc_lst);
+ lst = talloc_zero(ctx, struct bsc_nat_acc_lst);
if (!lst) {
LOGP(DNAT, LOGL_ERROR, "Failed to allocate access list");
return NULL;
@@ -89,7 +89,7 @@ struct bsc_nat_acc_lst *bsc_nat_acc_lst_get(struct bsc_nat *nat, const char *nam
INIT_LLIST_HEAD(&lst->fltr_list);
lst->name = talloc_strdup(lst, name);
- llist_add_tail(&lst->list, &nat->access_lists);
+ llist_add_tail(&lst->list, head);
return lst;
}