]> git.saurik.com Git - apple/configd.git/blobdiff - dnsinfo/dnsinfo_private.h
configd-453.19.tar.gz
[apple/configd.git] / dnsinfo / dnsinfo_private.h
index 5e6ac0e5a04f8c2622eebd4e052ec4d7edf8cfed..58128a8e05b745330ef3ac2d13d8ecc2da115015 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004-2006, 2008, 2009 Apple Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -25,7 +25,7 @@
 #define __DNSINFO_PRIVATE_H__
 
 
-#include <AvailabilityMacros.h>
+#include <Availability.h>
 #include <sys/cdefs.h>
 #include <stdint.h>
 #include <sys/types.h>
@@ -35,8 +35,6 @@
 
 #include "dnsinfo.h"
 
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
-
 /*
  * What's all of this stuff about???
  *
  * +-------------------------------------------------------------------+
  * | struct _dns_config_buf_t                                          |
  * +-+-------------+---------------------------------------------------+
- * | | config      | struct dns_config_t                              |
- * | |            +-+--------------+----------------------------------+
- * | |             | | n_resolver   | int32_t                          | <- # of name resolvers
- * | |            | +--------------+----------------------------------+
- * | |             | | resolver     | dns_resolver_t **                | <- not used during creation, filled
- * | |             | |              |                                  |    in with pointer to a list of
- * | |            | |              |                                  |    resolver configurations which be
- * | |            | |              |                                  |    established in the "padding"
- * | |            | +--------------+----------------------------------+
- * | |            | | ...          | ...                              |
- * | +-------------+-+--------------+----------------------------------+
+ * | | config      | struct dns_config_t                               |
+ * | |             +-+-------------------+-----------------------------+
+ * | |             | | n_resolver        | int32_t                     | <- # of name resolvers
+ * | |             | +-------------------+-----------------------------+
+ * | |             | | resolver          | dns_resolver_t **           | <- not used during creation, filled
+ * | |             | |                   |                             |    in with pointer to a list of
+ * | |             | |                   |                             |    resolver configurations that will
+ * | |             | |                   |                             |    be established in the "padding"
+ * | |             | +-------------------+-----------------------------+
+ * | |             | | n_scoped_resolver | int32_t                     | <- # of name scoped resolvers
+ * | |             | +-------------------+-----------------------------+
+ * | |             | | scoped_resolver   | dns_resolver_t **           | <- not used during creation, filled
+ * | |             | |                   |                             |    in with pointer to a list of scoped
+ * | |             | |                   |                             |    resolver configurations  that will
+ * | |             | |                   |                             |    be established in the "padding"
+ * | |             | +-------------------+-----------------------------+
+ * | |             | | ...               | ...                         |
+ * | +-------------+-+-------------------+-----------------------------+
  * | | n_attribute | uint32_t                                          | <- how many bytes of "attribute"
- * | |            |                                                   |    data is associated with the
- * | |            |                                                   |    configuration
+ * | |             |                                                   |    data is associated with the
+ * | |             |                                                   |    configuration
  * |-+-------------+---------------------------------------------------+
  * | | n_padding   | uint32_t                                          | <- how many additional bytes
- * | |            |                                                   |    for arrays (of pointers), ...
+ * | |             |                                                   |    for arrays (of pointers), ...
  * +-+-------------+---------------------------------------------------+
  * | struct dns_attribute_t                                            |
  * |-+-------------+---------------------------------------------------+
  * | | attribute   | struct _dns_resolver_buf_t                        | <- the attribute data (resolver configuration #1)
  * | |             +-+-------------+-----------------------------------+
  * | |             | | resolver    | struct dns_resolver_t             |
- * | |             | |            +--------------+--------------------+
- * | |             | |            | domain       | char *             | <- not used during creation,
- * | |             | |            |              |                    |    filled in with pointer to
- * | |             | |            |              |                    |    domain name in the "padding"
- * | |             | |            +--------------+--------------------+
- * | |             | |            | n_nameserver | int32_t            | <- # of name server addresses
- * | |             | |            +--------------+--------------------+
- * | |             | |            | nameserver   | struct sockaddr ** | <- not used during creation,
- * | |             | |            |              |                    |    filled in with pointer to
- * | |             | |            |              |                    |    a list of addresses which
- * | |             | |            |              |                    |    will be established in the
- * | |             | |            |              |                    |    "padding"
- * | |             | |            +--------------+--------------------+
- * | |             | |            | ...                               |
+ * | |             | |             +--------------+--------------------+
+ * | |             | |             | domain       | char *             | <- not used during creation,
+ * | |             | |             |              |                    |    filled in with pointer to
+ * | |             | |             |              |                    |    domain name in the "padding"
+ * | |             | |             +--------------+--------------------+
+ * | |             | |             | n_nameserver | int32_t            | <- # of name server addresses
+ * | |             | |             +--------------+--------------------+
+ * | |             | |             | nameserver   | struct sockaddr ** | <- not used during creation,
+ * | |             | |             |              |                    |    filled in with pointer to
+ * | |             | |             |              |                    |    a list of addresses which
+ * | |             | |             |              |                    |    will be established in the
+ * | |             | |             |              |                    |    "padding"
+ * | |             | |             +--------------+--------------------+
+ * | |             | |             | ...                               |
  * | |             +-+-------------+--------------+--------------------+
  * | |             | | n_attribute | uint32_t                          |
  * | |             +-+-------------+-----------------------------------+
  * | |             | | attribute   | struct dns_attribute_t            |
- * | |             | |            +-+-----------+---------------------+
- * | |             | |            | | type      | uint32_t            | <- type of attribute (e.g. RESOLVER_ATTRIBUTE_DOMAIN)
- * | |             | |            | +-----------+---------------------+
+ * | |             | |             +-+-----------+---------------------+
+ * | |             | |             | | type      | uint32_t            | <- type of attribute (e.g. RESOLVER_ATTRIBUTE_DOMAIN)
+ * | |             | |             | +-----------+---------------------+
  * | |             | |             | | length    | uint32_t            | <- length of the attribute
- * | |             | |            | +-----------+---------------------+
- * | |             | |            | | attribute |                     | <- the attribute data ("apple.com")
+ * | |             | |             | +-----------+---------------------+
+ * | |             | |             | | attribute |                     | <- the attribute data ("apple.com")
  * | |             +-+-------------+-------------+---------------------+
  * | |             | | attribute   | struct dns_attribute_t            |
- * | |             | |            +-+-----------+---------------------+
- * | |             | |            | | type      | uint32_t            | <- type of attribute (e.g. RESOLVER_ATTRIBUTE_ADDRESS)
- * | |             | |            | +-----------+---------------------+
+ * | |             | |             +-+-----------+---------------------+
+ * | |             | |             | | type      | uint32_t            | <- type of attribute (e.g. RESOLVER_ATTRIBUTE_ADDRESS)
+ * | |             | |             | +-----------+---------------------+
  * | |             | |             | | length    | uint32_t            | <- length of the attribute
- * | |             | |            | +-----------+---------------------+
- * | |             | |            | | attribute |                     | <- the attribute data ("struct sockaddr_in" #1)
+ * | |             | |             | +-----------+---------------------+
+ * | |             | |             | | attribute |                     | <- the attribute data ("struct sockaddr_in" #1)
  * | |             +---------------+-----------------------------------+
  * | |             | | attribute   | struct dns_attribute_t            |
- * | |             | |            +-+-----------+---------------------+
- * | |             | |            | | type      | uint32_t            | <- type of attribute (e.g. RESOLVER_ATTRIBUTE_ADDRESS)
- * | |             | |            | +-----------+---------------------+
+ * | |             | |             +-+-----------+---------------------+
+ * | |             | |             | | type      | uint32_t            | <- type of attribute (e.g. RESOLVER_ATTRIBUTE_ADDRESS)
+ * | |             | |             | +-----------+---------------------+
  * | |             | |             | | length    | uint32_t            | <- length of the attribute
- * | |             | |            | +-----------+---------------------+
- * | |             | |            | | attribute |                     | <- the attribute data ("struct sockaddr_in" #2)
+ * | |             | |             | +-----------+---------------------+
+ * | |             | |             | | attribute |                     | <- the attribute data ("struct sockaddr_in" #2)
  * | |             +---------------+-----------------------------------+
- * | |             | ...                                              |
+ * | |             | ...                                               |
  * +-+-------------+---------------------------------------------------+
- * | | attribute   | struct _dns_resolver_buf_t                               | <- the attribute data (resolver configuration #2)
+ * | | attribute   | struct _dns_resolver_buf_t                        | <- the attribute data (resolver configuration #2)
  * | |             +---------------+-----------------------------------+
- * | |             | ...                                              |
+ * | |             | ...                                               |
  * +---------------+---------------------------------------------------+
- * | | ...                                                            |
+ * | | ...                                                             |
  * +---------------+---------------------------------------------------+
  *
  * When the data is unpacked the "n_padding" additional bytes
 
 // configuration buffer attributes
 enum {
-       CONFIG_ATTRIBUTE_RESOLVER       = 1
+       CONFIG_ATTRIBUTE_RESOLVER       = 1,
+       CONFIG_ATTRIBUTE_SCOPED_RESOLVER,
 };
 
 
@@ -155,39 +161,55 @@ enum {
        RESOLVER_ATTRIBUTE_ADDRESS,
        RESOLVER_ATTRIBUTE_SEARCH,
        RESOLVER_ATTRIBUTE_SORTADDR,
-       RESOLVER_ATTRIBUTE_OPTIONS
+       RESOLVER_ATTRIBUTE_IF_INDEX,
+       RESOLVER_ATTRIBUTE_FLAGS,
+       RESOLVER_ATTRIBUTE_OPTIONS,
 };
 
 
+#pragma pack(4)
 typedef struct {
        uint32_t        type;
        uint32_t        length;
        uint8_t         attribute[0];
 } dns_attribute_t;
+#pragma pack()
 
 
+#pragma pack(4)
 typedef struct {
        dns_config_t    config;
        uint32_t        n_attribute;
        uint32_t        n_padding;
        uint8_t         attribute[0];
 } _dns_config_buf_t;
+#pragma pack()
 
 
+#pragma pack(4)
 typedef struct {
        dns_resolver_t  resolver;
        uint32_t        n_attribute;
        uint8_t         attribute[0];
 } _dns_resolver_buf_t;
+#pragma pack()
 
 
 __BEGIN_DECLS
 
-const char *    _dns_configuration_notify_key()                AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
-mach_port_t    _dns_configuration_server_port()        AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
+/*
+ * NOTE: __private_extern__ and __OSX_AVAILABLE_STARTING() cannot be mixed
+ *       due to a "visibility" conflict
+ */
+
+__private_extern__
+const char *
+_dns_configuration_notify_key  ()      /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
 
-__END_DECLS
+__private_extern__
+mach_port_t
+_dns_configuration_server_port ()      /*__OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_2_0)*/;
 
-#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
+__END_DECLS
 
 #endif /* __DNSINFO_PRIVATE_H__ */