Skip to Content.
Sympa Menu

freetds - Misc. newbie questions

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Craig Spannring" <cts AT internetcds.com>
  • To: freetds
  • Subject: Misc. newbie questions
  • Date: Wed, 12 Aug 1998 21:3:47


I went to http://franklin.oit.unc.edu/cgi-bin/lyris.pl?join=freetds
and joined the mailing list, but I recieved no instructions on
what address to use to send messages to the list. (I'm using
the web page to send this one, but I'd prefer using my own mailer.)
What is the list address?

I started reverse engineering the protocol for MS SQLServer 6.5 a few
weeks ago. I wasn't aware of this project until today. Now that I
know somebody else is working on it I can just sit on my butt and wait
until its done. ;-)

Seriously though, on the FreeTDS page is says that TDS 4.2 and 5.0 is
targeted. Is 5.0 a Sysbase-only version? I've never seen that
version number in any packet dumps of any of the M$ products I'm
using to generate test packets with.

BTW- what I've decoded so far more or less matches
what you have, only mine is written in Ada and I've only looked at the
header portion and the logon packets. (Sorry about not having a
'for ___ record use' clause to map the exact offsets. I wasn't
planning on talking to anyone about this until I was much further along.)


type Header_Record_T is record
-- packet_type 2 seems to be logon packets
-- 1 seems to be ??query??
-- 4 seems to be returned information
Packet_Type: Packet_Type_t;

-- Status 0 might mean that the packet is to be continued?
-- 1 might mean it is complete?
Status: Byte;

-- length hi byte low byte. Note- this is the length
-- of the entire portion of this packet including
header.
Length: Word;

-- channel ???
Channel: Word;

-- packet ???
Packet: Byte;

-- window ???
Window: Byte;
end record;

Srv_Pktlen: constant := 6;
Srv_Maxname : constant := 30;

Srv_Procid_String_Maxlen : constant := 8;

App_Specific_Datalen: constant := 6;
type App_Specific_Data is array (1..App_Specific_Datalen) of Byte;

Db_Prog_Name_Max: constant := 10;

type Security_Components_Array is array(1..8) of Byte;

type Srv_Name_Array is new Character_Array(1..Srv_Maxname);

type Unused1_Array is array (1..(Srv_Maxname -
Srv_Procid_String_Maxlen -
App_Specific_Datalen)) of Byte;
type Unused2_Array is array (1..7) of Byte;
type Dummy_Array is array(1..3) of Byte;

type Remote_Passwords_Array is array(1..253) of Byte;

type Logon_Record_t is record
Hostname: srv_name_array;
Hostname_Length: Byte;
Username: srv_name_array;
Username_Length: Byte;
Password: srv_name_array; -- plaintext
Password_Length: Byte;
Procid: Character_Array(1..Srv_Procid_String_Maxlen);

Unused1: Unused1_Array;

Apptype: App_Specific_Data; -- Application specific.
Procid_Len: Byte; -- length of host process id
Type_Of_Int2: Byte := 3; -- type of int2 on this host (perhaps
3)
Type_Of_Int4: Byte := 1; -- type of int4 on this host (perhaps
1)
Type_Of_Char: BYTE := 6; -- type of char (perhaps
6)
Type_Of_Float: Byte := 16#A#; -- type of float (perhaps
0x0A)
Type_Of_Date: BYTE := 9; -- type of datetime (perhaps
9)
Notify_On_Use_Db: BYTE := 1; -- notify on exec of use db cmd
Disallow_Dump: BYTE := 1; -- disallow use of dump/load and bulk
--insert
Sql_Interface: Byte := 0; -- SQL interface type (0?)
Network_Connection: Byte := 0; -- type of network connection
Unused2: Unused2_array; -- Apparently used by System-10
App_Name: srv_name_array; -- application name
App_Name_Length: byte; -- length of appl name
server_Name: srv_name_array; -- name of server
servnlen: byte; -- length of lservname
Remote_Passwords_Length: Byte; -- length of lrempw
Remote_passwords: Remote_Passwords_Array; -- passwords for remote
servers
Unknown1: Byte := 16#C#; --
Tds_Version: Byte := 4; --Tds_Version_String; -- tds version
Unknown2: Byte := 2;
Unknown3: Byte := 0;
Unknown4: Byte := 0;
Prog_Name: Character_Array(1..Db_Prog_Name_Max); -- client
program
-- name
Prog_Name_Length: byte; --length of client program name
Client_Version: Character_Array(1..4); -- client program version
No_Short: BYTE; -- auto convert of short datatypes
Type_Of_Float4: Byte; -- type of flt4 on this host
Type_Of_Date4: BYTE; -- type of date4 on this host
Language: srv_name_array; -- initial language
Language_Length: byte; -- length of language
Set_Lang: byte; -- notify on language change
Security_Label_Hier: short; -- security label hierarchy
Slcomp: Security_Components_array; -- security components
Security_Label_Spare: short; -- security label spare
Slrole: byte; -- security login role
Charset: srv_name_array; -- character set name (unused)
Charset_Length: byte; -- length of character set (unused)
set_Charset: byte; -- notify on character set change (unused)
Packet_Size: Character_Array(1..SRV_PKTLEN); -- length of TDS
-- packets
Packet_Size_Length: byte; -- length of lpacketsize
Dummy: Dummy_Array; -- 0 pad to longword boundary
end record;


--
=======================================================================
Life is short. | Craig Spannring
Ski hard, Bike fast. | cts AT internetcds.com
--------------------------------+------------------------------------
Any sufficiently perverted technology is indistinguishable from Perl.
=======================================================================



  • Re: Misc. newbie questions, Gregg Jensen, 08/13/1998
    • <Possible follow-up(s)>
    • Misc. newbie questions, Craig Spannring, 01/29/2024

Archive powered by MHonArc 2.6.24.

Top of Page