diff options
author | Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp> | 2005-06-22 12:24:21 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2005-06-22 12:24:21 +0000 |
commit | 9867e814492275cabfbccd6b30375b0e23eb10cb (patch) | |
tree | d8b31329c2cd532ecbe017d38b18856101b25811 /extensions/libipt_physdev.c | |
parent | a3a9c0d3e3d9df70c5ea2e64ef792e194dbfbde7 (diff) |
reduce code replication of parse_interface() (Yasuyuki Kozakai)
Diffstat (limited to 'extensions/libipt_physdev.c')
-rw-r--r-- | extensions/libipt_physdev.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/extensions/libipt_physdev.c b/extensions/libipt_physdev.c index 0c4c3576..b6dae2ac 100644 --- a/extensions/libipt_physdev.c +++ b/extensions/libipt_physdev.c @@ -34,45 +34,6 @@ static struct option opts[] = { {0} }; -/* copied from iptables.c */ -static void -parse_interface(const char *arg, char *vianame, unsigned char *mask) -{ - int vialen = strlen(arg); - unsigned int i; - - memset(mask, 0, IFNAMSIZ); - memset(vianame, 0, IFNAMSIZ); - - if (vialen + 1 > IFNAMSIZ) - exit_error(PARAMETER_PROBLEM, - "interface name `%s' must be shorter than IFNAMSIZ" - " (%i)", arg, IFNAMSIZ-1); - - strcpy(vianame, arg); - if (vialen == 0) - memset(mask, 0, IFNAMSIZ); - else if (vianame[vialen - 1] == '+') { - memset(mask, 0xFF, vialen - 1); - memset(mask + vialen - 1, 0, IFNAMSIZ - vialen + 1); - /* Don't remove `+' here! -HW */ - } else { - /* Include nul-terminator in match */ - memset(mask, 0xFF, vialen + 1); - memset(mask + vialen + 1, 0, IFNAMSIZ - vialen - 1); - for (i = 0; vianame[i]; i++) { - if (!isalnum(vianame[i]) - && vianame[i] != '_' - && vianame[i] != '.') { - printf("Warning: wierd character in interface" - " `%s' (No aliases, :, ! or *).\n", - vianame); - break; - } - } - } -} - static void init(struct ipt_entry_match *m, unsigned int *nfcache) { |