1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-26 20:01:35 +01:00

Added LGPL notice. TCP pdu is working.

This commit is contained in:
Matias
2011-08-11 17:27:15 -03:00
parent 1c2b255747
commit 6288574f85
10 changed files with 227 additions and 6 deletions

View File

@@ -1,3 +1,24 @@
/*
* libtins is a net packet wrapper library for crafting and
* interpreting sniffed packets.
*
* Copyright (C) 2011 Nasel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WIN32
#include <sys/socket.h>
#include <sys/select.h>
@@ -14,6 +35,8 @@
#include "packetsender.h"
const int Tins::PacketSender::INVALID_RAW_SOCKET = -10;
Tins::PacketSender::PacketSender() : _sockets(SOCKETS_END, INVALID_RAW_SOCKET) {
}
@@ -49,7 +72,6 @@ bool Tins::PacketSender::send_l3(PDU *pdu, const struct sockaddr* link_addr, uin
bool ret_val = true;
if(!open_l3_socket())
ret_val = false;
if (ret_val) {
uint32_t sz;
int sock = _sockets[IP_SOCKET];