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...
Nat_Thirasuttakorn
Employee
Mar 13, 2009I got a chance to test ...here is my irule
when CLIENT_ACCEPTED {
set blockdata(1) [binary format H* 000300014620494e495452442e494d473b31\
202020202020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
2020202020202020202020202020202009696e697472642e696d670d0a4620524541444d\
452e3b312020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202009524541444d450d0a4620564d\
4c494e555a2e3b3120202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020]
set blockdata(2) [binary format H* 000300022020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
202020202020202020202020202020202020202020202020202020202020202020202020\
20202020202020202020202020202020202009766d6c696e757a0d0a]
node [IP::client_addr] [TCP::client_port]
snat [IP::local_addr]
}
when CLIENT_DATA {
UDP::payload replace 0 [UDP::payload length] $blockdata(1)
}
when SERVER_DATA {
binary scan [UDP::payload] I tmp
set opcode [expr $tmp >> 16]
set blockid [expr $tmp & 0xffff]
if { $blockid < [array size blockdata] } {
UDP::respond $blockdata([expr $blockid + 1])
}
UDP::drop
}
it works when I connect from linux tftp client... right, this irule is not complete. I see that citizen_elah and jquinby already started a good one. so this can be merge with irule in previous post. For example, no filename checking and no type checking, so this irule will always return same data no matter what filename/mode client ask for.
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
