Open lattice0 opened 4 years ago
Sorry, I just found that serialize() returns an std::vector. However, the serialization of
Tins::IP pkt = Tins::IP("192.168.0.1") /
Tins::TCP(13, 15) /
Tins::RawPDU("I'm a payload!");
gives me a full ethernet packet, not an IP packet! Shouldn't it serialize to an IP packet? Why the ethernet?
I've read the documentation and some classes on doxygen and there's no way to either send a packet through a file descriptor as if I were writing directly to
/dev/net/tun
or there's no option to dump the packet into a simpleuint8_t*
buffer so I can do the write manually. I also found no way of creating my own PacketSender that writes to an interface. The closest I found was PDU's serialize but it is protected so I don't know exactly what it's for.Am I rigth?
I need this because I'm creating a way to send an IP packet through OpenVPN and I need to write to a virtual file from which it reads and sends my packet