summaryrefslogtreecommitdiffstats
path: root/ip6tables.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-02-07 03:05:49 +0100
committerJan Engelhardt <jengelh@medozas.de>2011-02-07 03:05:49 +0100
commitf6992cbb211a42f776333fe65dfad49f17455a3f (patch)
tree92f7775b3b8b8d8b7fda61cddb5e4974d4221773 /ip6tables.c
parent7a548b32d9ad8d6e4a8398573d4fa8c4e4a1f9e0 (diff)
src: deduplicate find_proto function
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'ip6tables.c')
-rw-r--r--ip6tables.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/ip6tables.c b/ip6tables.c
index dac0c524..ac376e23 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -205,24 +205,6 @@ struct pprot {
uint8_t num;
};
-static const char *
-proto_to_name(uint8_t proto, int nolookup)
-{
- unsigned int i;
-
- if (proto && !nolookup) {
- const struct protoent *pent = getprotobynumber(proto);
- if (pent)
- return pent->p_name;
- }
-
- for (i = 0; xtables_chain_protos[i].name != NULL; ++i)
- if (xtables_chain_protos[i].num == proto)
- return xtables_chain_protos[i].name;
-
- return NULL;
-}
-
static void __attribute__((noreturn))
exit_tryhelp(int status)
{
@@ -406,24 +388,6 @@ add_command(unsigned int *cmd, const int newcmd, const int othercmds,
* return global static data.
*/
-/* Christophe Burki wants `-p 6' to imply `-m tcp'. */
-static struct xtables_match *
-find_proto(const char *pname, enum xtables_tryload tryload,
- int nolookup, struct xtables_rule_match **matches)
-{
- unsigned int proto;
-
- if (xtables_strtoui(pname, NULL, &proto, 0, UINT8_MAX)) {
- const char *protoname = proto_to_name(proto, nolookup);
-
- if (protoname)
- return xtables_find_match(protoname, tryload, matches);
- } else
- return xtables_find_match(pname, tryload, matches);
-
- return NULL;
-}
-
/* These are invalid numbers as upper layer protocol */
static int is_exthdr(uint16_t proto)
{