configurationattribute.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 CONFIGURATIONATTRIBUTE_H
00022 #define CONFIGURATIONATTRIBUTE_H
00023 
00024 #include "printable.h"
00025 #include "bytebuffer.h"
00026 
00027 namespace openikev2 {
00028 
00033     class ConfigurationAttribute : public Printable {
00034 
00035             /****************************** ENUMS ******************************/
00036         public:
00038             enum CONFIGURATION_ATTRIBUTE_TYPE{
00039                 INTERNAL_IP4_ADDRESS    = 1,    
00040                 INTERNAL_IP4_NETMASK    = 2,    
00041                 INTERNAL_IP4_DNS        = 3,    
00042                 INTERNAL_IP4_NBNS       = 4,    
00043                 INTERNAL_ADDRESS_EXPIRY = 5,    
00044                 INTERNAL_IP4_DHCP       = 6,    
00045                 APPLICATION_VERSION     = 7,    
00046                 INTERNAL_IP6_ADDRESS    = 8,    
00047                 INTERNAL_IP6_DNS        = 10,   
00048                 INTERNAL_IP6_NBNS       = 11,   
00049                 INTERNAL_IP6_DHCP       = 12,   
00050                 INTERNAL_IP4_SUBNET     = 13,   
00051                 SUPPORTED_ATTRIBUTES    = 14,   
00052                 INTERNAL_IP6_SUBNET     = 15,   
00053         };
00054 
00055             /****************************** ATTRIBUTES ******************************/
00056         public:
00057             CONFIGURATION_ATTRIBUTE_TYPE type;  
00058             auto_ptr<ByteArray> value;          
00060             /****************************** METHODS ******************************/
00061         protected:
00067             static void checkLength( CONFIGURATION_ATTRIBUTE_TYPE type, uint16_t len );
00068         public:
00074             static string CONFIGURATION_ATTRIBUTE_TYPE_STR( CONFIGURATION_ATTRIBUTE_TYPE conf_attr );
00075 
00081             ConfigurationAttribute( CONFIGURATION_ATTRIBUTE_TYPE type, auto_ptr<ByteArray> value );
00082 
00087             ConfigurationAttribute( ByteBuffer& binary_representation );
00088 
00093             virtual auto_ptr<ConfigurationAttribute> clone();
00094 
00099             virtual void getBinaryRepresentation( ByteBuffer& byte_buffer ) const;
00100 
00101             virtual string toStringTab( uint8_t tabs ) const ;
00102 
00103             virtual ~ConfigurationAttribute();
00104 
00105     };
00106 }
00107 
00108 #endif

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