Commit Graph

3317 Commits

Author SHA1 Message Date
Jérôme Duval 56490cf3b7 virtualized DirectConnected() and EnableDirectMode()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20786 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-23 22:08:34 +00:00
Hugo Santos 8a819b17e4 retrieve the incoming interface on the domain_receive_adapter(). This should fix potential issues with packets addressed to the IP broadcast address, such as in with some DHCP implementations.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20767 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-20 04:40:53 +00:00
Hugo Santos 74b0e85845 merged a bit more of functionality into DatagramSocket so we don't require a custom ReadData in the link protocol.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20765 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-20 02:13:54 +00:00
Hugo Santos 2445c00e64 some internal reorganization of getsockopt()/setsockopt() handling. TCP is now able to fully use the application requested sender/receiver buffer sizes for improved performance.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20764 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-20 01:58:14 +00:00
Stephan Aßmus 375dc591e6 * thought of an extension for the icon editor protocol
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20755 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-19 19:28:57 +00:00
Stephan Aßmus f591eb8ba0 * cleanup license header (and convert Jérôme to UTF8)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20754 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-19 19:26:44 +00:00
Stephan Aßmus 66cd7e6cc6 * define some more stuff
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-19 19:22:49 +00:00
Jérôme Duval 31ebfe61e4 added default sound events
implemented system_beep() by sending an event to the media addon server


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20728 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-16 19:15:46 +00:00
Hugo Santos d5b5a2c2f8 introduced Checksum::PseudoHeader helper.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20717 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-15 23:18:15 +00:00
Hugo Santos 1408d1f0ce introduced datalink's send_datagram to perform route and source address selection and dispatch the datagram to appropriate domain/protocol.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-15 22:11:12 +00:00
Hugo Santos 624c52d8b7 ARP now queues packets while resolving a destination instead of blocking on send_data(). This fixes several issues:
- TCP now behaves correctly when receiving new connections as its SYN/ACK is queued, or if lost correctly retransmitted when the peer resends a SYN.
 - The first ICMP Replies from an external on-link host pinging Haiku are no longer lost.
 - Reduced the number of ARP messages Haiku needs to generate until resolving an entry.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20712 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-15 21:00:12 +00:00
Jérôme Duval 33c487a43e implemented add_system_beep_event()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20711 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-15 20:40:12 +00:00
Jérôme Duval 88ec4b1dbe fixed some warnings
code style of MMediaFilesManager.* 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20703 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-15 13:59:59 +00:00
Hugo Santos 6a60618094 glued the multicast filter handling to the receive path: we are now capable of receiving multicast frames in datagram sockets.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20695 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-15 07:31:04 +00:00
Hugo Santos 6c501a4085 support RFC 3678's Protocol-Independent setsockopt()s for IPv4 multicast.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20691 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-15 03:07:28 +00:00
Hugo Santos 46527f6806 initial steps towards IPv4 Multicast Filter Delta API (RFC 3678)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20690 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-15 02:44:01 +00:00
Axel Dörfler ffcc37a0aa * Added and implemented B_INVALIDATE as available on Dano; to invalidate only a certain
part of the view, you can add a BRect "be:area" to that message - very handy.
* Cleaned up AppDefs.h a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20683 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-14 18:11:42 +00:00
Hugo Santos 49f3c71e21 respect SO_BROADCAST for received and sent datagrams.
- check if the destination address is specified in IPv4's SendData()
 - minor cleanups to IPv4's TRACE()s.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20681 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-13 21:33:13 +00:00
Marcus Overhagen 36e0e8a8bd Interface definition of DVB drivers. Currently private API.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20677 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-13 15:52:58 +00:00
Hugo Santos 658a550639 use module_dependencies to load the required modules by udp, tcp, ipv4, icmp and arp.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20676 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-13 14:37:48 +00:00
Hugo Santos 57e2a3d584 only deliver frames to IPv4 raw sockets of the specified protocol.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-13 04:20:39 +00:00
Hugo Santos d438fa4c12 added buffer, datalink and socket module references to the stack module so we don't have to load them in each other module.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-13 03:06:36 +00:00
Hugo Santos bfb45f717c introduced a new helper class DatagramSocket which provides a consistent base interface and functionality for the implementation of datagram-based sockets.
- made the ipv4 raw, udp and link protocols use DatagramSocket.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20672 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-13 00:55:32 +00:00
Jérôme Duval 72b4b94081 use __builtin_offsetof for gcc4 and superior, it avoids a gcc4 broken build with template use of offsetof()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20669 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-12 18:36:37 +00:00
Jérôme Duval b342ed59fb gcc4 is picky with in-template symbols, they must be qualified
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20668 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-12 18:17:31 +00:00
Jérôme Duval b12aab90c7 fixed typo
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20667 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-12 18:11:11 +00:00
Hugo Santos 6c35350908 moved address selection logic to a new 'get_buffer_route'.
- IPv4 now assumes the addresses it is supplied in send_routed_data are already the appropriate ones.
 - made the Data(), operator* and operator-> methods in NetBufferFieldReader const so we can use them in the same expression as the constructor.
 - fixed an issue with UDP where the wrong source address could be used in the calculating the checksum.
 - changed ipv4_print_address to use the more common 0.0.0.0 format.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20660 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-11 22:24:12 +00:00
Hugo Santos 87001e059c some NetBufferUtility revamp.
- introduced base NetBufferFieldReader which deals with obtaining a continuguous field to deal with.
 - renamed Detach() to Sync() to better express the fact that we may be writing to the buffer.
 - Fixed IPv4's and ICMP's checksum calculation as it assumed the underlying header was contiguous.
 - ICMP is now able to reply to ICMP Echo Requests which were split across data nodes.
 - in split_buffer(), make sure we were able to trim() the new buffer before damaging the original one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20657 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-11 16:40:40 +00:00
Hugo Santos af56b5b233 fixed add_tcp_header() as it wasn't considering the possibility that prepending data would not result in a contiguous buffer. This would result in wrong checksums for apparent no reason.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20643 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-10 19:04:13 +00:00
Hugo Santos 8107b19403 Fixed some more TCP issues.
- Properly flag sockets using non-blocking connects() when in SYN SENT.
 - and when in LISTEN, we should use the socket's connection queue size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20631 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-10 05:28:56 +00:00
Hugo Santos e53357d57a Prepared net_device_monitor to accept device removal events.
- Introduced public net_device_monitor.
 - Changed the link protocol to maintain a lock per instance instead of inside the FIFO. Now all of the link instance data is protected.
 - Adapted the link protocol to use net_device_monitor.
 - Introduced a private Fifo class which doesn't maintain it's own lock.
  - Maybe we should add something like a public net_protocol_implementation which maintains a fifo and a benaphore? With the fifo using the structure's lock instead of maintaining it's own.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20614 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-08 09:15:52 +00:00
Ingo Weinhold d307e81230 Added ENOATTR.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20607 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-08 02:01:07 +00:00
Jérôme Duval 0c93c0a807 change the way FileGameSound works : avoid using a port
code style, some clean up


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20603 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-06 22:40:23 +00:00
Hugo Santos 0d5afa4dec introduced fifo_socket_enqueue_buffer which clones the buffer, enqueues it to the fifo and notifies the socket.
- changed the link, ipv4 and udp modules to use fifo_socket_enqueue_buffer


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20587 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 17:56:20 +00:00
Hugo Santos 17b77c3b92 consolidate all RECV/SEND ioctls into a single RECEIVE/SEND pair
- changed the socket module to use thew new RECEIVE/SEND in all forms of recv() and send()
 - changed libnetwork to use the new RECEIVE/SEND
 - remove transfer_args processing from strace since the structure was removed


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20581 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 14:26:46 +00:00
Hugo Santos dae7f8ea46 initial recvmsg and sendmsg implementations
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20562 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 17:39:43 +00:00
Hugo Santos 36883c5516 ipro1000: added ETHER_GET_LINK_STATE support
* use em_media_status to get link status
 * added IFM_1000_SX (Fiber Optic) to net/if_media.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20551 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 12:50:54 +00:00
Axel Dörfler 9206bb3779 * Changed ETHER_GET_LINK_STATE ethernet driver interface, added ETHER_SET_LINK_STATE_SEM.
* The device interface list now uses class DoublyLinkedList instead of struct list.
* Implemented SIOC[SG]IFMEDIA for setting (not supported by any device yet), and
  retrieving the device media information.
* Fixed a locking bug in list_domain_interfaces().
* Added new stack function device_link_changed() that should be called in case the
  link state (media) changed.
* The ethernet device module now spawns a thread and will periodically check the media
  state of all ethernet devices that support this (if any).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20546 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 09:41:04 +00:00
Axel Dörfler 1a3ab92b81 * Rewrote ether_driver.h, removed some BONE stuff we don't support at this point;
it might also be a good idea to change the constants to better match the usual
  style.
* Added a BSD-style if_media.h.
* Added interface flags IFF_LINK, IFF_AUTO_CONFIGURED, and IFF_CONFIGURING. The
  former will be set automatically by the stack, the rest will be set by the
  net_server depending on the current state.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20535 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-03 14:42:07 +00:00
Ingo Weinhold ed07b9c7e3 The last missing hooks -- get_vnode_name(), write_attr_stat() and
rewind_query() -- are passed to the userland. get_vnode_name() has an
emulation in userland, in case the client FS doesn't implement it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20522 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-03 04:40:54 +00:00
Axel Dörfler 2d55afcdf7 Support getting route information for a specific destination
using SIOCGETRT. Patch by Hugo Santos.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20494 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-01 12:06:16 +00:00
Ingo Weinhold 27d37d4d24 * Optional debug feature for tracking which page queue a page should be
in.
* New debugger command "find_page", which searches all page queues to
  find out, which one a page is actually in.
* Solved nasty race condition between the page scrubber and
  vm_page_allocate_page_run(): The page scrubber didn't mark the pages
  it was processing busy, so that vm_page_allocate_page_run() could claim
  them in the meantime. They would end up in the clear pages queue,
  although being assigned to a cache at the same time. This should
  finally solve bug #1056.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20474 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-30 19:48:51 +00:00
Axel Dörfler 9c62a6ed7d Rewritten Debug.h by Vasilis Kaoutsis.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20473 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-30 14:43:25 +00:00
Ingo Weinhold b8ba8f58d7 Added the disk device API to the libbe_haiku.so, so that libtracker.so builds
again for target libbe_test. Added respective syscall stubs and other functions
to libhaikucompat.a.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-28 15:20:08 +00:00
Ingo Weinhold 2b2ec4382a * Moved the AutoLocker class out of the kernel/utils/AutoLock.h header
into its own shared/AutoLocker.h. It can be used by userland code too.
* Removed headers/private/shared/ObjectLocker.h and replaced all uses of
  BObjectLocker by AutoLocker.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20432 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-27 12:05:33 +00:00
Axel Dörfler c6a7ff7a9f * The new vm_page_mappings weren't updated correctly in many cases.
* Added a comment to vm_remove_all_page_mappings() that shows that we need to
  change the mapping spinlock into a mutex.
* Pointed out some potential problems in the code.
* Added vm_page_at_index(), vm_clear_map_activation(), and vm_test_map_activation()
  in preparation of the page scanner rewrite.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-23 11:48:37 +00:00
Ingo Weinhold 27810ccf5e Added the last useful features I dare imagine: A Lock() method and the
possibility to initialize the AutoLocker without locking the object even
if it is unlocked yet. Especially in loops Lock()/Unlock() come handy
when an otherwise constantly hold lock needs to be unlocked for a short
time.

I suppose we should move the kernel utils AutoLocker implementation
to headers/private/shared, and drop the less powerful ObjectLocker.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-23 00:03:59 +00:00
Axel Dörfler bdfc47dbcd * Fixed the test for equality when a known ARP reply came in - you should no longer
see the "ARP entry updated with different address" message.
* sockaddr_dl::sdl_data is now unsigned (uint8_t instead of char).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-20 22:21:36 +00:00
Ingo Weinhold 44b5d72b5a Added new functions to the debugger API:
{set,clear}_debugger_{break,watch}point(), allowing to set/clear break
and watchpoints for the calling team. When a break/watchpoint is hit,
the team enters the debugger. Handy in situations when the program in
question can't really be started in a debugger (or it would be
complicated to do so). The functions work only as long as no debugger is
installed for the team.

We clear the arch specific team and thread debug infos now, when a new
debugger is installed, thus clearing break- and watchpoints.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-20 16:20:13 +00:00
Ingo Weinhold 2c97a8d164 Use -I instead of -isystem for system header directories when building
with gcc 4. Fixed resulting build errors (gcc is more lenient for
headers in -isystem directories).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20386 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-14 20:36:42 +00:00