payload_conf.h

00001 /***************************************************************************
00002 *   Copyright (C) 2005 by                                                 *
00003 *   Pedro J. Fernandez Ruiz    pedroj.fernandez@dif.um.es                 *
00004 *   Alejandro Perez Mendez     alejandro_perez@dif.um.es                  *
00005 *                                                                         *
00006 *   This library is free software; you can redistribute it and/or         *
00007 *   modify it under the terms of the GNU Lesser General Public            *
00008 *   License as published by the Free Software Foundation; either          *
00009 *   version 2.1 of the License, or (at your option) any later version.    *
00010 *                                                                         *
00011 *   This library is distributed in the hope that it will be useful,       *
00012 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014 *   Lesser General Public License for more details.                       *
00015 *                                                                         *
00016 *   You should have received a copy of the GNU Lesser General Public      *
00017 *   License along with this library; if not, write to the Free Software   *
00018 *   Foundation, Inc., 51 Franklin St, Fifth Floor,                        *
00019 *   Boston, MA  02110-1301  USA                                           *
00020 ***************************************************************************/
00021 #ifndef PAYLOAD_CONF_H
00022 #define PAYLOAD_CONF_H
00023 
00024 #ifdef HAVE_CONFIG_H
00025 #include "config.h"
00026 #endif
00027 
00028 #include "payload.h"
00029 #include "configurationattribute.h"
00030 
00031 #include "autovector.h"
00032 
00033 using namespace std;
00034 
00035 namespace openikev2 {
00036 
00041     class Payload_CONF : public Payload {
00042 
00043             /****************************** ENUMS ******************************/
00044         public:
00046             enum CONFIGURATION_TYPE{
00047                 RESERVED    = 0,    
00048                 CFG_REQUEST = 1,    
00049                 CFG_REPLY   = 2,    
00050                 CFG_SET     = 3,    
00051                 CFG_ACK     = 4,    
00052         };
00053 
00054             /****************************** ATTRIBUTES ******************************/
00055         protected:
00056             CONFIGURATION_TYPE configuration_type;          
00057         public:
00058             AutoVector<ConfigurationAttribute> attributes;  
00060             /****************************** METHODS ******************************/
00061         public:
00066             Payload_CONF( CONFIGURATION_TYPE configuration_type );
00067 
00072             Payload_CONF (const Payload_CONF& other);
00073             
00078             Payload_CONF( ByteBuffer& byte_buffer );
00079 
00085             static string CONFIGURATION_TYPE_STR( CONFIGURATION_TYPE conf_type );
00086 
00091             void addConfigurationAttribute( auto_ptr<ConfigurationAttribute> attribute );
00092 
00093             virtual void getBinaryRepresentation( ByteBuffer& byte_buffer ) const;
00094 
00095             virtual string toStringTab( uint8_t tabs ) const ;
00096 
00097             virtual auto_ptr<Payload> clone() const;
00098 
00099             virtual ~Payload_CONF();
00100     };
00101 }
00102 #endif

Generated on Fri Jul 27 11:04:45 2007 for libopenikev2 by  doxygen 1.5.1