Lines Matching refs:length
94 || f->addressFamily->length < 2) in X509v3_addr_get_afi()
105 const int length, const unsigned char fill) in addr_expand() argument
107 if (bs->length < 0 || bs->length > length) in addr_expand()
109 if (bs->length > 0) { in addr_expand()
110 memcpy(addr, bs->data, bs->length); in addr_expand()
115 addr[bs->length - 1] &= ~mask; in addr_expand()
117 addr[bs->length - 1] |= mask; in addr_expand()
120 memset(addr + bs->length, fill, length - bs->length); in addr_expand()
127 # define addr_prefixlen(bs) ((int)((bs)->length * 8 - ((bs)->flags & 7)))
139 if (bs->length < 0) in i2r_address()
161 for (i = 0; i < bs->length; i++) in i2r_address()
226 if (f->addressFamily->length > 2) { in i2r_IPAddrBlocks()
286 const IPAddressOrRange *b, const int length) in IPAddressOrRange_cmp() argument
294 if (!addr_expand(addr_a, a->u.addressPrefix, length, 0x00)) in IPAddressOrRange_cmp()
299 if (!addr_expand(addr_a, a->u.addressRange->min, length, 0x00)) in IPAddressOrRange_cmp()
301 prefixlen_a = length * 8; in IPAddressOrRange_cmp()
309 if (!addr_expand(addr_b, b->u.addressPrefix, length, 0x00)) in IPAddressOrRange_cmp()
314 if (!addr_expand(addr_b, b->u.addressRange->min, length, 0x00)) in IPAddressOrRange_cmp()
316 prefixlen_b = length * 8; in IPAddressOrRange_cmp()
322 if ((r = memcmp(addr_a, addr_b, length)) != 0) in IPAddressOrRange_cmp()
353 const unsigned char *max, const int length) in range_should_be_prefix() argument
363 assert(memcmp(min, max, length) <= 0); in range_should_be_prefix()
365 for (i = 0; i < length && min[i] == max[i]; i++) ; in range_should_be_prefix()
366 for (j = length - 1; j >= 0 && min[j] == 0x00 && max[j] == 0xFF; j--) ; in range_should_be_prefix()
441 unsigned char *max, const int length) in make_addressRange() argument
446 if (memcmp(min, max, length) > 0) in make_addressRange()
449 if ((prefixlen = range_should_be_prefix(min, max, length)) >= 0) in make_addressRange()
450 return make_addressPrefix(result, min, prefixlen, length); in make_addressRange()
464 for (i = length; i > 0 && min[i - 1] == 0x00; --i) ; in make_addressRange()
477 for (i = length; i > 0 && max[i - 1] == 0xFF; --i) ; in make_addressRange()
521 if (f->addressFamily->length == keylen && in make_IPAddressFamily()
633 int length = length_from_afi(afi); in X509v3_addr_add_range() local
637 if (!make_addressRange(&aor, min, max, length)) in X509v3_addr_add_range()
649 unsigned char *min, unsigned char *max, int length) in extract_min_max() argument
655 return (addr_expand(min, aor->u.addressPrefix, length, 0x00) && in extract_min_max()
656 addr_expand(max, aor->u.addressPrefix, length, 0xFF)); in extract_min_max()
658 return (addr_expand(min, aor->u.addressRange->min, length, 0x00) && in extract_min_max()
659 addr_expand(max, aor->u.addressRange->max, length, 0xFF)); in extract_min_max()
670 unsigned char *max, const int length) in X509v3_addr_get_range() argument
675 afi_length == 0 || length < afi_length || in X509v3_addr_get_range()
699 int len = ((a->length <= b->length) ? a->length : b->length); in IPAddressFamily_cmp()
702 return cmp ? cmp : a->length - b->length; in IPAddressFamily_cmp()
707 if (f->addressFamily->length < 2 || f->addressFamily->length > 3) in IPAddressFamily_check_len()
748 int length = length_from_afi(X509v3_addr_get_afi(f)); in X509v3_addr_is_canonical() local
778 if (!extract_min_max(a, a_min, a_max, length) || in X509v3_addr_is_canonical()
779 !extract_min_max(b, b_min, b_max, length)) in X509v3_addr_is_canonical()
785 if (memcmp(a_min, b_min, length) >= 0 || in X509v3_addr_is_canonical()
786 memcmp(a_min, a_max, length) > 0 || in X509v3_addr_is_canonical()
787 memcmp(b_min, b_max, length) > 0) in X509v3_addr_is_canonical()
794 for (k = length - 1; k >= 0 && b_min[k]-- == 0x00; k--) ; in X509v3_addr_is_canonical()
795 if (memcmp(a_max, b_min, length) >= 0) in X509v3_addr_is_canonical()
802 range_should_be_prefix(a_min, a_max, length) >= 0) in X509v3_addr_is_canonical()
815 if (!extract_min_max(a, a_min, a_max, length)) in X509v3_addr_is_canonical()
817 if (memcmp(a_min, a_max, length) > 0 || in X509v3_addr_is_canonical()
818 range_should_be_prefix(a_min, a_max, length) >= 0) in X509v3_addr_is_canonical()
836 int i, j, length = length_from_afi(afi); in IPAddressOrRanges_canonize() local
852 if (!extract_min_max(a, a_min, a_max, length) || in IPAddressOrRanges_canonize()
853 !extract_min_max(b, b_min, b_max, length)) in IPAddressOrRanges_canonize()
859 if (memcmp(a_min, a_max, length) > 0 || in IPAddressOrRanges_canonize()
860 memcmp(b_min, b_max, length) > 0) in IPAddressOrRanges_canonize()
866 if (memcmp(a_max, b_min, length) >= 0) in IPAddressOrRanges_canonize()
873 for (j = length - 1; j >= 0 && b_min[j]-- == 0x00; j--) ; in IPAddressOrRanges_canonize()
874 if (memcmp(a_max, b_min, length) == 0) { in IPAddressOrRanges_canonize()
877 if (!make_addressRange(&merged, a_min, b_max, length)) in IPAddressOrRanges_canonize()
898 if (!extract_min_max(a, a_min, a_max, length)) in IPAddressOrRanges_canonize()
900 if (memcmp(a_min, a_max, length) > 0) in IPAddressOrRanges_canonize()
957 int prefixlen, i1, i2, delim, length; in v2i_IPAddrBlocks() local
984 length = length_from_afi(afi); in v2i_IPAddrBlocks()
1030 if (ossl_a2i_ipadd(min, s) != length) { in v2i_IPAddrBlocks()
1041 || prefixlen > (length * 8) in v2i_IPAddrBlocks()
1060 if (ossl_a2i_ipadd(max, s + i1) != length) { in v2i_IPAddrBlocks()
1076 if (!X509v3_addr_add_prefix(addr, afi, safi, min, length * 8)) { in v2i_IPAddrBlocks()
1143 IPAddressOrRanges *child, int length) in addr_contains() argument
1157 c_min, c_max, length)) in addr_contains()
1163 p_min, p_max, length)) in addr_contains()
1165 if (memcmp(p_max, c_max, length) < 0) in addr_contains()
1167 if (memcmp(p_min, c_min, length) > 0) in addr_contains()