Lines Matching refs:prefix_length

61 in_addr_t prefixLengthToIpv4Netmask(int prefix_length)
66 if (prefix_length <= 0 || prefix_length > 32) {
70 mask = ~mask << (32 - prefix_length);
504 int ifc_act_on_ipv4_route(int action, const char *ifname, struct in_addr dst, int prefix_length,
516 netmask = prefixLengthToIpv4Netmask(prefix_length);
521 if (prefix_length == 32) {
820 int ifc_act_on_ipv6_route(int action, const char *ifname, struct in6_addr dst, int prefix_length,
837 rtmsg.rtmsg_dst_len = prefix_length;
840 if (prefix_length == 128) {
867 int ifc_act_on_route(int action, const char *ifname, const char *dst, int prefix_length,
894 if (((addr_ai->ai_family == AF_INET6) && (prefix_length < 0 || prefix_length > 128)) ||
895 ((addr_ai->ai_family == AF_INET) && (prefix_length < 0 || prefix_length > 32))) {
919 prefix_length, ipv6_gw.sin6_addr);
924 prefix_length, ipv4_gw.sin_addr);
939 int ifc_add_ipv4_route(const char *ifname, struct in_addr dst, int prefix_length,
942 int i =ifc_act_on_ipv4_route(SIOCADDRT, ifname, dst, prefix_length, gw);
943 if (DBG) printerr("ifc_add_ipv4_route(%s, xx, %d, xx) = %d", ifname, prefix_length, i);
950 int ifc_add_ipv6_route(const char *ifname, struct in6_addr dst, int prefix_length,
953 return ifc_act_on_ipv6_route(SIOCADDRT, ifname, dst, prefix_length, gw);
956 int ifc_add_route(const char *ifname, const char *dst, int prefix_length, const char *gw)
958 int i = ifc_act_on_route(SIOCADDRT, ifname, dst, prefix_length, gw);
959 if (DBG) printerr("ifc_add_route(%s, %s, %d, %s) = %d", ifname, dst, prefix_length, gw, i);
963 int ifc_remove_route(const char *ifname, const char*dst, int prefix_length, const char *gw)
965 return ifc_act_on_route(SIOCDELRT, ifname, dst, prefix_length, gw);