2021-06-18 00:31:49 -05:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1 */
|
2008-01-10 17:10:23 +00:00
|
|
|
/*
|
2021-09-13 14:51:10 -05:00
|
|
|
* DNS Resolver upcall management for CIFS DFS
|
|
|
|
* Handles host name to IP address resolution
|
2008-02-07 23:25:02 +00:00
|
|
|
*
|
2008-01-10 17:10:23 +00:00
|
|
|
* Copyright (c) International Business Machines Corp., 2008
|
|
|
|
* Author(s): Steve French (sfrench@us.ibm.com)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _DNS_RESOLVE_H
|
|
|
|
#define _DNS_RESOLVE_H
|
|
|
|
|
2022-10-04 18:41:36 -03:00
|
|
|
#include <linux/net.h>
|
2025-01-07 12:22:50 -03:00
|
|
|
#include "cifsglob.h"
|
|
|
|
#include "cifsproto.h"
|
2022-10-04 18:41:36 -03:00
|
|
|
|
2008-01-10 17:10:23 +00:00
|
|
|
#ifdef __KERNEL__
|
2025-01-07 12:22:50 -03:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2008-01-10 17:10:23 +00:00
|
|
|
#endif /* KERNEL */
|
|
|
|
|
|
|
|
#endif /* _DNS_RESOLVE_H */
|