Commit Graph

134 Commits

Author SHA1 Message Date
Adrien Destugues 5ebdc79955 SecureSocket: add some certificate support
* Instead of creating an OpenSSL context ofor each socket, use a global
one and initialize it lazily when the first SecureSocket is created
* Load the certificates from our certificate list so SSL certificates
sent by servers can be validated.
* Add a callback for signalling that certificate validation failed, the
default implementation proceeds with the connection anyway (to keep the
old behavior).
* Introduce BCertificate class, that provides some information about a
certificate. Currently it's only used by the callback mentionned above,
but it will be possible to get the leaf certificate for the connection
after it's established.

Review of the API and implementation is welcome, before I start making
use of this in HttpRequest and WebKit to allow the user to accept new
certificates.
2014-01-15 17:45:21 +01:00
Adrien Destugues 3d864cd870 Remove B_PROT_* and related code
Use standard error codes instead.
This allows using error code returned by the underlying functions
directly, and makes it possible to use strerror for debugging. So, we
can also remove StatusString() from the various *Request classes.
2014-01-13 08:05:32 +01:00
Adrien Destugues 5b53e2e516 HttpRequest: close the connection on Stop()
When calling Stop(), we expect the request thread to exit as soon as
possible. Closing the connection unlocks it from any blocking read() or
write(), avoiding some lockup situations.
2014-01-02 08:38:03 +01:00
Adrien Destugues 824dd0a834 Reintroduce BUrlResult and add BDataRequest
* BUrlResult is back, with ContentType and Length methods.
* BHttpResult subclasses it and use HTTP header fields to implement
those
* Introduce BDataRequest for "data" URIs. These embed the data inside
the URI, either as plaintext or base64 encoded.
2013-12-11 17:29:25 +01:00
Adrien Destugues 509755e136 HttpRequest: remove fOutputBuffer
We can send the data directly to the output socket instead of copying it
into a BString first, at the cost of very slightly less information in
debug output.
2013-11-26 10:21:57 +01:00
Michael Lotz dcc56bf748 BNetEndpoint: Fix socket leak and reduce Accept() overhead.
When using the copy constructor of BNetEndpoint the socket of the
original endpoint gets dup'ed. The Accept() method later directly reset
the fSocket member of the newly created BNetEndpoint to the socket
returned by accept(). The socket dup'ed by the copy constructor was
therefore leaked.

Of course dup'ing the socket and copying the local and remote addresses
is superfluous in the accept case, as these members all get set to new
values. To reduce that overhead there is now a new private constructor
that directly gets the final socket and remote and local address.
2013-11-24 22:36:29 +01:00
Stefano Ceccherini 41d4206692 Added family parameter to the GetRoutes() API.
Moved common code to a private file.
2013-11-18 10:13:26 +01:00
Stefano Ceccherini 905f910e53 Network route API: Second try (WIP).
Implement BNetworkRoster::GetRoutes() and BNetworkInterface::GetRoutes().
Also implement BNetworkInterface::GetDefaultGateway().
There is code duplication at the moment, and the api only supports IPV4.
2013-11-16 13:29:32 +01:00
Stefano Ceccherini 0074cea398 Implement BNetworkRoster::GetNextRoute()
Implement BNetworkRoster::GetNextRoute() and used it in Network preflet.
2013-11-15 21:59:28 +01:00
Adrien Destugues 564e256649 Various fixes to Services Kit
* Remove useless dummy protocol loop in UrlRequest
 * Stop HTTP requests before deleting the socket and other things the
loop may still be using
 * Deletion of items from the authentication map wasn't working
 * Remove some debug traces
2013-11-15 16:32:18 +01:00
John Scipione c2c1ce1dc5 Style fixes to HttpRequest 2013-11-04 20:16:26 -05:00
John Scipione f1e63b05cb Style fixes to HttpForm 2013-11-04 20:16:05 -05:00
Adrien Destugues 9ce2f7e386 Improve HTTP authentication support.
The authentication state is stored (in a hash map, using the domain+path
as a key) in the UrlContext class. It can then be reused for multiple
requests to the same place. We also lookup stored authentications for
parent directories and stop at the first we find.

Authentication state is not stored on disk (unlike cookies), and there
can only be one for each domain+path.
2013-10-28 17:29:20 +01:00
Adrien Destugues b7617ddd68 Network Cookie Jar: implement assignment operator.
This change is needed for implementing cookie persistence in Web+ using
the network kit backend.

The current implementation requires the user to unarchive the cookie
jar, then hand it over to the BUrlContext which will copy it to its own
field. This makes the code simpler, but maybe doing a complete copy
(with all the cookies) is an heavy operation and could be avoided.
2013-10-28 17:29:19 +01:00
Adrien Destugues c52c444c27 Add file: protocol handler. 2013-10-24 17:41:03 +02:00
Adrien Destugues f6782201f0 Move UrlResult to HttpResult
* Remove the fRawData field, as handling it is too complicated (it's
not easy to have proper copy semantics on a BDataIO) and it's not used
anyway, as the listener DataReceived call is enough to get the data and
handle it.
 * All the remaining fields are HTTP-only, so rename the class to
HttpResult and attach it to HttpRequest instead of UrlRequest.
2013-10-24 17:41:02 +02:00
Adrien Destugues b3d13a000c Network Kit: Coverity scan review and fixes
CID 1108353, 1108335: memory leak.
CID 610473: unused variable.
CID 1108446, 1108433, 1108432, 1108419, 1108400, 991710, 991713, 991712,
	610098, 610097, 610096, 610095: uninitialized field
CID 1108421: unused field

Change the ownership of the result for Url/HttpRequests. The request now
owns its result and you either access it by reference while the request
is live, or copy it to keep it after the request destruction. To help
with that, get BUrlResult copy constructor and assignment operator to
work.

Performance issue: copying the BUrlResult also copies the underlying
BMallocIO data. This should be shared between the BUrlResult objects to
make the copy lighter. The case of BUrlSynchronousRequest is now
particularly inefficient, with at least 2 copies needed to get at the
result.
2013-10-21 09:21:00 +02:00
Adrien Destugues 25b034e99c HttpRequest: docs and memory management fixes
* Now takes ownership of headers, form data and input data
 * Split Set* and Adopt* methods to help with proper use of this (Set
does a copy)
 * Write documentation.
2013-10-17 14:24:20 +02:00
Adrien Destugues ced0e0be04 BUrl: use a regex to parse URLs
* The RFC provide a regular expression for URI parsing, so just use it.
 * Allows parsing URIs with missing components (no scheme or authority)
 * This allows to parse relative URLs as expected
 * Can also handle things such as data: or mailto:
 * Also more fixes to handling of incomplete URIs, some flags weren't
always set to the right values.

This gets Windows Live Mail (or is it called Outlook?) working, with
some other fixes on WebKit side.
2013-10-16 21:01:43 +02:00
Adrien Destugues 400153ebf5 BUrl: parse URLs using a regular expression.
* RFC3986 provides the regexp to parse URIs properly
 * Code is simpler and safer
 * Avoids an infinite loop when trying to parse some data: URIs
2013-10-16 13:51:54 +02:00
Adrien Destugues 7696f7dd54 HttpRequest: allow custom http methods
* The W3C XmlHttpRequest testsuite likes to use "CHICKEN" as a method.
 * Also add constants for all specified methods in HTTP 1.1.
2013-10-15 14:43:09 +02:00
Adrien Destugues f6f14c5d1c Make BUrlProtocolAsynchronousListener inherit BUrlProtocolListener
* With so long class names, there's no way I'm going to follow the 64
char limit on commit headlines.
 * The class share the same API, so having them separate is not very
useful.
 * This makes it possible to use the same listener in either synchronous
or asycnhronous mode (or both, for different requests)
2013-10-15 10:16:33 +02:00
Adrien Destugues c9d31eeed6 More cookie fixes
* Add some error handling in NetworkCookie and don't add broken cookies
(or should I say crumbs?) to the cookie jar
 * More control on the path and domain, as well as the expiration time

We now pass Opera cookie testsuite functionality tests, as well as some
of the negative tests (we even do better than curl). Not going further
right now as this works well enough for positive cases and most
security/privacy issues are fixed (cross domain and cross path cookie
setting or spying).
2013-10-14 15:21:51 +02:00
Adrien Destugues a5ac24f00c BUrl: add a Redirect method
* This takes a relative path as a parameter, and modifies the object to
point to the given location.
 * '..' is not handled yet, and will be sent as-is to the server.
 * Makes it possible to follow more types of 302 redirects

In particular, I can now run the tests from Opera's testsuite
(testsuite.opera.com), which shows I have more work to do on cookie
handling.
2013-10-11 08:32:25 +02:00
Adrien Destugues 8ca6eeb77c HttpRequest: missing fields initializations
* Some fields weren't initialized, leading to random crashes later on
 * Remove the enum that was used for protocol options
 * Use a single field to track the request state, instead of separate
booleans.
2013-10-09 15:46:10 +02:00
Adrien Destugues 780967d8ac Cleanup and fix cookies handling
* The cookie jar iterator now use a BObjectList instead of a BList
 * Add a convenience method to the cookie jar to add a cookie by BUrl
and raw cookie string.
 * Remove some methods in BNetworkCookie that could lead to invalid
cookies (cross-domain or with no domain at all).
 * Make the cookie parsing able to report errors
 * Fix off-by-one error in domain cookies validation.
2013-10-09 12:08:46 +02:00
Adrien Destugues afd547b368 Refactor UrlRequest/UrlProtocol in the Service Kit
* Remove the BUrlRequest class, which was only delegating work to
BUrlProtocol and subclasses
 * Rename BUrlProtocol to BUrlRequest, and BUrlRequestHttp to BHttpRequest
 * Creating a request is now done through the BUrlProtocolRoster. For
now there is just a static MakeRequest method, this will be completed
when we get to actually allowing add-ons to provide different request
handlers.

This allows cleanup of the API for requests:
 * Remove the universal SetOption method with constants, and have
dedicated setters for each protocol option.
 * Setters can now have multiple parameters, for example you can give
BHTTPRequest a BDataIO and a known size
 * In this case, the BHttpRequest will not use HTTP chunked transfers,
which were always used before and made most servers unhappy (tested and
failed with lighttpd, google accounts and github).
2013-10-08 11:42:05 +02:00
Adrien Destugues 49e7165f9d Use ssize_t to allow returning a negative error code 2013-10-04 16:57:02 +02:00
Adrien Destugues 2ec188b903 Fix thread safety issue in chunked http transfers.
* The use of a static variable for storing the chunk size made it shared between all instances of BUrlProtoclHttp.
* Inline the function at the single place where it is used, and allocate the variable on the stack instead.

The whole receiving loop should be split into chunked and non-chunked variants to improve code readability.
2013-08-27 20:36:29 +02:00
Alexander von Gluck IV ae4da1002b netserver: Add EAP defines for WPA enterprise
* Working towards #8850
2013-07-17 20:16:49 -05:00
Hamish Morrison 2675e31a0c BUrlRequest: fix various issues
* Remove unused headers interface from BUrlProtocol
* Change confusing function names
* Style fixes and whitespace cleanup
2013-02-10 20:46:24 +00:00
Hamish Morrison 64a1f5a020 NetworkCookieJar: various small fixes and updated tests 2013-02-09 17:10:10 +00:00
Hamish Morrison c8bc218363 NetworkCookie: fix domain/path matching, and validity checks 2013-02-09 17:10:05 +00:00
Hamish Morrison 33462ef54a NetworkCookie: bring SetCookie parsing in line with RFC 6265 2013-02-09 17:09:53 +00:00
Hamish Morrison 2db5d2bc95 NetworkCookie: remove unused cookie attributes and add HttpOnly 2013-02-09 16:09:34 +00:00
Hamish Morrison 05f42aaba4 NetworkCookie: set the default path according to RFC 6265 2013-02-09 16:02:15 +00:00
Niels Sascha Reedijk f00edeb7e3 Automatically pick port 443 for HTTPS 2013-02-07 18:06:45 +00:00
Niels Sascha Reedijk 4e607e1aae Enable HTTPS connections.
Using more modern network classes:
 * BNetworkAddress instead of BNetAddress
 * BSocket and BSecureSocket instead of BNetEndpoint
2013-02-07 18:06:02 +00:00
Niels Sascha Reedijk d1b6afe678 Re-enable the services kit from GSOC 2010
* Use a public domain MD5 implementation when the OpenSSL one is not available
 * No functional changes
2013-02-07 18:05:38 +00:00
Axel Dörfler 0e478f5aec Added experimental version of a Socket API with SSL support.
* Each class has a Socket() method to retrieve the underlaying file descriptor
  to be able to do the more advanced stuff, if necessary.
* A server socket is yet missing, but the rest is pretty much covered.
2011-11-21 22:07:52 +01:00
Michael Lotz 7d7b963225 * Remove the BNetworkDevice::AddPersistentNetwork() again and instead introduce
BNetworkRoster::{Count|GetNext|Add|Remove}PersistentNetwork() as it fits
  better (thanks Philippe for the heads up).
* Implement the backend for these functions in the net_server and also move
  conversion of the wireless_network based format into the settings based format
  there.
* Implement removal of a network from the settings and make adding a new network
  with the same name replace the old one instead of just adding multiple ones.
  Might need to change this in the future depending on how we want to handle
  multiple networks with the same name (i.e. distinguish based on BSSID or
  similar).
* Fix apparent oversight that caused configured networks _not_ to be used in the
  auto join attempt.
* Remove auto joining open networks. I've been bitten by that more than once now
  because we happen to have an open network in the neighbourhood that I now
  accidentally used to transfer quite a bit of (unencrypted) stuff before
  noticing... In the future, one will instead have to explicitly join an open
  network once and store that config. Note that the driver will actually still
  auto-associate with open networks due to how things are set up currently.
  Note also that the auto join will fire join requests whenever there's a
  disassociation event, so you might see spurious join dialogs when the
  wpa_supplicant actually just re-establishes the connection.
* Make join requests async again. Instead of waiting for a synchronous reply of
  the wpa_supplicant we instead return success when the request has been sent.
  While the API call might still be made synchronous again in the future, the
  net_server should really not block on an external application. In the case of
  the wpa_supplicant we would otherwise deadlock when using the new
  *PersistentNetwork() API after a successful join, and in other cases we might
  just unacceptably delay other calls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42816 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-10-09 19:56:19 +00:00
Michael Lotz a1b98367ae Add a way to add persistent (configured) wireless_networks that will eventually
be stored by the backend in the net_server. I put it in BNetworkDevice because
that is where network enumeration is done as well, but I'm not sure that it fits
there particularly well.
Since BNetworkDevice::GetNetwork() directly interfaces with the driver and gets
the networks from scan results, such persistent networks don't yet show up in
those enumerations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42807 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-10-07 10:23:47 +00:00
Axel Dörfler ddf57b6cf6 * Reverted back to the original version of BNetworkAddress::SetAddress();
in_addr_t is now in network endian again. Thanks, Philippe!
* Made SetToLoopback(), and SetToLocal() a bit more useful (although the latter
  isn't implemented yet).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40552 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-18 21:09:21 +00:00
Axel Dörfler c416526666 * Parse the additional information elements the station sends in order to
retrieve the WLAN cipher/key configuration. Might not work perfectly yet; so
  far I've only seen WPA2, and WPA networks.
* Have wlan_test show this extra info.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39792 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-09 22:33:34 +00:00
Axel Dörfler 8faecc1d5e * Added ability to parse link level addresses.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-09 00:06:45 +00:00
Axel Dörfler d5a09773bf * Fixed size of sdl_type/sdl_e_type, the former is only a uint8, and the latter
a uint16.
* sdl_e_type is stored in network order now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39778 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-08 23:42:47 +00:00
Axel Dörfler 440d0e61e8 * Pretty much completed BNetworkDevice. The only parts missing are GetMediaAt(),
and parsing the extra station data to retrieve the authentication details.
  Comments welcome.
* NetworkStatus should now mark the currently associated network (if any).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39774 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-12-08 22:55:57 +00:00
Axel Dörfler 1d8e6ee862 * Untested work-in-progress. Actually cannot work because of missing
functionality in BNetworkAddress.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39687 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-30 21:22:25 +00:00
Axel Dörfler e6cec9839d * BNetworkAddress isn't really BArchivable material, switched to BFlattenable
instead.
* Also actually implemented the serializing functionality this time, as usual
  completely untested, though :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39677 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-29 20:29:37 +00:00
Axel Dörfler 2bd61a6f33 * Added Index() method, was not even declared yet.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-23 21:04:19 +00:00
Axel Dörfler 2087545cc0 * Added methods to manipulate routes.
* Added AutoConfigure() method.
* Implemented missing Index() method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-23 21:03:11 +00:00
Axel Dörfler 2977e7888f * Added alternatives to AddInterface()/RemoveInterface() that take the name
of the interface instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39591 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-23 21:01:19 +00:00
Axel Dörfler 6a75869303 * Added SetAddress() methods for IPv4, and IPv6 addresses.
* Improved API.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-23 21:00:05 +00:00
Stephan Aßmus 45939109b4 Patch done by Christophe Huriaux as part of GSoC 2010 "Services Kit" project:
Integrated the classes in the Network Kit (libbnetapi.so). Only the foundation
classed BUrl, BUrlContext, BNetworkCookie, BNetworkCookieJar and the private
HttpTime code is currently compiled. The BUrlProtocol currently contains some
misplaced BUrlProtocolHttp specific stuff, and the HTTP stuff itself has a
dependency on libcrypto and should live in an add-on instead. I've sprinkled
some TODOs in the code, and I've done some renaming compared to the last
version of the GSoC patch. Any help to bring this further along is appreciated.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39161 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-27 14:03:31 +00:00
Philippe Houdoin ed13a41e18 Fix the build, which was broken in r39147.
I hope I didn't overlap too much on your shoes, Axel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39155 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-26 10:24:17 +00:00
Axel Dörfler 1d56eab029 * Work in progress network API changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39147 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-25 20:20:09 +00:00
Axel Dörfler 28de0904dc * Added non-const sockaddr casts.
* Automatic whitespace cleanup.
* This also fixes the build; I wanted to commit this earlier.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38237 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-18 15:41:33 +00:00
Axel Dörfler 97ef73e074 * Added convenience methods FindAddress(), and FindFirstAddress().
* Added BNetworkInterfaceAddress::Destination() as synonym for Broadcast()
  (depending on the configuration, it could be either one).
* Media() will now return -1 in case of an error.
* Added "const" where it makes sense.
* Added convenience functions for AddAddress(), and RemoveAddress() that only
  take the actual address.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38060 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 13:50:32 +00:00
Axel Dörfler 836c43f2b8 * Factored out a BNetworkAddressResolver from BNetworkAddress, that also allows
to iterate over all possible addresses, as suggested privately by Rene.
* Added flags to the resolving methods that allow more control over the
  addresses returned.
* Added setters to BNetworkAddress that accept a service name instead of port
  number, renamed PortName() to ServiceName().
* Made the sockaddr* cast operators return a const sockaddr as it was supposed
  to be, although I should probably add non-const ones as well.
* This also simplified the code somewhat.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38039 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 11:27:14 +00:00
Axel Dörfler 23f2073215 * Implemented SetToMask(), and added PrefixLength() method, mostly reusing
code from ifconfig.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38026 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-11 13:53:31 +00:00
Axel Dörfler 9de96be375 * Added methods to get/set the media/metric.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38024 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-11 13:18:36 +00:00
Axel Dörfler c2808ea7b2 * Adapted API as needed, and implemented most of the C++ API - it's completely
untested at this point, though.
* Will port ifconfig, NetworkStatus, and the Network preferences application
  later in order to test the API.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37988 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-09 16:31:40 +00:00
Axel Dörfler bf58f252de * Adapted headers after Stippi's suggestions - I won't add the const until I
know how I implement that function :-)
* Cleaned up libbnetapi.so Jamfile, removed non-Haiku target code.
* Added empty files to the build to see that the headers are compiling.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37942 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-06 13:22:25 +00:00
Axel Dörfler ff1b1ac7ff * Introduced first draft of a C++ network API. Comments welcome (I haven't
started implementing it yet, anyway).
* Note that BNetworkAddress is supposed to replace BNetAddress -- the latter
  does not provide enough space for a struct sockaddr_storage, and has a very
  IPv4 specific and incapable API, anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-06 08:08:02 +00:00
Stephan Aßmus 2a452b95b1 Rewrote header. Don't know if this is even used/supported.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 12:45:31 +00:00
Bruno G. Albuquerque d254c83c84 - Changed BNetBuffer to a simpler (and R5 compatible) implementation.
- This has the side effect that now it actually works.
- This also indirectly fix BNetEndpoint usage of BNetBuffer.
- Added DynamicBuffer (the underlying buffer implementation) to the Jamfile.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28928 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-01-17 21:28:10 +00:00
Oliver Tappe 49a22456dd Overhauled BNetEndpoint implementation (and BNetAddress, too):
* added NetEndpointTest that exposed a couple of bugs
* fixed several bugs in the implementation of BNetEndpoint, some of which kept 
  NetPenguin from working
* fixed a couple of constness issues in BNetEndpoint and BNetAddress


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-13 19:58:35 +00:00
Oliver Tappe 1aa3d2e3f3 Resolved a couple of problems in BNetAddress implementation:
* fixed several byte order inconsistencies, it does not make sense to always
  convert the byte order input/output values - no we convert where it can
  be expected and leave it where it is confusing
* fixed size inconsistencies with respect to family and port, both of which
  were sometimes handled as int8, as int16 and as int32 in different places
  (now they are always int16)
These fixes make Beam connect to the correct address and port, but it still doesn't work, as it seems to be using UDP instead of TCP (doh!). Will look into that tomorrow.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26269 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-05 22:37:06 +00:00
Axel Dörfler f6e4cbb952 * Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 20:13:55 +00:00
Axel Dörfler 241b048033 * Fixed build of libnetapi.so - it probably won't work for now, though, have a look
at the comment in r5_compatibility.h.
* Intentionally broke source compatibility and removed all that outdated Nettle stuff.
* Also, I took the liberty of making m_init private and rename it to fInit - again, this
  will only affect source compatibility.
* Rewrote NetEndpoint.h
* Fixed quite a few small bugs around the code that I touched, for example in NetAddress,
  SetTo() never set fInit, and therefore could be wrong.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18680 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-29 00:19:23 +00:00
Axel Dörfler 036caeb9cf Those two aren't needed here (we don't need that level of source compatibility,
ie. if someone included net/socket.h he's doomed to change his sources).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18679 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-28 21:52:07 +00:00
Ingo Weinhold 338b8dc301 Merged changes from branch build_system_redesign at revision 14573.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-29 16:27:43 +00:00
Philippe Houdoin 200ec0269e Remove const that breaks binary compatibility (const are mangled too).
Thanks axeld to point at them.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8569 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-14 01:24:57 +00:00
Philippe Houdoin ad31a3c1c8 Comment about unsupported Nettle backward compatibility added.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8566 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-14 00:20:34 +00:00
Philippe Houdoin c714747365 Binary compatibility gurus are welcomed to check it and report.
Fix a typo present since Be's days...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8565 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-14 00:18:18 +00:00
Philippe Houdoin 0a574d3316 Introduce an OBOS_NET_STACK_VERSION symbol to help checking which
installed network stack a networking app is built on.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6037 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-12 23:52:40 +00:00
Philippe Houdoin 082059d403 Checked-in the update Scott Mansfield made to these BNet* classes declarations to male
them binary compatible.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2264 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-12-17 01:24:44 +00:00
Philippe Houdoin 40e492bc4c Some net headers fixes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1911 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-13 07:57:19 +00:00
Philippe Houdoin 2ae4404ac1 On behalf of Scott Mansfield, the 3/4 Net* classes headers are there.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1806 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-01 02:49:38 +00:00
beveloper b8377d8cb4 changes header guards
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1652 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-25 14:02:18 +00:00
beveloper d7e489f80a modified to provider better R5 compatibility
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1615 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-23 13:45:47 +00:00
beveloper 4c7e1fff2f Should help with compiling network related apps.
I'm not sure if we really need this socket.h and netdb.h wrappers


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1599 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-22 16:29:21 +00:00
Philippe Houdoin ae68bb3273 Re-written by Scott Mansfield <thephantom@mac.com>
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1548 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-16 22:54:05 +00:00
Philippe Houdoin 4c44e39a3a Initial checkin of C++ BeOS Net API include files.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@918 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-28 21:25:08 +00:00