Lines Matching refs:ifname
353 char ifname[64]; // Currently, IFNAMSIZ = 16.
362 rawaddrstr, &prefixlen, ifname) == 3) {
364 if (strcmp(name, ifname)) {
383 ret = ifc_del_address(ifname, addrstr, prefixlen);
385 ALOGE("Deleting address %s/%d on %s: %s", addrstr, prefixlen, ifname,
505 int ifc_act_on_ipv4_route(int action, const char *ifname, struct in_addr dst, int prefix_length,
515 rt.rt_dev = (void*) ifname;
573 int ifc_enable(const char *ifname)
578 result = ifc_up(ifname);
583 int ifc_disable(const char *ifname)
589 result = ifc_down(ifname);
591 ifc_set_addr(ifname, 0);
593 if (ifc_get_addr(ifname, &addr) < 0)
596 ifc_set_addr(ifname, 0);
607 int ifc_reset_connections(const char *ifname, const int reset_mask)
618 ifc_get_info(ifname, &myaddr, NULL, NULL);
619 ifc_init_ifr(ifname, &ifr);
655 char ifname[64];
673 ifname, &dest, &gway, &flags, &refcnt, &use, &metric, &mask,
679 || strcmp(ifname, name) != 0) {
690 ifname, inet_ntoa(addr), strerror(errno));
706 int ifc_get_default_route(const char *ifname)
733 && strcmp(ifname, name) == 0) {
747 int ifc_set_default_route(const char *ifname, in_addr_t gateway)
754 if ((result = ifc_create_default_route(ifname, gateway)) < 0) {
756 inet_ntoa(addr), ifname, strerror(errno));
765 int ifc_remove_default_route(const char *ifname)
772 rt.rt_dev = (void *)ifname;
776 ALOGD("failed to remove default route for %s: %s", ifname, strerror(errno));
783 ifc_configure(const char *ifname,
794 if (ifc_up(ifname)) {
795 printerr("failed to turn on interface %s: %s\n", ifname, strerror(errno));
799 if (ifc_set_addr(ifname, address)) {
804 if (ifc_set_prefixLength(ifname, prefixLength)) {
809 if (ifc_create_default_route(ifname, gateway)) {
817 snprintf(dns_prop_name, sizeof(dns_prop_name), "net.%s.dns1", ifname);
819 snprintf(dns_prop_name, sizeof(dns_prop_name), "net.%s.dns2", ifname);
825 int ifc_act_on_ipv6_route(int action, const char *ifname, struct in6_addr dst, int prefix_length,
834 ifindex = if_nametoindex(ifname);
836 printerr("if_nametoindex() failed: interface %s\n", ifname);
872 int ifc_act_on_route(int action, const char *ifname, const char *dst, int prefix_length,
923 ret = ifc_act_on_ipv6_route(action, ifname, ipv6_dst.sin6_addr,
928 ret = ifc_act_on_ipv4_route(action, ifname, ipv4_dst.sin_addr,
944 int ifc_add_ipv4_route(const char *ifname, struct in_addr dst, int prefix_length,
947 int i =ifc_act_on_ipv4_route(SIOCADDRT, ifname, dst, prefix_length, gw);
948 if (DBG) printerr("ifc_add_ipv4_route(%s, xx, %d, xx) = %d", ifname, prefix_length, i);
955 int ifc_add_ipv6_route(const char *ifname, struct in6_addr dst, int prefix_length,
958 return ifc_act_on_ipv6_route(SIOCADDRT, ifname, dst, prefix_length, gw);
961 int ifc_add_route(const char *ifname, const char *dst, int prefix_length, const char *gw)
963 int i = ifc_act_on_route(SIOCADDRT, ifname, dst, prefix_length, gw);
964 if (DBG) printerr("ifc_add_route(%s, %s, %d, %s) = %d", ifname, dst, prefix_length, gw, i);
968 int ifc_remove_route(const char *ifname, const char*dst, int prefix_length, const char *gw)
970 return ifc_act_on_route(SIOCDELRT, ifname, dst, prefix_length, gw);