| 253 | |
| 254 | |
| 255 | bool_t xdr_protocol(RemoteXdr* xdrs, PACKET* p) |
| 256 | { |
| 257 | /************************************** |
| 258 | * |
| 259 | * x d r _ p r o t o c o l |
| 260 | * |
| 261 | ************************************** |
| 262 | * |
| 263 | * Functional description |
| 264 | * Encode, decode, or free a protocol packet. |
| 265 | * |
| 266 | **************************************/ |
| 267 | p_cnct::p_cnct_repeat* tail; |
| 268 | P_ACPT *accept; |
| 269 | P_ACPD *accept_with_data; |
| 270 | P_ATCH *attach; |
| 271 | P_RESP *response; |
| 272 | P_CMPL *compile; |
| 273 | P_STTR *transaction; |
| 274 | P_DATA *data; |
| 275 | P_RLSE *release; |
| 276 | P_BLOB *blob; |
| 277 | P_SGMT *segment; |
| 278 | P_INFO *info; |
| 279 | P_PREP *prepare; |
| 280 | P_REQ *request; |
| 281 | P_SLC *slice; |
| 282 | P_SLR *slice_response; |
| 283 | P_SEEK *seek; |
| 284 | P_SQLFREE *free_stmt; |
| 285 | P_SQLCUR *sqlcur; |
| 286 | P_SQLST *prep_stmt; |
| 287 | P_SQLDATA *sqldata; |
| 288 | P_TRRQ *trrq; |
| 289 | #ifdef DEBUG |
| 290 | xdr_save_size = xdrs->x_handy; |
| 291 | #endif |
| 292 | |
| 293 | DEBUG_XDR_PACKET(xdrs, p); |
| 294 | |
| 295 | if (!xdr_enum(xdrs, reinterpret_cast<xdr_op*>(&p->p_operation))) |
| 296 | return P_FALSE(xdrs, p); |
| 297 | |
| 298 | #if COMPRESS_DEBUG > 1 |
| 299 | if (xdrs->x_op != XDR_FREE) |
| 300 | { |
| 301 | fprintf(stderr, "operation=%d %c\n", p->p_operation, |
| 302 | xdrs->x_op == XDR_ENCODE ? 'E' : xdrs->x_op == XDR_DECODE ? 'D' : xdrs->x_op == XDR_FREE ? 'F' : 'U'); |
| 303 | } |
| 304 | #endif |
| 305 | |
| 306 | const auto port = xdrs->x_public; |
| 307 | |
| 308 | if (xdrs->x_op != XDR_FREE) |
| 309 | port->bumpLogPackets(xdrs->x_op == XDR_ENCODE ? rem_port::SEND : rem_port::RECEIVE); |
| 310 | |
| 311 | switch (p->p_operation) |
| 312 | { |
no test coverage detected