Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
95ae3ef2
Commit
95ae3ef2
authored
9 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
Oops. Forgot to add a file in a previous commit
parent
21905bff
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libc/netdb/lib_dns.h
+118
-0
118 additions, 0 deletions
libc/netdb/lib_dns.h
with
118 additions
and
0 deletions
libc/netdb/lib_dns.h
0 → 100644
+
118
−
0
View file @
95ae3ef2
/****************************************************************************
* libc/netdb/lib_dns.h
* DNS resolver code header file.
*
* Copyright (C) 2007-2009, 2011-2012, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Inspired by/based on uIP logic by Adam Dunkels:
*
* Copyright (c) 2002-2003, Adam Dunkels. All rights reserved.
* Author Adam Dunkels <adam@dunkels.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __LIBC_NETDB_LIB_DNS_H
#define __LIBC_NETDB_LIB_DNS_H
/****************************************************************************
* Included Files
****************************************************************************/
#include
<nuttx/config.h>
#include
<netinet/in.h>
#include
<nuttx/net/netconfig.h>
#include
<nuttx/net/dns.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* DNS client configuration **************************************************/
#ifndef CONFIG_NETDB_DNSCLIENT_ENTRIES
# define RESOLV_ENTRIES 4
#else
# define RESOLV_ENTRIES CONFIG_NETDB_DNSCLIENT_ENTRIES
#endif
#ifndef CONFIG_NETDB_DNSCLIENT_MAXRESPONSE
# define CONFIG_NETDB_DNSCLIENT_MAXRESPONSE 96
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern
"C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Name: dns_bind
*
* Description:
* Initialize the DNS resolver and return a socket bound to the DNS name
* server. The name server was previously selected via dns_server().
*
* Input Parameters:
* None
*
* Returned Value:
* On success, the bound, non-negative socket descriptor is returned. A
* negated errno value is returned on any failure.
*
****************************************************************************/
int
dns_bind
(
void
);
/****************************************************************************
* Name: dns_query
*
* Description:
* Using the DNS resolver socket (sockfd), look up the the 'hostname', and
* return its IP address in 'ipaddr'
*
* Returned Value:
* Returns zero (OK) if the query was successful.
*
****************************************************************************/
int
dns_query
(
int
sockfd
,
FAR
const
char
*
hostname
,
FAR
in_addr_t
*
ipaddr
);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif
/* __LIBC_NETDB_LIB_DNS_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment