server

package
v0.0.0-...-f32c692 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_BLOCK_SIZE = 1024 /* default size of a single file block     */
View Source
const DEFAULT_HEARTBEAT_TIMEOUT = 15 /* the timeout to disconnect after no client feedback */
View Source
const DEFAULT_IPV6_YN = false /* the default IPv6 setting                */
View Source
const DEFAULT_TRANSCRIPT_YN = false /* the default transcript setting          */
View Source
const DEFAULT_UDP_BUFFER = 20000000 /* default size of the UDP transmit buffer */

const DEFAULT_SECRET = tsunami.DEFAULT_SECRET /* default shared secret */ const DEFAULT_TCP_PORT = tsunami.TS_TCP_PORT /* default TCP port to listen on */

View Source
const DEFAULT_VERBOSE_YN = true /* the default verbosity setting           */

Variables

View Source
var FileListSent error = errors.New("file list sent")

Functions

func Listen

func Listen(param *Parameter) (net.Listener, error)

------------------------------------------------------------------------

  • int Listen(Parameter *parameter); *
  • Establishes a new TCP server socket, returning the file descriptor
  • of the socket on success and a negative value on error. This will
  • be an IPv6 socket if ipv6_yn is true and an IPv4 socket otherwise. *------------------------------------------------------------------------

Types

type Parameter

type Parameter struct {
	// contains filtered or unexported fields
}

Tsunami transfer protocol parameters

func NewParameter

func NewParameter() *Parameter

func ProcessOptions

func ProcessOptions() *Parameter

------------------------------------------------------------------------

  • void process_options(); *
  • Processes the command-line options and sets the protocol parameters
  • as appropriate. *------------------------------------------------------------------------

func (*Parameter) FinishHook

func (param *Parameter) FinishHook(file string) error

func (*Parameter) VerboseArg

func (param *Parameter) VerboseArg(prompt string)

type Session

type Session struct {
	// contains filtered or unexported fields
}

state of a Tsunami session as a whole

func NewSession

func NewSession(id uint32, conn *net.TCPConn, param *Parameter) *Session

func (*Session) AcceptRetransmit

func (session *Session) AcceptRetransmit(retransmission Retransmission, datagram []byte) error

func (*Session) Authenticate

func (session *Session) Authenticate() error

------------------------------------------------------------------------

  • int Authenticate(ttp_session_t *session, const u_char *secret); *
  • Given an active Tsunami session, returns 0 if we are able to
  • negotiate authentication successfully and a non-zero value
  • otherwise. *
  • The negotiation process works like this: *
  • (1) The server [this process] sends 512 bits of random data
  • to the client. *
  • (2) The client XORs 512 bits of the shared secret onto this
  • random data and responds with the MD5 hash of the result. *
  • (3) The server does the same thing and compares the result.
  • If the authentication succeeds, the server transmits a
  • result byte of 0. Otherwise, it transmits a non-zero
  • result byte. *------------------------------------------------------------------------

func (*Session) Negotiate

func (session *Session) Negotiate() error

------------------------------------------------------------------------

  • int Negotiate(ttp_session_t *session); *
  • Performs all of the negotiation with the client that is done prior
  • to authentication. At the moment, this consists of verifying
  • identical protocol revisions between the client and server. Returns
  • 0 on success and non-zero on failure. *
  • Values are transmitted in network byte order. *------------------------------------------------------------------------

func (*Session) OpenPort

func (session *Session) OpenPort() error

------------------------------------------------------------------------

  • int OpenPort(ttp_session_t *session); *
  • Creates a new UDP socket for transmitting the file data associated
  • with our pending transfer and receives the destination port number
  • from the client. Returns 0 on success and non-zero on failure. *------------------------------------------------------------------------

func (*Session) OpenTransfer

func (session *Session) OpenTransfer() error

------------------------------------------------------------------------

  • int OpenTransfer(ttp_session_t *session); *
  • Tries to create a new TTP file request object for the given session
  • by reading the name of a requested file from the client. If we are
  • able to negotiate the transfer successfully, we return 0. If we
  • can't negotiate the transfer because of I/O or file errors, we
  • return a negative vlaue. *
  • The client is sent a result byte of 0 if the request is accepted
  • (because the file can be read) and a non-zero result byte otherwise. *------------------------------------------------------------------------

func (*Session) Transfer

func (session *Session) Transfer()

func (*Session) XsriptClose

func (s *Session) XsriptClose(delta uint64)

func (*Session) XsriptDataLog

func (s *Session) XsriptDataLog(logLine string)

func (*Session) XsriptDataStart

func (s *Session) XsriptDataStart(t time.Time)

func (*Session) XsriptDataStop

func (s *Session) XsriptDataStop(t time.Time)

func (*Session) XsriptOpen

func (s *Session) XsriptOpen()

type Transfer

type Transfer struct {
	// contains filtered or unexported fields
}

state of a transfer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL