ares_parse_srv_reply.c revision a3b55a024b03321be969a892cb0992bad14266af
919N/A Async resolver - SRV records parsing 919N/A Jakub Hrozek <jhrozek@redhat.com> 830N/A Copyright (C) Red Hat, Inc 2009 919N/A This program is free software; you can redistribute it and/or modify 919N/A it under the terms of the GNU General Public License as published by 830N/A the Free Software Foundation; either version 3 of the License, or 919N/A (at your option) any later version. 919N/A This program is distributed in the hope that it will be useful, 919N/A but WITHOUT ANY WARRANTY; without even the implied warranty of 919N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 919N/A GNU General Public License for more details. 830N/A You should have received a copy of the GNU General Public License 830N/A * This code is based on other c-ares parsing licensed as follows: 830N/A * Copyright 1998 by the Massachusetts Institute of Technology. 830N/A * Permission to use, copy, modify, and distribute this 830N/A * software and its documentation for any purpose and without 830N/A * fee is hereby granted, provided that the above copyright 830N/A * notice appear in all copies and that both that copyright 830N/A * notice and this permission notice appear in supporting 830N/A * documentation, and that the name of M.I.T. not be used in 830N/A * advertising or publicity pertaining to distribution of the 830N/A * software without specific, written prior permission. 830N/A * M.I.T. makes no representations about the suitability of 830N/A * this software for any purpose. It is provided "as is" 830N/A * without express or implied warranty. 830N/A/* this drags in some private macros c-ares uses */ 830N/A /* Set *srv_out to NULL for all failure cases. */ 830N/A /* Give up if abuf doesn't have room for a header. */ 830N/A /* Fetch the question and answer count from the header. */ 830N/A /* Expand the name from the question, and skip past the question. */ 830N/A /* Examine each answer resource record (RR) in turn. */ 830N/A /* Decode the RR up to the data field. */ 830N/A /* Check if we are really looking at a SRV record */ 830N/A /* parse the SRV record itself */ 830N/A /* Allocate storage for this SRV answer appending it to the list */ 830N/A /* Don't lose memory in the next iteration */ 830N/A /* Move on to the next record */ 830N/A /* clean up on error */ 830N/A /* everything looks fine, return the data */