Internet and Network Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Internet and Network >

Internet and Network Commands

GIP. - Get-IP-Address

Previous Top Next


MiniRobotLanguage (MRL)

 

GIP. Command

Get IP Address

 

 

Intention

 

Compute the IP Address of the actual computer. The code very simple:

GIP.

 

if multiple network cards, a index number can be given. Like this:

GIP.2

 

And this is how the stack will look in either case. The specific IP-numbers are just for example:

 

graphic

 

If you provide an host name/computer name, the command will translate the host name into the corresponding IP address. This can be a computer name from your network, as well as a internet resource. The code looks like this:

GIP.www.fa2.de

 

graphic

 

There is a second form of GIP. in which it can be used to translate a numeric IP address to a normal IP-address. Like this:

GIP.>16777343

 

and below you can see how the stack looks like.

 

graphic

 

The opposite will also work, to translate a normal IP address to a numeric IP-address. You just write it like this:

GIP.<127.0.0.1

 

graphic

 

The stack now shows the IP in numeric form.

 

In all these cases you can provide a variable as second parameter. Like this:

GIP.|$$RES

GIP.2|$$RES

GIP.<127.0.0.1|$$RES

GIP.>16777343|$$RES

 

Then the value thats on the TOS will not be placed on the stack, but into the provided variable.

 

 

 

 

Syntax

 

 

GIP.[P1][|P2]

 

 

Parameter Explanation

 

P1 - (optional) host name, computer name or name of a internet resource that can be computed to an ip address. If omitted the ip address of the actual computer is been returned.

 

P2 - (optional) variable for the result

 

There is a second mode in which GIP. makes conversions between the numeric and the conventional form of an ip address. In these cases P1 must be prefixed with a ">" to convert a numeric IP to a standard IP. And if you prefix P1 with a "<", followed by Standard IP, this one will be translated into a numeric IP.

 

 

 

Example

 

' GIP. - Sample

STS.LOCAL

STS.CLEAR

 

GIP.

' show Actual Stack

DMP.6

MBX. Sample 1

 

STS.CLEAR

 

GIP.

' show Actual Stack

DMP.6

MBX. Sample 2

 

STS.CLEAR

GIP.1|$$REA

GIP.2|$$REB

' show Actual Stack

DMP.6

MBX.IP's are is $$REA-$$REB

 

STS.CLEAR

GIP.>16777343

DMP.6

MBX. IP Conversion done

 

STS.CLEAR

GIP.>16777343|$$RES

DMP.6

MBX. IP Conversion done: $$RES

 

STS.CLEAR

GIP.<127.0.0.1

DMP.6

MBX. IP Conversion 3 done

 

STS.CLEAR

GIP.<127.0.0.1|$$RES

DMP.6

MBX. IP Conversion 3 done $$RES

 

STS.CLEAR

GIP.www.fa2.de

DMP.6

MBX. Network Name resolved.

ENR.

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

 

See also:

 

    GUN. - Get User Name

    GCN. - Get Computer Name

    GPU. - Get Process User