#include <dce_rpc_pac.h>
Collaboration diagram for BinPAC::DCE_RPC_Body:

Public Member Functions | |
| DCE_RPC_Body (DCE_RPC_Header *arg_header, int arg_length) | |
| ~DCE_RPC_Body () | |
| int | parse (const uint8 *const t_begin_of_data, const uint8 *const t_end_of_data, int t_byteorder) |
| DCE_RPC_Header *const | header () const |
| int const | length () const |
| int | val_case_index () const |
| DCE_RPC_Bind *const & | bind () const |
| DCE_RPC_Request *const & | request () const |
| DCE_RPC_Response *const & | response () const |
| array< uint8 > const & | other () const |
Protected Attributes | |
| DCE_RPC_Header * | header_ |
| int | length_ |
| int | val_case_index_ |
| union { | |
| DCE_RPC_Bind * bind_ | |
| DCE_RPC_Request * request_ | |
| DCE_RPC_Response * response_ | |
| array< uint8 > other_ | |
| } | val_ |
|
||||||||||||
|
Definition at line 546 of file dce_rpc_pac.cc. References header_, length_, and val_case_index_.
00547 {
00548 header_ = arg_header;
00549 length_ = arg_length;
00550 val_case_index_ = -1;
00551 }
|
|
|
Definition at line 553 of file dce_rpc_pac.cc. References BinPAC::delete_array(), val_, and val_case_index().
00554 {
00555 switch ( val_case_index() )
00556 {
00557 case 11:
00558 // Clean up "bind"
00559 {
00560 delete val_.bind_;
00561 }
00562 break;
00563 case 0:
00564 // Clean up "request"
00565 {
00566 delete val_.request_;
00567 }
00568 break;
00569 case 2:
00570 // Clean up "response"
00571 {
00572 delete val_.response_;
00573 }
00574 break;
00575 default:
00576 // Clean up "other"
00577 {
00578 delete_array(val_.other_);
00579 }
00580 break;
00581 }
00582 }
|
|
|
Definition at line 285 of file dce_rpc_pac.h. References val_, and val_case_index().
00286 {
00287 if ( val_case_index() == 11 )
00288 return val_.bind_;
00289 else
00290 throw ExceptionInvalidCase("./dce_rpc.pac:108:bind", val_case_index(), 11);
00291 }
|
|
|
Definition at line 282 of file dce_rpc_pac.h. References header_. Referenced by parse().
00282 { return header_; };
|
|
|
Definition at line 283 of file dce_rpc_pac.h. References length_. Referenced by parse().
00283 { return length_; };
|
|
|
Definition at line 306 of file dce_rpc_pac.h. References val_.
00307 {
00308 return val_.other_;
00309 }
|
|
||||||||||||||||
|
Definition at line 584 of file dce_rpc_pac.cc. References header(), length(), BinPAC::DCE_RPC_Header::PTYPE(), BinPAC::uint8, val_, val_case_index(), and val_case_index_. Referenced by BinPAC::DCE_RPC_PDU::parse().
00585 {
00586 int t_val__size;
00587 val_case_index_ = header()->PTYPE();
00588 switch ( val_case_index() )
00589 {
00590 case 11:
00591 // Parse "bind"
00592 {
00593 val_.bind_ = new DCE_RPC_Bind();
00594 int t_bind__size =
00595 val_.bind_->parse(t_begin_of_data, t_end_of_data, t_byteorder);
00596 t_val__size = t_bind__size;
00597 }
00598 break;
00599 case 0:
00600 // Parse "request"
00601 {
00602 val_.request_ = new DCE_RPC_Request(length());
00603 int t_request__size =
00604 val_.request_->parse(t_begin_of_data, t_end_of_data, t_byteorder);
00605 t_val__size = t_request__size;
00606 }
00607 break;
00608 case 2:
00609 // Parse "response"
00610 {
00611 val_.response_ = new DCE_RPC_Response(length());
00612 int t_response__size =
00613 val_.response_->parse(t_begin_of_data, t_end_of_data, t_byteorder);
00614 t_val__size = t_response__size;
00615 }
00616 break;
00617 default:
00618 // Parse "other"
00619 {
00620 int t_other__arraylength = length();
00621 int t_other__size = 1 * t_other__arraylength;
00622 // Checking out-of-bound for "DCE_RPC_Body:other"
00623 if ( t_begin_of_data + (t_other__size) > t_end_of_data )
00624 {
00625 // Handle out-of-bound condition
00626 throw ExceptionOutOfBound("DCE_RPC_Body:other",
00627 (0) + (t_other__size),
00628 (t_end_of_data) - (t_begin_of_data));
00629 }
00630 make_array<uint8>(val_.other_, t_other__arraylength);
00631 const uint8* t_other__elem__data = t_begin_of_data;
00632 for ( int t_other__elem__it = 0;
00633 t_other__elem__it < t_other__arraylength;
00634 ++t_other__elem__it )
00635 {
00636 uint8 t_other__elem;
00637 t_other__elem = *((uint8 *) (t_other__elem__data));
00638 val_.other_.v[t_other__elem__it] = t_other__elem;
00639 t_other__elem__data += 1;
00640 }
00641 t_val__size = t_other__size;
00642 }
00643 break;
00644 }
00645 return t_val__size;
00646 }
|
|
|
Definition at line 292 of file dce_rpc_pac.h. References val_, and val_case_index().
00293 {
00294 if ( val_case_index() == 0 )
00295 return val_.request_;
00296 else
00297 throw ExceptionInvalidCase("./dce_rpc.pac:109:request", val_case_index(), 0);
00298 }
|
|
|
Definition at line 299 of file dce_rpc_pac.h. References val_, and val_case_index().
00300 {
00301 if ( val_case_index() == 2 )
00302 return val_.response_;
00303 else
00304 throw ExceptionInvalidCase("./dce_rpc.pac:110:response", val_case_index(), 2);
00305 }
|
|
|
Definition at line 284 of file dce_rpc_pac.h. References val_case_index_. Referenced by bind(), parse(), request(), response(), and ~DCE_RPC_Body().
00284 { return val_case_index_; }
|
|
|
Definition at line 316 of file dce_rpc_pac.h. |
|
|
Definition at line 312 of file dce_rpc_pac.h. Referenced by DCE_RPC_Body(), and header(). |
|
|
Definition at line 313 of file dce_rpc_pac.h. Referenced by DCE_RPC_Body(), and length(). |
|
|
Definition at line 319 of file dce_rpc_pac.h. |
|
|
Definition at line 317 of file dce_rpc_pac.h. |
|
|
Definition at line 318 of file dce_rpc_pac.h. |
|
|
Referenced by bind(), other(), parse(), request(), response(), and ~DCE_RPC_Body(). |
|
|
Definition at line 314 of file dce_rpc_pac.h. Referenced by DCE_RPC_Body(), parse(), and val_case_index(). |
1.3.5