]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft-shared: Drop unused function print_proto()
authorPhil Sutter <phil@nwl.cc>
Sat, 6 Nov 2021 00:09:37 +0000 (01:09 +0100)
committerPhil Sutter <phil@nwl.cc>
Tue, 23 Nov 2021 14:01:23 +0000 (15:01 +0100)
The last users vanished back in 2013. There is identical code in
save_rule_details(), but with only a single user there's not much point
in keeping the function.

Fixes: cdc78b1d6bd7b ("nft: convert rule into a command state structure")
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/nft-shared.c
iptables/nft-shared.h

index a6a79c8cda084e0abaa4d0828660ba4736d67403..b281ba2987cc39c78c692d5c31da425e61493601 100644 (file)
@@ -373,21 +373,6 @@ static void nft_parse_match(struct nft_xt_ctx *ctx, struct nftnl_expr *e)
                ctx->h->ops->parse_match(match, ctx->cs);
 }
 
-void print_proto(uint16_t proto, int invert)
-{
-       const struct protoent *pent = getprotobynumber(proto);
-
-       if (invert)
-               printf("! ");
-
-       if (pent) {
-               printf("-p %s ", pent->p_name);
-               return;
-       }
-
-       printf("-p %u ", proto);
-}
-
 void get_cmp_data(struct nftnl_expr *e, void *data, size_t dlen, bool *inv)
 {
        uint32_t len;
index de684374ef9e062a3b61d34855f73ecdb2ae5f4f..bcf8486eb44c42838c3f3e0fda1706f1dd252e02 100644 (file)
@@ -158,7 +158,6 @@ bool is_same_interfaces(const char *a_iniface, const char *a_outiface,
 int parse_meta(struct nftnl_expr *e, uint8_t key, char *iniface,
                unsigned char *iniface_mask, char *outiface,
                unsigned char *outiface_mask, uint8_t *invflags);
-void print_proto(uint16_t proto, int invert);
 void get_cmp_data(struct nftnl_expr *e, void *data, size_t dlen, bool *inv);
 void nft_rule_to_iptables_command_state(struct nft_handle *h,
                                        const struct nftnl_rule *r,