msg_file_echo.go 492 B

123456789101112131415161718192021222324252627
  1. package smb
  2. func init() {
  3. commandRequestMap[CommandEcho] = func() DataI {
  4. return &EchoRequest{}
  5. }
  6. }
  7. // ECHO
  8. type EchoRequest struct {
  9. Header
  10. StructureSize uint16
  11. Reserved uint16
  12. }
  13. type EchoResponse struct {
  14. Header
  15. StructureSize uint16
  16. Reserved uint16
  17. }
  18. func (data *EchoRequest) ServerAction(ctx *DataCtx) (interface{}, error) {
  19. data.Header.Flags = SMB2_FLAGS_RESPONSE
  20. return &EchoResponse{
  21. Header: data.Header,
  22. StructureSize: data.StructureSize,
  23. }, nil
  24. }