Lines Matching refs:nfnl
33 sd_netlink *nfnl, in nfnl_netlink_sendv() argument
40 assert(nfnl); in nfnl_netlink_sendv()
44 r = sd_netlink_sendv(nfnl, messages, msgcount, &serial); in nfnl_netlink_sendv()
53 tmp = sd_netlink_read(nfnl, serial[i], NFNL_DEFAULT_TIMEOUT_USECS, NULL); in nfnl_netlink_sendv()
321 static int sd_nfnl_message_new_masq_rule(sd_netlink *nfnl, sd_netlink_message **ret, int family, in sd_nfnl_message_new_masq_rule() argument
328 r = sd_nfnl_nft_message_new_rule(nfnl, &m, family, NFT_SYSTEMD_TABLE_NAME, chain); in sd_nfnl_message_new_masq_rule()
363 static int sd_nfnl_message_new_dnat_rule_pre(sd_netlink *nfnl, sd_netlink_message **ret, int family, in sd_nfnl_message_new_dnat_rule_pre() argument
373 r = sd_nfnl_nft_message_new_rule(nfnl, &m, family, NFT_SYSTEMD_TABLE_NAME, chain); in sd_nfnl_message_new_dnat_rule_pre()
420 static int sd_nfnl_message_new_dnat_rule_out(sd_netlink *nfnl, sd_netlink_message **ret, in sd_nfnl_message_new_dnat_rule_out() argument
428 r = sd_nfnl_nft_message_new_rule(nfnl, &m, family, NFT_SYSTEMD_TABLE_NAME, chain); in sd_nfnl_message_new_dnat_rule_out()
509 static int nft_new_set(struct sd_netlink *nfnl, in nft_new_set() argument
517 … r = sd_nfnl_nft_message_new_set(nfnl, &m, family, NFT_SYSTEMD_TABLE_NAME, set_name, set_id, klen); in nft_new_set()
535 static int nft_new_map(struct sd_netlink *nfnl, in nft_new_map() argument
542 r = nft_new_set(nfnl, &m, family, set_name, set_id, flags | NFT_SET_MAP, type, klen); in nft_new_map()
557 static int nft_add_element(sd_netlink *nfnl, sd_netlink_message **ret, in nft_add_element() argument
577 … r = sd_nfnl_nft_message_new_setelems_begin(nfnl, &m, family, NFT_SYSTEMD_TABLE_NAME, set_name); in nft_add_element()
593 static int nft_del_element(sd_netlink *nfnl, in nft_del_element() argument
600 … r = sd_nfnl_nft_message_del_setelems_begin(nfnl, &m, family, NFT_SYSTEMD_TABLE_NAME, set_name); in nft_del_element()
640 static int fw_nftables_init_family(sd_netlink *nfnl, int family) { in fw_nftables_init_family() argument
648 r = sd_nfnl_message_batch_begin(nfnl, &batch[msgcnt]); in fw_nftables_init_family()
655 r = sd_nfnl_nft_message_new_table(nfnl, &batch[msgcnt], family, NFT_SYSTEMD_TABLE_NAME); in fw_nftables_init_family()
662 r = sd_nfnl_nft_message_new_basechain(nfnl, &batch[msgcnt], family, NFT_SYSTEMD_TABLE_NAME, in fw_nftables_init_family()
670 r = sd_nfnl_nft_message_new_basechain(nfnl, &batch[msgcnt], family, NFT_SYSTEMD_TABLE_NAME, in fw_nftables_init_family()
678 r = sd_nfnl_nft_message_new_basechain(nfnl, &batch[msgcnt], family, NFT_SYSTEMD_TABLE_NAME, in fw_nftables_init_family()
695 …r = nft_new_set(nfnl, &batch[msgcnt], family, NFT_SYSTEMD_MASQ_SET_NAME, ++set_id, NFT_SET_INTERVA… in fw_nftables_init_family()
708 r = nft_new_map(nfnl, &batch[msgcnt], family, NFT_SYSTEMD_DNAT_MAP_NAME, ++set_id, 0, in fw_nftables_init_family()
716 r = sd_nfnl_message_new_dnat_rule_pre(nfnl, &batch[msgcnt], family, "prerouting"); in fw_nftables_init_family()
722 r = sd_nfnl_message_new_dnat_rule_out(nfnl, &batch[msgcnt], family, "output"); in fw_nftables_init_family()
727 r = sd_nfnl_message_new_masq_rule(nfnl, &batch[msgcnt], family, "postrouting"); in fw_nftables_init_family()
733 r = sd_nfnl_message_batch_end(nfnl, &batch[msgcnt]); in fw_nftables_init_family()
739 r = nfnl_netlink_sendv(nfnl, batch, msgcnt); in fw_nftables_init_family()
751 _cleanup_(sd_netlink_unrefp) sd_netlink *nfnl = NULL; in fw_nftables_init()
754 r = sd_nfnl_socket_open(&nfnl); in fw_nftables_init()
758 r = fw_nftables_init_family(nfnl, AF_INET); in fw_nftables_init()
763 r = fw_nftables_init_family(nfnl, AF_INET6); in fw_nftables_init()
768 ctx->nfnl = TAKE_PTR(nfnl); in fw_nftables_init()
773 ctx->nfnl = sd_netlink_unref(ctx->nfnl); in fw_nftables_exit()
868 r = sd_nfnl_message_batch_begin(ctx->nfnl, &transaction[0]); in fw_nftables_add_masquerade_internal()
873 …r = sd_nfnl_nft_message_new_setelems_begin(ctx->nfnl, &transaction[tsize], af, NFT_SYSTEMD_TABLE_N… in fw_nftables_add_masquerade_internal()
875 …r = sd_nfnl_nft_message_del_setelems_begin(ctx->nfnl, &transaction[tsize], af, NFT_SYSTEMD_TABLE_N… in fw_nftables_add_masquerade_internal()
888 r = sd_nfnl_message_batch_end(ctx->nfnl, &transaction[tsize]); in fw_nftables_add_masquerade_internal()
893 r = nfnl_netlink_sendv(ctx->nfnl, transaction, tsize); in fw_nftables_add_masquerade_internal()
934 r = fw_nftables_init_family(ctx->nfnl, af); in fw_nftables_add_masquerade()
988 r = sd_nfnl_message_batch_begin(ctx->nfnl, &transaction[0]); in fw_nftables_add_local_dnat_internal()
1000 …r = nft_del_element(ctx->nfnl, &transaction[tsize], af, NFT_SYSTEMD_DNAT_MAP_NAME, key, sizeof(key… in fw_nftables_add_local_dnat_internal()
1014 …r = nft_add_element(ctx->nfnl, &transaction[tsize], af, NFT_SYSTEMD_DNAT_MAP_NAME, key, sizeof(key… in fw_nftables_add_local_dnat_internal()
1016 …r = nft_del_element(ctx->nfnl, &transaction[tsize], af, NFT_SYSTEMD_DNAT_MAP_NAME, key, sizeof(key… in fw_nftables_add_local_dnat_internal()
1023 r = sd_nfnl_message_batch_end(ctx->nfnl, &transaction[tsize]); in fw_nftables_add_local_dnat_internal()
1030 r = nfnl_netlink_sendv(ctx->nfnl, transaction, tsize); in fw_nftables_add_local_dnat_internal()
1067 r = fw_nftables_init_family(ctx->nfnl, af); in fw_nftables_add_local_dnat()