]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: ct: remove unused functions
authorFlorian Westphal <fw@strlen.de>
Wed, 27 Sep 2017 15:07:21 +0000 (17:07 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 27 Sep 2017 15:08:46 +0000 (17:08 +0200)
since commit b0c2606ed02fed828ab7c34227e355f5542bc925
("parser_bison: use keywords in ct expression") we no longer
abuse string for this, so there are no users of these helpers
anymore.

Signed-off-by: Florian Westphal <fw@strlen.de>
include/ct.h
src/ct.c

index becd09c6e867adfd7942e07235c3ceb842cefcb3..895a6ee3b255f26368afb61f804559fb526b0f36 100644 (file)
@@ -27,10 +27,6 @@ extern struct expr *ct_expr_alloc(const struct location *loc,
                                  enum nft_ct_keys key, int8_t direction);
 extern void ct_expr_update_type(struct proto_ctx *ctx, struct expr *expr);
 
-extern struct error_record *ct_dir_parse(const struct location *loc,
-                                        const char *str, int8_t *dir);
-extern struct error_record *ct_key_parse(const struct location *loc, const char *str,
-                                        unsigned int *key);
 extern struct error_record *ct_objtype_parse(const struct location *loc, const char *str, int *type);
 
 extern struct stmt *notrack_stmt_alloc(const struct location *loc);
index d64f46724002a5f788c6cf94e763260265ec8b82..2b0e2a0924a41bc7a49d638354359b0b98180a91 100644 (file)
--- a/src/ct.c
+++ b/src/ct.c
@@ -334,56 +334,6 @@ static const struct expr_ops ct_expr_ops = {
        .pctx_update    = ct_expr_pctx_update,
 };
 
-struct error_record *ct_dir_parse(const struct location *loc, const char *str,
-                                 int8_t *direction)
-{
-       const struct symbolic_constant *s;
-
-       for (s = ct_dir_tbl.symbols; s->identifier != NULL; s++) {
-               if (!strcmp(str, s->identifier)) {
-                       *direction = s->value;
-                       return NULL;
-               }
-       }
-
-       return error(loc, "Could not parse direction %s", str);
-}
-
-struct error_record *ct_key_parse(const struct location *loc, const char *str,
-                                 unsigned int *key)
-{
-       int ret, len, offset = 0;
-       const char *sep = "";
-       unsigned int i;
-       char buf[1024];
-       size_t size;
-
-       for (i = 0; i < array_size(ct_templates); i++) {
-               if (!ct_templates[i].token || strcmp(ct_templates[i].token, str))
-                       continue;
-
-               *key = i;
-               return NULL;
-       }
-
-       len = (int)sizeof(buf);
-       size = sizeof(buf);
-
-       for (i = 0; i < array_size(ct_templates); i++) {
-               if (!ct_templates[i].token)
-                       continue;
-
-               if (offset)
-                       sep = ", ";
-
-               ret = snprintf(buf+offset, len, "%s%s", sep, ct_templates[i].token);
-               SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
-               assert(offset < (int)sizeof(buf));
-       }
-
-       return error(loc, "syntax error, unexpected %s, known keys are %s", str, buf);
-}
-
 struct error_record *ct_objtype_parse(const struct location *loc, const char *str, int *type)
 {
        if (strcmp(str, "helper") == 0) {