blob: 68f9f80a6e1f4bf7461be599c51a40cdf24530f3 [file] [log] [blame] [edit]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Code generated by third_party/go/regen-fidl; DO NOT EDIT.
// WARNING: This file is machine generated by fidlgen.
package name
import (
_zx "syscall/zx"
_bindings "syscall/zx/fidl"
fuchsianet "syscall/zx/net"
)
const (
// Maximum number of addresses that can be returned by a lookup.
MaxAddresses uint16 = 1024
)
var _ _bindings.Enum = LookupError(0)
// Lookup operation errors.
type LookupError uint32
const (
// No result was found for this query.
LookupErrorNotFound LookupError = 1
// The lookup failed, but may succeed at a later time. For instance, the
// network or DNS server may be unreachable.
LookupErrorTransient LookupError = 2
// The lookup failed due to an invalid argument (for instance, the hostname
// was not encoded correctly, or was too long).
LookupErrorInvalidArgs LookupError = 3
// The lookup failed due to an internal error.
LookupErrorInternalError LookupError = 4
)
func (_ LookupError) I_EnumValues() []LookupError {
return []LookupError{
LookupErrorNotFound,
LookupErrorTransient,
LookupErrorInvalidArgs,
LookupErrorInternalError,
}
}
func (_ LookupError) I_EnumIsStrict() bool {
return true
}
func (x LookupError) IsUnknown() bool {
switch x {
case 1:
return false
case 2:
return false
case 3:
return false
case 4:
return false
}
return true
}
func (x LookupError) String() string {
switch x {
case 1:
return "NotFound"
case 2:
return "Transient"
case 3:
return "InvalidArgs"
case 4:
return "InternalError"
}
return "Unknown"
}
type DnsServerWatcherWatchServersResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Servers []DnsServer `fidl_offset_v2:"0" fidl_bounds:""`
}
var _mDnsServerWatcherWatchServersResponse = _bindings.CreateLazyMarshaler(DnsServerWatcherWatchServersResponse{})
func (msg *DnsServerWatcherWatchServersResponse) Marshaler() _bindings.Marshaler {
return _mDnsServerWatcherWatchServersResponse
}
type LookupAdminGetDnsServersResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Servers []fuchsianet.SocketAddress `fidl_offset_v2:"0" fidl_bounds:""`
}
var _mLookupAdminGetDnsServersResponse = _bindings.CreateLazyMarshaler(LookupAdminGetDnsServersResponse{})
func (msg *LookupAdminGetDnsServersResponse) Marshaler() _bindings.Marshaler {
return _mLookupAdminGetDnsServersResponse
}
type LookupAdminSetDnsServersRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Servers []fuchsianet.SocketAddress `fidl_offset_v2:"0" fidl_bounds:""`
}
var _mLookupAdminSetDnsServersRequest = _bindings.CreateLazyMarshaler(LookupAdminSetDnsServersRequest{})
func (msg *LookupAdminSetDnsServersRequest) Marshaler() _bindings.Marshaler {
return _mLookupAdminSetDnsServersRequest
}
type LookupAdminSetDnsServersResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mLookupAdminSetDnsServersResponse = _bindings.CreateLazyMarshaler(LookupAdminSetDnsServersResponse{})
func (msg *LookupAdminSetDnsServersResponse) Marshaler() _bindings.Marshaler {
return _mLookupAdminSetDnsServersResponse
}
type LookupLookupHostnameRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Addr fuchsianet.IpAddress `fidl_offset_v2:"0"`
}
var _mLookupLookupHostnameRequest = _bindings.CreateLazyMarshaler(LookupLookupHostnameRequest{})
func (msg *LookupLookupHostnameRequest) Marshaler() _bindings.Marshaler {
return _mLookupLookupHostnameRequest
}
type LookupLookupIpRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"32" fidl_alignment_v2:"8"`
// The hostname to look up.
//
// Must be a valid host domain name; i.e. may not be an IP address in
// dotted-decimal notation.
//
// If it is an Internationalized Domain Name, it must be encoded as per
// RFC 3490.
Hostname string `fidl_offset_v2:"0" fidl_bounds:"255"`
Options LookupIpOptions `fidl_offset_v2:"16"`
}
var _mLookupLookupIpRequest = _bindings.CreateLazyMarshaler(LookupLookupIpRequest{})
func (msg *LookupLookupIpRequest) Marshaler() _bindings.Marshaler {
return _mLookupLookupIpRequest
}
type LookupLookupHostnameResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Hostname string `fidl_offset_v2:"0" fidl_bounds:"255"`
}
var _mLookupLookupHostnameResponse = _bindings.CreateLazyMarshaler(LookupLookupHostnameResponse{})
func (msg *LookupLookupHostnameResponse) Marshaler() _bindings.Marshaler {
return _mLookupLookupHostnameResponse
}
type LookupLookupIpResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Result LookupResult `fidl_offset_v2:"0"`
}
var _mLookupLookupIpResponse = _bindings.CreateLazyMarshaler(LookupLookupIpResponse{})
func (msg *LookupLookupIpResponse) Marshaler() _bindings.Marshaler {
return _mLookupLookupIpResponse
}
type I_dnsServerSourceTag uint64
const (
DnsServerSourceStaticSource = 1 // 0x00000001
DnsServerSourceDhcp = 2 // 0x00000002
DnsServerSourceNdp = 3 // 0x00000003
DnsServerSourceDhcpv6 = 4 // 0x00000004
)
type DnsServerSource struct {
I_dnsServerSourceTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
// The server is statically configured through
// [`fuchsia.net.name/LookupAdmin.SetDefaultServers`].
StaticSource StaticDnsServerSource `fidl_ordinal:"1"`
// The server was discovered through DHCPv4.
Dhcp DhcpDnsServerSource `fidl_ordinal:"2"`
// The server was discovered through an NDP Router Advertisement.
Ndp NdpDnsServerSource `fidl_ordinal:"3"`
// The server was discovered through DHCPv6.
Dhcpv6 Dhcpv6DnsServerSource `fidl_ordinal:"4"`
}
var _mDnsServerSource = _bindings.CreateLazyMarshaler(DnsServerSource{})
func (msg *DnsServerSource) Marshaler() _bindings.Marshaler {
return _mDnsServerSource
}
func (_m *DnsServerSource) reset() {
switch _m.I_dnsServerSourceTag {
case 1:
var _zeroed StaticDnsServerSource
_m.StaticSource = _zeroed
case 2:
var _zeroed DhcpDnsServerSource
_m.Dhcp = _zeroed
case 3:
var _zeroed NdpDnsServerSource
_m.Ndp = _zeroed
case 4:
var _zeroed Dhcpv6DnsServerSource
_m.Dhcpv6 = _zeroed
}
}
func (_m *DnsServerSource) Which() I_dnsServerSourceTag {
return _m.I_dnsServerSourceTag
}
func (_m *DnsServerSource) Ordinal() uint64 {
return uint64(_m.I_dnsServerSourceTag)
}
func (_m *DnsServerSource) SetStaticSource(staticSource StaticDnsServerSource) {
_m.reset()
_m.I_dnsServerSourceTag = DnsServerSourceStaticSource
_m.StaticSource = staticSource
}
func DnsServerSourceWithStaticSource(staticSource StaticDnsServerSource) DnsServerSource {
var _u DnsServerSource
_u.SetStaticSource(staticSource)
return _u
}
func (_m *DnsServerSource) SetDhcp(dhcp DhcpDnsServerSource) {
_m.reset()
_m.I_dnsServerSourceTag = DnsServerSourceDhcp
_m.Dhcp = dhcp
}
func DnsServerSourceWithDhcp(dhcp DhcpDnsServerSource) DnsServerSource {
var _u DnsServerSource
_u.SetDhcp(dhcp)
return _u
}
func (_m *DnsServerSource) SetNdp(ndp NdpDnsServerSource) {
_m.reset()
_m.I_dnsServerSourceTag = DnsServerSourceNdp
_m.Ndp = ndp
}
func DnsServerSourceWithNdp(ndp NdpDnsServerSource) DnsServerSource {
var _u DnsServerSource
_u.SetNdp(ndp)
return _u
}
func (_m *DnsServerSource) SetDhcpv6(dhcpv6 Dhcpv6DnsServerSource) {
_m.reset()
_m.I_dnsServerSourceTag = DnsServerSourceDhcpv6
_m.Dhcpv6 = dhcpv6
}
func DnsServerSourceWithDhcpv6(dhcpv6 Dhcpv6DnsServerSource) DnsServerSource {
var _u DnsServerSource
_u.SetDhcpv6(dhcpv6)
return _u
}
type I_lookupAdminSetDnsServersResultTag uint64
const (
LookupAdminSetDnsServersResultResponse = 1 // 0x00000001
LookupAdminSetDnsServersResultErr = 2 // 0x00000002
)
type LookupAdminSetDnsServersResult struct {
I_lookupAdminSetDnsServersResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response LookupAdminSetDnsServersResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mLookupAdminSetDnsServersResult = _bindings.CreateLazyMarshaler(LookupAdminSetDnsServersResult{})
func (msg *LookupAdminSetDnsServersResult) Marshaler() _bindings.Marshaler {
return _mLookupAdminSetDnsServersResult
}
func (_m *LookupAdminSetDnsServersResult) reset() {
switch _m.I_lookupAdminSetDnsServersResultTag {
case 1:
var _zeroed LookupAdminSetDnsServersResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *LookupAdminSetDnsServersResult) Which() I_lookupAdminSetDnsServersResultTag {
return _m.I_lookupAdminSetDnsServersResultTag
}
func (_m *LookupAdminSetDnsServersResult) Ordinal() uint64 {
return uint64(_m.I_lookupAdminSetDnsServersResultTag)
}
func (_m *LookupAdminSetDnsServersResult) SetResponse(response LookupAdminSetDnsServersResponse) {
_m.reset()
_m.I_lookupAdminSetDnsServersResultTag = LookupAdminSetDnsServersResultResponse
_m.Response = response
}
func LookupAdminSetDnsServersResultWithResponse(response LookupAdminSetDnsServersResponse) LookupAdminSetDnsServersResult {
var _u LookupAdminSetDnsServersResult
_u.SetResponse(response)
return _u
}
func (_m *LookupAdminSetDnsServersResult) SetErr(err int32) {
_m.reset()
_m.I_lookupAdminSetDnsServersResultTag = LookupAdminSetDnsServersResultErr
_m.Err = err
}
func LookupAdminSetDnsServersResultWithErr(err int32) LookupAdminSetDnsServersResult {
var _u LookupAdminSetDnsServersResult
_u.SetErr(err)
return _u
}
type I_lookupLookupHostnameResultTag uint64
const (
LookupLookupHostnameResultResponse = 1 // 0x00000001
LookupLookupHostnameResultErr = 2 // 0x00000002
)
type LookupLookupHostnameResult struct {
I_lookupLookupHostnameResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response LookupLookupHostnameResponse `fidl_ordinal:"1"`
Err LookupError `fidl_ordinal:"2"`
}
var _mLookupLookupHostnameResult = _bindings.CreateLazyMarshaler(LookupLookupHostnameResult{})
func (msg *LookupLookupHostnameResult) Marshaler() _bindings.Marshaler {
return _mLookupLookupHostnameResult
}
func (_m *LookupLookupHostnameResult) reset() {
switch _m.I_lookupLookupHostnameResultTag {
case 1:
var _zeroed LookupLookupHostnameResponse
_m.Response = _zeroed
case 2:
var _zeroed LookupError
_m.Err = _zeroed
}
}
func (_m *LookupLookupHostnameResult) Which() I_lookupLookupHostnameResultTag {
return _m.I_lookupLookupHostnameResultTag
}
func (_m *LookupLookupHostnameResult) Ordinal() uint64 {
return uint64(_m.I_lookupLookupHostnameResultTag)
}
func (_m *LookupLookupHostnameResult) SetResponse(response LookupLookupHostnameResponse) {
_m.reset()
_m.I_lookupLookupHostnameResultTag = LookupLookupHostnameResultResponse
_m.Response = response
}
func LookupLookupHostnameResultWithResponse(response LookupLookupHostnameResponse) LookupLookupHostnameResult {
var _u LookupLookupHostnameResult
_u.SetResponse(response)
return _u
}
func (_m *LookupLookupHostnameResult) SetErr(err LookupError) {
_m.reset()
_m.I_lookupLookupHostnameResultTag = LookupLookupHostnameResultErr
_m.Err = err
}
func LookupLookupHostnameResultWithErr(err LookupError) LookupLookupHostnameResult {
var _u LookupLookupHostnameResult
_u.SetErr(err)
return _u
}
type I_lookupLookupIpResultTag uint64
const (
LookupLookupIpResultResponse = 1 // 0x00000001
LookupLookupIpResultErr = 2 // 0x00000002
)
type LookupLookupIpResult struct {
I_lookupLookupIpResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response LookupLookupIpResponse `fidl_ordinal:"1"`
Err LookupError `fidl_ordinal:"2"`
}
var _mLookupLookupIpResult = _bindings.CreateLazyMarshaler(LookupLookupIpResult{})
func (msg *LookupLookupIpResult) Marshaler() _bindings.Marshaler {
return _mLookupLookupIpResult
}
func (_m *LookupLookupIpResult) reset() {
switch _m.I_lookupLookupIpResultTag {
case 1:
var _zeroed LookupLookupIpResponse
_m.Response = _zeroed
case 2:
var _zeroed LookupError
_m.Err = _zeroed
}
}
func (_m *LookupLookupIpResult) Which() I_lookupLookupIpResultTag {
return _m.I_lookupLookupIpResultTag
}
func (_m *LookupLookupIpResult) Ordinal() uint64 {
return uint64(_m.I_lookupLookupIpResultTag)
}
func (_m *LookupLookupIpResult) SetResponse(response LookupLookupIpResponse) {
_m.reset()
_m.I_lookupLookupIpResultTag = LookupLookupIpResultResponse
_m.Response = response
}
func LookupLookupIpResultWithResponse(response LookupLookupIpResponse) LookupLookupIpResult {
var _u LookupLookupIpResult
_u.SetResponse(response)
return _u
}
func (_m *LookupLookupIpResult) SetErr(err LookupError) {
_m.reset()
_m.I_lookupLookupIpResultTag = LookupLookupIpResultErr
_m.Err = err
}
func LookupLookupIpResultWithErr(err LookupError) LookupLookupIpResult {
var _u LookupLookupIpResult
_u.SetErr(err)
return _u
}
type DhcpDnsServerSource struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// The interface index over which this server was discovered.
SourceInterface uint64 `fidl_ordinal:"1"`
SourceInterfacePresent bool
}
var _mDhcpDnsServerSource = _bindings.CreateLazyMarshaler(DhcpDnsServerSource{})
func (msg *DhcpDnsServerSource) Marshaler() _bindings.Marshaler {
return _mDhcpDnsServerSource
}
func (u *DhcpDnsServerSource) SetSourceInterface(sourceInterface uint64) {
u.SourceInterface = sourceInterface
u.SourceInterfacePresent = true
}
func (u *DhcpDnsServerSource) GetSourceInterface() uint64 {
return u.SourceInterface
}
func (u *DhcpDnsServerSource) GetSourceInterfaceWithDefault(_default uint64) uint64 {
if !u.HasSourceInterface() {
return _default
}
return u.SourceInterface
}
func (u *DhcpDnsServerSource) HasSourceInterface() bool {
return u.SourceInterfacePresent
}
func (u *DhcpDnsServerSource) ClearSourceInterface() {
u.SourceInterfacePresent = false
}
func (u *DhcpDnsServerSource) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *DhcpDnsServerSource) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type Dhcpv6DnsServerSource struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// The interface index over which this server was discovered.
SourceInterface uint64 `fidl_ordinal:"1"`
SourceInterfacePresent bool
}
var _mDhcpv6DnsServerSource = _bindings.CreateLazyMarshaler(Dhcpv6DnsServerSource{})
func (msg *Dhcpv6DnsServerSource) Marshaler() _bindings.Marshaler {
return _mDhcpv6DnsServerSource
}
func (u *Dhcpv6DnsServerSource) SetSourceInterface(sourceInterface uint64) {
u.SourceInterface = sourceInterface
u.SourceInterfacePresent = true
}
func (u *Dhcpv6DnsServerSource) GetSourceInterface() uint64 {
return u.SourceInterface
}
func (u *Dhcpv6DnsServerSource) GetSourceInterfaceWithDefault(_default uint64) uint64 {
if !u.HasSourceInterface() {
return _default
}
return u.SourceInterface
}
func (u *Dhcpv6DnsServerSource) HasSourceInterface() bool {
return u.SourceInterfacePresent
}
func (u *Dhcpv6DnsServerSource) ClearSourceInterface() {
u.SourceInterfacePresent = false
}
func (u *Dhcpv6DnsServerSource) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *Dhcpv6DnsServerSource) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
// A DNS server configuration.
type DnsServer struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// The server's address, must be provided.
Address fuchsianet.SocketAddress `fidl_ordinal:"1"`
AddressPresent bool
// The configuration source for this server. Defaults to
// [`fuchsia.net.name/DnsServerSource.static_source`].
Source DnsServerSource `fidl_ordinal:"2"`
SourcePresent bool
}
var _mDnsServer = _bindings.CreateLazyMarshaler(DnsServer{})
func (msg *DnsServer) Marshaler() _bindings.Marshaler {
return _mDnsServer
}
func (u *DnsServer) SetAddress(address fuchsianet.SocketAddress) {
u.Address = address
u.AddressPresent = true
}
func (u *DnsServer) GetAddress() fuchsianet.SocketAddress {
return u.Address
}
func (u *DnsServer) GetAddressWithDefault(_default fuchsianet.SocketAddress) fuchsianet.SocketAddress {
if !u.HasAddress() {
return _default
}
return u.Address
}
func (u *DnsServer) HasAddress() bool {
return u.AddressPresent
}
func (u *DnsServer) ClearAddress() {
u.AddressPresent = false
}
func (u *DnsServer) SetSource(source DnsServerSource) {
u.Source = source
u.SourcePresent = true
}
func (u *DnsServer) GetSource() DnsServerSource {
return u.Source
}
func (u *DnsServer) GetSourceWithDefault(_default DnsServerSource) DnsServerSource {
if !u.HasSource() {
return _default
}
return u.Source
}
func (u *DnsServer) HasSource() bool {
return u.SourcePresent
}
func (u *DnsServer) ClearSource() {
u.SourcePresent = false
}
func (u *DnsServer) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *DnsServer) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type LookupIpOptions struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// Include IPv4 results.
//
// If not set, interpreted as false.
Ipv4Lookup bool `fidl_ordinal:"1"`
Ipv4LookupPresent bool
// Include IPv6 results.
//
// If not set, interpreted as false.
Ipv6Lookup bool `fidl_ordinal:"2"`
Ipv6LookupPresent bool
// Sort addresses in order of preference.
//
// It true, Addresses are sorted according to destination address
// selection described in
// [RFC 6724 Section 6](https://tools.ietf.org/html/rfc6724#section-6).
//
// If not set, interpreted as false.
SortAddresses bool `fidl_ordinal:"3"`
SortAddressesPresent bool
// Include the canonical name.
//
// If not set, interpreted as false.
CanonicalNameLookup bool `fidl_ordinal:"4"`
CanonicalNameLookupPresent bool
}
var _mLookupIpOptions = _bindings.CreateLazyMarshaler(LookupIpOptions{})
func (msg *LookupIpOptions) Marshaler() _bindings.Marshaler {
return _mLookupIpOptions
}
func (u *LookupIpOptions) SetIpv4Lookup(ipv4Lookup bool) {
u.Ipv4Lookup = ipv4Lookup
u.Ipv4LookupPresent = true
}
func (u *LookupIpOptions) GetIpv4Lookup() bool {
return u.Ipv4Lookup
}
func (u *LookupIpOptions) GetIpv4LookupWithDefault(_default bool) bool {
if !u.HasIpv4Lookup() {
return _default
}
return u.Ipv4Lookup
}
func (u *LookupIpOptions) HasIpv4Lookup() bool {
return u.Ipv4LookupPresent
}
func (u *LookupIpOptions) ClearIpv4Lookup() {
u.Ipv4LookupPresent = false
}
func (u *LookupIpOptions) SetIpv6Lookup(ipv6Lookup bool) {
u.Ipv6Lookup = ipv6Lookup
u.Ipv6LookupPresent = true
}
func (u *LookupIpOptions) GetIpv6Lookup() bool {
return u.Ipv6Lookup
}
func (u *LookupIpOptions) GetIpv6LookupWithDefault(_default bool) bool {
if !u.HasIpv6Lookup() {
return _default
}
return u.Ipv6Lookup
}
func (u *LookupIpOptions) HasIpv6Lookup() bool {
return u.Ipv6LookupPresent
}
func (u *LookupIpOptions) ClearIpv6Lookup() {
u.Ipv6LookupPresent = false
}
func (u *LookupIpOptions) SetSortAddresses(sortAddresses bool) {
u.SortAddresses = sortAddresses
u.SortAddressesPresent = true
}
func (u *LookupIpOptions) GetSortAddresses() bool {
return u.SortAddresses
}
func (u *LookupIpOptions) GetSortAddressesWithDefault(_default bool) bool {
if !u.HasSortAddresses() {
return _default
}
return u.SortAddresses
}
func (u *LookupIpOptions) HasSortAddresses() bool {
return u.SortAddressesPresent
}
func (u *LookupIpOptions) ClearSortAddresses() {
u.SortAddressesPresent = false
}
func (u *LookupIpOptions) SetCanonicalNameLookup(canonicalNameLookup bool) {
u.CanonicalNameLookup = canonicalNameLookup
u.CanonicalNameLookupPresent = true
}
func (u *LookupIpOptions) GetCanonicalNameLookup() bool {
return u.CanonicalNameLookup
}
func (u *LookupIpOptions) GetCanonicalNameLookupWithDefault(_default bool) bool {
if !u.HasCanonicalNameLookup() {
return _default
}
return u.CanonicalNameLookup
}
func (u *LookupIpOptions) HasCanonicalNameLookup() bool {
return u.CanonicalNameLookupPresent
}
func (u *LookupIpOptions) ClearCanonicalNameLookup() {
u.CanonicalNameLookupPresent = false
}
func (u *LookupIpOptions) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *LookupIpOptions) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type LookupResult struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// The IP addresses resulting from a lookup.
//
// If sorting was requested, `addresses` is sorted in order of
// preference, most preferred destination address first.
Addresses []fuchsianet.IpAddress `fidl_bounds:"1024" fidl_ordinal:"1"`
AddressesPresent bool
// The canonical name of the requested hostname.
//
// Provided only if requested.
CanonicalName string `fidl_bounds:"255" fidl_ordinal:"2"`
CanonicalNamePresent bool
}
var _mLookupResult = _bindings.CreateLazyMarshaler(LookupResult{})
func (msg *LookupResult) Marshaler() _bindings.Marshaler {
return _mLookupResult
}
func (u *LookupResult) SetAddresses(addresses []fuchsianet.IpAddress) {
u.Addresses = addresses
u.AddressesPresent = true
}
func (u *LookupResult) GetAddresses() []fuchsianet.IpAddress {
return u.Addresses
}
func (u *LookupResult) GetAddressesWithDefault(_default []fuchsianet.IpAddress) []fuchsianet.IpAddress {
if !u.HasAddresses() {
return _default
}
return u.Addresses
}
func (u *LookupResult) HasAddresses() bool {
return u.AddressesPresent
}
func (u *LookupResult) ClearAddresses() {
u.AddressesPresent = false
}
func (u *LookupResult) SetCanonicalName(canonicalName string) {
u.CanonicalName = canonicalName
u.CanonicalNamePresent = true
}
func (u *LookupResult) GetCanonicalName() string {
return u.CanonicalName
}
func (u *LookupResult) GetCanonicalNameWithDefault(_default string) string {
if !u.HasCanonicalName() {
return _default
}
return u.CanonicalName
}
func (u *LookupResult) HasCanonicalName() bool {
return u.CanonicalNamePresent
}
func (u *LookupResult) ClearCanonicalName() {
u.CanonicalNamePresent = false
}
func (u *LookupResult) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *LookupResult) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type NdpDnsServerSource struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// The interface index over which this server was discovered.
SourceInterface uint64 `fidl_ordinal:"1"`
SourceInterfacePresent bool
}
var _mNdpDnsServerSource = _bindings.CreateLazyMarshaler(NdpDnsServerSource{})
func (msg *NdpDnsServerSource) Marshaler() _bindings.Marshaler {
return _mNdpDnsServerSource
}
func (u *NdpDnsServerSource) SetSourceInterface(sourceInterface uint64) {
u.SourceInterface = sourceInterface
u.SourceInterfacePresent = true
}
func (u *NdpDnsServerSource) GetSourceInterface() uint64 {
return u.SourceInterface
}
func (u *NdpDnsServerSource) GetSourceInterfaceWithDefault(_default uint64) uint64 {
if !u.HasSourceInterface() {
return _default
}
return u.SourceInterface
}
func (u *NdpDnsServerSource) HasSourceInterface() bool {
return u.SourceInterfacePresent
}
func (u *NdpDnsServerSource) ClearSourceInterface() {
u.SourceInterfacePresent = false
}
func (u *NdpDnsServerSource) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *NdpDnsServerSource) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type StaticDnsServerSource struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
}
var _mStaticDnsServerSource = _bindings.CreateLazyMarshaler(StaticDnsServerSource{})
func (msg *StaticDnsServerSource) Marshaler() _bindings.Marshaler {
return _mStaticDnsServerSource
}
func (u *StaticDnsServerSource) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *StaticDnsServerSource) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
const (
DnsServerWatcherWatchServersOrdinal uint64 = 0x5748907e7f11b632
)
type DnsServerWatcherWithCtxInterface _bindings.ChannelProxy
// Returns a list of DNS servers.
//
// First call always returns a snapshot of the current list of servers or blocks if an empty
// list would be returned. Subsequent calls will block until the list of servers changes.
//
// The list of servers changes over time by configuration or network topology changes,
// expiration, etc. Callers must repeatedly call `WatchServers` and replace any previously
// returned `servers` with new ones to avoid using stale or expired entries.
//
// It is invalid to call this method while a previous call is pending. Doing so will cause the
// server end of the protocol to be closed.
//
// - response `servers` The list of servers to use for DNS resolution, in priority order.
func (p *DnsServerWatcherWithCtxInterface) WatchServers(ctx_ _bindings.Context) ([]DnsServer, error) {
var req_ _bindings.Message
resp_ := &DnsServerWatcherWatchServersResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DnsServerWatcherWatchServersOrdinal, req_, resp_)
return (*resp_).Servers, err_
}
// Provides a hanging get interface to watch for DNS servers configuration.
type DnsServerWatcherWithCtx interface {
// Returns a list of DNS servers.
//
// First call always returns a snapshot of the current list of servers or blocks if an empty
// list would be returned. Subsequent calls will block until the list of servers changes.
//
// The list of servers changes over time by configuration or network topology changes,
// expiration, etc. Callers must repeatedly call `WatchServers` and replace any previously
// returned `servers` with new ones to avoid using stale or expired entries.
//
// It is invalid to call this method while a previous call is pending. Doing so will cause the
// server end of the protocol to be closed.
//
// - response `servers` The list of servers to use for DNS resolution, in priority order.
WatchServers(ctx_ _bindings.Context) ([]DnsServer, error)
}
type DnsServerWatcherWithCtxTransitionalBase struct{}
type DnsServerWatcherWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewDnsServerWatcherWithCtxInterfaceRequest() (DnsServerWatcherWithCtxInterfaceRequest, *DnsServerWatcherWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return DnsServerWatcherWithCtxInterfaceRequest(req), (*DnsServerWatcherWithCtxInterface)(cli), err
}
// Implements ServiceRequest.
func (_ DnsServerWatcherWithCtxInterfaceRequest) Name() string {
return "fuchsia.net.name.DnsServerWatcher"
}
func (c DnsServerWatcherWithCtxInterfaceRequest) ToChannel() _zx.Channel {
return c.Channel
}
const DnsServerWatcherName = "fuchsia.net.name.DnsServerWatcher"
type DnsServerWatcherWithCtxStub struct {
Impl DnsServerWatcherWithCtx
}
func (s_ *DnsServerWatcherWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case DnsServerWatcherWatchServersOrdinal:
servers, err_ := s_.Impl.WatchServers(args_.Ctx)
out_ := &DnsServerWatcherWatchServersResponse{Servers: servers}
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type DnsServerWatcherEventProxy _bindings.ChannelProxy
const (
LookupLookupIpOrdinal uint64 = 0x59247caf7560c1d0
LookupLookupHostnameOrdinal uint64 = 0x1b456b0e84888324
)
type LookupWithCtxInterface _bindings.ChannelProxy
// Lookup a list of IP addresses by hostname.
func (p *LookupWithCtxInterface) LookupIp(ctx_ _bindings.Context, hostname string, options LookupIpOptions) (LookupLookupIpResult, error) {
req_ := &LookupLookupIpRequest{Hostname: hostname, Options: options}
resp_ := &LookupLookupIpResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(LookupLookupIpOrdinal, req_, resp_)
return (*resp_), err_
}
// Look up a hostname by IP address.
func (p *LookupWithCtxInterface) LookupHostname(ctx_ _bindings.Context, addr fuchsianet.IpAddress) (LookupLookupHostnameResult, error) {
req_ := &LookupLookupHostnameRequest{Addr: addr}
resp_ := &LookupLookupHostnameResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(LookupLookupHostnameOrdinal, req_, resp_)
return (*resp_), err_
}
// Provides name and address resolution.
type LookupWithCtx interface {
// Lookup a list of IP addresses by hostname.
LookupIp(ctx_ _bindings.Context, hostname string, options LookupIpOptions) (LookupLookupIpResult, error)
// Look up a hostname by IP address.
LookupHostname(ctx_ _bindings.Context, addr fuchsianet.IpAddress) (LookupLookupHostnameResult, error)
}
type LookupWithCtxTransitionalBase struct{}
type LookupWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewLookupWithCtxInterfaceRequest() (LookupWithCtxInterfaceRequest, *LookupWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return LookupWithCtxInterfaceRequest(req), (*LookupWithCtxInterface)(cli), err
}
// Implements ServiceRequest.
func (_ LookupWithCtxInterfaceRequest) Name() string {
return "fuchsia.net.name.Lookup"
}
func (c LookupWithCtxInterfaceRequest) ToChannel() _zx.Channel {
return c.Channel
}
const LookupName = "fuchsia.net.name.Lookup"
type LookupWithCtxStub struct {
Impl LookupWithCtx
}
func (s_ *LookupWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case LookupLookupIpOrdinal:
in_ := &LookupLookupIpRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.LookupIp(args_.Ctx, (*in_).Hostname, (*in_).Options)
out_ := &payload
return out_, true, err_
case LookupLookupHostnameOrdinal:
in_ := &LookupLookupHostnameRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.LookupHostname(args_.Ctx, (*in_).Addr)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type LookupEventProxy _bindings.ChannelProxy
const (
LookupAdminSetDnsServersOrdinal uint64 = 0x55e2b9fcc777be96
LookupAdminGetDnsServersOrdinal uint64 = 0x614303bf6e72f80f
)
type LookupAdminWithCtxInterface _bindings.ChannelProxy
// Sets the DNS servers to `servers`
//
// + request `servers` The list of servers to use for domain name resolution, in priority
// order. An empty list means no servers will be used and name resolution may fail. Each
// `SocketAddress` in `servers` must be a valid unicast socket address. The list of servers
// will be deduplicated.
// * error Returns `ZX_ERR_INVALID_ARGS` if any of the provided addresses does not meet the
// conditions above.
func (p *LookupAdminWithCtxInterface) SetDnsServers(ctx_ _bindings.Context, servers []fuchsianet.SocketAddress) (LookupAdminSetDnsServersResult, error) {
req_ := &LookupAdminSetDnsServersRequest{Servers: servers}
resp_ := &LookupAdminSetDnsServersResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(LookupAdminSetDnsServersOrdinal, req_, resp_)
return (*resp_), err_
}
// Gets the DNS servers currently in use to resolve name lookups.
// - response `servers` The list of servers in use by `LookupAdmin`, in priority order.
func (p *LookupAdminWithCtxInterface) GetDnsServers(ctx_ _bindings.Context) ([]fuchsianet.SocketAddress, error) {
var req_ _bindings.Message
resp_ := &LookupAdminGetDnsServersResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(LookupAdminGetDnsServersOrdinal, req_, resp_)
return (*resp_).Servers, err_
}
// Provides administration controls over name resolution settings.
type LookupAdminWithCtx interface {
// Sets the DNS servers to `servers`
//
// + request `servers` The list of servers to use for domain name resolution, in priority
// order. An empty list means no servers will be used and name resolution may fail. Each
// `SocketAddress` in `servers` must be a valid unicast socket address. The list of servers
// will be deduplicated.
// * error Returns `ZX_ERR_INVALID_ARGS` if any of the provided addresses does not meet the
// conditions above.
SetDnsServers(ctx_ _bindings.Context, servers []fuchsianet.SocketAddress) (LookupAdminSetDnsServersResult, error)
// Gets the DNS servers currently in use to resolve name lookups.
// - response `servers` The list of servers in use by `LookupAdmin`, in priority order.
GetDnsServers(ctx_ _bindings.Context) ([]fuchsianet.SocketAddress, error)
}
type LookupAdminWithCtxTransitionalBase struct{}
type LookupAdminWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewLookupAdminWithCtxInterfaceRequest() (LookupAdminWithCtxInterfaceRequest, *LookupAdminWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return LookupAdminWithCtxInterfaceRequest(req), (*LookupAdminWithCtxInterface)(cli), err
}
// Implements ServiceRequest.
func (_ LookupAdminWithCtxInterfaceRequest) Name() string {
return "fuchsia.net.name.LookupAdmin"
}
func (c LookupAdminWithCtxInterfaceRequest) ToChannel() _zx.Channel {
return c.Channel
}
const LookupAdminName = "fuchsia.net.name.LookupAdmin"
type LookupAdminWithCtxStub struct {
Impl LookupAdminWithCtx
}
func (s_ *LookupAdminWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case LookupAdminSetDnsServersOrdinal:
in_ := &LookupAdminSetDnsServersRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.SetDnsServers(args_.Ctx, (*in_).Servers)
out_ := &payload
return out_, true, err_
case LookupAdminGetDnsServersOrdinal:
servers, err_ := s_.Impl.GetDnsServers(args_.Ctx)
out_ := &LookupAdminGetDnsServersResponse{Servers: servers}
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type LookupAdminEventProxy _bindings.ChannelProxy