File Index
Files and directories
Sign in
FILE

dns_resolve.h

File preview with syntax highlighting.

linux-6.19.14/fs/smb/client/dns_resolve.h C
 1/* SPDX-License-Identifier: LGPL-2.1 */
 2/*
 3 *   DNS Resolver upcall management for CIFS DFS
 4 *   Handles host name to IP address resolution
 5 *
 6 *   Copyright (c) International Business Machines  Corp., 2008
 7 *   Author(s): Steve French (sfrench@us.ibm.com)
 8 *
 9 */
10
11#ifndef _DNS_RESOLVE_H
12#define _DNS_RESOLVE_H
13
14#include <linux/net.h>
15#include "cifsglob.h"
16#include "cifsproto.h"
17
18int dns_resolve_name(const char *dom, const char *name,
19		     size_t namelen, struct sockaddr *ip_addr);
20
21static inline int dns_resolve_unc(const char *dom, const char *unc,
22				  struct sockaddr *ip_addr)
23{
24	const char *name;
25	size_t namelen;
26
27	if (!unc || strlen(unc) < 3)
28		return -EINVAL;
29
30	extract_unc_hostname(unc, &name, &namelen);
31	if (!namelen)
32		return -EINVAL;
33
34	return dns_resolve_name(dom, name, namelen, ip_addr);
35}
36
37#endif /* _DNS_RESOLVE_H */
~/ Read-only file preview.