Forum Discussion
Matthew_Gamble_
Nimbostratus
Mar 12, 2009TFTP Server?
Is it possible to write a simple TFTP server as an iRule to return static content? I see some examples for load balancing TFTP requests, but not for actually acting as a TFTP server. I have a very s...
JRahm
Admin
Mar 12, 2009I don't think the protocol handling would be that difficult, the problem is how to handle serving up the file, that command is disabled in iRules. Here's a start, maybe someone else has some ideas?
when CLIENT_ACCEPTED {
log local0. "Client connected from [IP::client_addr]"
binary scan [UDP::payload] xc opcode
log local0. "Opcode is $opcode"
if { $opcode == 1 } {
binary scan [UDP::payload] xxa* string
log local0. "String is $string"
set stringlist [split $string \000]
set file [lindex $stringlist 0]
set mode [lindex $stringlist 1]
log local0. "File is $file, Mode is $mode"
if { $mode != "octet" && $mode != "netascii" } {
reject
} else {
log local0. "Send the file!"
write goes here
}
} else { reject }
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
