All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jdk.internal.sys.posix.Netdb Maven / Gradle / Ivy

package jdk.internal.sys.posix;

import org.qbicc.runtime.Build;

import static org.qbicc.runtime.CNative.*;
import static jdk.internal.sys.posix.SysSocket.*;
import static org.qbicc.runtime.stdc.Stdint.*;

@define(value = "_POSIX_C_SOURCE", as = "200809L")
@define(value = "_DARWIN_C_SOURCE", when = Build.Target.IsApple.class)
@include("")
public class Netdb {

    public static final class struct_hostent extends object {
        public ptr h_name;
        public ptr> h_aliases;
        public c_int h_addrtype;
        public c_int h_length;
        public ptr> h_addr_list;
    }

    public static final class struct_netent extends object {
        public ptr n_name;
        public ptr> n_aliases;
        public c_int n_addrtype;
        public uint32_t n_net;
    }

    public static final class struct_servent extends object {
        public ptr s_name;
        public ptr> s_aliases;
        public c_int s_port;
        public ptr s_proto;
    }

    public static final class sturct_protoent extends object {
        public ptr p_name;
        public ptr> p_aliases;
        public c_int p_proto;
    }

    public static final class struct_addrinfo extends object {
        public c_int ai_flags;
        public c_int ai_family;
        public c_int ai_socktype;
        public c_int ai_protocol;
        public socklen_t ai_addrlen;
        public ptr ai_canonname;
        public ptr ai_addr;
        public ptr ai_next;
    }

    public static final c_int AI_PASSIVE = constant();
    public static final c_int AI_CANONNAME = constant();
    public static final c_int AI_NUMERICHOST = constant();
    public static final c_int AI_NUMERICSERV = constant();
    public static final c_int AI_V4MAPPED = constant();
    public static final c_int AI_ALL = constant();
    public static final c_int AI_ADDRCONFIG = constant();

    public static native c_int getaddrinfo(ptr<@c_const c_char> hostname, ptr<@c_const c_char> servname,
                                           ptr<@c_const struct_addrinfo> hints, ptr> res);

    public static native void freeaddrinfo(ptr ai);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy