Commit Graph

19508 Commits

Author SHA1 Message Date
Hugo Santos 20b534cd5f a bit more work towards proper locking including a fix to a refcount bug
- fixed a issue in add_interface_to_domain where the device interface's refcount was always incremented since that function was getting the device interface handle and not returning it unconditionlly
 - if the ethernet device goes down, and the fd is close()ed, return B_FILE_ERROR instead of calling into the driver again


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20601 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-06 09:48:02 +00:00
Hugo Santos c64fecca78 started some work to properly handle device_removed() and setting interfaces down in general.
- remove all routes that use interfaces going down.
 - when a device is going down, remove associated domain interfaces.
 - interfaces weren't getting a properly referenced device interface, fixed.
 - down call down_device_interface when deleting a interface, instead set it down and let the upcounts do its job.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20600 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-06 06:23:35 +00:00
Hugo Santos 0b10ed0573 check if the device going down is the head of the check list and remove it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20599 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-06 06:23:27 +00:00
Ingo Weinhold 2c24a1a9f6 New handy build system feature: It is now possible to pass a command
line to jam that contains build targets and that will be executed by
the build system after building the targets and replacing their
occurrences in the command line by their paths. The keyword indicating
such a command line is "run", targets are marked by a leading ":".
E.g.:

  jam -q run ':<build>xres' -l :libtracker.so

This builds the xres tool for the host platform and libtracker.so for
Haiku, and afterwards lists the resources libtracker.so contains. Note,
that this feature requires using Haiku's jam version.

The functionality is implemented by the new RunCommandLine rule, which
can, of course, also be used in the UserBuildConfig.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20598 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-06 03:14:58 +00:00
Ingo Weinhold f51c147043 Added rules NextID, which returns an numerical ID incremented with each
invocation, and NewUniqueTarget, which returns a unique target name.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-06 02:39:37 +00:00
Ingo Weinhold 25b12e83ae Added rules for performing basic integer arithmetics (+, -, *). The rules
operate manually on digit lists, so they are certainly not fast and shouldn't
be used excessively, but at least it's possible to do calculations in Jam now,
should the need arise.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20596 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-06 02:37:12 +00:00
Hugo Santos 1340c38e52 added message_args decoding support to strace (used by net_stack's RECEIVE/SEND).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20595 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-06 02:02:29 +00:00
Hugo Santos 3785f4f0f0 check if receive timeout is infinite before doing the usual preparation for ABSOLUTE_TIMEOUT
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20594 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-06 02:02:18 +00:00
Hugo Santos 8d00b95aa9 The Open Group base specification mentions that EINTR should be returned if the recv() is interrupted before _any data_ is available. So we actually check if there is data, and if so, push it to the user.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 23:26:39 +00:00
Hugo Santos d86f48f3f5 tiny TCP cleanups, move the read notifications to _NotifyReader().
- Also fixed the buffer size check in UDP's SendData() since UDP's length field includes the size of the header we need to check that as well. IPv4 is correct since we check for the size after prepending the header (due to it being possibly already included).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 22:42:45 +00:00
Hugo Santos a5d8483183 small cleanup, use get_node_at_offset().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20591 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 20:45:10 +00:00
Hugo Santos 4168e54af8 send buffer size is irrelevant for UDP, instead check if the fed buffer is larger than the maximum payload UDP supported. Do the same in IPV4.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 19:19:38 +00:00
Hugo Santos 9e084902c1 small cleanups in UDP
- don't set_to_empty_address, instead consider NULL to be the empty address and use is_empty_address().
 - most ipv4 address module calls already consider NULL to be the empty address, ipv4_hash_address_pair didn't, fixed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20589 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 18:57:15 +00:00
Hugo Santos c3e054c876 fixed an issue in UDP due to copying addresses to sockaddr, which may be too small for protocols other than IPv4. In fact, we don't need to copy the addresses at all, we can use the original address pointers in the hash key for lookup and hashing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20588 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 18:35:22 +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 a5e9026688 copy back the source address even when the data is truncated
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20586 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 17:56:09 +00:00
Hugo Santos daad608a3a Sigh, ignore previous commit, Open Group Specification is ambiguous. Now we properly support MSG_WAITALL.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20585 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 16:23:04 +00:00
Hugo Santos 8927167d28 support MSG_WAITALL in TCP
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20584 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 16:16:51 +00:00
Hugo Santos 485a82e613 as per the Open Group Specification, MSG_TRUNC should be set in flags whenever the packet is truncated
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20583 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 16:09:06 +00:00
Hugo Santos abe1ec18ac properly support MSG_TRUNC. we don't even have to trim the buffer, just try to fill the user buffers as much as possible
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20582 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 16:05:07 +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
Axel Dörfler d1fca1ccb8 Translate print the output formats twice instead of the input formats.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20580 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 14:26:06 +00:00
Axel Dörfler df004988d8 ioExtension can of course be NULL...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20579 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 13:33:07 +00:00
Axel Dörfler 0663933acc Now also exports the JPEG thumbnails as images using the translator service :-)
Note, this did not work with an older libtranslation.so from Haiku, so it might
also not work correctly on BeOS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20578 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 13:31:17 +00:00
Axel Dörfler 580d7b0441 No longer let translators overwrite the ioExtension message when they aren't
the chosen one.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 13:29:55 +00:00
Axel Dörfler ce694927b7 The TIFF translator overwrote the document count before it was clear that it could
handle the image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20576 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 13:17:55 +00:00
Axel Dörfler 9468eca38a * Implemented support for the "header only" extension.
* Added missing header when compiling RAWTranslator in test mode for Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20575 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 12:15:56 +00:00
Axel Dörfler 09c3a92d0a Now handles two cases of incorrectly built trees gracefully (instead of crashing).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 11:44:35 +00:00
Axel Dörfler b754aa3dbd RemoveItems() implementation was missing; more or less copied the one from BListView
(which is slow, but works).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20573 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 11:16:43 +00:00
Hugo Santos f2893088ba fixed another TCP issue: if we were in TIME_WAIT and we received a retransmission or delayed ack, TCP would wrongly bindly immediatly acknowledge.
* Moved TIME_WAIT and CLOSED handling to common Receive() path that does Sequence checking and further tests.
 * Moved setting FLAG_NO_RECEIVE to the end of Receive() when FIN is set so we can check for NO_RECEIVE before processing the segment text just after processing FIN.
 * Added a new action DELETE to be used when in TIME_WAIT and we receive a good RST


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20572 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 06:56:58 +00:00
Hugo Santos 2cff90bf94 fixed a critical issue with TCP's FIN handling: if FIN was set on a packet with data, fReceiveNext would be rewritten with the queue's LastSeuence which would be effectively the required sequence - 1. Increment instead fReceiveNext with the buffer's size.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20571 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 04:24:29 +00:00
Hugo Santos df247f1480 added select() support to packet capturing
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20570 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 04:24:21 +00:00
Hugo Santos fcd6d8cd92 keep PUSH'ed pointer in receiver side of TCP so we can wait for more data in recv()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20569 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-05 00:21:22 +00:00
Ingo Weinhold 8338b05a30 More FS interface documentation. All FS hooks required for writing a basic
read-only FS are documented, now. Be encouraged to review and add more. :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 23:46:05 +00:00
Hugo Santos 8c43814982 fix locking in TCP's ReadData()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20567 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 21:22:48 +00:00
Jérôme Duval 9e7de14057 added the usual weak symbols to fix bug #1134
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20566 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 20:56:57 +00:00
Hugo Santos c96b101d4d net_socket: make recvfrom() use recvmsg() and sendto() use sendmsg() for code reusal
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20565 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 19:42:53 +00:00
Hugo Santos babe239b7a copy back msg_flags after recvmsg() (we don't really use it yet though)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20564 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 19:42:33 +00:00
Hugo Santos 7245533300 some fixes to recvmsg() and sendmsg()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20563 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 19:17:04 +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
Axel Dörfler 0cac8bd145 Forgot to set IFM_ETHER in all drivers; "ethernet" now also sets it just in case.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20561 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 17:04:54 +00:00
Hugo Santos b7c0eba571 we want the argument's contents, don't use the size of the pointer (this would even be 8 bytes in a 64 bits platform).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20560 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 15:59:13 +00:00
Hugo Santos 183071cab3 ipro1000 knows when its link state changes (notified by interrupt). Use ETHER_SET_LINK_STATE_SEM to wake the ethernet device link state notifier sooner.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20559 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 15:54:50 +00:00
Hugo Santos 8df968341a tiny case but T/TX is copper, SX is fiber
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20558 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 15:36:10 +00:00
Axel Dörfler bf256341b9 Only print the media state in case we're linked.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20557 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 14:20:32 +00:00
Axel Dörfler eb70c5dd3b * Set default media type to IFM_ETHER.
* Added ETHER_INIT back in; we even have a driver in our repository that uses it,
  thanks to Michael for pointing that out.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20556 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 13:42:45 +00:00
Axel Dörfler 6d60dde7cd Added support for printing the media type.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20555 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 13:32:18 +00:00
Hugo Santos f03d121241 handle all cases of SIOCSIFFLAGS in the same place
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20554 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 12:53:27 +00:00
Hugo Santos ca2aa96377 don't overwrite the flags we set when the interface goes up or down, instead just update the flags in the same place.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20553 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 12:51:23 +00:00
Hugo Santos e65e15292c set IFM_ACTIVE if ipro1000 has link and output media changes on update_link_state()
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20552 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-04-04 12:51:09 +00:00