• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/openvpn-2.3.1/src/openvpn/

Lines Matching refs:gateway

171   buf_printf (&out, "ROUTE network %s netmask %s gateway %s",
174 print_in_addr_t (r->gateway, 0, gc)
232 *out = rl->rgi.gateway.addr;
235 msg (M_INFO, PACKAGE_NAME " ROUTE: net_gateway undefined -- unable to get default gateway from system");
326 /* gateway */
328 if (is_route_parm_defined (ro->gateway))
330 if (!get_special_addr (rl, ro->gateway, &r->gateway, &status))
332 r->gateway = getaddr (
336 ro->gateway,
347 r->gateway = rl->spec.remote_endpoint;
350 msg (M_WARN, PACKAGE_NAME " ROUTE: " PACKAGE_NAME " needs a gateway parameter for a --route option and no default was specified by either --route-gateway or --ifconfig options");
396 /* gateway */
397 if (is_route_parm_defined (r6o->gateway))
399 if ( inet_pton( AF_INET6, r6o->gateway, &r6->gateway ) != 1 )
401 msg( M_WARN, PACKAGE_NAME "ROUTE6: cannot parse gateway spec '%s'", r6o->gateway );
406 r6->gateway = rl6->remote_endpoint_ipv6;
410 msg (M_WARN, PACKAGE_NAME " ROUTE6: " PACKAGE_NAME " needs a gateway parameter for a --route-ipv6 option and no default was specified by either --route-ipv6-gateway or --ifconfig-ipv6 options");
451 const char *gateway,
461 ro->gateway = gateway;
469 const char *gateway,
478 ro->gateway = gateway;
513 const struct route_gateway_address *gateway,
518 && rl->rgi.gateway.netmask < 0xFFFFFFFF
527 r.gateway = target;
528 r.network = gateway->addr & gateway->netmask;
529 l2 = ((~gateway->netmask)+1)>>1;
548 /* add bypass for gateway addr */
549 add_bypass_address (&rl->spec.bypass, rl->rgi.gateway.addr);
552 add_block_local_item (rl, &rl->rgi.gateway, rl->spec.remote_endpoint);
554 /* process additional subnets on gateway interface */
559 if (!((rl->rgi.gateway.addr & rl->rgi.gateway.netmask) == (gwa->addr & gwa->netmask)
560 && rl->rgi.gateway.netmask == gwa->netmask))
596 setenv_route_addr (es, "net_gateway", rl->rgi.gateway.addr, -1);
628 msg (M_WARN, PACKAGE_NAME " ROUTE: failed to parse/resolve default gateway: %s",
707 /* "default_gateway" is stuff for "redirect-gateway", which we don't
723 msg (M_WARN, PACKAGE_NAME " ROUTE: failed to parse/resolve default gateway: %s", remote_endpoint);
756 in_addr_t gateway,
767 r.gateway = gateway;
774 in_addr_t gateway,
785 r.gateway = gateway;
791 in_addr_t gateway,
803 gateway,
813 in_addr_t gateway,
825 gateway,
836 const char err[] = "NOTE: unable to redirect default gateway --";
842 msg (M_WARN, "%s VPN gateway parameter (--route-gateway or --ifconfig) is missing", err);
846 msg (M_WARN, "%s Cannot read current default gateway from system", err);
870 /* route remote host to original default gateway */
876 rl->rgi.gateway.addr,
887 /* route DHCP/DNS server traffic through original default gateway */
888 add_bypass_routes (&rl->spec.bypass, rl->rgi.gateway.addr, tt, flags, &rl->rgi, es);
917 rl->rgi.gateway.addr,
950 rl->rgi.gateway.addr,
959 del_bypass_routes (&rl->spec.bypass, rl->rgi.gateway.addr, tt, flags, &rl->rgi, es);
997 rl->rgi.gateway.addr,
1109 show_opt (ro->gateway),
1136 buf_printf (&out, " %s", print_in_addr_t (rgi->gateway.addr, 0, &gc));
1138 buf_printf (&out, "/%s", print_in_addr_t (rgi->gateway.netmask, 0, &gc));
1180 setenv_route_addr (es, "gateway", r->gateway, i);
1216 setenv_str( es, BSTR(&name2), print_in6_addr( r6->gateway, 0, &gc ));
1229 * local_route() determines whether the gateway of a provided host
1230 * route is on the same interface that owns the default gateway.
1236 * gateway interface as the route destination. For example, here
1241 * This capability is needed by the "default-gateway block-local"
1243 * blocked but still allow access to the local default gateway.
1254 in_addr_t gateway,
1261 && gateway == rgi->gateway.addr
1264 if (((network ^ rgi->gateway.addr) & rgi->gateway.netmask) == 0)
1268 /* examine additional subnets on gateway interface */
1281 /* Return true if the "on-link" form of the route should be used. This is when the gateway for a
1300 const char *gateway;
1312 gateway = print_in_addr_t (r->gateway, 0, &gc);
1314 is_local_route = local_route(r->network, r->netmask, r->gateway, rgi);
1325 gateway);
1339 argv_printf_cat (&argv, "gw %s", gateway);
1353 gateway);
1403 gateway);
1407 * == "use gateway specified" (no finer-grained route metrics available)
1430 gateway,
1450 gateway,
1481 gateway,
1500 gateway,
1551 const char *gateway;
1564 gateway = print_in6_addr( r6->gateway, 0, &gc);
1574 network, r6->netbits, gateway, r6->metric, device );
1581 /* On "tun" interface, we never set a gateway if the operating system
1585 * gateway unless the route is to be an on-link network
1601 argv_printf_cat (&argv, "via %s", gateway);
1612 argv_printf_cat (&argv, "gw %s", gateway);
1637 argv_printf_cat( &argv, " %s", gateway );
1668 gateway );
1681 argv_printf_cat (&argv, "%s", gateway);
1695 argv_printf_cat (&argv, "%s", gateway);
1706 network, r6->netbits, gateway );
1715 network, r6->netbits, gateway );
1740 const char *gateway;
1751 gateway = print_in_addr_t (r->gateway, 0, &gc);
1753 is_local_route = local_route(r->network, r->netmask, r->gateway, rgi);
1781 gateway);
1819 gateway);
1829 gateway,
1840 gateway,
1861 gateway,
1873 gateway,
1895 const char *gateway;
1906 gateway = print_in6_addr( r6->gateway, 0, &gc);
1917 /* if we used a gateway on "add route", we also need to specify it on
1935 argv_printf_cat (&argv, "via %s", gateway);
1943 argv_printf_cat (&argv, "gw %s", gateway);
1969 argv_printf_cat( &argv, " %s", gateway );
1991 gateway );
2004 argv_printf_cat (&argv, "%s", gateway);
2018 argv_printf_cat (&argv, "%s", gateway);
2029 network, r6->netbits, gateway );
2038 network, r6->netbits, gateway );
2052 * The --redirect-gateway option requires OS-specific code below
2053 * to get the current default gateway.
2083 const in_addr_t gateway,
2087 DWORD i = adapter_index_of_ip (adapters, gateway, &count, NULL);
2099 const in_addr_t gateway)
2104 c = test_route (adapters, gateway, NULL);
2136 test_route_helper (&ret, &count, &good, &ambig, adapters, rl->routes[i].gateway);
2211 rgi->gateway.addr = ntohl (row->dwForwardNextHop);
2212 if (rgi->gateway.addr)
2215 a_index = adapter_index_of_ip (adapters, rgi->gateway.addr, NULL, &rgi->gateway.netmask);
2244 if (is_ip_in_adapter_subnet (tun_adapter, r->gateway, NULL))
2252 count = test_route (adapters, r->gateway, &ret);
2257 msg (M_WARN, "Warning: route gateway is not reachable on any active network adapters: %s",
2258 print_in_addr_t (r->gateway, 0, &gc));
2263 msg (M_WARN, "Warning: route gateway is ambiguous: %s (%d matches)",
2264 print_in_addr_t (r->gateway, 0, &gc),
2293 fr.dwForwardNextHop = htonl (r->gateway);
2322 --redirect-gateway over RRAS seems to need this. */
2368 fr.dwForwardNextHop = htonl (r->gateway);
2440 /* get default gateway IP addr */
2489 rgi->gateway.addr = best_gw;
2491 if (!rgi->gateway.addr && best_name[0])
2544 /* if point-to-point link, use remote addr as route gateway */
2547 rgi->gateway.addr = ntohl(((struct sockaddr_in *) &ifreq.ifr_addr)->sin_addr.s_addr);
2548 if (rgi->gateway.addr)
2561 if (((rgi->gateway.addr ^ addr) & netmask) != 0)
2565 rgi->gateway.netmask = netmask;
2622 u_long rmx_ssthresh; /* outbound gateway buffer limit */
2707 msg(M_WARN|M_ERRNO, "Could not retrieve default gateway from route socket:");
2740 rgi->gateway.addr = ntohl(((struct sockaddr_in *)gate)->sin_addr.s_addr);
2857 /* get gateway addr and interface name */
2860 /* get default gateway addr */
2861 rgi->gateway.addr = ntohl(((struct sockaddr_in *)gate)->sin_addr.s_addr);
2862 if (rgi->gateway.addr)
2879 /* get netmask of interface that owns default gateway */
2902 rgi->gateway.netmask = ntohl(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr);
2906 /* try to read MAC addr associated with interface that owns default gateway */
2968 #define RTA_GATEWAY 0x2 /* gateway sockaddr present */
2976 #define RTF_GATEWAY 0x2 /* destination is a gateway */
2988 u_long rmx_ssthresh; /* outbound gateway buffer limit */
3073 msg(M_WARN|M_ERRNO, "Could not retrieve default gateway from route socket:");
3106 rgi->gateway.addr = ntohl(((struct sockaddr_in *)gate)->sin_addr.s_addr);
3121 * the current default gateway. Return data is placed into
3127 * 1. default gateway address (rgi->gateway.addr)
3128 * 2. netmask of interface that owns default gateway
3129 * (rgi->gateway.netmask)
3131 * default gateway (rgi->hwaddr)
3133 * gateway (rgi->iface or rgi->adapter_index)
3135 * interface that owns default gateway (rgi->addrs with length
3176 * get_bypass_addresses() is used by the redirect-gateway bypass-x
3214 /* get the route which represents the default gateway */
3219 /* get the adapter which the default gateway is associated with */
3248 * or if it needs to be routed via the default gateway (return
3252 * Used by redirect-gateway autolocal feature
3293 if (local_route (addr, 0xFFFFFFFF, rgi->gateway.addr, rgi))