#define _RESOLVPROTO_H_
#include "ipaddr.h"
+#include "ipin.h"
+#include "ipout.h"
#include <string>
#include <vector>
#include <stdexcept>
std::string name;
/// Constructores
- ResolvProtoRequest(int fd);
- ResolvProtoRequest(std::string name, uint8_t query_type = QT_RECURSIVE);
+ ResolvProtoRequest(std::string name, uint8_t query_type);
+ ResolvProtoRequest(std::string buf);
/// Envía por socket
- void send(int sockfd) const throw (std::runtime_error);
+ void send(IPOut& ipo) const throw (std::runtime_error);
/// Recibe por socket
- void recv(int sockfd) throw (std::runtime_error);
+ void recv(IPIn& ipi) throw (std::runtime_error);
+
+ /// Obtiene tamaño del paquete
+ size_t packet_size() const;
+
+ /// Convierte a un string
+ operator std::string () const;
};
/// Constructores
ResolvProtoResponse();
- ResolvProtoResponse(int fd);
ResolvProtoResponse(ret_t ret, uint32_t ttl = 0,
const ipvec_t& ips = ipvec_t());
+ ResolvProtoResponse(std::string buf);
/// Envía por socket
- void send(int sockfd) const throw (std::runtime_error);
+ void send(IPOut& ipo) const throw (std::runtime_error);
/// Recibe por socket
- void recv(int sockfd) throw (std::runtime_error);
+ void recv(IPIn& ipi) throw (std::runtime_error);
+
+ /// Obtiene tamaño del paquete
+ size_t packet_size() const;
+
+ /// Convierte a un string
+ operator std::string () const;
};