blob: 4f8ac1257dab9c88f001f19e7b3e4f89b65faaf8 [file] [log] [blame]
// 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.
package name
import (
_zx "syscall/zx"
_bindings "syscall/zx/fidl"
fuchsianet "syscall/zx/net"
)
const (
// The maximum length of a hostname, as per [RFC 1035 section 2.3.4](https://tools.ietf.org/html/rfc1035#section-2.3.4).
MaxHostnameSize uint64 = 255
)
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
default:
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 LookupAdminSetDnsServersResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"1" fidl_alignment_v1:"1" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mLookupAdminSetDnsServersResponse = _bindings.CreateLazyMarshaler(LookupAdminSetDnsServersResponse{})
func (msg *LookupAdminSetDnsServersResponse) Marshaler() _bindings.Marshaler {
return _mLookupAdminSetDnsServersResponse
}
type LookupLookupIpResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Result LookupResult `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mLookupLookupIpResponse = _bindings.CreateLazyMarshaler(LookupLookupIpResponse{})
func (msg *LookupLookupIpResponse) Marshaler() _bindings.Marshaler {
return _mLookupLookupIpResponse
}
type LookupLookupHostnameResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Hostname string `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_bounds:"255"`
}
var _mLookupLookupHostnameResponse = _bindings.CreateLazyMarshaler(LookupLookupHostnameResponse{})
func (msg *LookupLookupHostnameResponse) Marshaler() _bindings.Marshaler {
return _mLookupLookupHostnameResponse
}
type lookupAdminWithCtxSetDnsServersRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Servers []fuchsianet.SocketAddress `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_bounds:""`
}
var _mlookupAdminWithCtxSetDnsServersRequest = _bindings.CreateLazyMarshaler(lookupAdminWithCtxSetDnsServersRequest{})
func (msg *lookupAdminWithCtxSetDnsServersRequest) Marshaler() _bindings.Marshaler {
return _mlookupAdminWithCtxSetDnsServersRequest
}
type lookupAdminWithCtxSetDnsServersResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Result LookupAdminSetDnsServersResult `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mlookupAdminWithCtxSetDnsServersResponse = _bindings.CreateLazyMarshaler(lookupAdminWithCtxSetDnsServersResponse{})
func (msg *lookupAdminWithCtxSetDnsServersResponse) Marshaler() _bindings.Marshaler {
return _mlookupAdminWithCtxSetDnsServersResponse
}
type lookupAdminWithCtxGetDnsServersResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Servers []fuchsianet.SocketAddress `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_bounds:""`
}
var _mlookupAdminWithCtxGetDnsServersResponse = _bindings.CreateLazyMarshaler(lookupAdminWithCtxGetDnsServersResponse{})
func (msg *lookupAdminWithCtxGetDnsServersResponse) Marshaler() _bindings.Marshaler {
return _mlookupAdminWithCtxGetDnsServersResponse
}
type lookupWithCtxLookupIpRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"32" fidl_alignment_v1:"8" fidl_size_v2:"32" fidl_alignment_v2:"8"`
Hostname string `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_bounds:"255"`
Options LookupIpOptions `fidl_offset_v1:"16" fidl_offset_v2:"16"`
}
var _mlookupWithCtxLookupIpRequest = _bindings.CreateLazyMarshaler(lookupWithCtxLookupIpRequest{})
func (msg *lookupWithCtxLookupIpRequest) Marshaler() _bindings.Marshaler {
return _mlookupWithCtxLookupIpRequest
}
type lookupWithCtxLookupIpResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Result LookupLookupIpResult `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mlookupWithCtxLookupIpResponse = _bindings.CreateLazyMarshaler(lookupWithCtxLookupIpResponse{})
func (msg *lookupWithCtxLookupIpResponse) Marshaler() _bindings.Marshaler {
return _mlookupWithCtxLookupIpResponse
}
type lookupWithCtxLookupHostnameRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Addr fuchsianet.IpAddress `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mlookupWithCtxLookupHostnameRequest = _bindings.CreateLazyMarshaler(lookupWithCtxLookupHostnameRequest{})
func (msg *lookupWithCtxLookupHostnameRequest) Marshaler() _bindings.Marshaler {
return _mlookupWithCtxLookupHostnameRequest
}
type lookupWithCtxLookupHostnameResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Result LookupLookupHostnameResult `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mlookupWithCtxLookupHostnameResponse = _bindings.CreateLazyMarshaler(lookupWithCtxLookupHostnameResponse{})
func (msg *lookupWithCtxLookupHostnameResponse) Marshaler() _bindings.Marshaler {
return _mlookupWithCtxLookupHostnameResponse
}
type dnsServerWatcherWithCtxWatchServersResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Servers []DnsServer `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_bounds:""`
}
var _mdnsServerWatcherWithCtxWatchServersResponse = _bindings.CreateLazyMarshaler(dnsServerWatcherWithCtxWatchServersResponse{})
func (msg *dnsServerWatcherWithCtxWatchServersResponse) Marshaler() _bindings.Marshaler {
return _mdnsServerWatcherWithCtxWatchServersResponse
}
type I_dnsServerSourceTag uint64
const (
DnsServerSourceStaticSource = 1 // 0x00000001
DnsServerSourceDhcp = 2 // 0x00000002
DnsServerSourceNdp = 3 // 0x00000003
DnsServerSourceDhcpv6 = 4 // 0x00000004
)
// The configuration source for a [`fuchsia.net.name/DnsServer`].
type DnsServerSource struct {
I_dnsServerSourceTag `fidl:"x!" fidl_size_v1:"24" fidl_alignment_v1:"8" 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"`
}
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_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response LookupAdminSetDnsServersResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
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_lookupLookupIpResultTag uint64
const (
LookupLookupIpResultResponse = 1 // 0x00000001
LookupLookupIpResultErr = 2 // 0x00000002
)
type LookupLookupIpResult struct {
I_lookupLookupIpResultTag `fidl:"x!" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response LookupLookupIpResponse `fidl_ordinal:"1"`
Err LookupError `fidl_ordinal:"2"`
}
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 I_lookupLookupHostnameResultTag uint64
const (
LookupLookupHostnameResultResponse = 1 // 0x00000001
LookupLookupHostnameResultErr = 2 // 0x00000002
)
type LookupLookupHostnameResult struct {
I_lookupLookupHostnameResultTag `fidl:"x!" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response LookupLookupHostnameResponse `fidl_ordinal:"1"`
Err LookupError `fidl_ordinal:"2"`
}
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
}
// Extra information about statically set DNS servers.
type StaticDnsServerSource struct {
_ struct{} `fidl:"t" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
}
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)
}
// Extra information about DNS servers discovered through DHCPv4.
type DhcpDnsServerSource struct {
_ struct{} `fidl:"t" fidl_size_v1:"16" fidl_alignment_v1:"8" 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
}
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)
}
// Extra information about DNS servers discovered through NDP.
type NdpDnsServerSource struct {
_ struct{} `fidl:"t" fidl_size_v1:"16" fidl_alignment_v1:"8" 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
}
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)
}
// Extra information about DNS servers discovered through DHCPv6.
type Dhcpv6DnsServerSource struct {
_ struct{} `fidl:"t" fidl_size_v1:"16" fidl_alignment_v1:"8" 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
}
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_v1:"16" fidl_alignment_v1:"8" 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
}
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)
}
// Lookup operation options.
type LookupIpOptions struct {
_ struct{} `fidl:"t" fidl_size_v1:"16" fidl_alignment_v1:"8" 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
}
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) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *LookupIpOptions) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
// The result of a lookup operation.
type LookupResult struct {
_ struct{} `fidl:"t" fidl_size_v1:"16" fidl_alignment_v1:"8" 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:"" fidl_ordinal:"1"`
AddressesPresent bool
}
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) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *LookupResult) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
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_ := &lookupAdminWithCtxSetDnsServersRequest{
Servers: servers,
}
resp_ := &lookupAdminWithCtxSetDnsServersResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(LookupAdminSetDnsServersOrdinal, req_, resp_)
return resp_.Result, 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_ := &lookupAdminWithCtxGetDnsServersResponse{}
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_ := lookupAdminWithCtxSetDnsServersRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
result, err_ := s_.Impl.SetDnsServers(args_.Ctx, in_.Servers)
out_ := lookupAdminWithCtxSetDnsServersResponse{}
out_.Result = result
return &out_, true, err_
case LookupAdminGetDnsServersOrdinal:
servers, err_ := s_.Impl.GetDnsServers(args_.Ctx)
out_ := lookupAdminWithCtxGetDnsServersResponse{}
out_.Servers = servers
return &out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type LookupAdminEventProxy _bindings.ChannelProxy
const (
LookupLookupIpOrdinal uint64 = 0x59247caf7560c1d0
LookupLookupHostnameOrdinal uint64 = 0x1b456b0e84888324
)
type LookupWithCtxInterface _bindings.ChannelProxy
// Lookup a list of IP addresses by hostname.
//
// If `hostname` is an Internationalized Domain Name, it must be encoded as per RFC 3490.
func (p *LookupWithCtxInterface) LookupIp(ctx_ _bindings.Context, hostname string, options LookupIpOptions) (LookupLookupIpResult, error) {
req_ := &lookupWithCtxLookupIpRequest{
Hostname: hostname,
Options: options,
}
resp_ := &lookupWithCtxLookupIpResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(LookupLookupIpOrdinal, req_, resp_)
return resp_.Result, err_
}
// Look up a hostname by IP address.
func (p *LookupWithCtxInterface) LookupHostname(ctx_ _bindings.Context, addr fuchsianet.IpAddress) (LookupLookupHostnameResult, error) {
req_ := &lookupWithCtxLookupHostnameRequest{
Addr: addr,
}
resp_ := &lookupWithCtxLookupHostnameResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(LookupLookupHostnameOrdinal, req_, resp_)
return resp_.Result, err_
}
// Provides name and address resolution.
type LookupWithCtx interface {
// Lookup a list of IP addresses by hostname.
//
// If `hostname` is an Internationalized Domain Name, it must be encoded as per RFC 3490.
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_ := lookupWithCtxLookupIpRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
result, err_ := s_.Impl.LookupIp(args_.Ctx, in_.Hostname, in_.Options)
out_ := lookupWithCtxLookupIpResponse{}
out_.Result = result
return &out_, true, err_
case LookupLookupHostnameOrdinal:
in_ := lookupWithCtxLookupHostnameRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
result, err_ := s_.Impl.LookupHostname(args_.Ctx, in_.Addr)
out_ := lookupWithCtxLookupHostnameResponse{}
out_.Result = result
return &out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type LookupEventProxy _bindings.ChannelProxy
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 `WatchServers` while a previous call is still pending. Doing so will
// cause the `DnsServerWatcher` channel 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_ := &dnsServerWatcherWithCtxWatchServersResponse{}
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 `WatchServers` while a previous call is still pending. Doing so will
// cause the `DnsServerWatcher` channel 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
}
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_ := dnsServerWatcherWithCtxWatchServersResponse{}
out_.Servers = servers
return &out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type DnsServerWatcherEventProxy _bindings.ChannelProxy