summaryrefslogtreecommitdiff
path: root/src/win32
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-01-16 15:49:42 +0000
committerChristian Pointner <equinox@anytun.org>2009-01-16 15:49:42 +0000
commit88a0ecb3917a38ef5edf95f302b9aed1b71ef36d (patch)
treef1b46011a80d594349c2fbc5ef1d3563cdaa74c8 /src/win32
parentsmall cleanup (diff)
added Log to stdout
added dummy stdio tun device some cleanups (windows)
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/tunDevice.cpp8
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;
}