1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 21:14:28 +01:00

Updated IP, PDU and PacketSender so as to send forged ip packets successfully

This commit is contained in:
Santiago Alessandri
2011-08-11 09:35:23 -03:00
parent 8dc0a5a832
commit f9445b05b6
7 changed files with 87 additions and 68 deletions

View File

@@ -7,21 +7,25 @@
#include "pdu.h"
namespace Tins {
class PDU;
class PacketSender {
public:
/* Opens a socket, using flag as protocol family.
/* Opens a socket, using flag as protocol family.
* Return true if it was possible to open it(or it was already open),
* false otherwise. */
bool open_socket(uint32_t flag);
bool open_l3_socket();
bool close_socket(uint32_t flag);
bool send(PDU *pdu);
bool send(PDU* pdu);
bool send_l3(PDU *pdu, const struct sockaddr* link_addr, uint32_t len_link_addr);
private:
typedef std::map<uint32_t, int> SocketMap;
bool write(int sock, uint8_t *buffer, uint32_t size);
static const uint32_t IP_SOCKET;
SocketMap _sockets;
};
};