struct nft_xt_cmd_parse *p, struct iptables_command_state *cs,
struct xtables_args *args);
-struct nft_xt_restore_parse {
- FILE *in;
- int testing;
- const char *tablename;
- bool commit;
-};
-
struct nftnl_chain_list;
struct nft_xt_restore_cb {
int (*abort)(struct nft_handle *h);
};
+struct nft_xt_restore_parse {
+ FILE *in;
+ int testing;
+ const char *tablename;
+ bool commit;
+ const struct nft_xt_restore_cb *cb;
+};
+
void xtables_restore_parse(struct nft_handle *h,
- const struct nft_xt_restore_parse *p,
- const struct nft_xt_restore_cb *cb);
+ const struct nft_xt_restore_parse *p);
void nft_check_xt_legacy(int family, bool is_ipt_save);
#endif
};
void xtables_restore_parse(struct nft_handle *h,
- const struct nft_xt_restore_parse *p,
- const struct nft_xt_restore_cb *cb)
+ const struct nft_xt_restore_parse *p)
{
const struct builtin_table *curtable = NULL;
+ const struct nft_xt_restore_cb *cb = p->cb;
struct argv_store av_store = {};
char buffer[10240];
int in_table = 0;
int c;
struct nft_xt_restore_parse p = {
.commit = true,
+ .cb = &restore_cb,
};
line = 0;
exit(EXIT_FAILURE);
}
- xtables_restore_parse(&h, &p, &restore_cb);
+ xtables_restore_parse(&h, &p);
nft_fini(&h);
fclose(p.in);
{
struct nft_xt_restore_parse p = {
.in = stdin,
+ .cb = &ebt_restore_cb,
};
bool noflush = false;
struct nft_handle h;
nft_init_eb(&h, "ebtables-restore");
h.noflush = noflush;
- xtables_restore_parse(&h, &p, &ebt_restore_cb);
+ xtables_restore_parse(&h, &p);
nft_fini(&h);
return 0;
{
struct nft_xt_restore_parse p = {
.in = stdin,
+ .cb = &arp_restore_cb,
};
struct nft_handle h;
nft_init_arp(&h, "arptables-restore");
- xtables_restore_parse(&h, &p, &arp_restore_cb);
+ xtables_restore_parse(&h, &p);
nft_fini(&h);
return 0;
.family = family,
};
const char *file = NULL;
- struct nft_xt_restore_parse p = {};
+ struct nft_xt_restore_parse p = {
+ .cb = &cb_xlate,
+ };
time_t now = time(NULL);
int c;
printf("# Translated by %s v%s on %s",
argv[0], PACKAGE_VERSION, ctime(&now));
- xtables_restore_parse(&h, &p, &cb_xlate);
+ xtables_restore_parse(&h, &p);
printf("# Completed on %s", ctime(&now));
nft_fini(&h);