diff options
Diffstat (limited to 'src/win32/tunDevice.cpp')
-rw-r--r-- | src/win32/tunDevice.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/win32/tunDevice.cpp b/src/win32/tunDevice.cpp index 5bc453d..c162ac3 100644 --- a/src/win32/tunDevice.cpp +++ b/src/win32/tunDevice.cpp @@ -56,11 +56,17 @@ int TunDevice::fix_return(int ret, size_t pi_length) int TunDevice::read(u_int8_t* buf, u_int32_t len) { - return 0; + std::string input; + std::cin >> input; + Buffer b(input); + u_int32_t cpylen = b.getLength() < len ? b.getLength() : len; + std::memcpy(buf, b.getBuf(), b.getLength()); + return cpylen; } int TunDevice::write(u_int8_t* buf, u_int32_t len) { + std::cout << Buffer(buf, len).getHexDumpOneLine() << std::endl; return 0; } |