2 * Abstract: this file contains Net8 related definiton and structure
3 * gathered from jdbc thin driver
7 * Copyright (C) 2002 - 2002 AppDancer Networks, Inc. All rights reserved.
8 * Author: Charles Tai 01/28/2003
10 * The initial Wireshark version of this file was imported from the
11 * ClearSight source code package.
13 * Wireshark - Network traffic analyzer
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 typedef unsigned char UI8_T, BYTE,*UI8_P;
33 typedef unsigned short UI16_T, *UI16_P;
34 typedef unsigned int UI32_T, *UI32_P;
35 typedef int I32_T, *I32_P;
36 typedef short I16_T, *I16_P;
37 typedef char I8_T, *I8_P;
39 /*+-------------------------------
40 * NET8 protocol definition
41 *--------------------------------
45 /*+-------------------------------
47 *--------------------------------
49 #define NET8_TYPE_SETPROP 1 /* Set PROtocol */
50 #define NET8_TYPE_SETDATAREP 2 /* Set Data Representation */
51 #define NET8_TYPE_USERTOSERVER 3 /* User to Server request */
52 #define NET8_TYPE_ERRORSTATUS 4 /* Error return status */
53 #define NET8_TYPE_AUAS 5 /* Access User Address space */
54 #define NET8_TYPE_ROWTRANSFER 6 /* Row Transfer Header */
55 #define NET8_TYPE_ROWDATA 7 /* I made this to handle spanning data rows */
56 #define NET8_TYPE_OPIPARAM 8 /* return OPI parameter */
57 #define NET8_TYPE_FUNCCOMPLETE 9 /* return Function Complete */
58 #define NET8_TYPE_TTINOER 10 /* for msdos/os2 N oerdefs follow */
59 #define NET8_TYPE_TTIIOV 11 /* Sending IO vec only for fast UPI */
60 #define NET8_TYPE_TTISLG 12 /* Send LonG for fast UPI*/
61 #define NET8_TYPE_TTIICA 13 /* Invoke user CAllback*/
62 #define NET8_TYPE_TTILOBD 14 /* LOB/FILE data follows */
63 #define NET8_TYPE_TTIWRN 15 /* warning messages - may be a set of them */
66 #define NET8_TYPE_DESCINFO 16 /* Describe Information */
67 #define NET8_TYPE_PIGGYBACKFUNC 17 /* piggy back funtion follow */
68 #define NET8_TYPE_TTI3GL 18 /* signals special action for untrusted callout support */
69 #define NET8_TYPE_TTIFOB 19 /* Flush Out Bind data in DML/w RETURN when error */
70 #define NET8_TYPE_SECURENEG 0xde /* Secure Network Services Negotiation */
71 #define MAX_QUERY_STRING_LEN 256
73 /*+--------------------------------------
74 * User to Server request function types
75 * NET8_TYPE_USERTOSERVER 0x03
76 * look in ttc7\FunCodes.java
77 *---------------------------------------
79 #define NET8_USER_FUNC_OLOGON 1 /* logon to Oracle */
80 #define NET8_USER_FUNC_OPENCURSOR 2 /* Open Cursor */
81 #define NET8_USER_FUNC_PARSE 3 /* Parse */
82 #define NET8_USER_FUNC_EXECUTE 4 /* Execute */
83 #define NET8_USER_FUNC_OFETCH 5 /* fetch a row */
85 #define NET8_USER_FUNC_CLOSECURSOR 8 /* Close Cursor */
88 #define NET8_USER_FUNC_OLOGOFF 9 /* logoff of ORACLE */
89 #define NET8_USER_FUNC_ODSCRIBE 10 /* describe a select list column */
90 #define NET8_USER_FUNC_ODEFIN 11 /* define[] where the column goes */
91 #define NET8_USER_FUNC_OCOMON 12 /* auto[] commit on */
92 #define NET8_USER_FUNC_OCOMOFF 13 /* auto commit off */
93 #define NET8_USER_FUNC_OCOMMIT 14 /* commit */
94 #define NET8_USER_FUNC_OROLLBACK 15 /* rollback */
95 #define NET8_USER_FUNC_OSFE 16 /* set fatal error options */
96 #define NET8_USER_FUNC_ORESUME 17 /* resume current operation */
97 #define NET8_USER_FUNC_OVERSN 18 /* get ORACLE version-date string */
98 #define NET8_USER_FUNC_OTEMP 19 /* until we get rid of OASQL */
99 #define NET8_USER_FUNC_CANCEL 20 /* cancel the current operation */
100 #define NET8_USER_FUNC_OGEM 21 /* get error message */
101 #define NET8_USER_FUNC_OEXIT 22 /* Exit oracle command */
102 #define NET8_USER_FUNC_OSPECIAL 23 /* special function */
103 #define NET8_USER_FUNC_OABORT 24 /* abort */
104 #define NET8_USER_FUNC_ODQRID 25 /* deq by rowid */
105 #define NET8_USER_FUNC_OLNGF6 26 /* fetch a long column value */
106 #define NET8_USER_FUNC_OCAM 27 /* Create Access Module */
107 #define NET8_USER_FUNC_OSAMS 28 /* Save Access Module Statement */
108 #define NET8_USER_FUNC_OSAM 29 /* Save Access Module */
109 #define NET8_USER_FUNC_OPAMS 30 /* Parse Access Module Statement */
110 #define NET8_USER_FUNC_OHOWMANY 31 /* How Many Items? */
111 #define NET8_USER_FUNC_OINIT 32 /* Initialize Oracle */
112 #define NET8_USER_FUNC_OCHANGEU 33 /* change user id */
113 #define NET8_USER_FUNC_OBINDRP 34 /* Bind by reference positional */
114 #define NET8_USER_FUNC_OGETBV 35 /* Get n'th Bind Variable */
115 #define NET8_USER_FUNC_OGETIV 36 /* Get n'th Into Variable */
116 #define NET8_USER_FUNC_OBINDRV 37 /* Bind by reference */
117 #define NET8_USER_FUNC_OBINDRN 38 /* Bind by reference numeric */
118 #define NET8_USER_FUNC_OPARSEX 39 /* Parse And Execute */
119 #define NET8_USER_FUNC_OPARSYN 40 /* Parse for Syntax only */
120 #define NET8_USER_FUNC_OPARSDI 41 /* Parse for Syntax & SQL Dictionary lookup */
121 #define NET8_USER_FUNC_OCONTINUE 42 /* continue serving after eof */
122 #define NET8_USER_FUNC_ODSCRARR 43 /* array describe */
123 #define NET8_USER_FUNC_OLCCINI 44 /* init sys pars command table */
124 #define NET8_USER_FUNC_OLCCFIN 45 /* finalize sys pars command table */
125 #define NET8_USER_FUNC_OLCCPUT 46 /* put sys par in command table */
126 #define NET8_USER_FUNC_OLCCGPI 47 /* get sys pars info from command table */
127 #define NET8_USER_FUNC_OV6STRT 48 /* start Oracle (V6) */
128 #define NET8_USER_FUNC_OV6STOP 49 /* [poll for] shut down Oracle (V6) */
129 #define NET8_USER_FUNC_ORIP 50 /* run independent process (V6) */
130 #define NET8_USER_FUNC_OTRAM 51 /* test RAM (V6) */
131 #define NET8_USER_FUNC_OARCHIVE 52 /* archive op (V6) */
132 #define NET8_USER_FUNC_OMRSTART 53 /* media recovery - start (V6) */
133 #define NET8_USER_FUNC_OMRRECTS 54 /* media recovery - record tablespace to recover (V6) */
135 #define NET8_USER_FUNC_OMRGSLSQ 55 /* media recovery - get starting log seq # (V6) */
136 #define NET8_USER_FUNC_OMRREC 56 /* media recovery - recover using offline log (V6) */
137 #define NET8_USER_FUNC_OMRCAN 57 /* media recovery - cancel media recovery (V6) */
138 #define NET8_USER_FUNC_O2LOGON 58 /* logon to ORACLE (V6) (supercedes OLOGON) */
139 #define NET8_USER_FUNC_OVERSION 59 /* get ORACLE version-date string in new format */
140 #define NET8_USER_FUNC_OINIT2 60 /* new init call (supersedes OINIT) */
141 #define NET8_USER_FUNC_OCLOALL 61 /* reserved for MAC; close all cursors */
142 #define NET8_USER_FUNC_OALL 62 /* bundled execution call */
143 #define NET8_USER_FUNC_OTEX 63 /* reserved for os2/msdos; transaction execute call */
144 #define NET8_USER_FUNC_OSDAUTH 64 /* reserved for os2/msdos; set DBA authorization call */
146 #define NET8_USER_FUNC_OUDLFUN 65 /* for direct loader: functions */
147 #define NET8_USER_FUNC_OUDLBUF 66 /* for direct loader: buffer transfer */
148 #define NET8_USER_FUNC_OK2RPC 67 /* distrib. trans. mgr. RPC */
149 #define NET8_USER_FUNC_ODSCIDX 68 /* describe indexes for distributed query */
150 #define NET8_USER_FUNC_OSESOPN 69 /* session operations */
151 #define NET8_USER_FUNC_OEXECSCN 70 /* execute using synchronized system commit numbers */
152 #define NET8_USER_FUNC_OALL7 71 /* fast upi calls to opial7 */
153 #define NET8_USER_FUNC_OLONGF 72 /* Long fetch version 7 */
154 #define NET8_USER_FUNC_OEXECA 73 /* call opiexe from opiall; no two-task access */
155 #define NET8_USER_FUNC_OSQL7 74 /* New ver 7 parse call to deal with various flavours*/
156 #define NET8_USER_FUNC_OOBS 75 /* Please DO Not REUSE THIS CODE */
157 #define NET8_USER_FUNC_ORPC 76 /* RPC Call from pl/sql */
158 #define NET8_USER_FUNC_OKGL_OLD 77 /* do a KGL operation */
159 #define NET8_USER_FUNC_OEXFEN 78
160 #define NET8_USER_FUNC_OXAOPN 79 /* X/Open XA operation */
161 #define NET8_USER_FUNC_OKGL 80 /* New OKGL call */
162 #define NET8_USER_FUNC_03LOGON 81 /* 2nd Half of Logon */
163 #define NET8_USER_FUNC_03LOGA 82 /* 1st Half of Logon */
164 #define NET8_USER_FUNC_OFNSTM 83 /* Do Streaming Operation */
165 #define NET8_USER_FUNC_OPENSESS 84 /* Open Session */
166 #define NET8_USER_FUNC_O71XAOPN 85 /* X/Open XA operations (71 interface */
167 #define NET8_USER_FUNC_ODEBUG 86 /* debugging operation */
168 #define NET8_USER_FUNC_ODEBUGS 87 /* special debugging operation */
169 #define NET8_USER_FUNC_OXAST 88 /* XA start */
170 #define NET8_USER_FUNC_OXACM 89 /* XA Switch and Commit */
171 #define NET8_USER_FUNC_OXAPR 90 /* XA Switch and Prepare */
172 #define NET8_USER_FUNC_OXDP 91 /* direct copy from db buffers to client addr */
174 /* in Oracle 7 and lower, this used to be OCONNECT */
175 #define NET8_USER_FUNC_OKOD 92 /* New OKOD call */
177 /* Oracle 8 changes follow */
178 #define NET8_USER_FUNC_OCBK 93 /* OCBK call (kernel side only) */
179 #define NET8_USER_FUNC_OALL8 94 /* new v8 bundled call */
180 #define NET8_USER_FUNC_OFNSTM2 95 /* OFNSTM without the begintxn */
181 #define NET8_USER_FUNC_OLOBOPS 96 /* LOB and FILE related calls */
182 #define NET8_USER_FUNC_OFILECRT 97 /* FILE create call */
183 #define NET8_USER_FUNC_ODNY 98 /* new describe query call */
184 #define NET8_USER_FUNC_OCONNECT 99 /* code for non blocking attach host */
185 #define NET8_USER_FUNC_OOPENRCS 100 /* Open a recursive cursor */
186 #define NET8_USER_FUNC_OKPRALL 101 /* Bundled KPR execution */
187 #define NET8_USER_FUNC_OPLS 102 /* Bundled PL/SQL execution */
188 #define NET8_USER_FUNC_OTXSE 103 /* transaction start, attach, detach */
189 #define NET8_USER_FUNC_OTXEN 104 /* transaction commit, rollback, recover */
190 #define NET8_USER_FUNC_OCCA 105 /* Cursor Close All */
191 #define NET8_USER_FUNC_OFOI 106 /* Failover info piggyback */
192 #define NET8_USER_FUNC_O80SES 107 /* V8 session switching piggyback */
193 #define NET8_USER_FUNC_ODDF 108 /* Do Dummy Defines */
194 #define NET8_USER_FUNC_OLRMINI 109 /* init sys pars */
195 #define NET8_USER_FUNC_OLRMFIN 110 /* finalize sys pars */
196 #define NET8_USER_FUNC_OLRMPUT 111 /* put sys par in par space */
197 #define NET8_USER_FUNC_OLRMTRM 112 /* terminate sys pars */
198 #define NET8_USER_FUNC_OEXFENA 113 /* execute but don't unmap (used from opiall0) */
199 #define NET8_USER_FUNC_OINIUCB 114 /* OINIT for Untrusted CallBacks */
200 #define NET8_USER_FUNC_AUTH 115 /* Generic authentication call */
201 #define NET8_USER_FUNC_OFGI 116 /* FailOver Get Instance Info */
202 #define NET8_USER_FUNC_OOTCO 117 /* Oracle Transaction service COmmit remote sites */
203 #define NET8_USER_FUNC_GETSESSKEY 118 /* Get the session key */
204 #define NET8_USER_FUNC_ODSY 119 /* V8 Describe Any */
205 #define NET8_USER_FUNC_OCANA 120 /* Cancel All */
206 #define NET8_USER_FUNC_OAQEQ 121 /* AQ EnQueue */
207 #define NET8_USER_FUNC_OAQDQ 122 /* AQ Dequeue */
208 #define NET8_USER_FUNC_ORFS 123 /* RFS call */
209 #define NET8_USER_FUNC_OKPN 124 /* Kernel Programmatic Notification */
210 #define NET8_USER_FUNC_MAX_OFCN 124 /* last item allocated */
211 /*+--------------------------------------------------
212 * query results db types in the describe pkt
213 * for NET8_TYPE_OPIPARAM 0x08
214 * & for NET8_TYPE_DESCINFO 0x10
215 *---------------------------------------------------
217 #define NET8_DATATYPE_VARCHAR 0x01
218 #define NET8_DATATYPE_NUMBER 0x02
219 #define NET8_DATATYPE_VARNUM 0x06
220 #define NET8_DATATYPE_LONG 0x08
221 #define NET8_DATATYPE_DATE 0x0C
222 #define NET8_DATATYPE_RAW 0x17
223 #define NET8_DATATYPE_LONG_RAW 0x18
224 #define NET8_DATATYPE_CHAR 0x60
225 #define NET8_DATATYPE_RESULT_SET 0x66
226 #define NET8_DATATYPE_ROWID 0x68
227 #define NET8_DATATYPE_NAMED_TYPE 0x6D
228 #define NET8_DATATYPE_REF_TYPE 0x6F
229 #define NET8_DATATYPE_CLOB 0x70
230 #define NET8_DATATYPE_BLOB 0x71
231 #define NET8_DATATYPE_BFILE 0x72
232 #define NET8_DATATYPE_TIMESTAMP 0xB4
233 #define NET8_DATATYPE_TIMESTAMPTZ 0xB5
234 #define NET8_DATATYPE_INTERVALYM 0xB6
235 #define NET8_DATATYPE_INTERVALDS 0xB7
236 #define NET8_DATATYPE_TIMESTAMPLTZ 0xE7
237 #define NET8_DATATYPE_PLSQL_INDEX_TABLE 0x3E6
238 #define NET8_DATATYPE_FIXED_CHAR 0x3E7
240 /*+--------------------------------------------------
242 *---------------------------------------------------
244 #define NET8_DATATYPE_SIZE_TIMESTAMP 11
245 #define NET8_DATATYPE_SIZE_TIMESTAMPNOFRAC 7
246 #define NET8_DATATYPE_SIZE_DATE 7
247 #define NET8_DATATYPE_SIZE_TIMESTAMPZ 13
248 #define NET8_TIMESTAMPZ_REGIONIDBIT 0x80 /*-128*/
249 #define NET8_DATATYPE_SIZE_TIMESTAMPLTZ 11
250 #define NET8_DATATYPE_SIZE_TIMESTAMPLTZNOFRAC 7
255 void proto_register_sqloracle(void);
256 void proto_reg_handoff_sqloracle(void);