#include <string>
#include <cstdlib>
#include <stdexcept>
+#include <stdint.h>
/// Dirección IP
struct IPAddr
{
/// Átomo de dirección IP
- typedef unsigned char atom;
+ typedef uint8_t atom;
/// Representación interna
atom atoms[4];
+ /// Constructor
+ IPAddr();
+
/// Constructor
IPAddr(atom a1, atom a2, atom a3, atom a4);
/// Constructor
- IPAddr(unsigned ip);
+ IPAddr(uint32_t ip);
+
+ /// Constructor
+ //IPAddr(const char* ip) throw (std::logic_error);
/// Constructor
- IPAddr(std::string ip) throw (std::logic_error);
+ IPAddr(const std::string& ip) throw (std::logic_error);
/// Operador de casteo a unsigned
- operator unsigned () const;
+ operator uint32_t () const;
/// Operador de casteo a std::string
operator std::string () const;