Commit Graph

19 Commits

Author SHA1 Message Date
Jason A. Donenfeld
544fdaaf8f api: rewrite based on SwDevice
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-12 18:54:20 +00:00
Simon Rozman
d675646ab8 api: upgrade
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-28 20:25:27 +02:00
Simon Rozman
7dffa4be72 vs: move shared configuration to wintun.props and upgrade
Remember to rename wintun.vcxproj.user file in your local working folder
to wintun.props.user manually.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-28 20:22:18 +02:00
Simon Rozman
bc5cde8916 api: upgrade logging
Log runtime information to quickly check whether the values are sane
when analyzing error logs sent in by users.

Signed-off-by: Simon Rozman <simon@rozman.si>
2021-02-16 04:19:21 +01:00
Jason A. Donenfeld
2628412d71 global: bump copyright
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-01-30 16:45:26 +01:00
Simon Rozman
c581a9f6cd api: fix Function and Prefix logging order
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-07 15:04:33 +01:00
Jason A. Donenfeld
c26b16e06f api: CALLBACK_FUNC -> CALLBACK
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-04 16:46:24 +01:00
Jason A. Donenfeld
5d1efa847f api: use a logging alloc function
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-04 13:21:43 +01:00
Jason A. Donenfeld
9c349273f5 api: concatenate function name at runtime
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-04 13:21:43 +01:00
Simon Rozman
f657e6fd27 api: use GetLastError() to report failures like standard Win32
Signed-off-by: Simon Rozman <simon@rozman.si>
2020-11-04 13:21:42 +01:00
Jason A. Donenfeld
0c85a2ebf1 api: move _L macro where it belongs
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-03 11:42:48 +01:00
Jason A. Donenfeld
dfa53185d0 api: check for duplicate adapter status
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-02 09:17:47 +01:00
Jason A. Donenfeld
334a5e619f api: cleanup names
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-11-01 00:00:14 +01:00
Jason A. Donenfeld
937eb44727 api: get rid of pch and make headers sane
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-10-31 19:11:51 +01:00
Simon Rozman
449876fdfd api: introduce wintun.h
The SDK header for deployment containing datatype and function
declarations for use by C/C++ clients.

As we shall not distribute MSVC wintun.lib files, making clients need to
use GetProcAddress(), this file contains function type declarations
rather then __declspec(dllimport) function declarations.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-10-30 16:51:01 +01:00
Simon Rozman
c049a8f853 api: make logger callback return a dummy value
Go supports only callbacks that return "something" of a size up to
uintptr. It panics on void-returning callbacks.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-10-30 16:51:01 +01:00
Simon Rozman
0ad302c11d api: stop double error status reporting
When an internal function logs an error and its cause, it bloats the log
when the caller logs the cause again.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-10-30 16:51:00 +01:00
Simon Rozman
78b7a01eb3 api: simplify logger macros names
WINTUN_LOGGER_... => LOGGER_... => LOG_...

Those macros are internal, so they don/t need to start with WINTUN_...

Replacing the noun LOGGER_... with the verb LOG_... makes the code more
natural to read now.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-10-30 16:51:00 +01:00
Simon Rozman
f316c13b3e api: introduce logging
And other unifications with installer before merging.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-10-30 16:50:59 +01:00