| 310 | |
| 311 | |
| 312 | void REMOTE_free_packet( rem_port* port, PACKET * packet, bool partial) |
| 313 | { |
| 314 | /************************************** |
| 315 | * |
| 316 | * R E M O T E _ f r e e _ p a c k e t |
| 317 | * |
| 318 | ************************************** |
| 319 | * |
| 320 | * Functional description |
| 321 | * Zero out a full packet block (partial == false) or |
| 322 | * part of packet used in last operation (partial == true) |
| 323 | **************************************/ |
| 324 | RemoteXdr xdr; |
| 325 | USHORT n; |
| 326 | |
| 327 | if (packet) |
| 328 | { |
| 329 | xdr.create(reinterpret_cast<char*>(packet), sizeof(PACKET), XDR_FREE); |
| 330 | xdr.x_public = port; |
| 331 | xdr.x_local = (port->port_type == rem_port::XNET); |
| 332 | |
| 333 | if (partial) { |
| 334 | xdr_protocol(&xdr, packet); |
| 335 | } |
| 336 | else |
| 337 | { |
| 338 | for (n = (USHORT) op_connect; n < (USHORT) op_max; n++) |
| 339 | { |
| 340 | packet->p_operation = (P_OP) n; |
| 341 | xdr_protocol(&xdr, packet); |
| 342 | } |
| 343 | } |
| 344 | #ifdef DEBUG_XDR_MEMORY |
| 345 | // All packet memory allocations should now be voided. |
| 346 | // note: this code will may work properly if partial == true |
| 347 | |
| 348 | for (n = 0; n < P_MALLOC_SIZE; n++) |
| 349 | fb_assert(packet->p_malloc[n].p_operation == op_void); |
| 350 | #endif |
| 351 | packet->p_operation = op_void; |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | |
| 356 | void REMOTE_get_timeout_params(rem_port* port, ClumpletReader* pb) |
no test coverage detected