Internet Direct (Indy)
Home
PreviousUpNext
TIdStackBSDBase.TranslateStringToTInAddr Method

Convert an IP address structured to a structured IP address data type.

Pascal
procedure TranslateStringToTInAddr(
    AIP: string; 
    var AInAddr; 
    const AIPVersion: TIdIPVersion
);
Parameters 
Description 
AIP 
IP address to convert to the structured data type.
 
AInAddr 
Structured data type for the IP address.
 
AIPVersion 
IP version to use for the converted IP address. 

TranslateStringToTInAddr is a procedure used to convert the IP address in AIP to the structured IP address data type indicated in AInAddr. 

TranslateStringToTInAddr uses the value in AIPVersion to determine the format for the IP address, and the processing required to convert AIP to a structured data type. 

 

IP Version 
Conversion Process 
Id_IPv4 
The IP address is expected in IP version 4 dotted-decimal format. Four byte values are extracted from the string and stored by casting the address to a TIdIn4Addr structure. 
Id_IPv6 
The IP address is expected in IP version 6 format, and is normalized by calling MakeCanonicalIPv6Address using the string value. Eight byte values are extracted from the string and stored by casting the address to a TIdIn6Addr structure. 

 

When AIPVersion contains any other value, the IPVersionUnsupported method is called. 

Use TranslateTInAddrToString to convert a structured IP address to its string representation.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.