Fortinet white logo
Fortinet white logo
7.0.2

IP address classes

IP address classes

__eq()

Support use “==” to compare two IP address classes.

__tostring()

Support use tostring(IP-class) to convert IP address class to IP string.

str()

Return IP string of this IP address class.

ver()

Return IP address version with integer 4 or 6.

v4()

Return a new IP address class in v4 version. If the IP address class is v4, copy the IP address class and return. If the IP address class is v6, the system will try to convert it to v4. If it succeeds, return the v4 IP address class. If it fails, return nil.

v6()

Return a new IP address class in v6 version. If the IP address class is v6, copy the IP address class and return. If the IP address class is v4, the system will try to convert it to v6. If it succeeds, return the v6 IP address class. If it fails, return nil.

eq(“IP-string”) / eq(IP_class)

Compare this IP address class with another one. It can compare IP address class or IP string.

IP address classes

IP address classes

__eq()

Support use “==” to compare two IP address classes.

__tostring()

Support use tostring(IP-class) to convert IP address class to IP string.

str()

Return IP string of this IP address class.

ver()

Return IP address version with integer 4 or 6.

v4()

Return a new IP address class in v4 version. If the IP address class is v4, copy the IP address class and return. If the IP address class is v6, the system will try to convert it to v4. If it succeeds, return the v4 IP address class. If it fails, return nil.

v6()

Return a new IP address class in v6 version. If the IP address class is v6, copy the IP address class and return. If the IP address class is v4, the system will try to convert it to v6. If it succeeds, return the v6 IP address class. If it fails, return nil.

eq(“IP-string”) / eq(IP_class)

Compare this IP address class with another one. It can compare IP address class or IP string.