Sunday, February 23, 2014

TNS Data Packet Structure

Byte 0-7 is the header

Byte 8-9 is the data flag.  0x0040 indicates a disconnect packet.  0x0000 indicates normal data.

Byte 10 determines what is in the data packet

Type
Description
0x01
Protocol negotiation.  The client sent to the server the protocol versions acceptable (e.g. 6, 5, 4, 3, 2, 1, 0).  The server will response with the common version and other information such as character set, version string and server flags
0x02
Data type representation exchange
0x03
Two-Task Interface (TTI) function call
0x02 Open
0x03 Query
0x04 Execute
0x05 Fetch
0x08 Close
0x09 Disconnect/logoff
0x0C Autocommit ON
0x0D Autocommit OFF
0x0E Commit
0x0F Rollback
0x14 Cancel
0x2B Describe
0x30 Start up
0x31 Shutdown
0x3B Version (will be called before authentication)
0x43 K2 Transactions
0x47 Query
0x4A OSQL7
0x51 Logon (present password)
0x52 Logon (present userid)
0x5C OKOD
0x5E Query
0x60 LOB Operations
0x62 ODNY
0x67 Transaction end
0x68 Transaction begin
0x69 OCCA
0x6D Start up
0x73 Logon (present password – send AUTH_PASSWORD)
0x76 Logon (present username – request AUTH_SESSKEY)
0x77 Describe
0x7F OOTCM
0x8B OKPPC
0x08
Indicate OK – send from server
0x11
Extended TTI functions
0x6B Switch or detach session
0x78 Close
0x87 OSCID
0x9A OKEYVAL
0x20
Used when calling external procedures with service registration
0x44
ditto

No comments: