From a5b204dd5b30eb9a9c3e7c88132e8e26b7400f10 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 4 Sep 2009 21:56:14 +0000 Subject: - Jakub Hrozek added ares_parse_srv_reply() for SRV parsing --- ares.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ares.h') diff --git a/ares.h b/ares.h index f64e862..bfca7da 100644 --- a/ares.h +++ b/ares.h @@ -1,6 +1,6 @@ /* $Id$ */ -/* Copyright 1998 by the Massachusetts Institute of Technology. +/* Copyright 1998, 2009 by the Massachusetts Institute of Technology. * Copyright (C) 2007-2009 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this @@ -322,6 +322,13 @@ struct addr6ttl { int ttl; }; +struct srv_reply { + u_int16_t weight; + u_int16_t priority; + u_int16_t port; + char *host; +}; + /* ** Parse the buffer, starting at *abuf and of length alen bytes, previously ** obtained from an ares_search call. Put the results in *host, if nonnull. @@ -339,6 +346,8 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, int addrlen, int family, struct hostent **host); int ares_parse_ns_reply(const unsigned char *abuf, int alen, struct hostent **host); +int ares_parse_srv_reply(const unsigned char* abuf, int alen, + struct srv_reply** srv_out, int *nsrvreply); void ares_free_string(void *str); void ares_free_hostent(struct hostent *host); const char *ares_strerror(int code); -- cgit v1.2.3