5 // Copyright (c) 2011-2017 Apple Inc. All rights reserved.
8 #ifndef __SI_COMPARE_H__
9 #define __SI_COMPARE_H__
11 #include <sys/cdefs.h>
12 #include <sys/socket.h>
14 #include <os/availability.h>
20 * @function si_destination_compare
22 * Equivalent to the si_destination_compare function, but doesn't take any routing table information
23 * into account. This follows rules 6, 8 and 10 of RFC 6724 destination address selection.
26 * The first potential destination address.
29 * The second potential destination address.
32 * Returns -1 if destination1 is less desirable than destination 2. Returns 0 if destination1
33 * is equally as desirable as destination 2. Returns 1 if destination 1 is more desirable than
36 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
37 int si_destination_compare(const struct sockaddr
*dst1
, int dst1ifindex
,
38 const struct sockaddr
*dst2
, int dst2ifindex
,
42 * @function si_destination_compare_no_dependencies
44 * Equivalent to the si_destination_compare function, but doesn't take any routing table information
45 * into account. This follows rules 6, 8 and 10 of RFC 6724 destination address selection.
48 * The first potential destination address.
51 * The second potential destination address.
54 * Returns -1 if destination1 is less desirable than destination 2. Returns 0 if destination1
55 * is equally as desirable as destination 2. Returns 1 if destination 1 is more desirable than
58 API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0))
60 si_destination_compare_no_dependencies(const struct sockaddr
*destination1
,
61 const struct sockaddr
*destination2
);
65 #endif // __SI_COMPARE_H__