Commit Graph

8 Commits

Author SHA1 Message Date
Brian White
e3a657c662 unix, windows: add MAC to uv_interface_addresses()
Make uv_interface_addresses() return the MAC address as a 48 bits
binary value in the phys_addr field of the uv_interface_address_t
struct.
2013-07-25 13:49:39 +02:00
Ben Noordhuis
3ee4d3f183 unix, windows: return error codes directly
This commit changes the libuv API to return error codes directly rather
than storing them in a loop-global field.

A code snippet like this one:

    if (uv_foo(loop) < 0) {
      uv_err_t err = uv_last_error(loop);
      fprintf(stderr, "%s\n", uv_strerror(err));
    }

Should be rewritten like this:

    int err = uv_foo(loop);
    if (err < 0)
      fprintf(stderr, "%s\n", uv_strerror(err));

The rationale for this change is that it should make creating bindings
for other languages a lot easier: dealing with struct return values is
painful with most FFIs and often downright buggy.
2013-07-07 09:51:00 +02:00
Ben Kelly
14aa6153be unix, win: add netmask to uv_interface_address
Include the netmask when returning information about the OS network
interfaces.

This commit provides implementations for windows and those unix
platforms using getifaddrs().

AIX was not implemented because it requires the use of ioctls and I do
not have an AIX development/test environment.  The windows code was
developed using mingw on winxp as I do not have access to visual studio.

Tested on darwin (ipv4/ipv6) and winxp (ipv4 only).  Needs testing on
newer windows using ipv6 and other unix platforms.
2013-04-10 14:48:23 +02:00
Bert Belder
2e5e1165ce Tests: don't use %zu placeholder in printf statements
It's not supported by msvcrt.
2012-04-11 22:54:02 +02:00
Brian White
9d3c00046f test: ensure valid uptime value 2012-04-01 21:15:51 +02:00
Ben Noordhuis
8ce8bfaa40 test: fix format string warnings 2012-03-21 06:26:10 -07:00
Ben Noordhuis
379ca428ef test: fix compiler warnings
* remove unused variables and functions
* replace %llu with %zu when printing size_t variables
2012-03-16 02:46:51 +01:00
Igor Zinkovsky
3d189de699 platform api 2011-12-14 17:50:36 -08:00