Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111374918
D33411.id99917.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33411.id99917.diff
View Options
Index: stand/libsa/tftp.c
===================================================================
--- stand/libsa/tftp.c
+++ stand/libsa/tftp.c
@@ -55,6 +55,7 @@
#include <string.h>
+#include <bootstrap.h>
#include "stand.h"
#include "net.h"
#include "netif.h"
@@ -765,3 +766,36 @@
#endif
return (0);
}
+
+#ifdef TFTP_DEBUG
+static int
+command_tftp(int argc, char *argv[])
+{
+ int fd;
+ time_t start, end;
+ char buf[TFTP_REQUESTED_BLKSIZE];
+ ssize_t rv, count = 0;
+
+ if (argc != 2) {
+ snprintf(command_errbuf, sizeof(command_errbuf),
+ "Usage: tftp <filename>");
+ return (CMD_ERROR);
+ }
+
+ start = getsecs();
+ if ((fd = open(argv[1], O_RDONLY)) < 0) {
+ snprintf(command_errbuf, sizeof(command_errbuf),
+ "can't open '%s'", argv[1]);
+ return (CMD_ERROR);
+ }
+ while ((rv = read(fd, buf, sizeof(buf))) > 0)
+ count += rv;
+ end = getsecs();
+
+ printf("Received %zd bytes during %jd seconds\n", count, (intmax_t)end - start);
+ close(fd);
+ return (CMD_OK);
+}
+
+COMMAND_SET(tftp, "tftp", "tftp debug", command_tftp);
+#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 4, 12:10 AM (11 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16956770
Default Alt Text
D33411.id99917.diff (1 KB)
Attached To
Mode
D33411: loader: Add a readtest command
Attached
Detach File
Event Timeline
Log In to Comment