Table of Contents

Struct DnsARecordResult

Namespace
Hi3Helper.Plugin.Core.Utility
Assembly
Hi3Helper.Plugin.Core.dll

Unmanaged struct which contains a string which represents both IPv4 or IPv6.

public struct DnsARecordResult
Inherited Members
Extension Methods

Fields

AddressData

Pointer to a string represents the IP address.

public byte* AddressData

Field Value

byte*

AddressDataLength

Represents the length of the address data written in bytes.

public int AddressDataLength

Field Value

int

NextResult

Next entry of the record result. This can be null if no any entries left.

public DnsARecordResult* NextResult

Field Value

DnsARecordResult*

Version

The version of the IP string. The value must be either 4 (for IPv4) or 6 (for IPv6).

public int Version

Field Value

int

Methods

Create(params ReadOnlySpan<IPAddress>)

Creates a single or multiple entries of DnsARecordResult from an array of IPAddress.

public static DnsARecordResult* Create(params ReadOnlySpan<IPAddress> addressSpan)

Parameters

addressSpan ReadOnlySpan<IPAddress>

A span/array of addresses to be converted.

Returns

DnsARecordResult*

A pointer to a struct of DnsARecordResult

Remarks

The field of NextResult will contain a pointer of the next DnsARecordResult entry if the array of IPAddress is used.
When the array is empty, a null pointer will be returned instead.

CreateToIntPtr(params ReadOnlySpan<IPAddress>)

Creates a single or multiple entries of DnsARecordResult from an array of IPAddress.

public static nint CreateToIntPtr(params ReadOnlySpan<IPAddress> addressSpan)

Parameters

addressSpan ReadOnlySpan<IPAddress>

A span/array of addresses to be converted.

Returns

nint

A pointer to a struct of DnsARecordResult

Remarks

The field of NextResult will contain a pointer of the next DnsARecordResult entry if the array of IPAddress is used.
When the array is empty, a null pointer will be returned instead.

Free(DnsARecordResult*, bool)

Free the instance of DnsARecordResult struct and its entries.

public static void Free(DnsARecordResult* resultP, bool isFreeAll = true)

Parameters

resultP DnsARecordResult*

The pointer of the current DnsARecordResult entry.

isFreeAll bool

If set to true, the current entry and all its next entries will be freed. Otherwise, just free the current one.

Free(nint, bool)

Free the instance of DnsARecordResult struct and its entries.

public static void Free(nint resultP, bool isFreeAll = true)

Parameters

resultP nint

The pointer of the current DnsARecordResult entry.

isFreeAll bool

If set to true, the current entry and all its next entries will be freed. Otherwise, just free the current one.

GetIPAddressArray(DnsARecordResult*)

Gets an array of IPAddress and free the struct data from the pointer.

public static IPAddress[] GetIPAddressArray(DnsARecordResult* dnsARecordP)

Parameters

dnsARecordP DnsARecordResult*

A pointer to DnsARecordResult struct.

Returns

IPAddress[]

An array of IPAddress

Remarks

If the is returning null or zero pointer, the method will return an empty array instead.

GetIPAddressArray(nint)

Gets an array of IPAddress and free the struct data from the pointer.

public static IPAddress[] GetIPAddressArray(nint dnsARecordP)

Parameters

dnsARecordP nint

A pointer to DnsARecordResult struct.

Returns

IPAddress[]

An array of IPAddress

Remarks

If the is returning null or zero pointer, the method will return an empty array instead.