payload_notify.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_NOTIFY_H
00022 #define PAYLOAD_NOTIFY_H
00023 
00024 #include "payload.h"
00025 #include "proposal.h"
00026 #include "utils.h"
00027 
00028 namespace openikev2 {
00029 
00034     class Payload_NOTIFY : public Payload {
00035 
00036             /****************************** ENUMS ******************************/
00037         public:
00039             enum NOTIFY_TYPE {
00040                 UNSUPPORTED_CRITICAL_PAYLOAD = 1,         
00041                 INVALID_IKE_SPI = 4,                      
00042                 INVALID_MAJOR_VERSION = 5,                
00043                 INVALID_SYNTAX = 7,                       
00044                 INVALID_MESSAGE_ID = 9,                   
00045                 INVALID_SPI = 11,                         
00046                 NO_PROPOSAL_CHOSEN = 14,                  
00047                 INVALID_KE_PAYLOAD = 17,                  
00049                 AUTHENTICATION_FAILED = 24,               
00050                 SINGLE_PAIR_REQUIRED = 34,                
00051                 NO_ADDITIONAL_SAS = 35,                   
00052                 INTERNAL_ADDRESS_FAILURE = 36,            
00053                 FAILED_CP_REQUIRED = 37,                  
00054                 TS_UNACCEPTABLE = 38,                     
00055                 INVALID_SELECTORS = 39,                   
00057                 INITIAL_CONTACT = 16384,                  
00058                 SET_WINDOW_SIZE = 16385,                  
00059                 ADDITIONAL_TS_POSSIBLE = 16386,           
00060                 IPCOMP_SUPPORTED = 16387,                 
00061                 NAT_DETECTION_SOURCE_IP = 16388,          
00062                 NAT_DETECTION_DESTINATION_IP = 16389,     
00063                 COOKIE = 16390,                           
00064                 USE_TRANSPORT_MODE = 16391,               
00065                 HTTP_CERT_LOOKUP_SUPPORTED = 16392,       
00066                 REKEY_SA = 16393,                         
00067                 ESP_TFC_PADDING_NOT_SUPPORTED = 16394,    
00068                 NON_FIRST_FRAGMENT_ALSO = 16395,          
00069         };
00070 
00071             /****************************** ATTRIBUTES ******************************/
00072         public:
00073             Enums::PROTOCOL_ID protocol_id;         
00074             NOTIFY_TYPE notification_type;          
00075             auto_ptr<ByteArray> spi_value;          
00076             auto_ptr<ByteArray> notification_data;  
00078             /****************************** METHODS ******************************/
00079         public:
00080 
00088             Payload_NOTIFY( NOTIFY_TYPE notification_type, Enums::PROTOCOL_ID protocol_id, auto_ptr<ByteArray> spi_value, auto_ptr<ByteArray> notification_data );
00089             
00095             Payload_NOTIFY( NOTIFY_TYPE notification_type, Enums::PROTOCOL_ID protocol_id );
00096 
00101             Payload_NOTIFY( const Payload_NOTIFY& other );
00102 
00107             Payload_NOTIFY( ByteBuffer& byte_buffer );
00108 
00113             virtual bool isError();
00114 
00120             static string NOTIFY_TYPE_STR( NOTIFY_TYPE notify_type );
00121             
00122             virtual void getBinaryRepresentation( ByteBuffer& byte_buffer ) const;
00123             
00124             virtual string toStringTab( uint8_t tabs ) const;
00125             
00126             virtual auto_ptr<Payload> clone() const;
00127             
00128             virtual ~Payload_NOTIFY();
00129 
00130     };
00131 };
00132 #endif

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