1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
samba-mirror/source3/libaddns/dnserr.h
Gerald Carter 5693e6c599 r17798: Beginnings of a standalone libaddns library released under
the LGPL.   Original code by Krishna Ganugapati <krishnag@centeris.com>.
Additional work by me.

It's still got some warts, but non-secure updates do
currently work.  There are at least four things left to
really clean up.

1. Change the memory management to use talloc() rather than
   malloc() and cleanup the leaks.
2. Fix the error code reporting (see initial changes to
   dnserr.h)
3. Fix the secure updates
4. Define a public interface in addns.h
5. Move the code in libads/dns.c into the libaddns/ directory
   (and under the LGPL).

A few notes:

* Enable the new code by compiling with --with-dnsupdate
* Also adds the command 'net ads dns register'
* Requires -luuid (included in the e2fsprogs-devel package).
* Has only been tested on Linux platforms so there may be portability
  issues.
(This used to be commit 36f04674ae)
2007-10-10 11:38:48 -05:00

75 lines
2.3 KiB
C

/*
Error codes for Linux DNS client library implementation
Copyright (C) 2006 Krishna Ganugapati <krishnag@centeris.com>
Copyright (C) 2006 Gerald Carter <jerry@samba.org>
** NOTE! The following LGPL license applies to the libaddns
** library. This does NOT imply that all of Samba is released
** under the LGPL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#ifndef _DNSERR_H
#define _DNSERR_H
/* The Splint code analysis tool (http://www.splint.org.) doesn't
like immediate structures. */
#ifdef _SPLINT_
#undef HAVE_IMMEDIATE_STRUCTURES
#endif
/* Setup the DNS_ERROR typedef. Technique takes from nt_status.h */
#if defined(HAVE_IMMEDIATE_STRUCTURES)
typedef struct {uint32 v;} DNS_ERROR;
#define ERROR_DNS(x) ((DNS_ERROR) { x })
#define ERROR_DNS_V(x) ((x).v)
#else
typedef uint32 DNS_ERROR;
#define ERROR_DNS(x) (x)
#define ERROR_DNS_V(x) (x)
#endif
#define ERR_DNS_IS_OK(x) (ERROR_DNS_V(x) == 0)
#define ERR_DNS_EQUAL(x,y) (ERROR_DNS_V(x) == ERROR_DNS_V(y))
/*************************************************
* Define the error codes here
*************************************************/
#define ERROR_DNS_SUCCESS ERROR_DNS(0)
#define ERROR_DNS_RECORD_NOT_FOUND ERROR_DNS(1)
#define ERROR_DNS_BAD_RESPONSE ERROR_DNS(2)
#define ERROR_DNS_INVALID_PARAMETER ERROR_DNS(3)
#define ERROR_DNS_NO_MEMORY ERROR_DNS(4)
#define ERROR_DNS_INVALID_NAME_SERVER ERROR_DNS(5)
#define ERROR_DNS_CONNECTION_FAILED ERROR_DNS(6)
#define ERROR_BAD_RESPONSE 1
#define ERROR_RECORD_NOT_FOUND 2
#define ERROR_OUTOFMEMORY 8
#if !defined(ERROR_INVALID_PARAMETER)
#define ERROR_INVALID_PARAMETER 87
#endif
#endif /* _DNSERR_H */