Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

BinPAC::SMB_unicode_string Class Reference

#include <smb_pac.h>

Collaboration diagram for BinPAC::SMB_unicode_string:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SMB_unicode_string (int arg_offset)
 ~SMB_unicode_string ()
int parse (const uint8 *const t_begin_of_data, const uint8 *const t_end_of_data, int t_byteorder)
int const  offset () const
array< uint16 > const & s () const

Protected Attributes

int offset_
array< uint16s_

Constructor & Destructor Documentation

BinPAC::SMB_unicode_string::SMB_unicode_string int  arg_offset  ) 
 

Definition at line 298 of file smb_pac.cc.

References BinPAC::make_array(), offset_, and s_.

00299         {
00300         offset_ = arg_offset;
00301         make_array(s_, 0);
00302         }

BinPAC::SMB_unicode_string::~SMB_unicode_string  ) 
 

Definition at line 304 of file smb_pac.cc.

References BinPAC::delete_array(), and s_.

00305         {
00306         delete_array(s_);
00307         }


Member Function Documentation

int const BinPAC::SMB_unicode_string::offset  )  const [inline]
 

Definition at line 152 of file smb_pac.h.

References offset_.

Referenced by parse().

00152 { return offset_; };

int BinPAC::SMB_unicode_string::parse const uint8 *const  t_begin_of_data,
const uint8 *const  t_end_of_data,
int  t_byteorder
 

Definition at line 309 of file smb_pac.cc.

References BinPAC::array< uint16 >::length, offset(), s(), s_, BinPAC::array< uint16 >::size(), BinPAC::uint16, and BinPAC::uint8.

00310         {
00311         
00312         const uint8* const t_dataptr_after_pad = t_begin_of_data + (offset() & 1);
00313         // Parse "s"
00314         std::vector<uint16> t_s__vec;
00315         const uint8* t_s__elem__data = t_dataptr_after_pad;
00316         for ( int t_s__elem__it = 0; 
00317                 /* forever */; 
00318                 ++t_s__elem__it )
00319                 {
00320                 // Checking out-of-bound for "s"
00321                 if ( t_s__elem__data + (2) > t_end_of_data )
00322                         {
00323                         // Handle out-of-bound condition
00324                         throw ExceptionOutOfBound("s",
00325                                 ((t_s__elem__data - t_begin_of_data)) + (2), 
00326                                 (t_end_of_data) - (t_begin_of_data));
00327                         }
00328                 if ( // Have we reached the end of the sequence?
00329                      t_s__elem__data[0] == 0 &&
00330                      t_s__elem__data[1] == 0 
00331                    )
00332                         {
00333                         t_s__elem__data += 2;
00334                         break;
00335                         }
00336                 uint16 t_s__elem;
00337                 // Checking out-of-bound for "SMB_unicode_string:s__elem"
00338                 if ( t_s__elem__data + (2) > t_end_of_data )
00339                         {
00340                         // Handle out-of-bound condition
00341                         throw ExceptionOutOfBound("SMB_unicode_string:s__elem",
00342                                 ((t_s__elem__data - t_begin_of_data)) + (2), 
00343                                 (t_end_of_data) - (t_begin_of_data));
00344                         }
00345                 t_s__elem = UnMarshall<uint16>(t_s__elem__data, t_s__elem, t_byteorder);
00346                 t_s__vec.push_back(t_s__elem);
00347                 t_s__elem__data += 2;
00348                 }
00349         make_array<uint16>(s_, t_s__vec.size());
00350         for ( int t_s__elem__it = 0; t_s__elem__it < s().length; ++t_s__elem__it )
00351                 s_[t_s__elem__it] = t_s__vec[t_s__elem__it];
00352         int t_s__size = t_s__elem__data - t_dataptr_after_pad;
00353         
00354         const uint8* const t_dataptr_after_s = t_dataptr_after_pad + (t_s__size);
00355         int t_val__size = t_dataptr_after_s - t_begin_of_data;
00356         return t_val__size;
00357         }

array<uint16> const& BinPAC::SMB_unicode_string::s  )  const [inline]
 

Definition at line 153 of file smb_pac.h.

References s_.

Referenced by SMB_Session::ExtractString(), and parse().

00153 { return s_; }


Member Data Documentation

int BinPAC::SMB_unicode_string::offset_ [protected]
 

Definition at line 156 of file smb_pac.h.

Referenced by offset(), and SMB_unicode_string().

array<uint16> BinPAC::SMB_unicode_string::s_ [protected]
 

Definition at line 157 of file smb_pac.h.

Referenced by parse(), s(), SMB_unicode_string(), and ~SMB_unicode_string().


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 03:16:31 2005 for bro_docs by doxygen 1.3.5