~ubuntu-branches/ubuntu/precise/pdnsd/precise

« back to all changes in this revision

Viewing changes to src/ipvers.h

  • Committer: Bazaar Package Importer
  • Author(s): Mahyuddin Susanto
  • Date: 2011-03-09 18:54:22 UTC
  • mfrom: (1.3.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110309185422-33hwmg565m18dpu4
Tags: 1.2.8-par-1
* New Maintainer. (Closes: #596302)
* New Upstream Releases. (Closes: #596302, LP: #712938)
* debian/patches/05_fix_spelling.patch: Fix spelling errors.
* debian/patches/04_ipv6_localhost.patch. Adding ipv6 in localhost.
  (Closes: #466332, #504211)
* debian/init.d:
  - Add init status. (Closes: #476538)
  - Don't says starting pdnsd if already started. (Closes: #487467)
* deban/changelog: Fix incorrect date in 1.2.7-par-1 (Closes: #527352)
* debian/control:
  - Add Vcs-Browser and Vcs-Git to alioth.
  - Bump Standards-Version to 3.9.1.
* debian/copyright: Updated as per DEP-5 specification.
* debian/pdnsd-recurse.conf:
  - Adding recurse mode. (Closes: #602262)
  - Fixing recursive neg section. (Closes: #519656)
* doc/pdnsd.conf.in: Separate ip address by new line. Thanks to
  Raphael Geissert. (Closes: #597734)
* perm_cache size set to default. (Closes: #602329)
  - doc/pdnsd.conf.in
  - debian/pdnsd.conf
  - debian/pdnsd-recurse.conf
  - debian/pdnsd-resolvconf.conf
* debian/002_NetMan_pdnsd: add compabilty with WiFi. 
  (Closes: #617373, LP: #452351)
* Ack'd NMU upload. (Closes: #548173)
* Update debconf Indonesian translations. (Closes: #610148)
* Switch to quilt system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* ipvers.h - definitions for IPv4 and IPv6
2
2
 
3
3
   Copyright (C) 2000, 2001 Thomas Moestl
4
 
   Copyright (C) 2003, 2007 Paul A. Rombouts
 
4
   Copyright (C) 2003, 2007, 2009 Paul A. Rombouts
5
5
 
6
6
  This file is part of the pdnsd package.
7
7
 
64
64
#endif
65
65
#ifdef ENABLE_IPV6
66
66
#define DEFAULT_IPV4_6_PREFIX "::ffff:0.0.0.0"
67
 
extern short int cmdlineprefix;
 
67
/* extern short int cmdlineprefix; */
68
68
#endif
69
69
 
70
70
#if (TARGET==TARGET_LINUX) && !defined(HAVE_STRUCT_IN_PKTINFO)
186
186
 
187
187
#ifdef ENABLE_IPV4
188
188
# ifdef ENABLE_IPV6
189
 
#  define ADDR_EQUIV(a,b) ((run_ipv4 && ADDR_EQUIV4(a,b)) || (!run_ipv4 && ADDR_EQUIV6(a,b)))
 
189
#  define ADDR_EQUIV(a,b) (run_ipv4? ADDR_EQUIV4(a,b): ADDR_EQUIV6(a,b))
190
190
# else
191
191
#  define ADDR_EQUIV(a,b) ADDR_EQUIV4(a,b)
192
192
# endif
251
251
#endif
252
252
} pdnsd_a;
253
253
 
 
254
/* The pdnsd_a2 type is very similar to pdnsd_a, but can hold
 
255
   both an IPv4 and an IPv6 address at the same time,
 
256
   i.e. a struct instead of a union.
 
257
*/
 
258
typedef struct {
 
259
#ifdef ENABLE_IPV6
 
260
        struct in6_addr  ipv6;
 
261
#endif
 
262
        struct in_addr   ipv4;
 
263
} pdnsd_a2;
 
264
 
 
265
/* Macros/functions for assigning/converting a pdnsd_a* to a pdnsd_a2* type,
 
266
   and vice versa.
 
267
*/
 
268
#ifdef ENABLE_IPV6
 
269
inline static void SET_PDNSD_A2(pdnsd_a2 *a2, pdnsd_a *a) __attribute__((always_inline));
 
270
inline static void SET_PDNSD_A2(pdnsd_a2 *a2, pdnsd_a *a)
 
271
{
 
272
#ifdef ENABLE_IPV4
 
273
        if(run_ipv4)
 
274
                a2->ipv4=a->ipv4;
 
275
        else
 
276
#endif
 
277
        {
 
278
                a2->ipv6=a->ipv6;
 
279
                a2->ipv4.s_addr=INADDR_ANY;
 
280
        }
 
281
}
 
282
#else
 
283
# define SET_PDNSD_A2(a2,a) ((a2)->ipv4=(a)->ipv4)
 
284
#endif
 
285
 
 
286
#ifdef ENABLE_IPV4
 
287
# ifdef ENABLE_IPV6
 
288
#  define PDNSD_A2_TO_A(a2) (run_ipv4?((pdnsd_a *)&(a2)->ipv4):((pdnsd_a *)&(a2)->ipv6))
 
289
# else
 
290
#  define PDNSD_A2_TO_A(a2) ((pdnsd_a *)&(a2)->ipv4)
 
291
# endif
 
292
#else
 
293
#  define PDNSD_A2_TO_A(a2) ((pdnsd_a *)&(a2)->ipv6)
 
294
#endif
 
295
 
254
296
/* Do we have sufficient support in the C libraries to allow local AAAA records
255
297
   to be defined? */
256
298
#if defined(DNS_NEW_RRS) && defined(HAVE_STRUCT_IN6_ADDR) && defined(HAVE_INET_PTON)