Mirror of git://git.busybox.net/busybox with our patches on top
Source
xxxxxxxxxx
static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
/*
* iptunnel.c "ip tunnel"
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
*
* Changes:
*
* Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
* Rani Assaf <rani@magic.metawire.com> 980930: do not allow key for ipip/sit
* Phil Karn <karn@ka9q.ampr.org> 990408: "pmtudisc" flag
*/
static int do_ioctl_get_ifindex(char *dev)
{
struct ifreq ifr;
int fd;
strcpy(ifr.ifr_name, dev);
fd = socket(AF_INET, SOCK_DGRAM, 0);
if (ioctl(fd, SIOCGIFINDEX, &ifr)) {
bb_perror_msg("ioctl");
return 0;
}
close(fd);
return ifr.ifr_ifindex;
}
static int do_ioctl_get_iftype(char *dev)
{
struct ifreq ifr;
int fd;
strcpy(ifr.ifr_name, dev);
fd = socket(AF_INET, SOCK_DGRAM, 0);