2012-06-29 05:18:28 +00:00
|
|
|
# -*- coding: binary -*-
|
2010-05-21 00:03:04 +00:00
|
|
|
require 'rex/proto/tftp'
|
|
|
|
|
|
|
|
module Rex
|
|
|
|
module Proto
|
|
|
|
module TFTP
|
|
|
|
|
|
|
|
OPCODES = %w{ Unknown RRQ WRQ DATA ACK ERROR }
|
2010-05-21 00:15:10 +00:00
|
|
|
OpRead = 1
|
|
|
|
OpWrite = 2
|
|
|
|
OpData = 3
|
|
|
|
OpAck = 4
|
|
|
|
OpError = 5
|
2010-08-06 17:21:22 +00:00
|
|
|
OpOptAck = 6
|
2010-05-21 00:15:10 +00:00
|
|
|
|
2010-05-21 00:03:04 +00:00
|
|
|
ERRCODES = [
|
2013-08-30 21:28:33 +00:00
|
|
|
"Undefined",
|
|
|
|
"File not found",
|
|
|
|
"Access violation",
|
|
|
|
"Disk full or allocation exceeded",
|
|
|
|
"Illegal TFTP operation",
|
|
|
|
"Unknown transfer ID",
|
|
|
|
"File already exists",
|
|
|
|
"No such user",
|
|
|
|
"Failed option negotiation"
|
2010-05-21 00:03:04 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
ErrFileNotFound = 1
|
|
|
|
ErrAccessViolation = 2
|
|
|
|
ErrDiskFull = 3
|
|
|
|
ErrIllegalOperation = 4
|
|
|
|
ErrUnknownTransferId = 5
|
|
|
|
ErrFileExists = 6
|
|
|
|
ErrNoSuchUser = 7
|
2010-08-06 17:21:22 +00:00
|
|
|
ErrFailedOptNegotiation = 8
|
2010-05-21 00:03:04 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|