NTTransPacket.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851
  1. /*
  2. * Copyright (C) 2006-2010 Alfresco Software Limited.
  3. *
  4. * This file is part of Alfresco
  5. *
  6. * Alfresco is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Alfresco is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package org.alfresco.jlan.client;
  20. import java.io.*;
  21. import org.alfresco.jlan.debug.Debug;
  22. import org.alfresco.jlan.netbios.RFCNetBIOSProtocol;
  23. import org.alfresco.jlan.smb.PacketType;
  24. import org.alfresco.jlan.smb.SMBException;
  25. import org.alfresco.jlan.smb.TransactBuffer;
  26. import org.alfresco.jlan.util.DataBuffer;
  27. import org.alfresco.jlan.util.DataPacker;
  28. /**
  29. * NT Transaction Packet Class
  30. *
  31. * @author gkspencer
  32. */
  33. public class NTTransPacket extends SMBPacket {
  34. // Define the number of standard parameter words/bytes
  35. private static final int StandardParams = 19;
  36. private static final int ParameterBytes = 36; // 8 x 32bit params + max setup count byte + setup count byte + reserved word
  37. // Offset to start of NT parameters from start of packet
  38. private static final int NTMaxSetupCount = SMBPacket.PARAMWORDS;
  39. private static final int NTParams = SMBPacket.PARAMWORDS + 3;
  40. private static final int NTSetupCount = NTParams + 32;
  41. private static final int NTFunction = NTSetupCount + 1;
  42. // Default return parameter/data byte counts
  43. private static final int DefaultReturnParams = 4;
  44. private static final int DefaultReturnData = 1024;
  45. /**
  46. * Default constructor
  47. */
  48. public NTTransPacket() {
  49. super();
  50. }
  51. /**
  52. * Class constructor
  53. *
  54. * @param buf byte[]
  55. */
  56. public NTTransPacket(byte[] buf) {
  57. super(buf);
  58. }
  59. /**
  60. * Return the data block size
  61. *
  62. * @return Data block size in bytes
  63. */
  64. public final int getDataLength() {
  65. return getNTParameter(6);
  66. }
  67. /**
  68. * Return the data block offset
  69. *
  70. * @return Data block offset within the SMB packet.
  71. */
  72. public final int getDataOffset() {
  73. return getNTParameter(7) + RFCNetBIOSProtocol.HEADER_LEN;
  74. }
  75. /**
  76. * Unpack the parameter block
  77. *
  78. * @return int[]
  79. */
  80. public final int[] getParameterBlock() {
  81. // Get the parameter count and allocate the parameter buffer
  82. int prmcnt = getParameterBlockCount() / 4; // convert to number of ints
  83. if ( prmcnt <= 0)
  84. return null;
  85. int[] prmblk = new int[prmcnt];
  86. // Get the offset to the parameter words, add the NetBIOS header length
  87. // to the offset.
  88. int pos = getParameterBlockOffset();
  89. // Unpack the parameter ints
  90. setBytePointer(pos, getByteCount());
  91. for (int idx = 0; idx < prmcnt; idx++) {
  92. // Unpack the current parameter value
  93. prmblk[idx] = unpackInt();
  94. }
  95. // Debug mode
  96. if ( Debug.EnableInfo && Session.hasDebugOption(Session.DBGDumpPacket)) {
  97. Debug.println("NT Transaction parameter dump - " + prmcnt + " params :-");
  98. for (int i = 0; i < prmcnt; i++)
  99. Debug.println(" " + i + ". = " + prmblk[i] + ", 0x" + Integer.toHexString(prmblk[i]));
  100. }
  101. // Return the parameter block
  102. return prmblk;
  103. }
  104. /**
  105. * Return the total parameter count
  106. *
  107. * @return int
  108. */
  109. public final int getTotalParameterCount() {
  110. return getNTParameter(0);
  111. }
  112. /**
  113. * Return the total data count
  114. *
  115. * @return int
  116. */
  117. public final int getTotalDataCount() {
  118. return getNTParameter(1);
  119. }
  120. /**
  121. * Return the parameter block count
  122. *
  123. * @return int
  124. */
  125. public final int getParameterBlockCount() {
  126. return getNTParameter(2);
  127. }
  128. /**
  129. * Return the parameter block offset
  130. *
  131. * @return int
  132. */
  133. public final int getParameterBlockOffset() {
  134. return getNTParameter(3) + RFCNetBIOSProtocol.HEADER_LEN;
  135. }
  136. /**
  137. * Return the paramater block displacement
  138. *
  139. * @return int
  140. */
  141. public final int getParameterBlockDisplacement() {
  142. return getNTParameter(4);
  143. }
  144. /**
  145. * Return the data block count
  146. *
  147. * @return int
  148. */
  149. public final int getDataBlockCount() {
  150. return getNTParameter(5);
  151. }
  152. /**
  153. * Return the data block offset
  154. *
  155. * @return int
  156. */
  157. public final int getDataBlockOffset() {
  158. return getNTParameter(6) + RFCNetBIOSProtocol.HEADER_LEN;
  159. }
  160. /**
  161. * Return the data block displacment
  162. *
  163. * @return int
  164. */
  165. public final int getDataBlockDisplacement() {
  166. return getNTParameter(7);
  167. }
  168. /**
  169. * Initialize the transact SMB packet
  170. *
  171. * @param func NT transaction function code
  172. * @param paramblk Parameter block data bytes
  173. * @param plen Parameter block data length
  174. * @param datablk Data block data bytes
  175. * @param dlen Data block data length
  176. * @param setupcnt Number of setup parameters
  177. */
  178. public final void InitializeNTTransact(int func, byte[] paramblk, int plen, byte[] datablk, int dlen, int setupcnt) {
  179. InitializeNTTransact(func, paramblk, plen, datablk, dlen, setupcnt, DefaultReturnParams, DefaultReturnData);
  180. }
  181. /**
  182. * Initialize the transact SMB packet
  183. *
  184. * @param func NT transaction function code
  185. * @param paramblk Parameter block data bytes
  186. * @param plen Parameter block data length
  187. * @param datablk Data block data bytes
  188. * @param dlen Data block data length
  189. * @param setupcnt Number of setup parameters
  190. * @param maxPrm Maximum parameter bytes to return
  191. * @param maxData Maximum data bytes to return
  192. */
  193. public final void InitializeNTTransact(int func, byte[] paramblk, int plen, byte[] datablk, int dlen, int setupcnt,
  194. int maxPrm, int maxData) {
  195. // Set the SMB command and parameter count
  196. setCommand(PacketType.NTTransact);
  197. setParameterCount(StandardParams + setupcnt);
  198. // Initialize the parameters
  199. setTotalParameterCount(plen);
  200. setTotalDataCount(dlen);
  201. setMaximumParameterReturn(maxPrm);
  202. setMaximumDataReturn(maxData);
  203. setNTParameterCount(plen);
  204. setParameterBlockOffset(0);
  205. setDataBlockCount(dlen);
  206. setDataBlockOffset(0);
  207. setSetupCount(setupcnt);
  208. setNTFunction(func);
  209. resetBytePointerAlign();
  210. // Pack the parameter block
  211. if ( paramblk != null) {
  212. // Set the parameter block offset, from the start of the SMB packet
  213. setParameterBlockOffset(getPosition());
  214. // Pack the parameter block
  215. packBytes(paramblk, plen);
  216. }
  217. // Pack the data block
  218. if ( datablk != null) {
  219. // Align the byte area offset and set the data block offset in the request
  220. alignBytePointer();
  221. setDataBlockOffset(getPosition());
  222. // Pack the data block
  223. packBytes(datablk, dlen);
  224. }
  225. // Set the byte count for the SMB packet
  226. setByteCount();
  227. }
  228. /**
  229. * Perform a transaction request and receive the response data
  230. *
  231. * @param sess Session
  232. * @param tbuf TransactBuffer
  233. * @return TransactBuffer
  234. * @exception IOException
  235. * @exception SMBException
  236. */
  237. public final TransactBuffer doTransaction(Session sess, TransactBuffer tbuf)
  238. throws IOException, SMBException {
  239. // Initialize the transaction request packet
  240. int mid = sess.getNextMultiplexId();
  241. setCommand(PacketType.NTTransact);
  242. setFlags(sess.getDefaultFlags());
  243. setFlags2(sess.getDefaultFlags2());
  244. setMultiplexId(mid);
  245. setTreeId(sess.getTreeId());
  246. setUserId(sess.getUserId());
  247. // Get the individual buffers from the transact buffer
  248. tbuf.setEndOfBuffer();
  249. DataBuffer setupBuf = tbuf.getSetupBuffer();
  250. DataBuffer paramBuf = tbuf.getParameterBuffer();
  251. DataBuffer dataBuf = tbuf.getDataBuffer();
  252. // Set the parameter count
  253. if ( tbuf.hasSetupBuffer())
  254. setParameterCount(StandardParams + setupBuf.getLengthInWords());
  255. else
  256. setParameterCount(StandardParams);
  257. // Get the total parameter/data block lengths
  258. int totParamLen = paramBuf != null ? paramBuf.getLength() : 0;
  259. int totDataLen = dataBuf != null ? dataBuf.getLength() : 0;
  260. // Initialize the parameters
  261. setTotalParameterCount(totParamLen);
  262. setTotalDataCount(totDataLen);
  263. setMaximumParameterReturn(tbuf.getReturnParameterLimit());
  264. setMaximumDataReturn(tbuf.getReturnDataLimit());
  265. // Check if the transaction parameter block and data block will fit within a single request
  266. // packet
  267. int availBuf = getAvailableLength();
  268. int plen = totParamLen;
  269. int dlen = totDataLen;
  270. if ( (plen + dlen) > availBuf) {
  271. // Calculate the parameter/data block sizes to send in the first request packet
  272. if ( plen > 0) {
  273. // Check if the parameter block can fit into the packet
  274. if ( plen <= availBuf) {
  275. // Pack all of the parameter block and fill the remaining buffer with the data
  276. // block
  277. if ( dlen > 0)
  278. dlen = availBuf - plen;
  279. }
  280. else {
  281. // Split the parameter/data space in the packet
  282. plen = availBuf / 2;
  283. dlen = plen;
  284. }
  285. }
  286. else if ( dlen > availBuf) {
  287. // Fill the packet with the first section of the data block
  288. dlen = availBuf;
  289. }
  290. }
  291. // Set the parameter/data block counts for this packet
  292. setNTParameterCount(plen);
  293. setParameterBlockOffset(0);
  294. setDataBlockCount(dlen);
  295. setDataBlockOffset(0);
  296. setSetupCount(setupBuf != null ? setupBuf.getLengthInWords() : 0);
  297. setNTFunction(tbuf.getFunction());
  298. // Pack the setup bytes
  299. if ( setupBuf != null)
  300. setupBuf.copyData(getBuffer(), getSetupOffset());
  301. // Pack the parameter block
  302. resetBytePointerAlign();
  303. // Set the parameter block offset, from the start of the SMB packet
  304. int pos = getPosition();
  305. setParameterBlockOffset(pos);
  306. int packLen = -1;
  307. if ( paramBuf != null) {
  308. // Pack the parameter block
  309. packLen = paramBuf.copyData(getBuffer(), pos, plen);
  310. // Update the buffer position for the data block
  311. pos = DataPacker.wordAlign(pos + packLen);
  312. setPosition(pos);
  313. }
  314. // Set the data block offset
  315. setDataBlockOffset(pos);
  316. // Pack the data block
  317. if ( dataBuf != null) {
  318. // Pack the data block
  319. packLen = dataBuf.copyData(getBuffer(), pos, dlen);
  320. // Update the end of buffer position
  321. setPosition(pos + packLen);
  322. }
  323. // Set the byte count for the SMB packet
  324. setByteCount();
  325. // Send/receive the transaction
  326. TransactBuffer respBuf = null;
  327. try {
  328. // Indicate that we are in a transaction, for SMB signing
  329. sess.setTransactionMID(mid);
  330. // Send the start of the transaction request
  331. SendSMB(sess);
  332. // If the transaction has been split over several requests the server will send an
  333. // interim response
  334. if ( (paramBuf != null && paramBuf.getAvailableLength() > 0) || (dataBuf != null && dataBuf.getAvailableLength() > 0)) {
  335. // Receive the interim response SMB
  336. ReceiveSMB(sess);
  337. }
  338. // Get the available parameter/data block buffer space for the secondary packet
  339. availBuf = getAvailableLength();
  340. // Loop until all parameter/data block data has been sent to the server
  341. while ((paramBuf != null && paramBuf.getAvailableLength() > 0)
  342. || (dataBuf != null && dataBuf.getAvailableLength() > 0)) {
  343. // Setup the NT transaction secondary packet to send the remaining parameter/data
  344. // blocks
  345. setCommand(PacketType.NTTransactSecond);
  346. setFlags(sess.getDefaultFlags());
  347. setFlags2(sess.getDefaultFlags2());
  348. setNTParameterCount(18);
  349. setTotalParameterCount(totParamLen);
  350. setTotalDataCount(totDataLen);
  351. // Set a new multiple id for each secondary packet
  352. setMultiplexId(sess.getNextMultiplexId());
  353. // Get the remaining parameter/data block lengths
  354. plen = paramBuf != null ? paramBuf.getAvailableLength() : 0;
  355. dlen = dataBuf != null ? dataBuf.getAvailableLength() : 0;
  356. if ( (plen + dlen) > availBuf) {
  357. // Calculate the parameter/data block sizes to send in the first request packet
  358. if ( plen > 0) {
  359. // Check if the remaining parameter block can fit into the packet
  360. if ( plen <= availBuf) {
  361. // Pack all of the parameter block and fill the remaining buffer with
  362. // the data block
  363. if ( dlen > 0)
  364. dlen = availBuf - plen;
  365. }
  366. else {
  367. // Split the parameter/data space in the packet
  368. plen = availBuf / 2;
  369. dlen = plen;
  370. }
  371. }
  372. else if ( dlen > availBuf) {
  373. // Fill the packet with the first section of the data block
  374. dlen = availBuf;
  375. }
  376. }
  377. // Pack the parameter block data, if any
  378. resetBytePointerAlign();
  379. packLen = -1;
  380. pos = getPosition();
  381. if ( plen > 0 && paramBuf != null) {
  382. // Set the parameter block offset, from the start of the SMB packet
  383. setParameterBlockOffset(pos);
  384. // Pack the parameter block
  385. packLen = paramBuf.copyData(getBuffer(), pos, plen);
  386. // Update the buffer position for the data block
  387. pos = DataPacker.wordAlign(pos + packLen);
  388. setPosition(pos);
  389. }
  390. // Pack the data block, if any
  391. if ( dlen > 0 && dataBuf != null) {
  392. // Set the data block offset
  393. setDataBlockOffset(pos);
  394. // Pack the data block
  395. packLen = dataBuf.copyData(getBuffer(), pos, dlen);
  396. // Update the end of buffer position
  397. setPosition(pos + packLen);
  398. }
  399. // Set the byte count for the SMB packet to set the overall length
  400. setByteCount();
  401. // Send the NT transaction secondary request, there is no response sent until all of
  402. // the transaction
  403. // parameter/data blocks have been sent and the server processes the transaction
  404. SendSMB(sess);
  405. }
  406. // Set the packet type so that the receive processing filters the correct packet
  407. setCommand(PacketType.NTTransact);
  408. // Receive the start of the transaction response
  409. ReceiveSMB(sess, false);
  410. // Check if the response is an error, there may be a warning to indicate that the reply
  411. // buffer is too short
  412. if ( isValidResponse() == false) // || warning_status
  413. checkForError();
  414. // Get the total return parameter block and data block lengths, and allocate the
  415. // response transaction buffer
  416. totParamLen = getTotalParameterCount();
  417. totDataLen = getTotalDataCount();
  418. int setupLen = getSetupCount() * 2;
  419. respBuf = new TransactBuffer(setupLen, totParamLen, totDataLen);
  420. // Get the individual buffers from the transact buffer
  421. setupBuf = respBuf.getSetupBuffer();
  422. paramBuf = respBuf.getParameterBuffer();
  423. dataBuf = respBuf.getDataBuffer();
  424. // Copy the return setup parameters, if any
  425. if ( setupLen > 0)
  426. setupBuf.appendData(getBuffer(), getSetupOffset(), setupLen);
  427. // Copy the parameter/data sections to the response transaction buffer and receive
  428. // additional response SMBs
  429. // until all of the response has been processed
  430. while ((paramBuf != null && paramBuf.getLength() < totParamLen)
  431. || (dataBuf != null && dataBuf.getLength() < totDataLen)) {
  432. // Copy the parameter data from the packet to the response buffer
  433. plen = getParameterBlockCount();
  434. if ( plen > 0 && paramBuf != null) {
  435. // Copy the parameter block section to the response buffer
  436. paramBuf.appendData(getBuffer(), getParameterBlockOffset(), plen);
  437. }
  438. // Copy the data from the packet to the response buffer
  439. dlen = getDataBlockCount();
  440. if ( dlen > 0 && dataBuf != null) {
  441. // Copy the data block section to the response buffer
  442. dataBuf.appendData(getBuffer(), getDataBlockOffset(), dlen);
  443. }
  444. // Check if we have received all the parameter/data block data
  445. if ( (paramBuf != null && paramBuf.getLength() < totParamLen)
  446. || (dataBuf != null && dataBuf.getLength() < totDataLen)) {
  447. // Read another packet of transaction response data
  448. ReceiveSMB(sess, false);
  449. // Check the receive status
  450. if ( isValidResponse() == false)
  451. checkForError();
  452. // Get the total parameter/data block lengths as they can change
  453. totParamLen = getTotalParameterCount();
  454. totDataLen = getTotalDataCount();
  455. }
  456. }
  457. // Reset the receive data buffers to read the data
  458. if ( respBuf != null)
  459. respBuf.setEndOfBuffer();
  460. }
  461. finally {
  462. // Indicate that the transaction is complete, for SMB signing
  463. sess.setTransactionMID(Session.NO_TRANSACTION);
  464. }
  465. // Return the response transaction buffer
  466. return respBuf;
  467. }
  468. /**
  469. * Set the total parameter count
  470. *
  471. * @param cnt int
  472. */
  473. public final void setTotalParameterCount(int cnt) {
  474. setNTParameter(0, cnt);
  475. }
  476. /**
  477. * Set the total data count
  478. *
  479. * @param cnt int
  480. */
  481. public final void setTotalDataCount(int cnt) {
  482. setNTParameter(1, cnt);
  483. }
  484. /**
  485. * Set the maximum return parameter count
  486. *
  487. * @param cnt int
  488. */
  489. public final void setMaximumParameterReturn(int cnt) {
  490. setNTParameter(2, cnt);
  491. }
  492. /**
  493. * Set the maximum return data count
  494. *
  495. * @param cnt int
  496. */
  497. public final void setMaximumDataReturn(int cnt) {
  498. setNTParameter(3, cnt);
  499. }
  500. /**
  501. * Set the paramater block count
  502. *
  503. * @param cnt int
  504. */
  505. public final void setNTParameterCount(int cnt) {
  506. setNTParameter(4, cnt);
  507. }
  508. /**
  509. * Set the parameter block offset within the packet
  510. *
  511. * @param off int
  512. */
  513. public final void setParameterBlockOffset(int off) {
  514. setNTParameter(5, off != 0 ? off - RFCNetBIOSProtocol.HEADER_LEN : 0);
  515. }
  516. /**
  517. * Set the data block count
  518. *
  519. * @param cnt int
  520. */
  521. public final void setDataBlockCount(int cnt) {
  522. setNTParameter(6, cnt);
  523. }
  524. /**
  525. * Set the data block offset
  526. *
  527. * @param off int
  528. */
  529. public final void setDataBlockOffset(int off) {
  530. setNTParameter(7, off != 0 ? off - RFCNetBIOSProtocol.HEADER_LEN : 0);
  531. }
  532. /**
  533. * Get an NT parameter (32bit)
  534. *
  535. * @param idx int
  536. * @return int
  537. */
  538. private final int getNTParameter(int idx) {
  539. int pos = NTParams + (4 * idx);
  540. return DataPacker.getIntelInt(getBuffer(), pos);
  541. }
  542. /**
  543. * Get the setup parameter count
  544. *
  545. * @return int
  546. */
  547. public final int getSetupCount() {
  548. byte[] buf = getBuffer();
  549. return (int) buf[NTSetupCount] & 0xFF;
  550. }
  551. /**
  552. * Return the offset to the setup words data
  553. *
  554. * @return int
  555. */
  556. public final int getSetupOffset() {
  557. return NTFunction + 2;
  558. }
  559. /**
  560. * Get the NT transaction function code
  561. *
  562. * @return int
  563. */
  564. public final int getNTFunction() {
  565. byte[] buf = getBuffer();
  566. return DataPacker.getIntelShort(buf, NTFunction);
  567. }
  568. /**
  569. * Set an NT parameter (32bit)
  570. *
  571. * @param idx int
  572. * @param val int
  573. */
  574. private final void setNTParameter(int idx, int val) {
  575. int pos = NTParams + (4 * idx);
  576. DataPacker.putIntelInt(val, getBuffer(), pos);
  577. }
  578. /**
  579. * Set the maximum setup parameter count
  580. *
  581. * @param cnt Maximum count of setup paramater words
  582. */
  583. public final void setMaximumSetupCount(int cnt) {
  584. byte[] buf = getBuffer();
  585. buf[NTMaxSetupCount] = (byte) cnt;
  586. }
  587. /**
  588. * Set the setup parameter count
  589. *
  590. * @param cnt Count of setup paramater words
  591. */
  592. public final void setSetupCount(int cnt) {
  593. byte[] buf = getBuffer();
  594. buf[NTSetupCount] = (byte) cnt;
  595. }
  596. /**
  597. * Set the NT transaction function code
  598. *
  599. * @param func int
  600. */
  601. public final void setNTFunction(int func) {
  602. byte[] buf = getBuffer();
  603. DataPacker.putIntelShort(func, buf, NTFunction);
  604. }
  605. /**
  606. * Reset the byte/parameter pointer area for packing/unpacking setup paramaters items to the
  607. * packet
  608. */
  609. public final void resetSetupPointer() {
  610. m_pos = NTFunction + 2;
  611. m_endpos = m_pos;
  612. }
  613. /**
  614. * Reset the byte/parameter pointer area for packing/unpacking the transaction data block
  615. */
  616. public final void resetDataBlockPointer() {
  617. m_pos = getDataBlockOffset();
  618. m_endpos = m_pos;
  619. }
  620. /**
  621. * Reset the byte/parameter pointer area for packing/unpacking the transaction paramater block
  622. */
  623. public final void resetParameterBlockPointer() {
  624. m_pos = getParameterBlockOffset();
  625. m_endpos = m_pos;
  626. }
  627. }