summaryrefslogtreecommitdiffstats
path: root/images
diff options
context:
space:
mode:
authorFrank Kühndel <frank.kuehndel@embedded-brains.de>2022-10-13 17:41:33 +0200
committerChris Johns <chrisj@rtems.org>2022-10-14 12:39:57 +1100
commite3cbdca98143bfccdac47f077abed1bcf4fbd7ad (patch)
tree3b5def9e7e0cf18665e01cded5dffd4cdef60027 /images
parentREADME: Add a note about image tools (diff)
downloadrtems-docs-e3cbdca98143bfccdac47f077abed1bcf4fbd7ad.tar.bz2
TFTPFS: Adding missing diagram
Diffstat (limited to 'images')
-rw-r--r--images/filesystem/tftpfs_usage.pngbin0 -> 47217 bytes
-rw-r--r--images/filesystem/tftpfs_usage.puml37
2 files changed, 37 insertions, 0 deletions
diff --git a/images/filesystem/tftpfs_usage.png b/images/filesystem/tftpfs_usage.png
new file mode 100644
index 0000000..5faa72f
--- /dev/null
+++ b/images/filesystem/tftpfs_usage.png
Binary files 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@embedded-brains.de>
+' All rights reserved.
+'
+@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 );
+@enduml