diff --git a/headers/os/net/NetworkInterface.h b/headers/os/net/NetworkInterface.h index 715c14c2e9..8820c6dc3e 100644 --- a/headers/os/net/NetworkInterface.h +++ b/headers/os/net/NetworkInterface.h @@ -65,14 +65,14 @@ public: status_t SetFlags(uint32 flags); status_t SetMTU(uint32 mtu); - uint32 CountAddresses() const; - BNetworkInterfaceAddress* AddressAt(uint32 index); + int32 CountAddresses() const; + BNetworkInterfaceAddress* AddressAt(int32 index); status_t AddAddress( const BNetworkInterfaceAddress& address); status_t RemoveAddress( const BNetworkInterfaceAddress& address); - status_t RemoveAddressAt(uint32 index); + status_t RemoveAddressAt(int32 index); status_t GetHardwareAddress(BNetworkAddress& address); diff --git a/headers/os/net/NetworkRoster.h b/headers/os/net/NetworkRoster.h index c7ed01612a..02fc48ee3a 100644 --- a/headers/os/net/NetworkRoster.h +++ b/headers/os/net/NetworkRoster.h @@ -15,16 +15,16 @@ class BNetworkInterface; class BNetworkRoster { public: - BNetworkRoster& Default(); + static BNetworkRoster& Default(); + + int32 CountInterfaces(); + BNetworkInterface* InterfaceAt(int32 index); - uint32 CountInterfaces(); - BNetworkInterface* InterfaceAt(uint32 index); - status_t AddInterface( const BNetworkInterface& interface); status_t RemoveInterface( const BNetworkInterface& interface); - status_t RemoveInterfaceAt(uint32 index); + status_t RemoveInterfaceAt(int32 index); status_t StartWatching(const BMessenger& target, uint32 eventMask); diff --git a/src/kits/network/libnetapi/Jamfile b/src/kits/network/libnetapi/Jamfile index 8b7fda43a4..e397d8882e 100644 --- a/src/kits/network/libnetapi/Jamfile +++ b/src/kits/network/libnetapi/Jamfile @@ -1,52 +1,18 @@ SubDir HAIKU_TOP src kits network libnetapi ; -SetSubDirSupportedPlatformsBeOSCompatible ; - UsePrivateHeaders net ; -local netapi_sources = +SharedLibrary libbnetapi.so : init.cpp DynamicBuffer.cpp NetEndpoint.cpp NetAddress.cpp NetBuffer.cpp NetDebug.cpp + + NetworkAddress.cpp + NetworkInterface.cpp + NetworkRoster.cpp + + : be $(TARGET_NETWORK_LIBS) $(TARGET_LIBSUPC++) ; - -if $(TARGET_PLATFORM) != haiku { - UseHeaders [ FDirName $(HAIKU_TOP) headers posix ] : true ; - # We need the public network headers also when not compiling for Haiku. - # Unfortunately we get more than we want, namely all POSIX headers. - UseHeaders [ FStandardOSHeaders ] : true ; - # Needed for and maybe other stuff. - - local defines = [ FDefines BUILDING_R5_LIBNET ] ; - SubDirCcFlags $(defines) ; - SubDirC++Flags $(defines) ; - - SharedLibrary libnetapi.so : - $(netapi_sources) - : be $(TARGET_NETWORK_LIBS) $(TARGET_LIBSUPC++) - ; - - # Installation -- in the test directory for the time being - HaikuInstallRelSymLink install-networking - : [ FDirName $(HAIKU_TEST_DIR) kits net lib ] - : libnetapi.so - : installed-networking-test ; - - HaikuInstallRelSymLink install-userland-networking - : [ FDirName $(HAIKU_TEST_DIR) kits net userland lib ] - : libnetapi.so - : installed-userland-networking ; - - Package haiku-networkingkit-cvs : - libnetapi.so : - # boot home config lib ; - boot home Desktop haiku-networkingkit lib ; -} else { - SharedLibrary libbnetapi.so : - $(netapi_sources) - : be $(TARGET_NETWORK_LIBS) $(TARGET_LIBSUPC++) - ; -} diff --git a/src/kits/network/libnetapi/NetworkAddress.cpp b/src/kits/network/libnetapi/NetworkAddress.cpp new file mode 100644 index 0000000000..c2536a0872 --- /dev/null +++ b/src/kits/network/libnetapi/NetworkAddress.cpp @@ -0,0 +1,8 @@ +/* + * Copyright 2010, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include + diff --git a/src/kits/network/libnetapi/NetworkInterface.cpp b/src/kits/network/libnetapi/NetworkInterface.cpp new file mode 100644 index 0000000000..7222f5cb82 --- /dev/null +++ b/src/kits/network/libnetapi/NetworkInterface.cpp @@ -0,0 +1,8 @@ +/* + * Copyright 2010, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include + diff --git a/src/kits/network/libnetapi/NetworkRoster.cpp b/src/kits/network/libnetapi/NetworkRoster.cpp new file mode 100644 index 0000000000..af90b2fef5 --- /dev/null +++ b/src/kits/network/libnetapi/NetworkRoster.cpp @@ -0,0 +1,8 @@ +/* + * Copyright 2010, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include +