Commit Graph

127 Commits

Author SHA1 Message Date
Sebastian Huber
3cffd66d76 libio: Add rtems_libio_iop_is_writeable()
Update #3132.
2017-09-15 10:27:12 +02:00
Sebastian Huber
a937a5a534 libio: Add rtems_libio_iop_is_readable()
Update #3132.
2017-09-15 10:27:12 +02:00
Kevin Kirspel
c6bb1c33bc posix/mmap: Add support for file handler and MAP_ANON
Added a mmap file handler to struct _rtems_filesystem_file_handlers_r.
Updated each file handler object to support the default mmap handler.
Updated mmap() to call the mmap handler for MAP_SHARED.
Added a mmap file handler for shm

Added support for MAP_ANON in mmap().

Updates #2859
2017-07-14 16:04:05 -04:00
Sebastian Huber
b94bbf1cb4 ftpfs: Remove superfluous include 2016-06-09 10:50:47 +02:00
Sebastian Huber
a2f91f6cb8 tftp: Use proper semaphore attr for mutex
Close #2729.
2016-06-06 12:57:07 +02:00
Sebastian Huber
f97536dcd3 basdefs.h: Add and use RTEMS_UNUSED 2015-10-26 09:13:19 +01:00
Michael Davidsaver
74ef2c101a tftpDriver: close() false error
closes #2376.
2015-07-29 10:56:14 -05:00
Sebastian Huber
eb7753437f Filesystem: Delete unused fsmountme_h handler 2015-02-09 15:38:48 +01:00
Sebastian Huber
c8cd4ff52b libnetworking: Fix memset() call
Close #2244.
2015-01-23 12:56:53 +01:00
Sebastian Huber
c625a64121 Filesystem: Delete node type operation
Use the fstat handler instead.
2015-01-22 07:52:40 +01:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Nick Withers
a32f996b60 Don't use unsafe buffer operations
Don't use unsafe buffer operations, averting (stack) buffer overflow
when the syslog message length (including Facility and Level encoding)
would exceed 199 characters
2014-01-20 08:52:21 +01:00
Jim Panetta
2b03a62441 NTP: Sync time correctly when receiving broadcast updates
1) The value of rtems_bsdnet_ntpserver_count is equal to 0 when no
   server is set, so the check for (rtems_bsdnet_ntpserver_count < 0)
   in rtems_bsdnet_get_ntp() is wrong.  The check should be "<= 0".

2) Binding the listening socket port to 0 does not work.  Packets
   appear on the interface, but the recvfrom in tryServer() never
   returns.  Changing this to the well known NTP socket 123 allows
   the packets to be seen.

3) In tryServer(), an explicit check for NTP version 3 packets is made.
   If the NTP server is version 4, this check fails even though the
   packets seem to be the right shape.
2014-01-09 09:56:03 -05:00
Sebastian Huber
56bea4339f Filesystem: Use default kqfilter and poll handler 2013-12-20 10:31:53 +01:00
Sebastian Huber
2f68778f08 Filesystem: Add readv/writev handlers
The readv() and writev() support was implemented in terms of multiple
calls to the read and write handlers.  This imposes a problem on device
files which use an IO vector as single request entity.  For example a
low-level network device (e.g. BPF(4)) may use an IO vector to create
one frame from multiple protocol layers each with its own IO vector
entry.
2013-12-20 10:31:53 +01:00
Chris Johns
663ffd0e7c PR2161: Set the source port to SYSLOG in the syslog socket. 2013-12-10 12:37:05 +11:00
Sebastian Huber
b63c8f9b50 ftpfs: Fix SIZE command handling
It is invalid to issue a SIZE command once a data transfer is
in progress.  For reads we issue the SIZE command before the RETR
command and get a snapshot of the file size.  For writes the file size
is initialized to zero and incremented for each write chunk.
2013-01-28 16:46:02 +01:00
Sebastian Huber
82eb2c4d5f ftpfs: Fix NULL pointer access 2012-11-22 16:35:06 +01:00
Sebastian Huber
fe0f24ea39 ftpfs: Use SIZE command 2012-11-21 16:38:34 +01:00
Sebastian Huber
ad5e0708a2 ftpfs: Open control connection during path eval 2012-11-21 16:38:34 +01:00
Sebastian Huber
be6f505df7 ftpfs: Format 2012-11-21 16:38:34 +01:00
Sebastian Huber
0a95800a58 Filesystem: Change pathconf_limits_and_options
The pathconf_limits_and_options field of
rtems_filesystem_mount_table_entry_t is now a const pointer to reduce
the read-write memory demands of file system instances.
2012-05-15 10:37:00 +02:00
Sebastian Huber
da154e14f6 Filesystem: Move operations to mount table entry
The scope of the file system operations is the file system instance.
The scope of the file system node handlers is the file location.  The
benefit of moving the operations to the mount table entry is a size
reduction of the file location (rtems_filesystem_location_info_t).  The
code size is slightly increased due to additional load instructions.

Restructure rtems_filesystem_mount_table_entry_t to improve cache
efficiency.
2012-05-15 10:01:43 +02:00
Joel Sherrill
9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00
Sebastian Huber
2563410019 Filesystem: Rename defines
o Removed RTEMS_LIBIO_PERMS_SEARCH.
 o Renamed RTEMS_LIBIO_PERMS_READ in RTEMS_FS_PERMS_READ.
 o Renamed RTEMS_LIBIO_PERMS_WRITE in RTEMS_FS_PERMS_WRITE.
 o Renamed RTEMS_LIBIO_PERMS_EXEC in RTEMS_FS_PERMS_EXEC.
 o Renamed RTEMS_LIBIO_FOLLOW_HARD_LINK in RTEMS_FS_FOLLOW_HARD_LINK.
 o Renamed RTEMS_LIBIO_FOLLOW_SYM_LINK in RTEMS_FS_FOLLOW_SYM_LINK.
 o Renamed RTEMS_LIBIO_MAKE in RTEMS_FS_MAKE.
 o Renamed RTEMS_LIBIO_EXCLUSIVE in RTEMS_FS_EXCLUSIVE.
 o Renamed RTEMS_LIBIO_ACCEPT_RESIDUAL_DELIMITERS in
   RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS.
 o Renamed RTEMS_LIBIO_REJECT_TERMINAL_DOT in
 RTEMS_FS_REJECT_TERMINAL_DOT.
2012-03-13 12:24:10 +01:00
Sebastian Huber
4116fce629 Filesystem: New defaults fsync_h and fdatasync_h
New defaults rtems_filesystem_default_fsync_or_fdatasync() and
rtems_filesystem_default_fsync_or_fdatasync_success() for fsync_h and
fdatasync_h.  The rtems_filesystem_default_fsync_or_fdatasync() sets now
errno to EINVAL according to POSIX.
2012-03-13 12:23:45 +01:00
Sebastian Huber
3b7c123c8d Filesystem: Reference counting for locations
o A new data structure rtems_filesystem_global_location_t was
   introduced to be used for
    o the mount point location in the mount table entry,
    o the file system root location in the mount table entry,
    o the root directory location in the user environment, and
    o the current directory location in the user environment.
   During the path evaluation global start locations are obtained to
   ensure that the current file system instance will be not unmounted in
   the meantime.
 o The user environment uses now reference counting and is protected
   from concurrent access.
 o The path evaluation process was completely rewritten and simplified.
   The IMFS, RFS, NFS, and DOSFS use now a generic path evaluation
   method.  Recursive calls in the path evaluation have been replaced
   with iteration to avoid stack overflows.  Only the evaluation of
   symbolic links is recursive.  No dynamic memory allocations and
   intermediate buffers are used in the high level path evaluation.  No
   global locks are held during the file system instance specific path
   evaluation process.
 o Recursive symbolic link evaluation is now limited by
   RTEMS_FILESYSTEM_SYMLOOP_MAX.  Applications can retrieve this value
   via sysconf().
 o The device file system (devFS) uses now no global variables and
   allocation from the workspace.  Node names are allocated from the
   heap.
 o The upper layer lseek() performs now some parameter checks.
 o The upper layer ftruncate() performs now some parameter checks.
 o unmask() is now restricted to the RWX flags and protected from
   concurrent access.
 o The fchmod_h and rmnod_h file system node handlers are now a file
   system operation.
 o The unlink_h operation has been removed.  All nodes are now destroyed
   with the rmnod_h operation.
 o New lock_h, unlock_h, clonenod_h, and are_nodes_equal_h file system
   operations.
 o The path evaluation and file system operations are now protected by
   per file system instance lock and unlock operations.
 o Fix and test file descriptor duplicate in fcntl().
 o New test fstests/fsnofs01.
2012-03-13 12:23:37 +01:00
Sebastian Huber
f14327a24d Fixed incorrect error path
The inet_aton() function returns non-zero in case of success.
2012-02-15 10:02:50 +01:00
Sebastian Huber
1052242d23 Removed fpathconf file system node handler.
There existed no calling function for this handler.
2012-02-02 15:55:33 +01:00
Ralf Corsepius
984c4c492f 2011-11-06 Ralf Corsépius <ralf.corsepius@rtems.org>
PR1945/cpukit
	* libfs/src/nfsclient/src/nfs.c, libfs/src/rfs/rtems-rfs-rtems-dev.c,
	libfs/src/rfs/rtems-rfs-rtems-dir.c,
	libfs/src/rfs/rtems-rfs-rtems-file.c, libnetworking/lib/ftpfs.c,
	libnetworking/lib/tftpDriver.c: Replace rtems_off64_t with off_t.
2011-11-06 12:00:04 +00:00
Sebastian Huber
8f6ef47836 2011-07-18 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/lib/ftpfs.c: Fixed reply parsing.
2011-07-18 15:25:33 +00:00
Sebastian Huber
9f816ad4dc 2011-07-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/rtems/tftp.h, libnetworking/lib/tftpDriver.c: Fixed
	prototype.
2011-07-07 06:55:48 +00:00
Sebastian Huber
00db336a00 2011-02-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/lib/ftpfs.c: Workaround for some firewalls.
2011-02-21 10:58:15 +00:00
Sebastian Huber
6366c2e2a6 2010-10-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/lib/ftpfs.c: Do not fall back to BOOTP server address
	in case hostname was not specified.
2010-10-19 09:16:20 +00:00
Sebastian Huber
71a6a16fd0 2010-10-19 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/lib/ftpfs.c: Fixed a special case with no username and
	password.
2010-10-19 07:38:53 +00:00
Sebastian Huber
de39b5127d 2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio_.h: Removed rtems_filesystem_null_handlers.
	* libcsupport/src/fs_null_handlers.c: Removed file.
	* libcsupport/Makefile.am: Reflect change above.
	* libfs/src/nfsclient/src/nfs.c, libfs/src/imfs/imfs_creat.c,
	libfs/src/imfs/imfs_init.c, libfs/src/imfs/miniimfs_init.c: Use
	rtems_filesystem_handlers_default instead of
	rtems_filesystem_null_handlers.
	* libnetworking/lib/ftpfs.c, libnetworking/lib/tftpDriver.c:
	Initialize handler and operations table with proper defaults.
2010-07-15 08:46:06 +00:00
Sebastian Huber
fd2b1634bb 2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio.h: Removed file_info and handlers
	fields in rtems_libio_t.
	* libcsupport/src/close.c, libcsupport/src/fcntl.c,
	libcsupport/src/fdatasync.c, libcsupport/src/fstat.c,
	libcsupport/src/fsync.c, libcsupport/src/ftruncate.c,
	libcsupport/src/getdents.c, libcsupport/src/ioctl.c,
	libcsupport/src/libio_sockets.c, libcsupport/src/lseek.c,
	libcsupport/src/open.c, libcsupport/src/read.c,
	libcsupport/src/readv.c, libcsupport/src/write.c,
	libcsupport/src/writev.c, libfs/src/devfs/devclose.c,
	libfs/src/devfs/devioctl.c, libfs/src/devfs/devopen.c,
	libfs/src/devfs/devread.c, libfs/src/devfs/devwrite.c
	libfs/src/dosfs/msdos_dir.c libfs/src/dosfs/msdos_file.c
	libfs/src/imfs/deviceio.c libfs/src/imfs/imfs_directory.c
	libfs/src/imfs/imfs_fifo.c libfs/src/imfs/memfile.c
	libfs/src/nfsclient/src/nfs.c libfs/src/rfs/rtems-rfs-rtems-file.c
	libfs/src/rfs/rtems-rfs-rtems.h libnetworking/lib/ftpfs.c: Reflect
	changes above.
2010-07-15 08:10:48 +00:00
Sebastian Huber
55c3939bbb 2010-06-29 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/lib/tftpDriver.c: rtems_tftp_ops and
	rtems_tftp_handlers are now const and static.
	* libnetworking/rtems/tftp.h: Removed
	rtems_bsdnet_initialize_tftp_filesystem and rtems_tftp_ops.
2010-06-29 13:03:31 +00:00
Sebastian Huber
293228e822 2010-06-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c:  Removed
	rtems_ftpfs_mount().
2010-06-10 09:20:29 +00:00
Sebastian Huber
c69b6fe66a 2010-06-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c:  Added
	rtems_ftpfs_mount() again.  Documentation.
2010-06-09 11:36:09 +00:00
Chris Johns
29e92b090c 2010-05-31 Chris Johns <chrisj@rtems.org>
* libcsupport/Makefile.am: Add mount-mgr.c.
        * libcsupport/src/mount-mgr.c: New.
        * include/rtems/fs.h: Added rtems_filesystem_location_mount.
        * libcsupport/include/rtems/libio.h, libcsupport/src/mount.c: New
        mount interface. It is similar to Linux.
        * libcsupport/include/rtems/libio_.h: Remove the
        init_fs_mount_table call.
        * libcsupport/src/base_fs.c: Remove init_fs_mount_table_call. Use
        the new mount call. Remove setting the root node in the global
        pathloc. Mount does this now.
        * libcsupport/src/privateenv.c: Remove the hack to set the root
        mount table entry in the environment.
        * libcsupport/src/unmount.cL Free the target string.
        * libblock/src/bdpart-mount.c: New mount API.

        * libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_init.c,
        libfs/src/dosfs/dosfs.h, libfs/src/dosfs/msdos.h,
        libfs/src/dosfs/msdos_init.c, libfs/src/imfs/imfs.h,
        libfs/src/imfs/imfs_eval.c, libfs/src/imfs/imfs_init.c,
        libfs/src/imfs/miniimfs_init.c,
        libfs/src/nfsclient/src/librtemsNfs.h,
        libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs.h,
        libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h,
        libnetworking/rtems/tftp.h: New mount_h API.

        * libfs/src/devfs/devfs_eval.c: Local include of extern ops.
        * libfs/src/nfsclient/src/nfs.c: New mount API. Removed the mount
        me call and fixed the initialisation to happen when mounting.

        * libmisc/Makefile.am, libmisc/shell/shellconfig.h: Remove mount
        filesystem files.

        * libmisc/fsmount/fsmount.c, libmisc/fsmount/fsmount.h: Updated to
        the new mount table values.

        * libmisc/shell/main_mount_ftp.c,
        libmisc/shell/main_mount_msdos.c, libmisc/shell/main_mount_rfs.c,
        libmisc/shell/main_mount_tftp.c: Removed.

        * libmisc/shell/main_mount.c: Use the new mount API. Also access
        the file system table for the file system types.

        * libnetworking/lib/tftpDriver.c: Updated to the new mount
        API. Fixed to allow mounting from any mount point. Also can now
        have more than file system mounted.

        * sapi/include/confdefs.h: Add file system configuration support.
2010-05-31 13:56:37 +00:00
Ralf Corsepius
4665f32fc5 2010-05-27 Ralf Corsépius <ralf.corsepius@rtems.org>
*  libnetworking/lib/ftpfs.c, libnetworking/lib/tftpDriver.c:
	Use size_t instead of int for pathnamelen.
2010-05-27 16:36:02 +00:00
Sebastian Huber
ebf2bc6cbc 2010-04-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/lib/ftpfs.c: Format changes.  Fixed pathname
	allocation in rtems_ftpfs_eval_path().  Send QUIT command during
	file close.
2010-04-30 08:52:29 +00:00
Ralf Corsepius
959e0a0a80 2010-04-12 Ralf Corsépius <ralf.corsepius@rtems.org>
* libnetworking/lib/ftpfs.c: 16bit target fixes:
	Use ioctl_command_t as arg to rtems_ftpfs_do_ioctl.
	Explicitly cast to uint32_t in char[] to uint32_t
	conversion.
2010-04-12 12:50:25 +00:00
Ralf Corsepius
5d974c9a70 #include <unistd.h> 2010-04-04 11:03:43 +00:00
Ralf Corsepius
b25b88e732 Add HAVE_CONFIG_H support to let files receive configure defines. 2010-03-28 05:50:29 +00:00
Joel Sherrill
391b4dda25 2010-03-11 Joel Sherrill <joel.sherrill@oarcorp.com>
* ftpd/ftpd.c, httpd/uemf.c, httpd/um.c, httpd/webs.c,
	httpd/websuemf.c, libblock/src/diskdevs.c,
	libmisc/capture/capture-cli.c, libmisc/monitor/mon-network.c,
	libmisc/shell/hexdump-odsyntax.c, libmisc/shell/main_ifconfig.c,
	libmisc/uuid/parse.c, libnetworking/lib/ftpfs.c,
	libnetworking/libc/gethostbyht.c, libnetworking/libc/getnetnamadr.c,
	libnetworking/libc/inet_network.c,
	libnetworking/rtems/rtems_mii_ioctl.c,
	score/src/objectgetnameasstring.c: Fix warnings for ctype methods.
2010-03-11 19:12:30 +00:00
Joel Sherrill
b45ba5258b 2009-12-21 Joel Sherrill <joel.sherrill@oarcorp.com>
* libnetworking/lib/ftpfs.c: Use EINVAL not EBADRQC.
2009-12-21 15:13:24 +00:00
Joel Sherrill
27643e0336 2009-12-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/termios.c, libfs/src/dosfs/msdos_format.c,
	libfs/src/nfsclient/src/nfs.c, libfs/src/pipe/fifo.c,
	libnetworking/lib/rtems_bsdnet_ntp.c, libnetworking/lib/tftpDriver.c,
	libnetworking/rtems/rtems_glue.c, libnetworking/rtems/rtems_select.c:
	Eliminate uses of deprecated rtems_clock_get() and replace with
	properly typed routine.
2009-12-17 20:26:09 +00:00
Ralf Corsepius
1de949a8bd Whitespace removal. 2009-11-30 15:49:52 +00:00