This is an opaque structure used to describe an internet address.
struct addr_t {
unsigned int length;
unsighed char data[16];
};The application has no way of learning the type of the address other than guessing it by the value of the length member. Typically, the value is 4 for an IPv4 address and 16 for an IPv6 address. Other address families are currently not supported.
To convert an address to a human-readable string, the application can use the rascal_ntoa function; to convert a string to an addr_t structure, the rascal_aton function should be used. Otherwise, the application can work with address descriptors on the octet level, by accessing the data array.
The following additional methods are available in C++ mode:
// Constructors: addr_t(unsigned int length = 0); addr_t(const addr_t &src); // Operators: addr_t& operator = (const addr_t &src);