C# Class Microsoft.SqlServer.TDS.TDSUtilities

Internal utilities
Show file Open project: dotnet/corefx

Public Methods

Method Description
GetEncryptionResponse ( TDSPreLoginTokenEncryptionType client, TDSPreLoginTokenEncryptionType server ) : TDSPreLoginTokenEncryptionType

Generate an encryption response based on the client request and server setting

Log ( TextWriter log, string prefix, object instance ) : void

Log object content into destination

ResolveEncryption ( TDSPreLoginTokenEncryptionType client, TDSPreLoginTokenEncryptionType server ) : TDSEncryptionType

Convert indications of encryption support by client and server into expected behavior

SerializedWriteLineToLog ( TextWriter log, string text ) : void

Serialized write line to destination

WriteUInt ( Stream destination, uint value ) : void

Write unsigned integer into the stream

Private Methods

Method Description
ReadInt ( Stream source ) : int

Read signed integer from the packet

ReadPasswordString ( Stream source, ushort length ) : string

Read a password string and decrypt it

ReadString ( Stream source, ushort length ) : string

Read string from the packet

ReadUInt ( Stream source ) : uint

Read unsigned integer from the stream

ReadULong ( Stream source ) : ulong

Read unsigned long from the stream

ReadUShort ( Stream source ) : ushort

Read unsigned short from the packet

WriteInt ( Stream destination, int value ) : void

Write signed integer into the stream

WritePasswordString ( Stream destination, string value ) : void

Write password string encrypted into the packet

WriteString ( Stream destination, string value ) : void

Write string from into the packet

WriteULong ( Stream destination, ulong value ) : void

Write unsigned long into the stream

WriteUShort ( Stream destination, ushort value ) : void

Write unsigned short into the stream

WriteUShortBigEndian ( Stream destination, ushort value ) : void

Write unsigned short into the stream in network byte order (big-endian)

Method Details

GetEncryptionResponse() public static method

Generate an encryption response based on the client request and server setting
public static GetEncryptionResponse ( TDSPreLoginTokenEncryptionType client, TDSPreLoginTokenEncryptionType server ) : TDSPreLoginTokenEncryptionType
client TDSPreLoginTokenEncryptionType A value received from the client
server TDSPreLoginTokenEncryptionType Configuration of the server
return TDSPreLoginTokenEncryptionType

Log() public static method

Log object content into destination
public static Log ( TextWriter log, string prefix, object instance ) : void
log System.IO.TextWriter Destination
prefix string Prefix the output with
instance object Object to log
return void

ResolveEncryption() public static method

Convert indications of encryption support by client and server into expected behavior
public static ResolveEncryption ( TDSPreLoginTokenEncryptionType client, TDSPreLoginTokenEncryptionType server ) : TDSEncryptionType
client TDSPreLoginTokenEncryptionType
server TDSPreLoginTokenEncryptionType
return TDSEncryptionType

SerializedWriteLineToLog() public static method

Serialized write line to destination
public static SerializedWriteLineToLog ( TextWriter log, string text ) : void
log System.IO.TextWriter Destination
text string Text to log
return void

WriteUInt() public static method

Write unsigned integer into the stream
public static WriteUInt ( Stream destination, uint value ) : void
destination Stream
value uint
return void