[rtems-docs commit] TFTPFS: Adding missing diagram
Chris Johns
chrisj at rtems.org
Fri Oct 14 01:34:57 UTC 2022
Module: rtems-docs
Branch: master
Commit: e3cbdca98143bfccdac47f077abed1bcf4fbd7ad
Changeset: http://git.rtems.org/rtems-docs/commit/?id=e3cbdca98143bfccdac47f077abed1bcf4fbd7ad
Author: Frank Kühndel <frank.kuehndel at embedded-brains.de>
Date: Thu Oct 13 17:41:33 2022 +0200
TFTPFS: Adding missing diagram
---
filesystem/trivial_ftp.rst | 8 ++++++--
images/filesystem/tftpfs_usage.png | Bin 0 -> 47217 bytes
images/filesystem/tftpfs_usage.puml | 37 ++++++++++++++++++++++++++++++++++++
3 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/filesystem/trivial_ftp.rst b/filesystem/trivial_ftp.rst
index 3ef8bba..b8e1ae4 100644
--- a/filesystem/trivial_ftp.rst
+++ b/filesystem/trivial_ftp.rst
@@ -275,16 +275,20 @@ repository):
Usage
=====
-The following diagram shows how the TFTP filesystem is used by an
+The following diagram usage_ shows how the TFTP filesystem is used by an
application. The mount point can be any directory. The name ``/tftp``
used in the figure serves only as an example. The final unmounting and
remove directory steps are optional.
+.. _usage:
+
.. figure:: ../images/filesystem/tftpfs_usage.png
- :width: 90%
+ :width: 75%
:align: center
:alt: TFTP Usage Diagram
+ TFTP file system usage
+
Mounting the TFTP Filesystem
----------------------------
diff --git a/images/filesystem/tftpfs_usage.png b/images/filesystem/tftpfs_usage.png
new file mode 100644
index 0000000..5faa72f
Binary files /dev/null and b/images/filesystem/tftpfs_usage.png differ
diff --git a/images/filesystem/tftpfs_usage.puml b/images/filesystem/tftpfs_usage.puml
new file mode 100644
index 0000000..ebd449c
--- /dev/null
+++ b/images/filesystem/tftpfs_usage.puml
@@ -0,0 +1,37 @@
+'
+' TFTP file system : usage
+'
+' Copyright (c) 2022 Frank Kuehndel <frank.kuehndel at embedded-brains.de>
+' All rights reserved.
+'
+ at startuml
+:Initialize libbsd;
+:Initialize Networking;
+:const char *mount_point = "/tftp"
+result = mkdir( mount_point, S_IRWXU | S_IRWXG | S_IRWXO );
+:result = mount(
+ "",
+ mount_point,
+ RTEMS_FILESYSTEM_TYPE_TFTPFS,
+ RTEMS_FILESYSTEM_READ_WRITE,
+ "blocksize=1024,windowsize=4,verbose"
+ );
+repeat
+ if () then
+ :fd = open( path, O_RDONLY );
+ repeat
+ :bytes = read( fd, data_buffer,
+ sizeof( data_buffer ) );
+ repeat while ()
+ :result = close( fd );
+ else
+ :fd = open( path, O_WRONLY );
+ repeat
+ :bytes = write( fd, data, size );
+ repeat while ()
+ :result = close( fd );
+ endif
+repeat while ()
+:result = unmount( mount_point );
+:result = rmdir( mount_point );
+ at enduml
More information about the vc
mailing list