Skip to Content.
Sympa Menu

freetds - RE: [freetds] RPC/Packet Type 3 Format

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] RPC/Packet Type 3 Format
  • Date: Thu, 17 Jul 2003 16:11:57 -0400

> From: lists-tds AT mymailfilter.net [mailto:lists-tds AT mymailfilter.net]
> Sent: July 17, 2003 1:29 PM
>
> Is the format of the RPC packet known or available somewhere?

I was going to say Yes, until I looked at your trace. That wasn't produced
by FreeTDS, was it? Our Type 3 packets include "sp_execsql". Where did
this come from?

------------------------||TDS Packet starts w/byte 7 (03)
0030 f7 48 ca 56 00 00 03 01 00 fa 00 00 01 00 ff ff .H.V............
0040 0b 00 00 00 00 01 26 04 04 ff ff ff ff 00 00 63 ......&........c
0050 00 00 00 00 09 04 00 01 32 ff ff ff ff 00 00 63 ........2......c
0060 ba 00 00 00 09 04 00 01 32 ba 00 00 00 64 00 65 ........2....d.e
0070 00 63 00 6c 00 61 00 72 00 65 00 20 00 40 00 70 .c.l.a.r.e. .@.p
0080 00 34 00 20 00 69 00 6e 00 74 00 65 00 67 00 65 .4. .i.n.t.e.g.e
0090 00 72 00 0d 00 0a 00 65 00 78 00 65 00 63 00 20 .r.....e.x.e.c.
00a0 00 6a 00 64 00 5f 00 74 00 65 00 73 00 74 00 5f .j.d._.t.e.s.t._
00b0 00 30 00 30 00 31 00 20 00 40 00 70 00 31 00 3d .0.0.1. .@.p.1.=
00c0 00 33 00 2c 00 20 00 40 00 70 00 32 00 3d 00 27 .3.,. .@.p.2.=.'
00d0 00 74 00 65 00 73 00 74 00 27 00 2c 00 20 00 40 .t.e.s.t.'.,. .@
00e0 00 70 00 33 00 3d 00 20 00 27 00 30 00 37 00 2f .p.3.=. .'.0.7./
00f0 00 31 00 37 00 2f 00 32 00 30 00 30 00 33 00 27 .1.7./.2.0.0.3.'
0100 00 2c 00 20 00 40 00 40 00 70 00 34 00 3d 00 40 .,. .@.@.p.4.=.@
0110 00 70 00 34 00 20 00 6f 00 75 00 74 00 70 00 75 .p.4. .o.u.t.p.u
0120 00 74 00 0d 00 0a 00 00 00 26 04 04 01 00 00 00 .t.......&......>

> Also, there are sometimes characters inserted within the SQL code (in
> between parameters and such (N' 2 & etc). Are the rules
> surrounding this known?

Your example doesn't show any such. The first explanation that comes to
mind is that some character data must be explicitly UCS-2, represented as

N'your stuff here'

> And finally, there is a bit of a "trailer" on the end of each
> packet.

0120 00 74 00 0d 00 0a 00 00 00 26 04 04 01 00 00 00
\0 t \0 CR \0 LF \0 \0 ?? ?? ?? ^^ ^^ ^^^^^ ^^
| | | 3 more?
| | + length=0
| + final
+ Response packet

I see a CR/LF pair, a null terminator (or so), two unknown bytes, and a
server response. I think.

HTH. Could I know your name?

--jkl
-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page