00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
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
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
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