Documentation ¶
Index ¶
- Constants
- Variables
- func Listen(param *Parameter) (net.Listener, error)
- type Parameter
- type Session
- func (session *Session) AcceptRetransmit(retransmission Retransmission, datagram []byte) error
- func (session *Session) Authenticate() error
- func (session *Session) Negotiate() error
- func (session *Session) OpenPort() error
- func (session *Session) OpenTransfer() error
- func (session *Session) Transfer()
- func (s *Session) XsriptClose(delta uint64)
- func (s *Session) XsriptDataLog(logLine string)
- func (s *Session) XsriptDataStart(t time.Time)
- func (s *Session) XsriptDataStop(t time.Time)
- func (s *Session) XsriptOpen()
- type Transfer
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 ¶
------------------------------------------------------------------------
- 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 (*Parameter) VerboseArg ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
state of a Tsunami session as a whole
func (*Session) AcceptRetransmit ¶
func (*Session) Authenticate ¶
------------------------------------------------------------------------
- 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 ¶
------------------------------------------------------------------------
- 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 ¶
------------------------------------------------------------------------
- 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 ¶
------------------------------------------------------------------------
- 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) XsriptClose ¶
func (*Session) XsriptDataLog ¶
func (*Session) XsriptDataStart ¶
func (*Session) XsriptDataStop ¶
func (*Session) XsriptOpen ¶
func (s *Session) XsriptOpen()
Click to show internal directories.
Click to hide internal directories.