PGEN-Address

PGEN-Address gives users easy interface for IP address and MAC address. These are implemented as pgen_ipaddr and pgen_macaddr.

These are sample codes with PGEN-Address.

They has many utility member functions and operators.

Member Function and Operator

Address class has many operators that helps address operation.

Available operators is ==, !=, <, >, <=, >=. For example 192.168.100.1 <= 192.168.120.1 is true. 192.168.1.3 > 192.168.1.4 is false. 192.168.111.1 != 192.168.111.1 is false.

If you want to print address with printf(), you use member function, c_str(), like std::string class. See sample code above. More Information, please see libpgen on GihHub.

Comments are closed.