Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
38 lines
841 B
C
38 lines
841 B
C
/* SPDX-License-Identifier: LGPL-2.1 */
|
|
/*
|
|
* DNS Resolver upcall management for CIFS DFS
|
|
* Handles host name to IP address resolution
|
|
*
|
|
* Copyright (c) International Business Machines Corp., 2008
|
|
* Author(s): Steve French (sfrench@us.ibm.com)
|
|
*
|
|
*/
|
|
|
|
#ifndef _DNS_RESOLVE_H
|
|
#define _DNS_RESOLVE_H
|
|
|
|
#include <linux/net.h>
|
|
#include "cifsglob.h"
|
|
#include "cifsproto.h"
|
|
|
|
int dns_resolve_name(const char *dom, const char *name,
|
|
size_t namelen, struct sockaddr *ip_addr);
|
|
|
|
static inline int dns_resolve_unc(const char *dom, const char *unc,
|
|
struct sockaddr *ip_addr)
|
|
{
|
|
const char *name;
|
|
size_t namelen;
|
|
|
|
if (!unc || strlen(unc) < 3)
|
|
return -EINVAL;
|
|
|
|
extract_unc_hostname(unc, &name, &namelen);
|
|
if (!namelen)
|
|
return -EINVAL;
|
|
|
|
return dns_resolve_name(dom, name, namelen, ip_addr);
|
|
}
|
|
|
|
#endif /* _DNS_RESOLVE_H */
|