Struct DnsARecordResult
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
NextResult
Next entry of the record result. This can be null if no any entries left.
public DnsARecordResult* NextResult
Field Value
Version
The version of the IP string. The value must be either 4 (for IPv4) or 6 (for IPv6).
public int Version
Field Value
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
addressSpanReadOnlySpan<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
addressSpanReadOnlySpan<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
resultPDnsARecordResult*The pointer of the current DnsARecordResult entry.
isFreeAllboolIf 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
resultPnintThe pointer of the current DnsARecordResult entry.
isFreeAllboolIf 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
dnsARecordPDnsARecordResult*A pointer to DnsARecordResult struct.
Returns
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
dnsARecordPnintA pointer to DnsARecordResult struct.
Returns
Remarks
If the is returning null or zero pointer, the method will return an empty array instead.