diff options
| author | martti <martti@NetBSD.org> | 2006-04-04 16:17:18 +0000 |
|---|---|---|
| committer | martti <martti@NetBSD.org> | 2006-04-04 16:17:18 +0000 |
| commit | 9ea58d54bc33aec41259ffe6552f8969375b59aa (patch) | |
| tree | 6d48ac3be198557f26f11a90f3b256d9c84c45de /dist/ipf/lib/icmpcode.c | |
| parent | 983a2072cee4b5033319b848ebc04ea4d5ce62b6 (diff) | |
Upgraded IPFilter to 4.1.13
Diffstat (limited to 'dist/ipf/lib/icmpcode.c')
| -rw-r--r-- | dist/ipf/lib/icmpcode.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/dist/ipf/lib/icmpcode.c b/dist/ipf/lib/icmpcode.c index f5aadbfecea..895b5cbedc9 100644 --- a/dist/ipf/lib/icmpcode.c +++ b/dist/ipf/lib/icmpcode.c @@ -1,11 +1,11 @@ -/* $NetBSD: icmpcode.c,v 1.5 2005/02/08 07:01:53 martti Exp $ */ +/* $NetBSD: icmpcode.c,v 1.6 2006/04/04 16:17:18 martti Exp $ */ /* * Copyright (C) 1993-2001 by Darren Reed. * * See the IPFILTER.LICENCE file for details on licencing. * - * Id: icmpcode.c,v 1.7.2.1 2004/12/09 19:41:20 darrenr Exp + * Id: icmpcode.c,v 1.7.2.4 2006/02/25 17:40:22 darrenr Exp */ #include <ctype.h> @@ -22,28 +22,3 @@ char *icmpcodes[MAX_ICMPCODE + 1] = { "net-unk", "host-unk", "isolate", "net-prohib", "host-prohib", "net-tos", "host-tos", "filter-prohib", "host-preced", "preced-cutoff", NULL }; - -/* - * Return the number for the associated ICMP unreachable code. - */ -int icmpcode(str) -char *str; -{ - char *s; - int i, len; - - if ((s = strrchr(str, ')'))) - *s = '\0'; - if (ISDIGIT(*str)) { - if (!ratoi(str, &i, 0, 255)) - return -1; - else - return i; - } - len = strlen(str); - for (i = 0; icmpcodes[i]; i++) - if (!strncasecmp(str, icmpcodes[i], MIN(len, - strlen(icmpcodes[i])) )) - return i; - return -1; -} |
