Commit Graph

8446 Commits

Author SHA1 Message Date
Axel Dörfler
001d7548ab * Style cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38430 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-29 21:25:12 +00:00
Axel Dörfler
977f0426ee * Fixed CID 1508: a corrupted rockridge entry could cause a kernel panic.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38429 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-29 21:12:35 +00:00
Axel Dörfler
1216557e1b * iso9660_volume::volSetIDString[] should have been 129 bytes in size, not 29.
This fixes (a harmless) out of bounds array access, and CID 1359.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-28 17:03:47 +00:00
Axel Dörfler
d2a6c05145 * Removed superfluous check, and fixed wrong indentation. This also closes
CID 1510.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38422 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-28 16:55:57 +00:00
Axel Dörfler
6195b696db * Added missing destructor; fString was leaked. This fixes CIDs 1411-1413.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38421 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-28 16:50:26 +00:00
Axel Dörfler
44260788fe * Fixed CID 1650: the "raw" buffer could be leaked.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38420 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-28 16:46:18 +00:00
Axel Dörfler
8d797bda1d * Fixed CIDs 1503 & 2054: dereferenced {record|playback}_stream which could be
NULL.
* Fixed an operator precedence bug (&), and added the (() != 0) everywhere.
* Minor cleanup.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38417 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-28 14:52:22 +00:00
Axel Dörfler
be136723e7 * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-28 14:35:48 +00:00
Axel Dörfler
da0d740954 * Fixed broken UDP for non device bound sockets.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38415 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-28 10:41:57 +00:00
Adrien Destugues
355a38a098 Fix gcc4 build as well as logic error : the driver needlessly scanned some devices.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-28 09:35:15 +00:00
Adrien Destugues
18900042ce * Use defines for the SCSI commands instead of the numeric opcode directly
* Colorize the trace output for easier syslog reading
 * Add usb_floppy to the default image
 * disable error tracing


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38411 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-28 08:57:29 +00:00
Adrien Destugues
68f54d50f2 Better error handling : do not enter an endless loop in cases of errors, but report them to the caller.
Note this leads to KDL if there is a write error, so it may not be the best way for a floppy...

This allows the driver to uninitialize properly when all devices are unplugged, which in turns permits updating the driver without rebooting to unload it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38410 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 22:02:24 +00:00
Axel Dörfler
46af4e7787 * Fixed CID 566 that was duplicated in blue_screen.cpp as well (but was not
discovered by Coverity for some reason): commands without arguments would
  overwrite memory (in this case the sConsole::arg_count only, though).
* Travis's copyright was missing in blue_screen.cpp.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38409 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 21:36:07 +00:00
Axel Dörfler
882d595fc0 * If an unknown type is encountered, return immediately. This fixes CID 1504.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38408 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 21:10:14 +00:00
Adrien Destugues
0a240bcefe Replace icon for the usb_floppy devices.
The floppy icon is based on zumi's one. changes done :
 * I made the floppy a bit thinner, it looked more like a zip100 cartridge
 * I added an USB logo (or something that more or less looks like one) on the floppy label
 * The logo only shows at big icon sizes since I couldn't get it looking good at small ones.

Feel free to improve.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38407 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 21:00:17 +00:00
Adrien Destugues
a046d61f81 * Write operation data direction is obviously host-to-device
* Write operation will always return an error, one needs to send request sense until the write is actually done.
This gets floppy writing working.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38406 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 20:17:12 +00:00
Adrien Destugues
027fabed60 Use block read and block write instead of regular read and write commands. Mounting the device read-only now works. Writing
is still not working.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 17:54:04 +00:00
Adrien Destugues
87bfae8987 A floppy drive is a slow device, so we have to try many times before getting a result.
This gets read capaity working, the device shows up in drivesetup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38404 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 17:33:54 +00:00
Stephan Aßmus
e9a09f6670 * Enabled the mp2/mp3 decoder in the ffmpeg plug-in (CodecTable.h).
* Removed the mp3_reader and mp3_decoder from the image and from
   the source tree even. The mpeg123lib based decoder was crashy,
   since the lib didn't cope with bad input data too well, whatever
   the reason, but bad input can also be a specially crafted file.
   I didn't see the value in keeping two decoders around that use
   a third party library as backend. While reading in the mp3_decoder
   code, I even saw that it used global variables in the mpeg123 lib
   to figure out framerate and channel count, after decoding a bit of
   input. Obviously this has concurrency issues.
 * Removed the mp4_reader from the image. It is native code, and should
   perhaps be preferred over imported code, but I don't have the
   resources to look into it, and David doesn't seem to have the time
   either. There are basically three types of problems with the
   native mp4 reader: 1) It is way too CPU intensive. I have many HD
   files that don't play at all, since there is not enough time left
   for actual decoding. 2) Seeking leaves a lot of visual artifacts
   (with the very same decoder plug-in), since there seems something
   wrong either with finding true keyframes, or with flushing buffers
   correctly. And 3) very often audio stops working at all after
   seeking. Sometimes a keyframe is returned for audio which is very
   far away from the wanted frame, which currently triggers bad
   behavior in the audio producer node in MediaPlayer and can even
   crash the media_addon_server. With the ffmpeg based mp4 reader,
   none of these problems exist: Seeking is perfect, no artifacts,
   CPU load is low enough for pretty much all HD clips I tested with,
   and audio always works and is always in perfect sync with the video
   after seeking.

If there are regressions after this commit at all (I tested a lot of
files), then I anticipate only that the ffmpeg plugin does not advertise
support for files it could actually handle (i.e. easily fixable). In
those cases hopefully a test stream can be made available. If the
native mp4 reader is improved to the point that it works as well as
the ffmpeg mp4 demuxer, we can easily switch it back, but for now, users
will prefer reliable playback.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38403 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 17:16:00 +00:00
Adrien Destugues
779ccf5c6d * Properly initialize the drive before attempting to access it
* Ask the drive for its status after each command we send, or else it locks up
THis get us as far as trying to read the drive capacity, but this still fails for some reason.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38402 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 17:00:57 +00:00
Stephan Aßmus
22ce5d9517 * Optionally separate tracing output for FindKeyFrame().
* Output more information in AVFormatReader::StreamCookie::Open(),
   AVInputFormat flags for example.
 * Added CODEC_ID_AAC handling when codecTag is 0. Adds support
   for AAC in Matroska containers when the ffmpeg plugin is enabled
   to handle those.
 * Added some rounding to frame<->time conversions.
 * AVFormatReader::StreamCookie::Seek() forgot to pass the seek
   flags to av_seek_frame().
 * The most important fix is this, though: There are formats which
   build the keyframe index on the fly, while parsing the stream!!
   These means we can only seek to real keyframes for parts of the
   stream that has already been decoded. Handle this situation by
   assuming we can seek to the requested frame/time. This change
   fixes the use of the AVFormatReader as MP3 reader.
 * Anothe important fix is to ignore the nb_frames member of the
   stream for the total frame count. This makes MP4 movies
   also work perfectly now when the AVFormatReader is used for them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38401 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 13:29:52 +00:00
Stephan Aßmus
d5479a3bd0 * Use the new avcodec_decode_audio3() call, avcodec_decode_audio2()
gives the deprecated warning... We need to cache an AVPacket for this.
 * Check the allocation of fOutputBuffer.
 * When seeking, we need to flush the already decoded stuff
   in fOutputBuffer, and throw away the last chunk buffer as well.
 * Handle an incomplete input format at least to the point of not
   crashing with a divide error (mp3_reader would give us such an
   incomplete format for example).
 * _DecodeAudio():
   - Fixed some edge cases in the audio decoding loop: avcodec_decode_audio3()
     can return a 0 length, which means no error, but no decoded frames
     either. ffplay throws away the chunk in this case, do the same.
  - Convert some invalid situations that were printf()s into debugger()s.
  - Add much more comments to explain how everything works.
 * Fixed the occasional coding style issue.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38400 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 13:21:03 +00:00
Adrien Destugues
156a187d0d * Fix test unit ready command (the device still stall, no idea why).
* Move the interrupt stuff inside the device structure
 * Some cleanup, added some more tracing fordebug purposes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 12:40:05 +00:00
Axel Dörfler
bbbb5592e4 * UDP now respects the net_socket::bound_to_device field when propagating data
to endpoints. This should help with the final issues of bug #6454.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 11:05:13 +00:00
Axel Dörfler
c993531c60 * Fixed GCC4 only error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38396 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 10:57:03 +00:00
Axel Dörfler
89bf19ccde * Made an uint32 out of net_socket::bound_to_device.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38395 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 10:56:41 +00:00
Axel Dörfler
cf064cc7b5 * Set the new net_buffer::index field on retrieval of a buffer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38394 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 10:55:48 +00:00
Axel Dörfler
870fd4b77b * Removed radix.c from the build, as it's not currently used.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38393 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 10:54:58 +00:00
Axel Dörfler
8402e1f46d * Now sets the net_buffer::index field before forwarding a buffer to the next
layer.
* Converted the hash used to the BOpenHashTable instead of khash.
* Fixed remaining GCC4 warnings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38391 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 10:51:39 +00:00
Stephan Aßmus
ff1679bee8 * Improved some comments.
* When writing encoded audio, we were leaking one
   temporary buffer per chunk.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38388 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 10:32:18 +00:00
Axel Dörfler
1e4feb533e * Added some optional debug output.
* Check for errors using != instead of < - the functions are not supposed to
  return anything above B_OK.
* Use the stack-wide ENABLE_DEBUGGER_COMMANDS instead of our own local solution.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38386 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-27 07:32:41 +00:00
Adrien Destugues
bbdb55154d Work In Progress (do not try yet!) driver for usb floppy drive.
This is loosely based on usb_disk, but uses a different protocol for sending the commands.
Refactoring is unfinished, so don't look at the style too muh, it will e fixed and cleaned up later.

Basic communication with the drive works (sending commands). Command themselves still mostly untested.
Command Blocks sent to the drive are most likely wrong and may erase your floppies or do any other weird things!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38379 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-26 20:28:54 +00:00
Axel Dörfler
93e784a576 * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38377 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-26 14:32:14 +00:00
Adrien Destugues
c1b432af8e Fix build with tracing enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-26 12:43:44 +00:00
Axel Dörfler
f16be37f87 * Fixed strange/wrong indentation.
* Made sure the 80 character per line limit is honoured.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-26 12:36:52 +00:00
Axel Dörfler
9d4331902c * Now we should also support link layer and INADDR_BROADCAST broadcasts again
correctly.
* This should finally fix ticket #6454, but I keep it open until it's confirmed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38365 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-26 09:23:49 +00:00
Adrien Destugues
a8a33a98ff Intel_extreme now centers the screen when one select a resolution smaller than the ne of the LVDS panel.
Also clean up the style and add some more TODOs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38363 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-26 09:13:41 +00:00
Clemens Zeidler
ccaae539b4 Call the correct method to minimize/activate a window. Previously the BWindow got out of sync and activation of a window haven't worked probably.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38359 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-25 21:22:26 +00:00
Axel Dörfler
4c6e53f601 * IPv4 must always set the net_buffer::interface_address on incoming buffers; it
didn't do that for broadcasts - this is still not a full solution as it won't
  work for link layer broadcasts, but this should fix most DHCP problems.
* IPv4 multicast doesn't do that yet.
* Only send ICMP errors if it hasn't been a link layer broadcast.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38356 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-25 15:54:35 +00:00
Axel Dörfler
cb99c9153b * The KDL command "udp_endpoints" did not work anymore, since
DatagramSocket::AvailableData() locks; introduced a UdpEndpoint::Dump() method
  to work around that.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38355 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-25 15:51:43 +00:00
Adrien Destugues
124a502a7a Always set the LVDS panel to its native mode, except for the 'display' part.
This allows to use lower resolution screen modes with black border.

Added a set of TODOs :
 * The smaller scren is not centered, but aligned top-left
 * The base resolution used is the one reported from edid 1.1, because I'm still not sure how to parse EDID 1.2. This resolution is too small on my laptop, but it works.

Also added two ways of setting 8-to-6 dithering for 18-bit LVDS panel. No visible result for me, unfortunately.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38354 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-25 15:06:49 +00:00
Axel Dörfler
d401ca7b98 * Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38350 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-25 10:04:01 +00:00
Adrien Destugues
0405fd3b15 Set the color depth for head B. This allows using 8,15, and 16-bit modes on lvds panels.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38349 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-25 09:46:48 +00:00
Andreas Färber
424f57123c pci: Fix memory leaks in uninorth (ppc)
The future cookie was leaked in three of four error scenarios.

Backported from grackle.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38345 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-24 22:58:08 +00:00
Andreas Färber
6ed10d93ed pci: Implement probing and config r/w for grackle
Based on Motorola MPC106 User Manual and NetBSD's
src/sys/arch/macppc/pci/grackle.c 1.11. The MPC106 apparently deviates by
requiring the E (enable) bit set to 1 for config read/write to work.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38344 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-24 22:48:51 +00:00
Stephan Aßmus
303ecf89ec There was some bogus code in the Seek and FindKeyframe methods:
First B_MEDIA_SEEK_TO_FRAME was handled to compute a time, then
it was ignored and frame was used as time stamp. Also the
conversion from frame to time had the num and den members of
the time base swapped in the computation, so it computed
bogus time stamps. Refactored the conversion methods, always
seek based on the time. Needs more testing (perhaps there are rounding
issues), but overriding a lot of native reader implementations with
AVFormatReader holds up very well now with a lot of files I tested.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38332 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-24 13:57:40 +00:00
Adrien Destugues
0767bd3a8b Use the EDID info from LVDS panels :
* Read the EDID info on both port A (analog VGA monitor) and C (LVDS panel)
 * If an LVDS panel is detected, report the EDID resolutions instead of the BIOs settings

This fixes #6326, likely #5096, and possibly some others intel_extreme problems. Please test.
On the other hand, this make the screen preflet show the full list of more reported by the LVDS panel. As we don't support 
scaling, some of these modes are unuseable and lead to a garbled screen.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38329 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-24 11:06:50 +00:00
Jérôme Duval
b2c38f748a Fixed #5839: Return ENOENT in case ntfs_attr_open() returns NULL.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38324 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-23 19:59:39 +00:00
Andreas Färber
b5bc8fc8ab pci: Add stub support for grackle (ppc)
A grackle-compatible Motorola MPC106 PCI controller can be found in the
PowerMac G3 (ticket #6247). For now just let the user know.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38323 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-23 19:11:46 +00:00
Clemens Zeidler
1da17f129a Clean up.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38314 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-23 06:39:47 +00:00
Clemens Zeidler
7d69f43e9f - Update the size constraints when a window has been resized.
- Remove superflouse and wrong SetRange.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38313 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-23 06:27:08 +00:00
Andreas Färber
58782ca147 pci: Fix line endings of ppc code
No functional changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38295 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-21 14:47:38 +00:00
Ingo Weinhold
8e192dad09 Fixed build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38290 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-20 20:42:33 +00:00
Fredrik Holmqvist
d7b1a83fc3 Add get_current_resources call to ACPI module which allows us to read out a device current resources.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38288 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-20 19:23:33 +00:00
Clemens Zeidler
668e181957 Move constraint solving to the rest of the constraint stuff. Only adjust windows if specifications are feasible.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38285 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-20 02:21:34 +00:00
Oliver Tappe
258b762aef * fix a warning in the wonderbrush translator which I think indicates an actual
problem (since + binds stronger than >>)
Stephan: please review, esp since I don't know how to test this!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38279 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-19 19:40:15 +00:00
Oliver Tappe
36947c7bf0 * style adjustments - no functional change
Stephan: please yell if you dislike the formatting of the large expressions now

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38278 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-19 19:33:54 +00:00
Oliver Tappe
269ebc04b9 Fix #6373, second try
* make BDADDR_* macros refer to value types instead of addresses
* adjust all interfaces using bdaddr_t* to use (mostly const) refs instead,
  which IMHO makes the interface & code clearer
* that got rid of a couple of const incorrectness casts
* some cleanup along the way


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38265 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-19 15:29:02 +00:00
Oliver Tappe
32a2294fdc * revert r38213, as it introduces initialization problems
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38263 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-19 14:40:17 +00:00
Andreas Färber
04e09d1be8 shortcut_catcher: Suppress #pragma export
Fix some more #pragma export warnings treated as errors on ppc.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38258 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-19 00:24:09 +00:00
Clemens Zeidler
de8a0836ac Fix coding style.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 23:48:47 +00:00
Oliver Tappe
e0ef64750f * fix #6373 by switching the BD... macros to take the address of corresponding
constants, which had to be defined in several places in order to be available
  in the kernel addons, network protocols and the server/kit.
* enable -Werror for all servers

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38213 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 21:46:32 +00:00
Axel Dörfler
0f274fd5b2 * Calmed down CID 1976; the problematic situation should not be able to occur,
but I've changed it anyway to make the code clearer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38206 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 18:22:17 +00:00
Axel Dörfler
ed64d4e0f5 * Fixed CID 1511: protocol could be NULL.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38193 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 15:34:24 +00:00
Axel Dörfler
579e19f5b9 * Fixed CID 1703: buffer could be leaked. Thanks to Stefano for the note.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38191 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 15:21:39 +00:00
Adrien Destugues
f7502de1bb Look for catkeys files with .catkeys extension instead of .txt, since that's what everyone uses.
It makes it easier and less confusing to test catalogs without linking them.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38183 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 13:49:52 +00:00
Axel Dörfler
3f7e748f91 * Made the code a bit more robust against faulty use.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38181 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 11:45:56 +00:00
Axel Dörfler
ed18d7cf71 * Initialized the domain_datalink's first_{protocol|info} members. This fixes
the crashing bug reported by Atis when trying to add an interface which fails
  (the bug causing this has already been fixed with the previous commit).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38180 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 11:45:26 +00:00
Axel Dörfler
75b83073c2 * Getting an address leaked a reference. This fixes that interfaces could not
really be deleted (a reference of them was kept in memory).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38179 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 11:43:22 +00:00
Axel Dörfler
7e046eab3b * UDP really wanted to make sure that the error buffer was freed, and just did
it once more. This should be the final nail on bug #6446.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38178 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 09:51:22 +00:00
Clemens Zeidler
19f43b9f6a SATDecorator implements event handling and handles the stacking api requests.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38170 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-17 06:41:35 +00:00
Axel Dörfler
3f2a18bd30 * The UDP protocol was deleting a received error buffer twice in the case that
everything went okay. This finally fixes #6446.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38145 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-16 15:01:26 +00:00
Andreas Färber
0d6a8357f4 Generic: Type fixes for atomic op
Cast uint32* arguments for atomic_or() to int32*.

Resolves warnings treated as errors for Big Endian targets.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38128 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-15 22:38:41 +00:00
Andreas Färber
994f861dfc Generic: Type fixes for byte swapping
Cast further pointer arguments for B_HOST_TO_LENDIAN_INT32 to uint32.

Resolves warnings treated as errors for Big Endian targets.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38127 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-15 22:32:58 +00:00
Axel Dörfler
df2895e0f8 * Automatic whitespace cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-15 13:24:41 +00:00
Axel Dörfler
44a3d0d1f6 * Spotted a few reference counting bugs that were probably responsible for
#6446, although I could not reproduce the exact problem.
* net_datalink::is_local_[link_]address() now releases a previous reference if
  the _interfaceAddress arguments does not point to NULL.
* When a buffer is received from a device, it's interface_address should be NULL
  already.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38118 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-15 13:21:42 +00:00
Axel Dörfler
11eccb54e2 * Added ability to be able to dump a net_interface by name.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38117 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-15 13:17:52 +00:00
Andreas Färber
be95e26df8 ATA: Type fix for byte swapping
Cast pointer arguments for B_HOST_TO_LENDIAN_INT32 to uint32.

Resolves warnings treated as errors for Big Endian targets.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38114 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-15 11:57:24 +00:00
Axel Dörfler
a89dbefb7d * On change_address(), arp_remove_local_enty() must not switch to the address
that caused the change (but that has not actually been changed yet).
* Also, it will now reset the INADDR_ANY local address in case there is no
  other address configured. This should help with automatic configuring after
  deletion of an interface address (though it doesn't seem to work yet for
  some other reason, at least in VMware).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38110 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-15 10:39:39 +00:00
Andreas Färber
756ea297c2 Firewire: Type fix for byte swapping
Cast return value of __swap_int32 to uint32_t, as suggested by Ingo.

Remedies uint32 %08x warnings treated as errors in the Big Endian code path.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38106 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-15 09:37:20 +00:00
Axel Dörfler
75148e0193 * Applied patch by Janito that fixes broken reverting when a rename operation
failed on last chance. Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38103 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-14 18:41:52 +00:00
Stefano Ceccherini
cdb58cbb69 Fix a possible NULL dereference. CID 1582
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38102 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-14 17:34:02 +00:00
Adrien Destugues
c3d88d5160 Fix clang build. modf is not good for optimizations it seems
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38092 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-13 19:45:54 +00:00
Axel Dörfler
8dcde8b128 * B_SOCKET_SET_ALIAS handling was leaking references.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38079 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-13 10:27:00 +00:00
Axel Dörfler
7e5d6acf69 * Added rlphy MII driver back to the rtl81xx driver - originally, I intended to
change the current MII management, but I ran out of time.
* This should fix bug #6295.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38078 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-13 09:10:53 +00:00
Axel Dörfler
8ccc01cf2d * Improved the output of the "net_domains" KDL command.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38077 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-13 08:02:40 +00:00
Clemens Zeidler
756e5df62f Fix gcc2 build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38076 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-13 04:06:58 +00:00
Clemens Zeidler
bc7f766f5d Use new listener interface.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38073 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 23:06:11 +00:00
Clemens Zeidler
b960e45194 Add the SATDecorator. This is a new implementation of Stack and Tile with a different tiling logic. For example, this should make overlapping windows in the same tiling group impossible. There are still many issues I know about and this version is far from usable but the basic features are working now. So if you like to test it at this state please only report errors like crashes or memory leaks (think there is one).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38071 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 22:37:16 +00:00
Axel Dörfler
095f97a6b6 * Fixed memory leaks pointed out by Stephan, thanks!
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38068 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 21:20:31 +00:00
Adrien Destugues
77fa0021d9 Enable the "interpolate" resampling method. Results are not as good as I expected, however.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38066 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 17:12:00 +00:00
Alex Wilson
25fd5c7b35 Update some apps/add-ons/preflets for impending changes to the layout API, specifically the layout builders. Also do a bit of style and layout cleanup in some places. This is part of #6407. Everything I've updated should look and function the same as it did before.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38064 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 16:54:03 +00:00
Axel Dörfler
2c12b8a334 * Also report the address index back to the userland.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38059 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 13:45:18 +00:00
Axel Dörfler
14d0b44b79 * Applied the B_SOCKET_SET_ALIAS address retrieval logic to B_SOCKET_GET_ALIAS
as well (of course, no address is created automatically here).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38058 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 13:38:52 +00:00
Axel Dörfler
a271028e37 * Also create a new address for B_SOCKET_SET_ALIAS if the index is -1 - this
now has an almost equivalent logic to the old setters like SIOCSIFADDR.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38054 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 13:27:50 +00:00
Axel Dörfler
910ffb32fe * If the network mask, and broadcast are not specified with a B_SOCKET_SET_ALIAS
they will no longer be unset - instead they are set with defaults.
* If B_SOCKET_SET_ALIAS gets an index of -1, it will now try to find the local
  address, and if that fails, will just use the first address there is.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38053 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 13:25:45 +00:00
Adrien Destugues
de6ba1a073 CID 1393: Memory leak.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38051 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 13:16:40 +00:00
Adrien Destugues
e0bc2fcce4 CID 903 : Memory leak on error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38048 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 12:39:39 +00:00
Adrien Destugues
eaf26d03ba CID 912: Memory leak on error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38046 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 12:31:27 +00:00
Adrien Destugues
99002a3991 CID 691 : parameter not used in fprintf, but still evaluated, leading to acces out of bounds of array.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38044 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 12:09:05 +00:00
Adrien Destugues
b9eef2a018 CID 704 : Off-by-one error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38043 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 11:59:51 +00:00
Adrien Destugues
ff617a11dd * Add a resampler that interpolates instead of dropping/copying samples.
* Not plugged anywhere yet.
 * I'm not sure the downsampling is done properly, either.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38037 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 10:18:38 +00:00
Axel Dörfler
3794b8e560 * Applied Atis latest changes to the IPv6 related modules. This brings them back
into a working state after the latest stack changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38021 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-11 12:44:38 +00:00
Axel Dörfler
e8802e499c * datalink_control() also need to accept structures smaller than ifreq as long
as the interface name can be specified.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38015 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-11 11:41:54 +00:00
Axel Dörfler
28bbeaca96 * Removed the call to net_stack_module::register_domain_device_handler(), as
it's not needed for locally received buffers. This fixes a doubled
  initialization for a single device when there is more than a single domain
  involved. Reported by Atis.
* Fixed missing call to unregister_device_deframer() in case there was not
  enough memory to allocate the loopback_frame_protocol object.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38002 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-10 10:46:27 +00:00
Axel Dörfler
1ebd87f4e7 * As Atis pointed out, the SIOCSIFNETMASK here didn't make any sense, must have
been a copy&paste error.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38001 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-10 10:31:22 +00:00
Axel Dörfler
3a5082aa46 * Got rid of the home brewn double click detection - we're now simply using the
"clicks" field of the mouse message as everywhere else.
* Renamed Decorator::Clicked() to MouseAction().
* Minor style cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37996 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-10 09:14:46 +00:00
Axel Dörfler
4af124a15a * We need to acquire references to the interface_address when copying/cloning
the buffer, and we also need to release it when freeing it.
* Adapted patch by Atis: append_cloned_data() now preserves the stored header;
  this is kind of bad, because it will not notice if the original header is
  removed, but this could probably just be documented this way.
* Also print the reference count of the interface addresses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37993 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-09 19:03:39 +00:00
Axel Dörfler
c8b53acf35 * Also initialize the arp_protocol::local_address field, spotted by Atis,
thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37991 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-09 17:53:42 +00:00
Axel Dörfler
78abd72799 * Made the work-around that Atis added to ifconfig and the net_server
in order to be able to use SIOCSIFADDR (and friends) on a net yet added
  family superfluous; we now add a new address when needed on the fly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-09 17:08:41 +00:00
Stefano Ceccherini
e36d4dad06 Cast error to status_t when throwing, otherwise it won't be caught.
CID 1962


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37969 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-08 11:33:15 +00:00
Jérôme Duval
db6f1135a6 CID 1418: fInputByteSwap was leaked.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37964 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-08 00:00:54 +00:00
Jérôme Duval
5e819d74dd CID 1464: Delete an array with delete[]
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37963 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-07 23:49:49 +00:00
Jérôme Duval
3d8f229273 CID 1390: buf was leaked in case of error.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37962 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-07 23:30:35 +00:00
François Revol
abfa93e2e6 Fix warnings & build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37948 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-07 00:32:31 +00:00
Axel Dörfler
1f9c8c4576 * Changed the _SIZEOF_ADDR_IFREQ() macro such that it can be used how we are
using it - hopefully, that is actually correct (it's adopted from FreeBSD).
* Fixed bug that cut off the sockaddr_dl reported by the system, so that DHCP
  wouldn't work anymore (and ifconfig wouldn't show the actual MAC address
  anymore).
* Changed the listing code to actually pad to ifreq size, and leave the length
  of the sockaddr untouched.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37941 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-06 12:58:02 +00:00
Axel Dörfler
8b6048a285 * The sockaddr_dl can actually be longer than sockaddr, so we need to use a
sockaddr_storage here (wasn't that bad before, as ifreq has a 30 bytes buffer
  after the sockaddr.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37940 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-06 12:55:51 +00:00
Axel Dörfler
081dd39e94 * Further improved debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37938 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-06 11:13:00 +00:00
Axel Dörfler
b0cf274a3f * Interface::_ChangeAddress() got the address check for equality wrong,
effectively rejecting any try to set an address.
* It now copies the new address as well in order to make sure that its
  sa_len field is set correctly.
* Improved debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37937 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-06 09:59:55 +00:00
Axel Dörfler
6b1e148824 * Only actually call change_address() of the net_datalink_protocols if the
address actually changed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37928 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-05 13:27:31 +00:00
Axel Dörfler
715fed4479 * Make sure the SIOCGIFCONF never returns an address with an address length
smaller than sizeof(sockaddr). This fixes a compatibility issue with other
  platforms - portable software often assumes that the amount of bytes to
  add to an ifreq structure is the larger amount between sizeof(ifreq), and
  basically what the _SIZEOF_ADDR_IFREQ() macro returns, instead of always
  relying on that macro.
* Renamed UserBuffer::Copy() to Push, ConsumedAmount() to BytesConsumed(),
  added Pad() method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37927 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-05 13:17:12 +00:00
Axel Dörfler
cb51fb9e4d * Turns out it wasn't such a bright idea to reset the protocol in
arp_update_entry() for known entries, as it also uses that to update the
  timestamp.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-05 11:09:17 +00:00
Axel Dörfler
07ad8bb60e * We need to call arp_remove_local_entry() from arp_change_address() even if the
old address is NULL for anything but SIOCAIFADDR. Hopefully, this fixes the
  problem Rene is seeing.
* Make sure that arp_entry::protocol is not NULL before using it. This is
  necessary because of the possibility to manually set ARP entries.
* Further improved debug output.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37916 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-05 07:56:23 +00:00
François Revol
49101c576d Fix warnings and thus build. It's still unusable with QEMU for ex, which uses a different default colorspace.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37914 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-05 00:37:30 +00:00
Axel Dörfler
afbbc97abf * Improved debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-04 18:16:07 +00:00
Oliver Tappe
e0ea55e0a0 * added get_timezone_offset() to kernel, which returns the offset in seconds
* made FAT add-on use get_timezone_offset(), this time correctly adjusted for
  the difference in units (minutes/seconds)
This makes the times in our FAT-fs agree with Linux again, at least :-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37905 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-04 17:11:47 +00:00
Philippe Houdoin
cc8eceb0af Report the actual error when read() or write() a network device failed.
This enable to actually detect and handle device removal (USB...).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37897 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-04 11:11:56 +00:00
Axel Dörfler
2b4154458a * Finished groundwork on ICMP by introducing a completely protocol agnostic
error mechanism.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-04 10:35:40 +00:00
Axel Dörfler
dc660d32ef * Call put_domain_protocols() without having the socket locked. This fixes bug
#5210.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37895 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-04 08:42:25 +00:00
Oliver Tappe
7e965f506d More consolidation of timezone code:
* dropped DaylightSavingTime from real_time_clock code in kernel, it was
  never really being used for what it meant (and just being referred to by
  gettimeofday(), which put a different meaning to it
* adjusted the syscalls get_timezone() & set_timezone() as well as their callers 
  accordingly
* got rid of get_rtc_info() and rtc_info struct in kernel, as it was only
  being referred to by the FAT add-on and that one (like gettimeofday()) put a
  different meaning to tz_minuteswest. Added a comment to FAT's util.c
  showing a possible solution, should the hardcoded GMT timezone pose a problem.
* fixed declaration of gettimeofday() to match POSIX base specs, issue 7
* changed implementation of gettimeofday() to not bother trying to fill struct
  timezone - it was using wrong values before, anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37888 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 23:02:57 +00:00
Clemens Zeidler
f8751b1fe6 Fix coding style.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37887 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 20:33:05 +00:00
Axel Dörfler
7aa2819c12 * Enabled removing the interface on device removal again.
* Made the return type of remove_interface() void, as it cannot fail.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37884 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 19:33:05 +00:00
Axel Dörfler
2b1c0755dd * Renamed the proprietary SIOC_* ioctls to B_SOCKET_* - no reason to pollute
global name space, and have ugly identifiers for nothing :-)
* Added a flags field to struct ifaliasreq. Added flags to mark an alias that
  is currently being configured, or has been automatically configured.
  Those flags aren't used yet, but they will replace IFF_CONFIGURING and
  friends.
* Implemented deleting addresses only from interfaces via ifconfig.
* Added more command aliases for delete to ifconfig ("del", and "delete", for
  more consistency with route).
* Fixed control_routes() to only release a reference to an address if it
  actually got one before.
* If an interface address is deleted, its routes are now removed as well.
* InterfaceAddress now holds a reference to its interface as planned.
* Implemented removing interfaces. Works quite nicely.
* When downing an interface, all of its routes are now removed. When upping
  it again, at least the default routes are added.
* datalink.cpp's get_interface_name_or_index() leaked a reference to the
  interface found.
* SIOCAIFADDR would also leak a reference when new addresses were added.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37872 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 15:51:54 +00:00
Axel Dörfler
2651e51d92 * Renamed net_datalink_module::send_data() to send_routed_data(), and
send_datagram() to send_data().
* Renamed DatagramSocket::SocketEnqueue() to EnqueueClone(), SocketDequeue()
  to Dequeue().
* Ordered the methods in ProtocolUtilities.h according to their declaration.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37870 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 12:00:06 +00:00
Axel Dörfler
03e02ed983 * Introduced a datalink layer (2) independent way of specifying the packet
type one wants to receive. Changed ipv6_datagram to use that (but note that
  it currently does not compile).
* Header cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37868 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 11:23:03 +00:00
Adrien Destugues
4d978eea2f * Fix the WinDecorator and some parts of the MacDecorator
* Since they all work reasonalbly well, add them to the default image. (beOs had them after all)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37864 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 10:32:19 +00:00
Clemens Zeidler
b9857cc356 Adapt MacDecorator to the new addon interface.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37859 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 04:46:21 +00:00
Clemens Zeidler
1649544d81 Adapted the ClassicBe decorator to the new DecorAddOn interface.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37858 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-03 04:38:38 +00:00
Clemens Zeidler
4d1aa4a619 Some coding style fixes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37854 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 23:16:19 +00:00
Axel Dörfler
cd08b9f7bc * Work in progress of extending the AF_LINK protocol to be able to send and
receive raw packets (only without the ethernet framing).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37853 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 21:21:16 +00:00
Axel Dörfler
67678a989e * put_device_interface() now also accepts a NULL pointer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37852 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 21:17:33 +00:00
Axel Dörfler
edf1018372 * Removed a superfluous check.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37851 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 21:16:02 +00:00
Axel Dörfler
ca215dfe68 * Replaced more occurences of EOPNOTSUPP with B_NOT_SUPPORTED.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37847 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 16:27:44 +00:00
Axel Dörfler
fee56868a1 * Added a dedicated lock for the device monitors. This fixes a locking issue in
interface_protocol_send_data() which accessed the monitors unlocked.
* Changed SIOCCPACKETCAP to check if the device name matches the one used with
  SIOCSPACKETCAP.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37845 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 15:23:19 +00:00
Axel Dörfler
41f05b8607 * Made datalink and interface protocol module functions static.
* Got rid of datalink.h.
* Only allow sending/receiving of packets through AF_LINK for root (not that
  sending would be implemented yet).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37844 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 14:45:44 +00:00
Axel Dörfler
cb8adf5ed2 * Only allow raw sockets for root.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37843 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 14:18:26 +00:00
Axel Dörfler
845a29a054 * B_SELECT_{READ|WRITE|ERROR} are no flags fields, so they cannot be or'ed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37834 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-02 08:28:47 +00:00
Axel Dörfler
791fe8ec0f * Added new socket ioctls to strace, and the datalink debug output.
* Added a few more types to strace's network ioctls.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37807 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-29 09:54:46 +00:00
Axel Dörfler
9d771afb39 * Added Haiku specific socket ioctls to configure the interface aliases:
SIOC_IF_ALIAS_ADD, SIOC_IF_ALIAS_REMOVE, SIOC_IF_ALIAS_GET, SIOC_ALIAS_SET,
  and SIOC_IF_ALIAS_COUNT.
* Implemented all of those new ioctls, though they are yet untested.
* Added ifreq::ifr_data, and removed the hack in the FreeBSD compat if.h
  header.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37806 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-29 09:43:08 +00:00
Axel Dörfler
5b2bb28ea1 * Fixed typo that broke the build.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37805 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-29 09:38:07 +00:00