From c59d42a90b0d279955d5051c2306733bc01522f8 Mon Sep 17 00:00:00 2001 From: Zhongqiu Duan Date: Wed, 19 Mar 2025 14:20:53 +0000 Subject: src: remove unused str2XXX helpers After commit 80077787f8f2 ("src: remove json support"), these internal functions are no longer used: nftnl_str2hooknum nftnl_str2ntoh nftnl_str2cmp str2ctkey str2ctdir str2exthdr_op str2exthdr_type str2meta_key nftnl_str2nat nftnl_str2range str2rt_key nftnl_str2hooknum Signed-off-by: Zhongqiu Duan Signed-off-by: Florian Westphal --- src/expr/exthdr.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/expr/exthdr.c') diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c index 339527d..ddebe43 100644 --- a/src/expr/exthdr.c +++ b/src/expr/exthdr.c @@ -202,33 +202,6 @@ static const char *op2str(uint8_t op) } } -static inline int str2exthdr_op(const char* str) -{ - if (!strcmp(str, "tcpopt")) - return NFT_EXTHDR_OP_TCPOPT; - if (!strcmp(str, "ipv4")) - return NFT_EXTHDR_OP_IPV4; - - /* if str == "ipv6" or anything else */ - return NFT_EXTHDR_OP_IPV6; -} - -static inline int str2exthdr_type(const char *str) -{ - if (strcmp(str, "hopopts") == 0) - return IPPROTO_HOPOPTS; - else if (strcmp(str, "routing") == 0) - return IPPROTO_ROUTING; - else if (strcmp(str, "fragment") == 0) - return IPPROTO_FRAGMENT; - else if (strcmp(str, "dstopts") == 0) - return IPPROTO_DSTOPTS; - else if (strcmp(str, "mh") == 0) - return IPPROTO_MH; - - return -1; -} - static int nftnl_expr_exthdr_snprintf(char *buf, size_t len, uint32_t flags, const struct nftnl_expr *e) -- cgit v1.2.3