Lines Matching defs:iptnl

2502   struct ip_tunnel_parm iptnl;
2515 if ((ret = tnl_ioctl(iface, SIOCGIFHWADDR, &iptnl)) < 0) {
2522 memset(&iptnl, 0, sizeof(iptnl));
2523 if (tnl_ioctl(iface, SIOCGETTUNNEL, &iptnl) < 0) continue;
2524 if ((ptnl->link && iptnl.link != ptnl->link) || (*ptnl->name &&
2525 strcmp(iptnl.name, ptnl->name)) || (ptnl->iph.daddr &&
2526 iptnl.iph.daddr != ptnl->iph.daddr) || (ptnl->iph.saddr &&
2527 iptnl.iph.saddr != ptnl->iph.saddr) || (ptnl->i_key &&
2528 iptnl.i_key != ptnl->i_key)) continue;
2529 display_tunnel(&iptnl);
2715 struct ip_tunnel_parm iptnl;
2718 memset(&iptnl, 0, sizeof(iptnl));
2719 parse_iptunnel_args(&iptnl, argv, 3);
2721 if (iptnl.iph.protocol == IPPROTO_IPIP)
2722 ret = tnl_ioctl(*iptnl.name ? iptnl.name : "tunl0", SIOCGETTUNNEL, &iptnl);
2723 else if (iptnl.iph.protocol == IPPROTO_GRE)
2724 ret = tnl_ioctl(*iptnl.name ? iptnl.name : "gre0", SIOCGETTUNNEL, &iptnl);
2725 else if (iptnl.iph.protocol == IPPROTO_IPV6)
2726 ret = tnl_ioctl(*iptnl.name ? iptnl.name : "sit0", SIOCGETTUNNEL, &iptnl);
2727 else return read_tunnel(&iptnl);
2732 } else return display_tunnel(&iptnl);
2738 struct ip_tunnel_parm iptnl;
2749 memset(&iptnl, 0, sizeof(iptnl));
2750 parse_iptunnel_args(&iptnl, argv, idx);
2751 if (idx != 2 && iptnl.iph.ttl && !(iptnl.iph.frag_off))
2753 if (iptnl.iph.protocol == IPPROTO_IPIP)
2754 return (tnl_ioctl("tunl0", rtype, &iptnl) < 0) ? 1 : 0;
2755 else if (iptnl.iph.protocol == IPPROTO_GRE)
2756 return (tnl_ioctl("gre0", rtype, &iptnl) < 0) ? 1 : 0;
2757 else if (iptnl.iph.protocol == IPPROTO_IPV6)
2758 return (tnl_ioctl("sit0", rtype, &iptnl) < 0) ? 1 : 0;
2761 return (tnl_ioctl(iptnl.name, rtype, &iptnl) < 0) ? 1 : 0;