2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2N/A * Copyright 1990,2000,2001,2002,2003 by the Massachusetts Institute of Technology. 2N/A * All Rights Reserved. 2N/A * Export of this software from the United States of America may 2N/A * require a specific license from the United States Government. 2N/A * It is the responsibility of any person or organization contemplating 2N/A * export to obtain such a license before exporting. 2N/A * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and 2N/A * distribute this software and its documentation for any purpose and 2N/A * without fee is hereby granted, provided that the above copyright 2N/A * notice appear in all copies and that both that copyright notice and 2N/A * this permission notice appear in supporting documentation, and that 2N/A * the name of M.I.T. not be used in advertising or publicity pertaining 2N/A * to distribution of the software without specific, written prior 2N/A * permission. Furthermore if you modify this software you must label 2N/A * your software as modified software and not distribute it in such a 2N/A * fashion that it might be confused with the original M.I.T. software. 2N/A * M.I.T. makes no representations about the suitability of 2N/A * this software for any purpose. It is provided "as is" without express 2N/A * or implied warranty. 2N/A * do DNS SRV RR queries 2N/A * Lookup a KDC via DNS SRV records 2N/A/* Do DNS SRV query, return results in *answers. 2N/A Make best effort to return all the data we can. On memory or 2N/A decoding errors, just return what we've got. Always return 0, 2N/A * First off, build a query of the form: 2N/A * service.protocol.realm 2N/A * which will most likely be something like: 2N/A * _kerberos._udp.REALM 2N/A /* Realm names don't (normally) end with ".", but if the query 2N/A doesn't end with "." and doesn't get an answer as is, the 2N/A resolv code will try appending the local domain. Since the 2N/A realm names are absolutes, let's stop that. 2N/A But only if a name has been specified. If we are performing 2N/A a search on the prefix alone then the intention is to allow 2N/A the local domain or domain search lists to be expanded. */ 2N/A * RFC 2782 says the target is never compressed in the reply; 2N/A * do we believe that? We need to flatten it anyway, though. 2N/A * We got everything! Insert it into our list, but make sure 2N/A * it's in the right order. Right now we don't do anything 2N/A * with the weight field 2N/A /* The returned names are fully qualified. Don't let the 2N/A local resolver code do domain search path stuff. */ 2N/A * This is confusing. Only insert an entry into this 2N/A * The next person has a higher priority (lower priorities 2N/A * There is no next entry (we're at the end)