17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
+
+
-
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
+
+
-
+
+
+
+
+
-
+
-
-
-
-
+
+
-
-
-
+
-
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <arpa/nameser.h>
#include <resolv.h>
#import <ObjFW/ObjFW.h>
@interface XMPPSRVEntry: OFObject
{
uint16_t priority;
uint16_t weight;
uint16_t weight, accumulatedWeight;
uint16_t port;
OFString *target;
}
#ifdef OF_HAVE_PROPERTIES
@property uint16_t priority;
@property uint16_t weight;
@property uint16_t port;
@property (copy) OFString *target;
@property (readonly, assign) uint16_t priority;
@property (readonly, assign) uint16_t weight;
@property (assign) uint16_t accumulatedWeight;
@property (readonly, assign) uint16_t port;
@property (readonly, copy) OFString *target;
#endif
- (void) setPriority: (uint16_t)priority_;
- (uint16_t) priority;
- (void) setWeight: (uint16_t)weight_;
- (uint16_t) weight;
- (void) setPort: (uint16_t)port_;
- (uint16_t) port;
+ entryWithPriority: (uint16_t)priority
weight: (uint16_t)weight
port: (uint16_t)port
target: (OFString*)target;
+ entryWithResourceRecord: (ns_rr)resourceRecord
handle: (ns_msg)handle;
- initWithPriority: (uint16_t)priority
weight: (uint16_t)weight
port: (uint16_t)port
target: (OFString*)target;
- initWithResourceRecord: (ns_rr)resourceRecord
handle: (ns_msg)handle;
- (uint16_t)priority;
- (uint16_t)weight;
- (uint16_t)port;
- (void) setTarget: (OFString*)target_;
- (OFString*) target;
- (OFString*)target;
@end
@interface XMPPSRVEnumerator: OFEnumerator <OFFastEnumeration>
@interface XMPPSRVEnumerator: OFEnumerator
{
OFString *domain;
struct __res_state resState;
OFList *priorityList;
OFList *list;
of_list_object_t *listIter;
OFList *subListCopy;
BOOL done;
}
#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *domain;
@property (readonly, copy) OFString *domain;
#endif
+ enumeratorWithDomain: (OFString*)domain;
- initWithDomain: (OFString*)domain;
- (void) setDomain: (OFString*)domain;
- (OFString*) domain;
- (void)XMPP_parseSRVRRWithHandle: (const ns_msg)handle
- (OFString*)domain;
- (void)lookUpEntries;
RR: (const ns_rr)rr
result: (XMPPSRVEntry*)result;
- (void)XMPP_addSRVEntry: (XMPPSRVEntry*)item
- (void)XMPP_addEntry: (XMPPSRVEntry*)item;
toSortedPriorityList: (OFList*)list;
@end
|