Boost.Python.ArgumentError: Python argument types in
PacketSender.isend(PacketSender, str, Boost.Python.class)
did not match C++ signature:
isend(PyPacketSender {lvalue}, Tins::NetworkInterface, PyPDU*)
Yet I can re-send the sniffed packets on a different interface without issue. I can also change various attributes such as the dest/source MAC addresses.
thanks!
Yes it seems that this could replace most Python libs that need basic packet crafting but at high speed. Very appealing! Happy to assist if possible.
--
You received this message because you are subscribed to a topic in the Google Groups "libtins" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/libtins/t006uGJK5Wg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to libtins+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
In file included from include/pypdu.h:103:0,
from include/pydhcp.h:33,
from src/pydhcp.cpp:31:
src/pydhcp.cpp: In static member function ‘static void PyDHCP::python_register()’:
include/cppwrappers.h:325:65: error: no matches converting function ‘routers’ to type ‘class std::list<Tins::IPv4Address> (class Tins::DHCP::*)()const’
make_getter_wrapper((RETURN (CLASS::*)() const)(&CLASS::NAME))
^
include/cppwrappers.h:353:23: note: in expansion of macro ‘PYTINS_GETTER_FUN’
.def("get_"#NAME, PYTINS_GETTER_FUN(GETTER_TYPE, CLASS, NAME)) \
^
src/pydhcp.cpp:80:9: note: in expansion of macro ‘PYTINS_MAKE_GETTER_SETTER2’
PYTINS_MAKE_GETTER_SETTER2(std::list<ipaddress_type>, const std::list<ipaddress_type>&, DHCP, routers)
^
In file included from src/pydhcp.cpp:30:0:
/usr/local/include/tins/dhcp.h:411:37: note: candidates are: std::vector<Tins::IPv4Address> Tins::DHCP::routers() const
std::vector<ipaddress_type> routers() const;
^
/usr/local/include/tins/dhcp.h:293:14: note: void Tins::DHCP::routers(const std::vector<Tins::IPv4Address>&)
void routers(const std::vector<ipaddress_type> &routers);
^
In file included from include/pypdu.h:103:0,
from include/pydhcp.h:33,
from src/pydhcp.cpp:31:
include/cppwrappers.h:331:64: error: no matches converting function ‘routers’ to type ‘void (class Tins::DHCP::*)(const class std::list<Tins::IPv4Address>&)’
make_setter_wrapper((void (CLASS::*)(ARGTYPE))(&CLASS::NAME))
^
include/cppwrappers.h:354:23: note: in expansion of macro ‘PYTINS_SETTER_FUN’
.def("set_"#NAME, PYTINS_SETTER_FUN(SETTER_TYPE, CLASS, NAME))
^
src/pydhcp.cpp:80:9: note: in expansion of macro ‘PYTINS_MAKE_GETTER_SETTER2’
PYTINS_MAKE_GETTER_SETTER2(std::list<ipaddress_type>, const std::list<ipaddress_type>&, DHCP, routers)
^
In file included from src/pydhcp.cpp:30:0:
/usr/local/include/tins/dhcp.h:411:37: note: candidates are: std::vector<Tins::IPv4Address> Tins::DHCP::routers() const
std::vector<ipaddress_type> routers() const;
^
/usr/local/include/tins/dhcp.h:293:14: note: void Tins::DHCP::routers(const std::vector<Tins::IPv4Address>&)
void routers(const std::vector<ipaddress_type> &routers);
^
In file included from include/pypdu.h:103:0,
from include/pydhcp.h:33,
from src/pydhcp.cpp:31:
include/cppwrappers.h:325:65: error: no matches converting function ‘domain_name_servers’ to type ‘class std::list<Tins::IPv4Address> (class Tins::DHCP::*)()const’
make_getter_wrapper((RETURN (CLASS::*)() const)(&CLASS::NAME))
^
include/cppwrappers.h:353:23: note: in expansion of macro ‘PYTINS_GETTER_FUN’
.def("get_"#NAME, PYTINS_GETTER_FUN(GETTER_TYPE, CLASS, NAME)) \
^
src/pydhcp.cpp:81:9: note: in expansion of macro ‘PYTINS_MAKE_GETTER_SETTER2’
PYTINS_MAKE_GETTER_SETTER2(std::list<ipaddress_type>, const std::list<ipaddress_type>&, DHCP, domain_name_servers)
^
In file included from src/pydhcp.cpp:30:0:
/usr/local/include/tins/dhcp.h:422:37: note: candidates are: std::vector<Tins::IPv4Address> Tins::DHCP::domain_name_servers() const
std::vector<ipaddress_type> domain_name_servers() const;
^
/usr/local/include/tins/dhcp.h:302:14: note: void Tins::DHCP::domain_name_servers(const std::vector<Tins::IPv4Address>&)
void domain_name_servers(const std::vector<ipaddress_type> &dns);
^
In file included from include/pypdu.h:103:0,
from include/pydhcp.h:33,
from src/pydhcp.cpp:31:
include/cppwrappers.h:331:64: error: no matches converting function ‘domain_name_servers’ to type ‘void (class Tins::DHCP::*)(const class std::list<Tins::IPv4Address>&)’
make_setter_wrapper((void (CLASS::*)(ARGTYPE))(&CLASS::NAME))
^
include/cppwrappers.h:354:23: note: in expansion of macro ‘PYTINS_SETTER_FUN’
.def("set_"#NAME, PYTINS_SETTER_FUN(SETTER_TYPE, CLASS, NAME))
^
src/pydhcp.cpp:81:9: note: in expansion of macro ‘PYTINS_MAKE_GETTER_SETTER2’
PYTINS_MAKE_GETTER_SETTER2(std::list<ipaddress_type>, const std::list<ipaddress_type>&, DHCP, domain_name_servers)
^
In file included from src/pydhcp.cpp:30:0:
/usr/local/include/tins/dhcp.h:422:37: note: candidates are: std::vector<Tins::IPv4Address> Tins::DHCP::domain_name_servers() const
std::vector<ipaddress_type> domain_name_servers() const;
^
/usr/local/include/tins/dhcp.h:302:14: note: void Tins::DHCP::domain_name_servers(const std::vector<Tins::IPv4Address>&)
void domain_name_servers(const std::vector<ipaddress_type> &dns);
^
make: *** [src/pydhcp.o] Error 1...
PDU* cpp_find_pdu(const PDU* pdu, PDU::PDUType t) {- default constructors for address ranges... gcc is painful about it.
PDU* current_pdu = (PDU*) pdu;
while(current_pdu) {
if(current_pdu->matches_flag(t))
return current_pdu;
current_pdu = current_pdu->inner_pdu();
}
return 0;
}
--
You received this message because you are subscribed to the Google Groups "libtins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libtins+u...@googlegroups.com.
- a way to remove an option from IP and TCP PDU (so that i can write things like "tcp_pdu.mss = None" in python to reset the option)(WIP: it can kill your pets or trigger the end of the world or worse)What would be nice in libtins to ease the bindings:
https://github.com/stephane-martin/cycapture
- a non-templated function to find PDUs inside a PDU, because template support in python is a bit too rough
PDU* tcp = packet.find_pdu<PDU>(TCP::pdu_flag);eg like:PDU* cpp_find_pdu(const PDU* pdu, PDU::PDUType t) {- default constructors for address ranges... gcc is painful about it.
PDU* current_pdu = (PDU*) pdu;
while(current_pdu) {
if(current_pdu->matches_flag(t))
return current_pdu;
current_pdu = current_pdu->inner_pdu();
}
return 0;
}
- have been implemented: generic PDU, RAW, Ethernet, IP, TCP, UDP (the DNS is just a stub). It should be enough to test the parsing capabilities.- polymorphism of find_pdu has been workaround: there is a PDU.find_pdu method that does the same job. Just have to specify the type of PDU you're looking for.- i think i was quite careful about memory management, but of course some small details can still be wrong- the setup.py will download and compile deps (libpcap and libtins). the python extensions are built statically against them. so the resulting .so should be all you need in python.Cheers,Stephane
2015-08-01 6:43 GMT+02:00 Matias Fontanini <matias.f...@gmail.com>:
Hi Stephane,that's awesome! Looking forward to hearing news about it :). Let me know if you need any help on anything.Cheers,Matias
On Friday, July 31, 2015 at 7:41:39 PM UTC-7, houbaastef wrote:Hello,
i started to work on a cython wrapper for libtins (scapy and dpkt are just too slow...). I have some difficulties with C++ classes inheritance and template methods, but i don't think it will be an insurmountable problem. I'll post update here when it will be usable, probably in a few weeks.
Regards,
Stephane
On Friday, 15 August 2014 01:26:18 UTC+2, Matias Fontanini wrote:Hi,the python bindings are not at all usable. Some features might work, but there are still lots that aren't working and there are a few bugs. It's just a project I started a while ago but never really got into.It's in my plans to start developing again though, since according to some quick benchmarks I made, it was several times faster than the rest of the python libraries available.If you really want to use python for this, I'd suggest dpkt. If you're ok with C++, then go for libtins :D.Cheers
--
You received this message because you are subscribed to the Google Groups "libtins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libtins+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to libtins+u...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "libtins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libtins+u...@googlegroups.com.
TCP tcp;
tcp.mss(1460);
tcp.remove_option(TCP::MSS);To unsubscribe from this group and stop receiving emails from it, send an email to libtins+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "libtins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libtins+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "libtins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libtins+u...@googlegroups.com.