[haiku-commits] haiku: hrev54923 - src/kits/network/libnetservices src/kits/network/libnetapi headers/private/netservices headers/os/net

  • From: Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 27 Jan 2021 19:53:19 +0000 (UTC)

hrev54923 adds 8 changesets to branch 'master'
old head: 4dcdff4fe3d770e6fc3fffcd6cfd0326ef471c1f
new head: 8579c7faf2111c668a31ace64d268cac00f71d59
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=8579c7faf211+%5E4dcdff4fe3d7

----------------------------------------------------------------------------

35d8d4d113fc: libnetapi.so: move deprecated classes out into a libnetservices 
directory
  
  These classes have been moved to the public API too soon, and they need some
  more time to mature before they can be declared stable.
  
  In this first step the classes that are involved, are moved to a separate
  folder. They will still be linked to libnetapi.so, so that binaries that
  depend on them currently will not break.
  
  Change-Id: I6c16f17573d819314a27936f065ebe675846f763
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/3664
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

603e0bdf6208: libnetapi.so: make headers of deprecated classes private
  
  These classes have been moved to the public API too soon, and they need some
  more time to mature before they can be declared stable.
  
  Change-Id: I9c52a8e6cc103922abde7a6b911fe0c3e6bf5700
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/3665
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

1b133b90fd01: libnetservices.a: create new static library for the network 
services
  
  These will be added to the _devel packages so that other applications can link
  to them.
  
  Change-Id: If3fd231869823b42d6d896c6c9eb7a95c5fe715d
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/3666
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

ce64ffdb9003: libnetservices.a: Put the experimental API into BPrivate::Network 
namespace
  
  In order to prevent classes between libnetapi.so with the legacy API and
  applications using the libnetservices.a library, the latter will have the
  classes in a distinct namespace.
  
  In the implementation, both libbnetapi.so and libnetservices.a will use the
  same header and source files. If LIBNETAPI_DEPRECATED is defined during build,
  the headers and source will have binary compatible behavior. Otherwise, the
  classes and other objects will be put in the HaikuExt namespace.
  
  In order to build the libbnetapi.so and libnetservices.a with the proper
  build configuration, there is a stub `src/kits/net/libnetapi_deprecated` 
folder
  that applies the special configuration to the source files.
  
  Currently HaikuDepot, Webpositive, libshared.a and the http_streamer add on
  use the compatible API in libbnetapi.so.
  
  Change-Id: Ic73e9f271ef75749adda46f6f72e9a0b2851b461
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/3667
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

ac4b83732861: http_streamer: switch to libnetservices.a
  
  Switch to the experimental services API as the copy in libbnetapi.so is
  deprecated.
  
  Change-Id: I57d76b1d1be5c957221cc2d77d148fadbac2a642
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/3668
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

4080dbd635ec: haikudepot: switch to libnetservices.a
  
  Switch to the experimental services API as the copy in libbnetapi.so is
  deprecated.
  
  Change-Id: Ic5e2c23a1be598be3057ea913c420c5346f9007f
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/3669
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

2a7090df71ce: libnetservices.a: move BGeoLocation from libshared.a
  
  The BGeolocation class uses the network interface in libnetservices.a, so it
  is moved here for now.
  
  This will break any out of tree projects that depend on it, but it is a source
  incompatible change only.
  
  Change-Id: I6f5b1332eb87ad37dd33fbe09fdb11b16f7f26e4
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/3670
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

8579c7faf211: Package Kit: switch to libnetservices.a
  
  Switch to the experimental services API as the copy in libbnetapi.so is
  deprecated.
  
  Change-Id: Ia0742038937d078c6a59ae13180a00a4c4eeb177
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/3671
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

                          [ Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx> ]

----------------------------------------------------------------------------

66 files changed, 457 insertions(+), 52 deletions(-)
build/jam/packages/HaikuDevel                    |  4 +-
build/jam/packages/HaikuDevelSecondary           |  1 +
.../net => private/netservices}/DataRequest.h    | 12 ++++
.../net => private/netservices}/FileRequest.h    | 11 ++++
.../{shared => netservices}/Geolocation.h        |  2 +
.../net => private/netservices}/GopherRequest.h  | 11 ++++
.../netservices}/HttpAuthentication.h            | 13 ++++
.../{os/net => private/netservices}/HttpForm.h   | 12 ++++
.../net => private/netservices}/HttpHeaders.h    | 12 ++++
.../net => private/netservices}/HttpRequest.h    | 12 ++++
.../{os/net => private/netservices}/HttpResult.h | 11 ++++
headers/private/{net => netservices}/HttpTime.h  | 10 ++-
.../net => private/netservices}/NetworkCookie.h  | 12 ++++
.../netservices}/NetworkCookieJar.h              | 12 ++++
.../net => private/netservices}/NetworkRequest.h | 11 ++++
.../{os/net => private/netservices}/UrlContext.h | 13 ++++
.../UrlProtocolAsynchronousListener.h            | 11 ++++
.../UrlProtocolDispatchingListener.h             | 11 ++++
.../netservices}/UrlProtocolListener.h           | 13 ++++
.../netservices}/UrlProtocolRoster.h             | 13 ++++
.../{os/net => private/netservices}/UrlRequest.h | 11 ++++
.../{os/net => private/netservices}/UrlResult.h  | 12 ++++
.../netservices}/UrlSynchronousRequest.h         | 12 ++++
.../media/plugins/http_streamer/HTTPMediaIO.cpp  |  2 +
.../media/plugins/http_streamer/HTTPMediaIO.h    |  3 +-
src/add-ons/media/plugins/http_streamer/Jamfile  |  5 +-
src/apps/haikudepot/Jamfile                      |  5 +-
.../haikudepot/server/AbstractServerProcess.cpp  |  7 ++-
.../haikudepot/server/AbstractServerProcess.h    |  3 +
src/apps/haikudepot/server/ServerHelper.h        |  2 +
src/apps/haikudepot/server/ServerSettings.h      |  2 +
src/apps/haikudepot/server/WebAppInterface.cpp   |  3 +
.../util/ToFileUrlProtocolListener.cpp           |  4 ++
.../haikudepot/util/ToFileUrlProtocolListener.h  |  6 ++
src/apps/webpositive/Jamfile                     |  5 +-
src/kits/network/Jamfile                         |  2 +
src/kits/network/libnetapi/Jamfile               | 31 +--------
src/kits/network/libnetapi_deprecated/Jamfile    |  3 +
.../DataRequest.cpp                              |  5 ++
.../FileRequest.cpp                              |  4 ++
.../libnetservices}/Geolocation.cpp              |  2 +
.../GopherRequest.cpp                            |  5 ++
.../HttpAuthentication.cpp                       |  5 ++
.../{libnetapi => libnetservices}/HttpForm.cpp   |  3 +
.../HttpHeaders.cpp                              |  4 ++
.../HttpRequest.cpp                              |  5 ++
.../{libnetapi => libnetservices}/HttpResult.cpp |  4 ++
.../{libnetapi => libnetservices}/HttpTime.cpp   |  4 ++
src/kits/network/libnetservices/JamCommon        | 66 ++++++++++++++++++++
src/kits/network/libnetservices/Jamfile          |  3 +
.../NetworkCookie.cpp                            |  9 ++-
.../NetworkCookieJar.cpp                         |  4 ++
.../NetworkCookieJarPrivate.h                    |  7 +++
.../NetworkRequest.cpp                           |  4 ++
.../{libnetapi => libnetservices}/UrlContext.cpp |  4 ++
.../UrlProtocolAsynchronousListener.cpp          |  5 ++
.../UrlProtocolDispatchingListener.cpp           |  4 ++
.../UrlProtocolListener.cpp                      |  3 +
.../UrlProtocolRoster.cpp                        |  3 +
.../{libnetapi => libnetservices}/UrlRequest.cpp |  4 ++
.../{libnetapi => libnetservices}/UrlResult.cpp  |  4 ++
.../UrlSynchronousRequest.cpp                    |  3 +
src/kits/package/FetchFileJob.cpp                |  1 +
src/kits/package/FetchFileJob.h                  | 12 +++-
src/kits/package/Jamfile                         |  2 +
src/kits/shared/Jamfile                          |  5 --

############################################################################

Commit:      35d8d4d113fc34ee03e141a7c4c8eb3c7cd03672
URL:         https://git.haiku-os.org/haiku/commit/?id=35d8d4d113fc
Author:      Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
Date:        Wed Jan 20 06:46:47 2021 UTC

libnetapi.so: move deprecated classes out into a libnetservices directory

These classes have been moved to the public API too soon, and they need some
more time to mature before they can be declared stable.

In this first step the classes that are involved, are moved to a separate
folder. They will still be linked to libnetapi.so, so that binaries that
depend on them currently will not break.

Change-Id: I6c16f17573d819314a27936f065ebe675846f763
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3664
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/kits/network/Jamfile b/src/kits/network/Jamfile
index f05d77a72d..ea77dcc433 100644
--- a/src/kits/network/Jamfile
+++ b/src/kits/network/Jamfile
@@ -1,3 +1,4 @@
 SubDir HAIKU_TOP src kits network ;
 
 SubInclude HAIKU_TOP src kits network libnetapi ;
+SubInclude HAIKU_TOP src kits network libnetservices ;
diff --git a/src/kits/network/libnetapi/Jamfile 
b/src/kits/network/libnetapi/Jamfile
index 52d2233c42..a08c92b93b 100644
--- a/src/kits/network/libnetapi/Jamfile
+++ b/src/kits/network/libnetapi/Jamfile
@@ -11,6 +11,7 @@ UseHeaders [ FDirName $(HAIKU_TOP) headers os add-ons 
network_settings ]
 local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
        on $(architectureObject) {
+               local architecture = $(TARGET_PACKAGING_ARCH) ;
                local sslSources ;
 
                UsePrivateSystemHeaders ;
@@ -41,8 +42,6 @@ for architectureObject in [ MultiArchSubDirSetup ] {
 
                        NetworkAddress.cpp
                        NetworkAddressResolver.cpp
-                       NetworkCookie.cpp
-                       NetworkCookieJar.cpp
                        NetworkDevice.cpp
                        NetworkInterface.cpp
                        NetworkRoster.cpp
@@ -56,36 +55,10 @@ for architectureObject in [ MultiArchSubDirSetup ] {
                        Socket.cpp
                        SocketMessenger.cpp
 
-                       # TODO: another add-on for file:// (a much simpler one)
-                       FileRequest.cpp
-
-                       # TODO: another add-on for gopher://
-                       GopherRequest.cpp
-
-                       # TODO: The HTTP stuff should all go into an add-on. It 
needs
-                       # linking against libcrypto.so and only the add-on 
should link
-                       # against it.
-                       DataRequest.cpp
-                       HttpAuthentication.cpp
-                       HttpHeaders.cpp
-                       HttpForm.cpp
-                       HttpRequest.cpp
-                       HttpResult.cpp
-                       HttpTime.cpp
-
                        notifications.cpp
 
-                       NetworkRequest.cpp
-                       UrlContext.cpp
-                       UrlProtocolAsynchronousListener.cpp
-                       UrlProtocolDispatchingListener.cpp
-                       UrlProtocolListener.cpp
-                       UrlProtocolRoster.cpp
-                       UrlRequest.cpp
-                       UrlResult.cpp
-                       UrlSynchronousRequest.cpp
-
                        :
+                       <libnetapi!$(architecture)>netservices.o
                        be shared $(TARGET_NETWORK_LIBS) [ TargetLibstdc++ ]
                        [ TargetLibsupc++ ] [ BuildFeatureAttribute openssl : 
libraries ]
                        [ BuildFeatureAttribute icu : libraries ]
diff --git a/src/kits/network/libnetapi/DataRequest.cpp 
b/src/kits/network/libnetservices/DataRequest.cpp
similarity index 100%
rename from src/kits/network/libnetapi/DataRequest.cpp
rename to src/kits/network/libnetservices/DataRequest.cpp
diff --git a/src/kits/network/libnetapi/FileRequest.cpp 
b/src/kits/network/libnetservices/FileRequest.cpp
similarity index 100%
rename from src/kits/network/libnetapi/FileRequest.cpp
rename to src/kits/network/libnetservices/FileRequest.cpp
diff --git a/src/kits/network/libnetapi/GopherRequest.cpp 
b/src/kits/network/libnetservices/GopherRequest.cpp
similarity index 100%
rename from src/kits/network/libnetapi/GopherRequest.cpp
rename to src/kits/network/libnetservices/GopherRequest.cpp
diff --git a/src/kits/network/libnetapi/HttpAuthentication.cpp 
b/src/kits/network/libnetservices/HttpAuthentication.cpp
similarity index 100%
rename from src/kits/network/libnetapi/HttpAuthentication.cpp
rename to src/kits/network/libnetservices/HttpAuthentication.cpp
diff --git a/src/kits/network/libnetapi/HttpForm.cpp 
b/src/kits/network/libnetservices/HttpForm.cpp
similarity index 100%
rename from src/kits/network/libnetapi/HttpForm.cpp
rename to src/kits/network/libnetservices/HttpForm.cpp
diff --git a/src/kits/network/libnetapi/HttpHeaders.cpp 
b/src/kits/network/libnetservices/HttpHeaders.cpp
similarity index 100%
rename from src/kits/network/libnetapi/HttpHeaders.cpp
rename to src/kits/network/libnetservices/HttpHeaders.cpp
diff --git a/src/kits/network/libnetapi/HttpRequest.cpp 
b/src/kits/network/libnetservices/HttpRequest.cpp
similarity index 100%
rename from src/kits/network/libnetapi/HttpRequest.cpp
rename to src/kits/network/libnetservices/HttpRequest.cpp
diff --git a/src/kits/network/libnetapi/HttpResult.cpp 
b/src/kits/network/libnetservices/HttpResult.cpp
similarity index 100%
rename from src/kits/network/libnetapi/HttpResult.cpp
rename to src/kits/network/libnetservices/HttpResult.cpp
diff --git a/src/kits/network/libnetapi/HttpTime.cpp 
b/src/kits/network/libnetservices/HttpTime.cpp
similarity index 100%
rename from src/kits/network/libnetapi/HttpTime.cpp
rename to src/kits/network/libnetservices/HttpTime.cpp
diff --git a/src/kits/network/libnetservices/Jamfile 
b/src/kits/network/libnetservices/Jamfile
new file mode 100644
index 0000000000..8f24667a46
--- /dev/null
+++ b/src/kits/network/libnetservices/Jamfile
@@ -0,0 +1,43 @@
+SubDir HAIKU_TOP src kits network libnetservices ;
+
+UsePrivateHeaders net shared support ;
+
+local architectureObject ;
+for architectureObject in [ MultiArchSubDirSetup ] {
+       on $(architectureObject) {
+               local architecture = $(TARGET_PACKAGING_ARCH) ;
+
+               MergeObject <libnetapi!$(architecture)>netservices.o :
+                       # FUTURE: The HTTP stuff should all go into an add-on. 
It needs
+                       # linking against libcrypto.so and only the add-on 
should link
+                       # against it.
+                       DataRequest.cpp
+                       HttpAuthentication.cpp
+                       HttpHeaders.cpp
+                       HttpForm.cpp
+                       HttpRequest.cpp
+                       HttpResult.cpp
+
+                       # FUTURE: another add-on for file:// (a much simpler 
one)
+                       FileRequest.cpp
+
+                       # FUTURE: another add-on for gopher://
+                       GopherRequest.cpp
+
+                       HttpTime.cpp
+                       NetworkCookie.cpp
+                       NetworkCookieJar.cpp
+
+                       NetworkRequest.cpp
+                       UrlContext.cpp
+                       UrlProtocolAsynchronousListener.cpp
+                       UrlProtocolDispatchingListener.cpp
+                       UrlProtocolListener.cpp
+                       UrlProtocolRoster.cpp
+                       UrlRequest.cpp
+                       UrlResult.cpp
+                       UrlSynchronousRequest.cpp
+                       : <$(architecture)>libshared.a
+                       ;
+       }
+}
diff --git a/src/kits/network/libnetapi/NetworkCookie.cpp 
b/src/kits/network/libnetservices/NetworkCookie.cpp
similarity index 100%
rename from src/kits/network/libnetapi/NetworkCookie.cpp
rename to src/kits/network/libnetservices/NetworkCookie.cpp
diff --git a/src/kits/network/libnetapi/NetworkCookieJar.cpp 
b/src/kits/network/libnetservices/NetworkCookieJar.cpp
similarity index 100%
rename from src/kits/network/libnetapi/NetworkCookieJar.cpp
rename to src/kits/network/libnetservices/NetworkCookieJar.cpp
diff --git a/src/kits/network/libnetapi/NetworkCookieJarPrivate.h 
b/src/kits/network/libnetservices/NetworkCookieJarPrivate.h
similarity index 100%
rename from src/kits/network/libnetapi/NetworkCookieJarPrivate.h
rename to src/kits/network/libnetservices/NetworkCookieJarPrivate.h
diff --git a/src/kits/network/libnetapi/NetworkRequest.cpp 
b/src/kits/network/libnetservices/NetworkRequest.cpp
similarity index 100%
rename from src/kits/network/libnetapi/NetworkRequest.cpp
rename to src/kits/network/libnetservices/NetworkRequest.cpp
diff --git a/src/kits/network/libnetapi/UrlContext.cpp 
b/src/kits/network/libnetservices/UrlContext.cpp
similarity index 100%
rename from src/kits/network/libnetapi/UrlContext.cpp
rename to src/kits/network/libnetservices/UrlContext.cpp
diff --git a/src/kits/network/libnetapi/UrlProtocolAsynchronousListener.cpp 
b/src/kits/network/libnetservices/UrlProtocolAsynchronousListener.cpp
similarity index 100%
rename from src/kits/network/libnetapi/UrlProtocolAsynchronousListener.cpp
rename to src/kits/network/libnetservices/UrlProtocolAsynchronousListener.cpp
diff --git a/src/kits/network/libnetapi/UrlProtocolDispatchingListener.cpp 
b/src/kits/network/libnetservices/UrlProtocolDispatchingListener.cpp
similarity index 100%
rename from src/kits/network/libnetapi/UrlProtocolDispatchingListener.cpp
rename to src/kits/network/libnetservices/UrlProtocolDispatchingListener.cpp
diff --git a/src/kits/network/libnetapi/UrlProtocolListener.cpp 
b/src/kits/network/libnetservices/UrlProtocolListener.cpp
similarity index 100%
rename from src/kits/network/libnetapi/UrlProtocolListener.cpp
rename to src/kits/network/libnetservices/UrlProtocolListener.cpp
diff --git a/src/kits/network/libnetapi/UrlProtocolRoster.cpp 
b/src/kits/network/libnetservices/UrlProtocolRoster.cpp
similarity index 100%
rename from src/kits/network/libnetapi/UrlProtocolRoster.cpp
rename to src/kits/network/libnetservices/UrlProtocolRoster.cpp
diff --git a/src/kits/network/libnetapi/UrlRequest.cpp 
b/src/kits/network/libnetservices/UrlRequest.cpp
similarity index 100%
rename from src/kits/network/libnetapi/UrlRequest.cpp
rename to src/kits/network/libnetservices/UrlRequest.cpp
diff --git a/src/kits/network/libnetapi/UrlResult.cpp 
b/src/kits/network/libnetservices/UrlResult.cpp
similarity index 100%
rename from src/kits/network/libnetapi/UrlResult.cpp
rename to src/kits/network/libnetservices/UrlResult.cpp
diff --git a/src/kits/network/libnetapi/UrlSynchronousRequest.cpp 
b/src/kits/network/libnetservices/UrlSynchronousRequest.cpp
similarity index 100%
rename from src/kits/network/libnetapi/UrlSynchronousRequest.cpp
rename to src/kits/network/libnetservices/UrlSynchronousRequest.cpp

############################################################################

Commit:      603e0bdf6208f145a0ef40cd37c71b0f285c1d96
URL:         https://git.haiku-os.org/haiku/commit/?id=603e0bdf6208
Author:      Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
Date:        Wed Jan 20 07:51:41 2021 UTC

libnetapi.so: make headers of deprecated classes private

These classes have been moved to the public API too soon, and they need some
more time to mature before they can be declared stable.

Change-Id: I9c52a8e6cc103922abde7a6b911fe0c3e6bf5700
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3665
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/headers/os/net/DataRequest.h 
b/headers/private/netservices/DataRequest.h
similarity index 100%
rename from headers/os/net/DataRequest.h
rename to headers/private/netservices/DataRequest.h
diff --git a/headers/os/net/FileRequest.h 
b/headers/private/netservices/FileRequest.h
similarity index 100%
rename from headers/os/net/FileRequest.h
rename to headers/private/netservices/FileRequest.h
diff --git a/headers/os/net/GopherRequest.h 
b/headers/private/netservices/GopherRequest.h
similarity index 100%
rename from headers/os/net/GopherRequest.h
rename to headers/private/netservices/GopherRequest.h
diff --git a/headers/os/net/HttpAuthentication.h 
b/headers/private/netservices/HttpAuthentication.h
similarity index 100%
rename from headers/os/net/HttpAuthentication.h
rename to headers/private/netservices/HttpAuthentication.h
diff --git a/headers/os/net/HttpForm.h b/headers/private/netservices/HttpForm.h
similarity index 100%
rename from headers/os/net/HttpForm.h
rename to headers/private/netservices/HttpForm.h
diff --git a/headers/os/net/HttpHeaders.h 
b/headers/private/netservices/HttpHeaders.h
similarity index 100%
rename from headers/os/net/HttpHeaders.h
rename to headers/private/netservices/HttpHeaders.h
diff --git a/headers/os/net/HttpRequest.h 
b/headers/private/netservices/HttpRequest.h
similarity index 100%
rename from headers/os/net/HttpRequest.h
rename to headers/private/netservices/HttpRequest.h
diff --git a/headers/os/net/HttpResult.h 
b/headers/private/netservices/HttpResult.h
similarity index 100%
rename from headers/os/net/HttpResult.h
rename to headers/private/netservices/HttpResult.h
diff --git a/headers/private/net/HttpTime.h 
b/headers/private/netservices/HttpTime.h
similarity index 100%
rename from headers/private/net/HttpTime.h
rename to headers/private/netservices/HttpTime.h
diff --git a/headers/os/net/NetworkCookie.h 
b/headers/private/netservices/NetworkCookie.h
similarity index 100%
rename from headers/os/net/NetworkCookie.h
rename to headers/private/netservices/NetworkCookie.h
diff --git a/headers/os/net/NetworkCookieJar.h 
b/headers/private/netservices/NetworkCookieJar.h
similarity index 100%
rename from headers/os/net/NetworkCookieJar.h
rename to headers/private/netservices/NetworkCookieJar.h
diff --git a/headers/os/net/NetworkRequest.h 
b/headers/private/netservices/NetworkRequest.h
similarity index 100%
rename from headers/os/net/NetworkRequest.h
rename to headers/private/netservices/NetworkRequest.h
diff --git a/headers/os/net/UrlContext.h 
b/headers/private/netservices/UrlContext.h
similarity index 100%
rename from headers/os/net/UrlContext.h
rename to headers/private/netservices/UrlContext.h
diff --git a/headers/os/net/UrlProtocolAsynchronousListener.h 
b/headers/private/netservices/UrlProtocolAsynchronousListener.h
similarity index 100%
rename from headers/os/net/UrlProtocolAsynchronousListener.h
rename to headers/private/netservices/UrlProtocolAsynchronousListener.h
diff --git a/headers/os/net/UrlProtocolDispatchingListener.h 
b/headers/private/netservices/UrlProtocolDispatchingListener.h
similarity index 100%
rename from headers/os/net/UrlProtocolDispatchingListener.h
rename to headers/private/netservices/UrlProtocolDispatchingListener.h
diff --git a/headers/os/net/UrlProtocolListener.h 
b/headers/private/netservices/UrlProtocolListener.h
similarity index 100%
rename from headers/os/net/UrlProtocolListener.h
rename to headers/private/netservices/UrlProtocolListener.h
diff --git a/headers/os/net/UrlProtocolRoster.h 
b/headers/private/netservices/UrlProtocolRoster.h
similarity index 100%
rename from headers/os/net/UrlProtocolRoster.h
rename to headers/private/netservices/UrlProtocolRoster.h
diff --git a/headers/os/net/UrlRequest.h 
b/headers/private/netservices/UrlRequest.h
similarity index 100%
rename from headers/os/net/UrlRequest.h
rename to headers/private/netservices/UrlRequest.h
diff --git a/headers/os/net/UrlResult.h 
b/headers/private/netservices/UrlResult.h
similarity index 100%
rename from headers/os/net/UrlResult.h
rename to headers/private/netservices/UrlResult.h
diff --git a/headers/os/net/UrlSynchronousRequest.h 
b/headers/private/netservices/UrlSynchronousRequest.h
similarity index 100%
rename from headers/os/net/UrlSynchronousRequest.h
rename to headers/private/netservices/UrlSynchronousRequest.h
diff --git a/src/add-ons/media/plugins/http_streamer/Jamfile 
b/src/add-ons/media/plugins/http_streamer/Jamfile
index c8180ce131..5d28db78cc 100644
--- a/src/add-ons/media/plugins/http_streamer/Jamfile
+++ b/src/add-ons/media/plugins/http_streamer/Jamfile
@@ -1,6 +1,6 @@
 SubDir HAIKU_TOP src add-ons media plugins http_streamer ;
 
-UsePrivateHeaders media shared ;
+UsePrivateHeaders media netservices shared ;
 UsePrivateHeaders [ FDirName media experimental ] ;
 
 local architectureObject ;
diff --git a/src/apps/haikudepot/Jamfile b/src/apps/haikudepot/Jamfile
index f56bc2ea0d..f8f24f1305 100644
--- a/src/apps/haikudepot/Jamfile
+++ b/src/apps/haikudepot/Jamfile
@@ -6,7 +6,8 @@ SubDirC++Flags -Wno-error ;
 include [ FDirName $(HAIKU_TOP) src apps haikudepot build jam
        HdsSchemaGenRules ] ;
 
-UsePrivateHeaders interface kernel net package shared storage support locale ;
+UsePrivateHeaders interface kernel net netservices package shared storage ;
+UsePrivateHeaders support locale ;
 
 HAIKUDEPOT_GENERATED_SOURCES_DIRECTORY = $(TARGET_COMMON_DEBUG_LOCATE_TARGET) ;
 
diff --git a/src/apps/webpositive/Jamfile b/src/apps/webpositive/Jamfile
index bf82ab804c..e2bc7783bb 100644
--- a/src/apps/webpositive/Jamfile
+++ b/src/apps/webpositive/Jamfile
@@ -65,7 +65,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
 
                # private OS headers
                UseLibraryHeaders icon ;
-               UsePrivateHeaders interface shared tracker ;
+               UsePrivateHeaders interface netservices shared tracker ;
                SubDirHdrs $(HAIKU_TOP) src kits tracker ;
 
                Application WebPositive :
diff --git a/src/kits/network/libnetservices/Jamfile 
b/src/kits/network/libnetservices/Jamfile
index 8f24667a46..845e4da369 100644
--- a/src/kits/network/libnetservices/Jamfile
+++ b/src/kits/network/libnetservices/Jamfile
@@ -1,6 +1,6 @@
 SubDir HAIKU_TOP src kits network libnetservices ;
 
-UsePrivateHeaders net shared support ;
+UsePrivateHeaders net netservices shared support ;
 
 local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
diff --git a/src/kits/package/Jamfile b/src/kits/package/Jamfile
index 9fb8563733..e4fcb04372 100644
--- a/src/kits/package/Jamfile
+++ b/src/kits/package/Jamfile
@@ -5,6 +5,7 @@ AddResources libpackage.so : libpackage.rdef ;
 UsePrivateHeaders
        app
        kernel
+       netservices
        shared
        libroot
        storage
diff --git a/src/kits/shared/Jamfile b/src/kits/shared/Jamfile
index 51b0d2e4bd..d10c0a6032 100644
--- a/src/kits/shared/Jamfile
+++ b/src/kits/shared/Jamfile
@@ -28,6 +28,9 @@ for architectureObject in [ MultiArchSubDirSetup ] {
                # for BKeymap
                UsePrivateHeaders interface ;
 
+               # for BGeolocation
+               UsePrivateHeaders netservices ;
+
                StaticLibrary <$(architecture)>libshared.a :
                        AboutMenuItem.cpp
                        ArgumentVector.cpp

############################################################################

Commit:      1b133b90fd01fec8790c4590359ffbc8721de798
URL:         https://git.haiku-os.org/haiku/commit/?id=1b133b90fd01
Author:      Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
Date:        Wed Jan 20 14:24:53 2021 UTC

libnetservices.a: create new static library for the network services

These will be added to the _devel packages so that other applications can link
to them.

Change-Id: If3fd231869823b42d6d896c6c9eb7a95c5fe715d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3666
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/build/jam/packages/HaikuDevel b/build/jam/packages/HaikuDevel
index ebb86a9f25..f438f5539d 100644
--- a/build/jam/packages/HaikuDevel
+++ b/build/jam/packages/HaikuDevel
@@ -41,8 +41,8 @@ for lib in [ HaikuImageGetSystemLibs ] $(developmentLibs) {
 AddFilesToPackage develop lib :
        libc.a libcolumnlistview.a
        <$(architecture)>liblocalestub.a
-       libm.a libpthread.a
-       libprint.a libprintutils.a
+       libm.a libnetservices.a
+       libpthread.a libprint.a libprintutils.a
        <$(architecture)>libshared.a ;
 
 # the POSIX error code mapper library
diff --git a/build/jam/packages/HaikuDevelSecondary 
b/build/jam/packages/HaikuDevelSecondary
index 947d4e03eb..6c1f36b61f 100644
--- a/build/jam/packages/HaikuDevelSecondary
+++ b/build/jam/packages/HaikuDevelSecondary
@@ -38,6 +38,7 @@ AddFilesToPackage develop lib $(architecture) :
        <$(architecture)>libcolumnlistview.a
        <$(architecture)>liblocalestub.a
        <$(architecture)>libm.a
+       <$(architecture)>libnetservices.a
        <$(architecture)>libpthread.a
        <$(architecture)>libshared.a ;
 
diff --git a/src/kits/network/libnetservices/Jamfile 
b/src/kits/network/libnetservices/Jamfile
index 845e4da369..6a6ece1466 100644
--- a/src/kits/network/libnetservices/Jamfile
+++ b/src/kits/network/libnetservices/Jamfile
@@ -2,42 +2,50 @@ SubDir HAIKU_TOP src kits network libnetservices ;
 
 UsePrivateHeaders net netservices shared support ;
 
+local sources =
+       # FUTURE: The HTTP stuff should all go into an add-on. It needs
+       # linking against libcrypto.so and only the add-on should link
+       # against it.
+       DataRequest.cpp
+       HttpAuthentication.cpp
+       HttpHeaders.cpp
+       HttpForm.cpp
+       HttpRequest.cpp
+       HttpResult.cpp
+
+       # FUTURE: another add-on for file:// (a much simpler one)
+       FileRequest.cpp
+
+       # FUTURE: another add-on for gopher://
+       GopherRequest.cpp
+
+       HttpTime.cpp
+       NetworkCookie.cpp
+       NetworkCookieJar.cpp
+
+       NetworkRequest.cpp
+       UrlContext.cpp
+       UrlProtocolAsynchronousListener.cpp
+       UrlProtocolDispatchingListener.cpp
+       UrlProtocolListener.cpp
+       UrlProtocolRoster.cpp
+       UrlRequest.cpp
+       UrlResult.cpp
+       UrlSynchronousRequest.cpp
+       ;
+
 local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
        on $(architectureObject) {
                local architecture = $(TARGET_PACKAGING_ARCH) ;
 
                MergeObject <libnetapi!$(architecture)>netservices.o :
-                       # FUTURE: The HTTP stuff should all go into an add-on. 
It needs
-                       # linking against libcrypto.so and only the add-on 
should link
-                       # against it.
-                       DataRequest.cpp
-                       HttpAuthentication.cpp
-                       HttpHeaders.cpp
-                       HttpForm.cpp
-                       HttpRequest.cpp
-                       HttpResult.cpp
-
-                       # FUTURE: another add-on for file:// (a much simpler 
one)
-                       FileRequest.cpp
-
-                       # FUTURE: another add-on for gopher://
-                       GopherRequest.cpp
-
-                       HttpTime.cpp
-                       NetworkCookie.cpp
-                       NetworkCookieJar.cpp
-
-                       NetworkRequest.cpp
-                       UrlContext.cpp
-                       UrlProtocolAsynchronousListener.cpp
-                       UrlProtocolDispatchingListener.cpp
-                       UrlProtocolListener.cpp
-                       UrlProtocolRoster.cpp
-                       UrlRequest.cpp
-                       UrlResult.cpp
-                       UrlSynchronousRequest.cpp
+                       $(sources)
                        : <$(architecture)>libshared.a
                        ;
+
+               StaticLibrary <$(architecture)>libnetservices.a :
+                       $(sources)
+                       ;
        }
 }

############################################################################

Commit:      ce64ffdb9003171981534bc5d3e49147561ed096
URL:         https://git.haiku-os.org/haiku/commit/?id=ce64ffdb9003
Author:      Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
Date:        Fri Jan 22 14:20:19 2021 UTC

libnetservices.a: Put the experimental API into BPrivate::Network namespace

In order to prevent classes between libnetapi.so with the legacy API and
applications using the libnetservices.a library, the latter will have the
classes in a distinct namespace.

In the implementation, both libbnetapi.so and libnetservices.a will use the
same header and source files. If LIBNETAPI_DEPRECATED is defined during build,
the headers and source will have binary compatible behavior. Otherwise, the
classes and other objects will be put in the HaikuExt namespace.

In order to build the libbnetapi.so and libnetservices.a with the proper
build configuration, there is a stub `src/kits/net/libnetapi_deprecated` folder
that applies the special configuration to the source files.

Currently HaikuDepot, Webpositive, libshared.a and the http_streamer add on
use the compatible API in libbnetapi.so.

Change-Id: Ic73e9f271ef75749adda46f6f72e9a0b2851b461
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3667
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/headers/private/netservices/DataRequest.h 
b/headers/private/netservices/DataRequest.h
index 8e4debf13e..8657af1c74 100644
--- a/headers/private/netservices/DataRequest.h
+++ b/headers/private/netservices/DataRequest.h
@@ -15,6 +15,12 @@
 #include <UrlRequest.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BDataRequest: public BUrlRequest {
 public:
                const BUrlResult&       Result() const;
@@ -30,4 +36,10 @@ private:
                BUrlResult                      fResult;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif
diff --git a/headers/private/netservices/FileRequest.h 
b/headers/private/netservices/FileRequest.h
index 6701860e40..ffc6d59bf9 100644
--- a/headers/private/netservices/FileRequest.h
+++ b/headers/private/netservices/FileRequest.h
@@ -13,6 +13,12 @@
 #include <UrlProtocolRoster.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BFileRequest : public BUrlRequest {
 public:
        virtual                                         ~BFileRequest();
@@ -32,5 +38,10 @@ private:
                        BUrlResult                      fResult;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
 
 #endif // _B_FILE_REQUEST_H_
diff --git a/headers/private/netservices/GopherRequest.h 
b/headers/private/netservices/GopherRequest.h
index 7e627c8078..d39ca5afa1 100644
--- a/headers/private/netservices/GopherRequest.h
+++ b/headers/private/netservices/GopherRequest.h
@@ -12,6 +12,12 @@
 #include <UrlProtocolRoster.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BGopherRequest : public BNetworkRequest {
 public:
        virtual                                         ~BGopherRequest();
@@ -45,5 +51,10 @@ private:
                        BUrlResult                      fResult;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
 
 #endif // _B_GOPHER_REQUEST_H_
diff --git a/headers/private/netservices/HttpAuthentication.h 
b/headers/private/netservices/HttpAuthentication.h
index 8334f581bf..ff66ba1070 100644
--- a/headers/private/netservices/HttpAuthentication.h
+++ b/headers/private/netservices/HttpAuthentication.h
@@ -10,6 +10,13 @@
 #include <String.h>
 #include <Url.h>
 
+
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 // HTTP authentication method
 enum BHttpAuthenticationMethod {
        B_HTTP_AUTHENTICATION_NONE = 0,
@@ -98,4 +105,10 @@ private:
        mutable BLocker                         fLock;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif // _B_HTTP_AUTHENTICATION_H_
diff --git a/headers/private/netservices/HttpForm.h 
b/headers/private/netservices/HttpForm.h
index ff7cee2972..3c56da1505 100644
--- a/headers/private/netservices/HttpForm.h
+++ b/headers/private/netservices/HttpForm.h
@@ -12,6 +12,12 @@
 #include <map>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 enum form_type {
        B_HTTP_FORM_URL_ENCODED,
        B_HTTP_FORM_MULTIPART
@@ -188,4 +194,10 @@ private:
                        BHttpFormData*          fPrevElement;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif // _B_HTTP_FORM_H_
diff --git a/headers/private/netservices/HttpHeaders.h 
b/headers/private/netservices/HttpHeaders.h
index 0b22845b72..ff97953f91 100644
--- a/headers/private/netservices/HttpHeaders.h
+++ b/headers/private/netservices/HttpHeaders.h
@@ -11,6 +11,12 @@
 #include <String.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BHttpHeader {
 public:
                                                                BHttpHeader();
@@ -87,4 +93,10 @@ private:
                        BList                           fHeaderList;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif // _B_HTTP_HEADERS_H_
diff --git a/headers/private/netservices/HttpRequest.h 
b/headers/private/netservices/HttpRequest.h
index 9b8d5df9d2..36cd511e97 100644
--- a/headers/private/netservices/HttpRequest.h
+++ b/headers/private/netservices/HttpRequest.h
@@ -23,6 +23,12 @@ namespace BPrivate {
 };
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BHttpRequest : public BNetworkRequest {
 public:
        virtual                                         ~BHttpRequest();
@@ -237,4 +243,10 @@ enum http_status_code {
 // HTTP default User-Agent
 #define B_HTTP_PROTOCOL_USER_AGENT_FORMAT "ServicesKit (%s)"
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif // _B_URL_PROTOCOL_HTTP_H_
diff --git a/headers/private/netservices/HttpResult.h 
b/headers/private/netservices/HttpResult.h
index 9875f99d5b..cc79362018 100644
--- a/headers/private/netservices/HttpResult.h
+++ b/headers/private/netservices/HttpResult.h
@@ -14,6 +14,12 @@
 #include <UrlResult.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BUrlRequest;
 
 
@@ -55,5 +61,10 @@ private:
                        BString                                         
fStatusString;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
 
 #endif // _B_URL_RESULT_H_
diff --git a/headers/private/netservices/HttpTime.h 
b/headers/private/netservices/HttpTime.h
index 7f622de8b3..68f4454243 100644
--- a/headers/private/netservices/HttpTime.h
+++ b/headers/private/netservices/HttpTime.h
@@ -12,6 +12,10 @@
 
 namespace BPrivate {
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace Network {
+#endif
+
 enum {
        B_HTTP_TIME_FORMAT_PARSED = -1,
        B_HTTP_TIME_FORMAT_RFC1123 = 0,
@@ -43,5 +47,9 @@ private:
                        int8            fDateFormat;
 };
 
-}
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+#endif
+
+} // namespace BPrivate
 #endif // _B_HTTP_TIME_H_
diff --git a/headers/private/netservices/NetworkCookie.h 
b/headers/private/netservices/NetworkCookie.h
index e676ed036a..9c5b797c3d 100644
--- a/headers/private/netservices/NetworkCookie.h
+++ b/headers/private/netservices/NetworkCookie.h
@@ -13,6 +13,12 @@
 #include <Url.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BNetworkCookie : public BArchivable {
 public:
                                                                
BNetworkCookie(const char* name,
@@ -110,5 +116,11 @@ private:
                        bool                            fSessionCookie;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif // _B_NETWORK_COOKIE_H_
 
diff --git a/headers/private/netservices/NetworkCookieJar.h 
b/headers/private/netservices/NetworkCookieJar.h
index 6efba2642f..fddae9f6a9 100644
--- a/headers/private/netservices/NetworkCookieJar.h
+++ b/headers/private/netservices/NetworkCookieJar.h
@@ -16,6 +16,12 @@
 #include <Url.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BNetworkCookieList: public BObjectList<const BNetworkCookie> {
 public:
                                                                
BNetworkCookieList();
@@ -158,4 +164,10 @@ private:
                        BUrl                            fUrl;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif // _B_NETWORK_COOKIE_JAR_
diff --git a/headers/private/netservices/NetworkRequest.h 
b/headers/private/netservices/NetworkRequest.h
index f4ab01529a..15650d827e 100644
--- a/headers/private/netservices/NetworkRequest.h
+++ b/headers/private/netservices/NetworkRequest.h
@@ -14,6 +14,12 @@
 class BAbstractSocket;
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BNetworkRequest: public BUrlRequest
 {
 public:
@@ -39,5 +45,10 @@ protected:
                        BNetBuffer                      fInputBuffer;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
 
 #endif
diff --git a/headers/private/netservices/UrlContext.h 
b/headers/private/netservices/UrlContext.h
index 97836abf73..cc880b4783 100644
--- a/headers/private/netservices/UrlContext.h
+++ b/headers/private/netservices/UrlContext.h
@@ -14,6 +14,12 @@
 #include <Referenceable.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BUrlContext: public BReferenceable {
 public:
                                                                BUrlContext();
@@ -49,4 +55,11 @@ private:
 };
 
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
+
 #endif // _B_URL_CONTEXT_H_
diff --git a/headers/private/netservices/UrlProtocolAsynchronousListener.h 
b/headers/private/netservices/UrlProtocolAsynchronousListener.h
index 910cec0e26..4c5db18279 100644
--- a/headers/private/netservices/UrlProtocolAsynchronousListener.h
+++ b/headers/private/netservices/UrlProtocolAsynchronousListener.h
@@ -10,6 +10,11 @@
 #include <Message.h>
 #include <UrlProtocolDispatchingListener.h>
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
 
 class BUrlProtocolAsynchronousListener : public BHandler,
        public BUrlProtocolListener {
@@ -28,6 +33,12 @@ private:
                        BUrlProtocolDispatchingListener*
                                                                
fSynchronousListener;
 };
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 
 #endif // _B_URL_PROTOCOL_ASYNCHRONOUS_LISTENER_H_
 
diff --git a/headers/private/netservices/UrlProtocolDispatchingListener.h 
b/headers/private/netservices/UrlProtocolDispatchingListener.h
index 0107c2cfdc..a81a73b23f 100644
--- a/headers/private/netservices/UrlProtocolDispatchingListener.h
+++ b/headers/private/netservices/UrlProtocolDispatchingListener.h
@@ -10,6 +10,11 @@
 #include <Message.h>
 #include <UrlProtocolListener.h>
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
 
 //! To be in AppTypes.h
 enum {
@@ -71,5 +76,11 @@ private:
                        BMessenger                      fMessenger;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif // _B_URL_PROTOCOL_DISPATCHING_LISTENER_H_
 
diff --git a/headers/private/netservices/UrlProtocolListener.h 
b/headers/private/netservices/UrlProtocolListener.h
index 1aefd13757..b6c28655ba 100644
--- a/headers/private/netservices/UrlProtocolListener.h
+++ b/headers/private/netservices/UrlProtocolListener.h
@@ -13,6 +13,13 @@
 
 
 class BCertificate;
+
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BUrlRequest;
 
 
@@ -52,4 +59,10 @@ public:
                                                                        const 
char* message);
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif // _B_URL_PROTOCOL_LISTENER_H_
diff --git a/headers/private/netservices/UrlProtocolRoster.h 
b/headers/private/netservices/UrlProtocolRoster.h
index 3e541493dc..b763f4c0c8 100644
--- a/headers/private/netservices/UrlProtocolRoster.h
+++ b/headers/private/netservices/UrlProtocolRoster.h
@@ -11,6 +11,13 @@
 
 
 class BUrl;
+
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BUrlContext;
 class BUrlProtocolListener;
 class BUrlRequest;
@@ -22,4 +29,10 @@ public:
                                 BUrlContext* context = NULL);
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif
diff --git a/headers/private/netservices/UrlRequest.h 
b/headers/private/netservices/UrlRequest.h
index 1a323fae81..74c8eb0002 100644
--- a/headers/private/netservices/UrlRequest.h
+++ b/headers/private/netservices/UrlRequest.h
@@ -14,6 +14,12 @@
 #include <Referenceable.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BUrlRequest {
 public:
                                                                        
BUrlRequest(const BUrl& url,
@@ -66,5 +72,10 @@ protected:
                        BString                                 fProtocol;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
 
 #endif // _B_URL_REQUEST_H_
diff --git a/headers/private/netservices/UrlResult.h 
b/headers/private/netservices/UrlResult.h
index a0feb35dfd..594b277256 100644
--- a/headers/private/netservices/UrlResult.h
+++ b/headers/private/netservices/UrlResult.h
@@ -10,6 +10,12 @@
 #include <String.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BUrlResult: public BArchivable {
 public:
                                                        BUrlResult();
@@ -31,4 +37,10 @@ private:
                        size_t                  fLength;
 };
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif
diff --git a/headers/private/netservices/UrlSynchronousRequest.h 
b/headers/private/netservices/UrlSynchronousRequest.h
index 4a7dbfc3ef..17dfe6780c 100644
--- a/headers/private/netservices/UrlSynchronousRequest.h
+++ b/headers/private/netservices/UrlSynchronousRequest.h
@@ -10,6 +10,12 @@
 #include <UrlProtocolListener.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+namespace BPrivate {
+
+namespace Network {
+#endif
+
 class BUrlSynchronousRequest : public BUrlRequest, public BUrlProtocolListener 
{
 public:
                                                                
BUrlSynchronousRequest(BUrlRequest& asynchronousRequest);
@@ -43,4 +49,10 @@ protected:
 };
 
 
+#ifndef LIBNETAPI_DEPRECATED
+} // namespace Network
+
+} // namespace BPrivate
+#endif
+
 #endif // _B_URL_SYNCHRONOUS_REQUEST_H_
diff --git a/src/add-ons/media/plugins/http_streamer/Jamfile 
b/src/add-ons/media/plugins/http_streamer/Jamfile
index 5d28db78cc..bc9031dbde 100644
--- a/src/add-ons/media/plugins/http_streamer/Jamfile
+++ b/src/add-ons/media/plugins/http_streamer/Jamfile
@@ -3,6 +3,9 @@ SubDir HAIKU_TOP src add-ons media plugins http_streamer ;
 UsePrivateHeaders media netservices shared ;
 UsePrivateHeaders [ FDirName media experimental ] ;
 
+# Use the deprecated libnetapi.so classes
+SubDirC++Flags [ FDefines LIBNETAPI_DEPRECATED ] ;
+
 local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
        on $(architectureObject) {
diff --git a/src/apps/haikudepot/Jamfile b/src/apps/haikudepot/Jamfile
index f8f24f1305..b79edf8d14 100644
--- a/src/apps/haikudepot/Jamfile
+++ b/src/apps/haikudepot/Jamfile
@@ -229,6 +229,9 @@ local generatedReferenceParserSourceFiles =
        DumpExportReferenceJsonListener.cpp
 ;
 
+# Use the deprecated libnetapi.so network classes
+SubDirC++Flags [ FDefines LIBNETAPI_DEPRECATED ] ;
+
 Application HaikuDepot
        :
        $(applicationSources)
diff --git a/src/apps/webpositive/Jamfile b/src/apps/webpositive/Jamfile
index e2bc7783bb..405fcab069 100644
--- a/src/apps/webpositive/Jamfile
+++ b/src/apps/webpositive/Jamfile
@@ -3,6 +3,9 @@ SubDir HAIKU_TOP src apps webpositive ;
 SubDirC++Flags $(defines) -Wno-error=sequence-point 
-Wno-error=format-truncation ;
 SubDirCcFlags $(defines) -Wno-error=sequence-point 
-Wno-error=format-truncation ;
 
+# Use the deprecated libnetapi.so classes
+SubDirC++Flags [ FDefines LIBNETAPI_DEPRECATED ] ;
+
 # source directories
 local sourceDirs =
        autocompletion
diff --git a/src/kits/network/Jamfile b/src/kits/network/Jamfile
index ea77dcc433..c4a447a174 100644
--- a/src/kits/network/Jamfile
+++ b/src/kits/network/Jamfile
@@ -1,4 +1,5 @@
 SubDir HAIKU_TOP src kits network ;
 
 SubInclude HAIKU_TOP src kits network libnetapi ;
+SubInclude HAIKU_TOP src kits network libnetapi_deprecated ;
 SubInclude HAIKU_TOP src kits network libnetservices ;
diff --git a/src/kits/network/libnetapi_deprecated/Jamfile 
b/src/kits/network/libnetapi_deprecated/Jamfile
new file mode 100644
index 0000000000..b8f78ff653
--- /dev/null
+++ b/src/kits/network/libnetapi_deprecated/Jamfile
@@ -0,0 +1,3 @@
+SubDir HAIKU_TOP src kits network libnetapi_deprecated ;
+
+include [ FDirName $(HAIKU_TOP) src kits network libnetservices JamCommon ] ;
diff --git a/src/kits/network/libnetservices/DataRequest.cpp 
b/src/kits/network/libnetservices/DataRequest.cpp
index a9ece68851..79583d7283 100644
--- a/src/kits/network/libnetservices/DataRequest.cpp
+++ b/src/kits/network/libnetservices/DataRequest.cpp
@@ -15,6 +15,11 @@
 #include <stdio.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
+
 BDataRequest::BDataRequest(const BUrl& url, BUrlProtocolListener* listener,
                BUrlContext* context)
        : BUrlRequest(url, listener, context, "data URL parser", "data"),
diff --git a/src/kits/network/libnetservices/FileRequest.cpp 
b/src/kits/network/libnetservices/FileRequest.cpp
index 02b0103480..43599f88e3 100644
--- a/src/kits/network/libnetservices/FileRequest.cpp
+++ b/src/kits/network/libnetservices/FileRequest.cpp
@@ -17,6 +17,10 @@
 #include <Path.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
 BFileRequest::BFileRequest(const BUrl& url, BUrlProtocolListener* listener,
        BUrlContext* context)
        :
diff --git a/src/kits/network/libnetservices/GopherRequest.cpp 
b/src/kits/network/libnetservices/GopherRequest.cpp
index 9e3edf754a..8713192ee8 100644
--- a/src/kits/network/libnetservices/GopherRequest.cpp
+++ b/src/kits/network/libnetservices/GopherRequest.cpp
@@ -23,6 +23,11 @@
 #include <String.h>
 #include <StringList.h>
 
+
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
 /*
  * TODO: fix '+' in selectors, cf. gopher://gophernicus.org/1/doc/gopher/
  * TODO: add proper favicon
diff --git a/src/kits/network/libnetservices/HttpAuthentication.cpp 
b/src/kits/network/libnetservices/HttpAuthentication.cpp
index 30b9feeddb..42c9731d55 100644
--- a/src/kits/network/libnetservices/HttpAuthentication.cpp
+++ b/src/kits/network/libnetservices/HttpAuthentication.cpp
@@ -15,6 +15,11 @@
 #include <AutoLocker.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
+
 #if DEBUG > 0
 #define PRINT(x) printf x
 #else
diff --git a/src/kits/network/libnetservices/HttpForm.cpp 
b/src/kits/network/libnetservices/HttpForm.cpp
index cfebcbd5bc..3620f953d5 100644
--- a/src/kits/network/libnetservices/HttpForm.cpp
+++ b/src/kits/network/libnetservices/HttpForm.cpp
@@ -23,6 +23,9 @@ static int32 kBoundaryRandomSize = 16;
 
 using namespace std;
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
 
 // #pragma mark - BHttpFormData
 
diff --git a/src/kits/network/libnetservices/HttpHeaders.cpp 
b/src/kits/network/libnetservices/HttpHeaders.cpp
index 9895f578c5..9757b8da67 100644
--- a/src/kits/network/libnetservices/HttpHeaders.cpp
+++ b/src/kits/network/libnetservices/HttpHeaders.cpp
@@ -15,6 +15,10 @@
 #include <HttpHeaders.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
 // #pragma mark -- BHttpHeader
 
 
diff --git a/src/kits/network/libnetservices/HttpRequest.cpp 
b/src/kits/network/libnetservices/HttpRequest.cpp
index 6eae914945..d427ef9107 100644
--- a/src/kits/network/libnetservices/HttpRequest.cpp
+++ b/src/kits/network/libnetservices/HttpRequest.cpp
@@ -34,6 +34,11 @@
 static const int32 kHttpBufferSize = 4096;
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
+
 namespace BPrivate {
 
        class CheckedSecureSocket: public BSecureSocket
diff --git a/src/kits/network/libnetservices/HttpResult.cpp 
b/src/kits/network/libnetservices/HttpResult.cpp
index 41aa4fba87..ef8bd6fa7b 100644
--- a/src/kits/network/libnetservices/HttpResult.cpp
+++ b/src/kits/network/libnetservices/HttpResult.cpp
@@ -15,6 +15,10 @@
 
 using std::ostream;
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
 
 BHttpResult::BHttpResult(const BUrl& url)
        :
diff --git a/src/kits/network/libnetservices/HttpTime.cpp 
b/src/kits/network/libnetservices/HttpTime.cpp
index 773c08fd75..11ee02d728 100644
--- a/src/kits/network/libnetservices/HttpTime.cpp
+++ b/src/kits/network/libnetservices/HttpTime.cpp
@@ -47,7 +47,11 @@ static const char* kDateFormats[] = {
        "%a %d %b %H:%M:%S %Y"
 };
 
+#ifdef LIBNETAPI_DEPRECATED
 using namespace BPrivate;
+#else
+using namespace BPrivate::Network;
+#endif
 
 
 BHttpTime::BHttpTime()
diff --git a/src/kits/network/libnetservices/JamCommon 
b/src/kits/network/libnetservices/JamCommon
new file mode 100644
index 0000000000..dd35f03958
--- /dev/null
+++ b/src/kits/network/libnetservices/JamCommon
@@ -0,0 +1,61 @@
+# This module is built as an independent static library, and as a (deprecated)
+# part of libnetapi.so. In the latter case LIBNETAPI_DEPRECATED will be defined
+# to ensure binary compatibility.
+
+UsePrivateHeaders net netservices shared support ;
+
+local sources =
+       # FUTURE: The HTTP stuff should all go into an add-on. It needs
+       # linking against libcrypto.so and only the add-on should link
+       # against it.
+       DataRequest.cpp
+       HttpAuthentication.cpp
+       HttpHeaders.cpp
+       HttpForm.cpp
+       HttpRequest.cpp
+       HttpResult.cpp
+
+       # FUTURE: another add-on for file:// (a much simpler one)
+       FileRequest.cpp
+
+       # FUTURE: another add-on for gopher://
+       GopherRequest.cpp
+
+       HttpTime.cpp
+       NetworkCookie.cpp
+       NetworkCookieJar.cpp
+
+       NetworkRequest.cpp
+       UrlContext.cpp
+       UrlProtocolAsynchronousListener.cpp
+       UrlProtocolDispatchingListener.cpp
+       UrlProtocolListener.cpp
+       UrlProtocolRoster.cpp
+       UrlRequest.cpp
+       UrlResult.cpp
+       UrlSynchronousRequest.cpp
+       ;
+
+local architectureObject ;
+for architectureObject in [ MultiArchSubDirSetup ] {
+       on $(architectureObject) {
+               local architecture = $(TARGET_PACKAGING_ARCH) ;
+
+               if $(SUBDIR:B) = libnetapi_deprecated {
+                       SubDirC++Flags [ FDefines LIBNETAPI_DEPRECATED ] ;
+                       UseHeaders [ FDirName $(HAIKU_TOP) src kits network 
libnetservices ] : false ;
+
+                       MergeObject <libnetapi!$(architecture)>netservices.o :
+                               $(sources)
+                               : <$(architecture)>libshared.a
+                               ;
+               } else {
+                       StaticLibrary [ MultiArchDefaultGristFiles 
libnetservices.a ] :
+                               $(sources)
+                               ;
+               }
+
+               SEARCH on [ FGristFiles $(sources) ]
+                       = [ FDirName $(HAIKU_TOP) src kits network 
libnetservices ] ;
+       }
+}
diff --git a/src/kits/network/libnetservices/Jamfile 
b/src/kits/network/libnetservices/Jamfile
index 6a6ece1466..7a3f7e66cd 100644
--- a/src/kits/network/libnetservices/Jamfile
+++ b/src/kits/network/libnetservices/Jamfile
@@ -1,51 +1,3 @@
 SubDir HAIKU_TOP src kits network libnetservices ;
 
-UsePrivateHeaders net netservices shared support ;
-
-local sources =
-       # FUTURE: The HTTP stuff should all go into an add-on. It needs
-       # linking against libcrypto.so and only the add-on should link
-       # against it.
-       DataRequest.cpp
-       HttpAuthentication.cpp
-       HttpHeaders.cpp
-       HttpForm.cpp
-       HttpRequest.cpp
-       HttpResult.cpp
-
-       # FUTURE: another add-on for file:// (a much simpler one)
-       FileRequest.cpp
-
-       # FUTURE: another add-on for gopher://
-       GopherRequest.cpp
-
-       HttpTime.cpp
-       NetworkCookie.cpp
-       NetworkCookieJar.cpp
-
-       NetworkRequest.cpp
-       UrlContext.cpp
-       UrlProtocolAsynchronousListener.cpp
-       UrlProtocolDispatchingListener.cpp
-       UrlProtocolListener.cpp
-       UrlProtocolRoster.cpp
-       UrlRequest.cpp
-       UrlResult.cpp
-       UrlSynchronousRequest.cpp
-       ;
-
-local architectureObject ;
-for architectureObject in [ MultiArchSubDirSetup ] {
-       on $(architectureObject) {
-               local architecture = $(TARGET_PACKAGING_ARCH) ;
-
-               MergeObject <libnetapi!$(architecture)>netservices.o :
-                       $(sources)
-                       : <$(architecture)>libshared.a
-                       ;
-
-               StaticLibrary <$(architecture)>libnetservices.a :
-                       $(sources)
-                       ;
-       }
-}
+include [ FDirName $(HAIKU_TOP) src kits network libnetservices JamCommon ] ;
diff --git a/src/kits/network/libnetservices/NetworkCookie.cpp 
b/src/kits/network/libnetservices/NetworkCookie.cpp
index 317f5066c8..0a7db5b24c 100644
--- a/src/kits/network/libnetservices/NetworkCookie.cpp
+++ b/src/kits/network/libnetservices/NetworkCookie.cpp
@@ -20,9 +20,12 @@
 #include <HttpTime.h>
 #include <NetworkCookie.h>
 
-
+#ifdef LIBNETAPI_DEPRECATED
 using BPrivate::BHttpTime;
-
+using BPrivate::B_HTTP_TIME_FORMAT_COOKIE;
+#else
+using namespace BPrivate::Network;
+#endif
 
 static const char* kArchivedCookieName = "be:cookie.name";
 static const char* kArchivedCookieValue = "be:cookie.value";
@@ -380,7 +383,7 @@ BNetworkCookie::ExpirationString() const
        BHttpTime date(fExpiration);
 
        if (!fExpirationStringValid) {
-               fExpirationString = 
date.ToString(BPrivate::B_HTTP_TIME_FORMAT_COOKIE);
+               fExpirationString = date.ToString(B_HTTP_TIME_FORMAT_COOKIE);
                fExpirationStringValid = true;
        }
 
diff --git a/src/kits/network/libnetservices/NetworkCookieJar.cpp 
b/src/kits/network/libnetservices/NetworkCookieJar.cpp
index 3014c69d5d..98412570fd 100644
--- a/src/kits/network/libnetservices/NetworkCookieJar.cpp
+++ b/src/kits/network/libnetservices/NetworkCookieJar.cpp
@@ -19,6 +19,10 @@
 #include "NetworkCookieJarPrivate.h"
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
 // #define TRACE_COOKIE
 #ifdef TRACE_COOKIE
 #      define TRACE(x...) printf(x)
diff --git a/src/kits/network/libnetservices/NetworkCookieJarPrivate.h 
b/src/kits/network/libnetservices/NetworkCookieJarPrivate.h
index 6751496175..f47e9084dc 100644
--- a/src/kits/network/libnetservices/NetworkCookieJarPrivate.h
+++ b/src/kits/network/libnetservices/NetworkCookieJarPrivate.h
@@ -9,6 +9,13 @@
 #include <HashMap.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using BPrivate::Network::BNetworkCookie;
+using BPrivate::Network::BNetworkCookieJar;
+using BPrivate::Network::BNetworkCookieList;
+#endif
+
+
 typedef BPrivate::SynchronizedHashMap<HashString, BNetworkCookieList*>
        BNetworkCookieHashMap;
 
diff --git a/src/kits/network/libnetservices/NetworkRequest.cpp 
b/src/kits/network/libnetservices/NetworkRequest.cpp
index 8007558a3b..7d57095c57 100644
--- a/src/kits/network/libnetservices/NetworkRequest.cpp
+++ b/src/kits/network/libnetservices/NetworkRequest.cpp
@@ -14,6 +14,10 @@
 #include <AbstractSocket.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
 BNetworkRequest::BNetworkRequest(const BUrl& url, BUrlProtocolListener* 
listener,
                BUrlContext* context, const char* threadName, const char* 
protocolName)
        :
diff --git a/src/kits/network/libnetservices/UrlContext.cpp 
b/src/kits/network/libnetservices/UrlContext.cpp
index 6a1a0d23a8..c3d1bff546 100644
--- a/src/kits/network/libnetservices/UrlContext.cpp
+++ b/src/kits/network/libnetservices/UrlContext.cpp
@@ -16,6 +16,10 @@
 #include <HashString.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
 class BUrlContext::BHttpAuthenticationMap : public
        SynchronizedHashMap<BPrivate::HashString, BHttpAuthentication*> {};
 
diff --git 
a/src/kits/network/libnetservices/UrlProtocolAsynchronousListener.cpp 
b/src/kits/network/libnetservices/UrlProtocolAsynchronousListener.cpp
index 710f0ccc64..115a7293fc 100644
--- a/src/kits/network/libnetservices/UrlProtocolAsynchronousListener.cpp
+++ b/src/kits/network/libnetservices/UrlProtocolAsynchronousListener.cpp
@@ -19,6 +19,11 @@
 #include <UrlResult.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
+
 extern const char* kUrlProtocolMessageType;
 extern const char* kUrlProtocolCaller;
 
diff --git a/src/kits/network/libnetservices/UrlProtocolDispatchingListener.cpp 
b/src/kits/network/libnetservices/UrlProtocolDispatchingListener.cpp
index 59b40901f5..d241de90a5 100644
--- a/src/kits/network/libnetservices/UrlProtocolDispatchingListener.cpp
+++ b/src/kits/network/libnetservices/UrlProtocolDispatchingListener.cpp
@@ -16,6 +16,10 @@
 #include <assert.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
 const char* kUrlProtocolMessageType = "be:urlProtocolMessageType";
 const char* kUrlProtocolCaller = "be:urlProtocolCaller";
 
diff --git a/src/kits/network/libnetservices/UrlProtocolListener.cpp 
b/src/kits/network/libnetservices/UrlProtocolListener.cpp
index 3a96d94a1f..5ea32bcde8 100644
--- a/src/kits/network/libnetservices/UrlProtocolListener.cpp
+++ b/src/kits/network/libnetservices/UrlProtocolListener.cpp
@@ -15,6 +15,9 @@
 
 using namespace std;
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
 
 void
 BUrlProtocolListener::ConnectionOpened(BUrlRequest*)
diff --git a/src/kits/network/libnetservices/UrlProtocolRoster.cpp 
b/src/kits/network/libnetservices/UrlProtocolRoster.cpp
index 1284beeda1..eb8b240118 100644
--- a/src/kits/network/libnetservices/UrlProtocolRoster.cpp
+++ b/src/kits/network/libnetservices/UrlProtocolRoster.cpp
@@ -18,6 +18,9 @@
 #include <HttpRequest.h>
 #include <UrlRequest.h>
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
 
 /* static */ BUrlRequest*
 BUrlProtocolRoster::MakeRequest(const BUrl& url,
diff --git a/src/kits/network/libnetservices/UrlRequest.cpp 
b/src/kits/network/libnetservices/UrlRequest.cpp
index c1e2042c14..c0b49c304e 100644
--- a/src/kits/network/libnetservices/UrlRequest.cpp
+++ b/src/kits/network/libnetservices/UrlRequest.cpp
@@ -12,6 +12,10 @@
 #include <stdio.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
 static BReference<BUrlContext> gDefaultContext = new(std::nothrow) 
BUrlContext();
 
 
diff --git a/src/kits/network/libnetservices/UrlResult.cpp 
b/src/kits/network/libnetservices/UrlResult.cpp
index 454c71e397..49c70c1cef 100644
--- a/src/kits/network/libnetservices/UrlResult.cpp
+++ b/src/kits/network/libnetservices/UrlResult.cpp
@@ -10,6 +10,10 @@
 #include <UrlResult.h>
 
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
+
 BUrlResult::BUrlResult()
        :
        BArchivable(),
diff --git a/src/kits/network/libnetservices/UrlSynchronousRequest.cpp 
b/src/kits/network/libnetservices/UrlSynchronousRequest.cpp
index 687ee224a1..d822c6500b 100644
--- a/src/kits/network/libnetservices/UrlSynchronousRequest.cpp
+++ b/src/kits/network/libnetservices/UrlSynchronousRequest.cpp
@@ -12,6 +12,9 @@
 
 #define PRINT(x) printf x;
 
+#ifndef LIBNETAPI_DEPRECATED
+using namespace BPrivate::Network;
+#endif
 
 BUrlSynchronousRequest::BUrlSynchronousRequest(BUrlRequest& request)
        :
diff --git a/src/kits/package/Jamfile b/src/kits/package/Jamfile
index e4fcb04372..4307a1b699 100644
--- a/src/kits/package/Jamfile
+++ b/src/kits/package/Jamfile
@@ -13,6 +13,9 @@ UsePrivateHeaders
        ;
 UsePrivateSystemHeaders ;
 
+# Use the deprecated libnetapi.so classes
+SubDirC++Flags [ FDefines LIBNETAPI_DEPRECATED ] ;
+
 HPKG_SOURCES =
        AttributeDataReader.cpp
        BlockBufferPool.cpp
diff --git a/src/kits/shared/Jamfile b/src/kits/shared/Jamfile
index d10c0a6032..b89d43b367 100644
--- a/src/kits/shared/Jamfile
+++ b/src/kits/shared/Jamfile
@@ -9,6 +9,9 @@ if [ Glob $(SUBDIR) : DefaultGeolocationServiceKey.h ] {
        SubDirC++Flags [ FDefines HAVE_DEFAULT_GEOLOCATION_SERVICE_KEY ] ;
 }
 
+# Use the deprecated libnetapi.so classes
+SubDirC++Flags [ FDefines LIBNETAPI_DEPRECATED ] ;
+
 local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
        on $(architectureObject) {

############################################################################

Commit:      ac4b83732861796ceade108bed3e96e337c8c10a
URL:         https://git.haiku-os.org/haiku/commit/?id=ac4b83732861
Author:      Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
Date:        Fri Jan 22 20:30:38 2021 UTC

http_streamer: switch to libnetservices.a

Switch to the experimental services API as the copy in libbnetapi.so is
deprecated.

Change-Id: I57d76b1d1be5c957221cc2d77d148fadbac2a642
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3668
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp 
b/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp
index 1cabcd2211..fd42b94013 100644
--- a/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp
+++ b/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.cpp
@@ -16,6 +16,8 @@
 // 10 seconds timeout
 #define HTTP_TIMEOUT 10000000
 
+using namespace BPrivate::Network;
+
 
 class FileListener : public BUrlProtocolListener {
 public:
diff --git a/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.h 
b/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.h
index e917391d24..4fe8c75e35 100644
--- a/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.h
+++ b/src/add-ons/media/plugins/http_streamer/HTTPMediaIO.h
@@ -9,7 +9,6 @@
 #include <AdapterIO.h>
 #include <FileRequest.h>
 #include <Url.h>
-#include <UrlContext.h>
 #include <UrlProtocolAsynchronousListener.h>
 
 
@@ -40,7 +39,7 @@ protected:
 
        friend class FileListener;
 private:
-       BUrlRequest*                                            fReq;
+       BPrivate::Network::BUrlRequest*         fReq;
        FileListener*                                           fListener;
        thread_id                                                       
fReqThread;
 
diff --git a/src/add-ons/media/plugins/http_streamer/Jamfile 
b/src/add-ons/media/plugins/http_streamer/Jamfile
index bc9031dbde..6af42df175 100644
--- a/src/add-ons/media/plugins/http_streamer/Jamfile
+++ b/src/add-ons/media/plugins/http_streamer/Jamfile
@@ -3,16 +3,14 @@ SubDir HAIKU_TOP src add-ons media plugins http_streamer ;
 UsePrivateHeaders media netservices shared ;
 UsePrivateHeaders [ FDirName media experimental ] ;
 
-# Use the deprecated libnetapi.so classes
-SubDirC++Flags [ FDefines LIBNETAPI_DEPRECATED ] ;
-
 local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
        on $(architectureObject) {
                Addon [ MultiArchDefaultGristFiles http_streamer ] :
                        HTTPStreamerPlugin.cpp
                        HTTPMediaIO.cpp
-                       : be media bnetapi shared
+                       : [ MultiArchDefaultGristFiles libnetservices.a ]
+                       be media bnetapi shared
                        [ TargetLibsupc++ ]
                ;
        }

############################################################################

Commit:      4080dbd635ecd3e71aca18a5f2d32374f4b88c91
URL:         https://git.haiku-os.org/haiku/commit/?id=4080dbd635ec
Author:      Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
Date:        Fri Jan 22 20:34:51 2021 UTC

haikudepot: switch to libnetservices.a

Switch to the experimental services API as the copy in libbnetapi.so is
deprecated.

Change-Id: Ic5e2c23a1be598be3057ea913c420c5346f9007f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3669
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/apps/haikudepot/Jamfile b/src/apps/haikudepot/Jamfile
index b79edf8d14..255c5066a2 100644
--- a/src/apps/haikudepot/Jamfile
+++ b/src/apps/haikudepot/Jamfile
@@ -229,9 +229,6 @@ local generatedReferenceParserSourceFiles =
        DumpExportReferenceJsonListener.cpp
 ;
 
-# Use the deprecated libnetapi.so network classes
-SubDirC++Flags [ FDefines LIBNETAPI_DEPRECATED ] ;
-
 Application HaikuDepot
        :
        $(applicationSources)
@@ -243,7 +240,7 @@ Application HaikuDepot
        $(generatedRepositoryParserSourceFiles)
        $(generatedReferenceParserSourceFiles)
        :
-       be package bnetapi translation libcolumnlistview.a shared
+       be package bnetapi translation libnetservices.a libcolumnlistview.a 
shared
        [ TargetLibstdc++ ] [ TargetLibsupc++ ] localestub
        :
        HaikuDepot.rdef
diff --git a/src/apps/haikudepot/server/AbstractServerProcess.cpp 
b/src/apps/haikudepot/server/AbstractServerProcess.cpp
index d438f30f1f..ae79af8329 100644
--- a/src/apps/haikudepot/server/AbstractServerProcess.cpp
+++ b/src/apps/haikudepot/server/AbstractServerProcess.cpp
@@ -27,6 +27,9 @@
 #include "ToFileUrlProtocolListener.h"
 
 
+using namespace BPrivate::Network;
+
+
 #define MAX_REDIRECTS 3
 #define MAX_FAILURES 2
 
@@ -133,9 +136,9 @@ 
AbstractServerProcess::SetIfModifiedSinceHeaderValueFromMetaData(
        // An example of this output would be; 'Fri, 24 Oct 2014 19:32:27 +0000'
        BDateTime modifiedDateTime = metaData
                .GetDataModifiedTimestampAsDateTime();
-       BPrivate::BHttpTime modifiedHttpTime(modifiedDateTime);
+       BHttpTime modifiedHttpTime(modifiedDateTime);
        headerValue.SetTo(modifiedHttpTime
-               .ToString(BPrivate::B_HTTP_TIME_FORMAT_COOKIE));
+               .ToString(B_HTTP_TIME_FORMAT_COOKIE));
 }
 
 
diff --git a/src/apps/haikudepot/server/AbstractServerProcess.h 
b/src/apps/haikudepot/server/AbstractServerProcess.h
index fd787ad14f..4185341a9d 100644
--- a/src/apps/haikudepot/server/AbstractServerProcess.h
+++ b/src/apps/haikudepot/server/AbstractServerProcess.h
@@ -14,6 +14,9 @@
 #include "StandardMetaData.h"
 
 
+using BPrivate::Network::BHttpRequest;
+
+
 typedef enum server_process_options {
        SERVER_PROCESS_NO_NETWORKING    = 1 << 0,
        SERVER_PROCESS_PREFER_CACHE             = 1 << 1,
diff --git a/src/apps/haikudepot/server/ServerHelper.h 
b/src/apps/haikudepot/server/ServerHelper.h
index a8eb4f9115..802d178d9e 100644
--- a/src/apps/haikudepot/server/ServerHelper.h
+++ b/src/apps/haikudepot/server/ServerHelper.h
@@ -10,6 +10,8 @@
 #include "ValidationFailure.h"
 
 
+using BPrivate::Network::BHttpHeaders;
+
 class BMessage;
 
 
diff --git a/src/apps/haikudepot/server/ServerSettings.h 
b/src/apps/haikudepot/server/ServerSettings.h
index 51f6073d4b..7e37019cb6 100644
--- a/src/apps/haikudepot/server/ServerSettings.h
+++ b/src/apps/haikudepot/server/ServerSettings.h
@@ -13,6 +13,8 @@
 #include <Url.h>
 
 
+using BPrivate::Network::BHttpHeaders;
+
 class ServerSettings {
 public:
                static status_t                                 
SetBaseUrl(const BUrl& baseUrl);
diff --git a/src/apps/haikudepot/server/WebAppInterface.cpp 
b/src/apps/haikudepot/server/WebAppInterface.cpp
index 0828437e55..f85b7d9ae7 100644
--- a/src/apps/haikudepot/server/WebAppInterface.cpp
+++ b/src/apps/haikudepot/server/WebAppInterface.cpp
@@ -26,6 +26,9 @@
 #include "ServerHelper.h"
 
 
+using namespace BPrivate::Network;
+
+
 #define BASEURL_DEFAULT "https://depot.haiku-os.org";
 #define USERAGENT_FALLBACK_VERSION "0.0.0"
 #define LOG_PAYLOAD_LIMIT 8192
diff --git a/src/apps/haikudepot/util/ToFileUrlProtocolListener.cpp 
b/src/apps/haikudepot/util/ToFileUrlProtocolListener.cpp
index 9395fc892a..d135a81181 100644
--- a/src/apps/haikudepot/util/ToFileUrlProtocolListener.cpp
+++ b/src/apps/haikudepot/util/ToFileUrlProtocolListener.cpp
@@ -10,6 +10,10 @@
 
 #include "Logger.h"
 
+
+using namespace BPrivate::Network;
+
+
 ToFileUrlProtocolListener::ToFileUrlProtocolListener(BPath path,
        BString traceLoggingIdentifier, bool traceLogging)
 {
diff --git a/src/apps/haikudepot/util/ToFileUrlProtocolListener.h 
b/src/apps/haikudepot/util/ToFileUrlProtocolListener.h
index a65b29b0d4..50c4d02533 100644
--- a/src/apps/haikudepot/util/ToFileUrlProtocolListener.h
+++ b/src/apps/haikudepot/util/ToFileUrlProtocolListener.h
@@ -6,6 +6,12 @@
 #include <UrlProtocolListener.h>
 #include <UrlRequest.h>
 
+
+using BPrivate::Network::BUrlProtocolDebugMessage;
+using BPrivate::Network::BUrlProtocolListener;
+using BPrivate::Network::BUrlRequest;
+using BPrivate::Network::BUrlResult;
+
 class ToFileUrlProtocolListener : public BUrlProtocolListener {
 public:
                                                                
ToFileUrlProtocolListener(BPath path,

############################################################################

Commit:      2a7090df71ce5516f1ee30c8b78f0a84c6ec9c34
URL:         https://git.haiku-os.org/haiku/commit/?id=2a7090df71ce
Author:      Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
Date:        Fri Jan 22 20:35:29 2021 UTC

libnetservices.a: move BGeoLocation from libshared.a

The BGeolocation class uses the network interface in libnetservices.a, so it
is moved here for now.

This will break any out of tree projects that depend on it, but it is a source
incompatible change only.

Change-Id: I6f5b1332eb87ad37dd33fbe09fdb11b16f7f26e4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3670
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/headers/private/shared/Geolocation.h 
b/headers/private/netservices/Geolocation.h
similarity index 95%
rename from headers/private/shared/Geolocation.h
rename to headers/private/netservices/Geolocation.h
index 825f696228..df62d6c320 100644
--- a/headers/private/shared/Geolocation.h
+++ b/headers/private/netservices/Geolocation.h
@@ -12,6 +12,7 @@
 
 namespace BPrivate {
 
+namespace Network {
 
 class BGeolocation {
 public:
@@ -36,6 +37,7 @@ private:
        static const    char*   kDefaultGeocodingService;
 };
 
+}      // namespace Network
 
 }      // namespace BPrivate
 
diff --git a/src/kits/shared/Geolocation.cpp 
b/src/kits/network/libnetservices/Geolocation.cpp
similarity index 99%
rename from src/kits/shared/Geolocation.cpp
rename to src/kits/network/libnetservices/Geolocation.cpp
index 9698533882..644c6fb06e 100644
--- a/src/kits/shared/Geolocation.cpp
+++ b/src/kits/network/libnetservices/Geolocation.cpp
@@ -19,6 +19,7 @@
 
 namespace BPrivate {
 
+namespace Network {
 
 class GeolocationListener: public BUrlProtocolListener
 {
@@ -248,5 +249,6 @@ const char* BGeolocation::kDefaultGeocodingService = "";
 
 #endif
 
+}      // namespace Network
 
 }      // namespace BPrivate
diff --git a/src/kits/network/libnetservices/JamCommon 
b/src/kits/network/libnetservices/JamCommon
index dd35f03958..1233f81026 100644
--- a/src/kits/network/libnetservices/JamCommon
+++ b/src/kits/network/libnetservices/JamCommon
@@ -36,6 +36,10 @@ local sources =
        UrlSynchronousRequest.cpp
        ;
 
+if [ Glob $(SUBDIR) : DefaultGeolocationServiceKey.h ] {
+       SubDirC++Flags [ FDefines HAVE_DEFAULT_GEOLOCATION_SERVICE_KEY ] ;
+}
+
 local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
        on $(architectureObject) {
@@ -52,6 +56,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
                } else {
                        StaticLibrary [ MultiArchDefaultGristFiles 
libnetservices.a ] :
                                $(sources)
+                               Geolocation.cpp
                                ;
                }
 
diff --git a/src/kits/shared/Jamfile b/src/kits/shared/Jamfile
index b89d43b367..7910176c73 100644
--- a/src/kits/shared/Jamfile
+++ b/src/kits/shared/Jamfile
@@ -5,13 +5,6 @@ AddSubDirSupportedPlatforms libbe_test ;
 UseLibraryHeaders agg ;
 UsePrivateHeaders shared locale ;
 
-if [ Glob $(SUBDIR) : DefaultGeolocationServiceKey.h ] {
-       SubDirC++Flags [ FDefines HAVE_DEFAULT_GEOLOCATION_SERVICE_KEY ] ;
-}
-
-# Use the deprecated libnetapi.so classes
-SubDirC++Flags [ FDefines LIBNETAPI_DEPRECATED ] ;
-
 local architectureObject ;
 for architectureObject in [ MultiArchSubDirSetup ] {
        on $(architectureObject) {
@@ -31,9 +24,6 @@ for architectureObject in [ MultiArchSubDirSetup ] {
                # for BKeymap
                UsePrivateHeaders interface ;
 
-               # for BGeolocation
-               UsePrivateHeaders netservices ;
-
                StaticLibrary <$(architecture)>libshared.a :
                        AboutMenuItem.cpp
                        ArgumentVector.cpp
@@ -44,7 +34,6 @@ for architectureObject in [ MultiArchSubDirSetup ] {
                        CommandPipe.cpp
                        DragTrackingFilter.cpp
                        DriverSettingsMessageAdapter.cpp
-                       Geolocation.cpp
                        HashString.cpp
                        IconButton.cpp
                        IconView.cpp

############################################################################

Revision:    hrev54923
Commit:      8579c7faf2111c668a31ace64d268cac00f71d59
URL:         https://git.haiku-os.org/haiku/commit/?id=8579c7faf211
Author:      Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
Date:        Sat Jan 23 09:18:30 2021 UTC

Package Kit: switch to libnetservices.a

Switch to the experimental services API as the copy in libbnetapi.so is
deprecated.

Change-Id: Ia0742038937d078c6a59ae13180a00a4c4eeb177
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3671
Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

----------------------------------------------------------------------------

diff --git a/src/kits/package/FetchFileJob.cpp 
b/src/kits/package/FetchFileJob.cpp
index 92ab42828f..0256ef3338 100644
--- a/src/kits/package/FetchFileJob.cpp
+++ b/src/kits/package/FetchFileJob.cpp
@@ -21,6 +21,7 @@
 #      include <HttpRequest.h>
 #      include <UrlRequest.h>
 #      include <UrlProtocolRoster.h>
+using namespace BPrivate::Network;
 #endif
 
 #include "FetchUtils.h"
diff --git a/src/kits/package/FetchFileJob.h b/src/kits/package/FetchFileJob.h
index b4ba4230e2..1105050c10 100644
--- a/src/kits/package/FetchFileJob.h
+++ b/src/kits/package/FetchFileJob.h
@@ -18,6 +18,11 @@
 
 #include <package/Job.h>
 
+#ifdef HAIKU_TARGET_PLATFORM_HAIKU
+using BPrivate::Network::BUrlProtocolListener;
+using BPrivate::Network::BUrlRequest;
+#endif
+
 
 namespace BPackageKit {
 
@@ -48,9 +53,10 @@ public:
 #ifdef HAIKU_TARGET_PLATFORM_HAIKU
        virtual void    DataReceived(BUrlRequest*, const char* data,
                                                off_t position, ssize_t size);
-       virtual void    DownloadProgress(BUrlRequest*, ssize_t bytesReceived,
-                                               ssize_t bytesTotal);
-       virtual void    RequestCompleted(BUrlRequest* request, bool success);
+       virtual void    DownloadProgress(BUrlRequest*,
+                                               ssize_t bytesReceived, ssize_t 
bytesTotal);
+       virtual void    RequestCompleted(BUrlRequest* request,
+                                               bool success);
 #endif
 
 protected:
diff --git a/src/kits/package/Jamfile b/src/kits/package/Jamfile
index 4307a1b699..c2381a4ae9 100644
--- a/src/kits/package/Jamfile
+++ b/src/kits/package/Jamfile
@@ -13,9 +13,6 @@ UsePrivateHeaders
        ;
 UsePrivateSystemHeaders ;
 
-# Use the deprecated libnetapi.so classes
-SubDirC++Flags [ FDefines LIBNETAPI_DEPRECATED ] ;
-
 HPKG_SOURCES =
        AttributeDataReader.cpp
        BlockBufferPool.cpp
@@ -134,6 +131,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
                        shared
                        bnetapi
                        be localestub
+                       [ MultiArchDefaultGristFiles libnetservices.a ]
                        [ TargetLibstdc++ ]
                        $(TARGET_NETWORK_LIBS)
                        ;


Other related posts: