Home / File/ netty_resolver_dns_macos.c — netty Source File

netty_resolver_dns_macos.c — netty Source File

Architecture documentation for netty_resolver_dns_macos.c, a c file in the netty codebase. 11 imports, 0 dependents.

File c NativeResolver 11 imports

Entity Profile

Dependency Diagram

graph LR
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d["netty_resolver_dns_macos.c"]
  7a3e29bf_b4be_5bbd_7fb6_92ca019f2b13["dnsinfo.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> 7a3e29bf_b4be_5bbd_7fb6_92ca019f2b13
  724c6e3b_8c91_862a_27de_edb148e159fa["netty_unix_jni.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> 724c6e3b_8c91_862a_27de_edb148e159fa
  2127efed_c8c6_aa9c_a285_41b947bbce96["netty_unix_util.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> 2127efed_c8c6_aa9c_a285_41b947bbce96
  a4ecc0da_99a2_2a4c_1ed5_23d430b969e5["netty_unix_socket.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> a4ecc0da_99a2_2a4c_1ed5_23d430b969e5
  cddb3cb5_efa7_4afc_b4b2_4fe42d787e4b["netty_unix_errors.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> cddb3cb5_efa7_4afc_b4b2_4fe42d787e4b
  71c52c20_b4aa_1551_58db_42e42fa27aa6["errno.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> 71c52c20_b4aa_1551_58db_42e42fa27aa6
  5cbcd069_b25c_7379_e9c5_47a7dd85985a["string.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> 5cbcd069_b25c_7379_e9c5_47a7dd85985a
  6f8e9f3d_28f0_b3bb_e5f8_505aa6fd30ef["unistd.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> 6f8e9f3d_28f0_b3bb_e5f8_505aa6fd30ef
  9352ca16_90fc_8ed8_7895_3d7ec708edb1["dlfcn.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> 9352ca16_90fc_8ed8_7895_3d7ec708edb1
  505c78e3_5429_a273_f5c4_148e73de1d1f["socket.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> 505c78e3_5429_a273_f5c4_148e73de1d1f
  d822c438_bcda_8ebc_05f9_1007c55018be["stdlib.h"]
  1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d --> d822c438_bcda_8ebc_05f9_1007c55018be
  style 1bcde9d3_ef88_154c_dabd_8d3c3d7d8b2d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/*
 * Copyright 2019 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <dlfcn.h>
#include <sys/socket.h>
#include <stdlib.h>
#include "dnsinfo.h"
#include "netty_unix_jni.h"
#include "netty_unix_util.h"
#include "netty_unix_socket.h"
#include "netty_unix_errors.h"

// Add define if NETTY_BUILD_STATIC is defined so it is picked up in netty_jni_util.c
#ifdef NETTY_BUILD_STATIC
#define NETTY_JNI_UTIL_BUILD_STATIC
#endif

#define STREAM_CLASSNAME "io/netty/resolver/dns/macos/MacOSDnsServerAddressStreamProvider"

static jweak dnsResolverClassWeak = NULL;
static jclass byteArrayClass = NULL;
static jclass stringClass = NULL;
static jmethodID dnsResolverMethodId = NULL;
static char const* staticPackagePrefix = NULL;

// JNI Registered Methods Begin

// We use the same API as mDNSResponder and Chromium to retrieve the current nameserver configuration for the system:
// See:
//     https://src.chromium.org/viewvc/chrome?revision=218617&view=revision
//     https://opensource.apple.com/tarballs/mDNSResponder/
static jobjectArray netty_resolver_dns_macos_resolvers(JNIEnv* env, jclass clazz) {
    jclass dnsResolverClass = NULL;
    dns_config_t* config = dns_configuration_copy();
    if (config == NULL) {
        goto error;
    }
    NETTY_JNI_UTIL_NEW_LOCAL_FROM_WEAK(env, dnsResolverClass, dnsResolverClassWeak, error);

    jobjectArray array = (*env)->NewObjectArray(env, config->n_resolver, dnsResolverClass, NULL);
    if (array == NULL) {
        goto error;
    }

    for (int i = 0; i < config->n_resolver; i++) {
// ... (181 more lines)

Dependencies

  • dlfcn.h
  • dnsinfo.h
  • errno.h
  • netty_unix_errors.h
  • netty_unix_jni.h
  • netty_unix_socket.h
  • netty_unix_util.h
  • socket.h
  • stdlib.h
  • string.h
  • unistd.h

Frequently Asked Questions

What does netty_resolver_dns_macos.c do?
netty_resolver_dns_macos.c is a source file in the netty codebase, written in c. It belongs to the NativeResolver domain.
What does netty_resolver_dns_macos.c depend on?
netty_resolver_dns_macos.c imports 11 module(s): dlfcn.h, dnsinfo.h, errno.h, netty_unix_errors.h, netty_unix_jni.h, netty_unix_socket.h, netty_unix_util.h, socket.h, and 3 more.
Where is netty_resolver_dns_macos.c in the architecture?
netty_resolver_dns_macos.c is located at resolver-dns-native-macos/src/main/c/netty_resolver_dns_macos.c (domain: NativeResolver, directory: resolver-dns-native-macos/src/main/c).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free