00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00043 #ifndef __IPSEC_TYPES_H__
00044 #define __IPSEC_TYPES_H__
00045
00046 typedef unsigned char __u8;
00047 typedef signed char __s8;
00048 typedef unsigned short __u16;
00049 typedef signed short __s16;
00050 typedef unsigned long __u32;
00051 typedef signed long __s32;
00052
00053
00061 typedef enum ipsec_status_list {
00062 IPSEC_STATUS_SUCCESS = 0,
00063 IPSEC_STATUS_NOT_IMPLEMENTED = -1,
00064 IPSEC_STATUS_FAILURE = -2,
00065 IPSEC_STATUS_DATA_SIZE_ERROR = -3,
00066 IPSEC_STATUS_NO_SPACE_IN_SPD = -4,
00067 IPSEC_STATUS_NO_POLICY_FOUND = -5,
00068 IPSEC_STATUS_NO_SA_FOUND = -6,
00069 IPSEC_STATUS_BAD_PACKET = -7,
00070 IPSEC_STATUS_BAD_PROTOCOL = -8,
00071 IPSEC_STATUS_BAD_KEY = -9,
00072 IPSEC_STATUS_TTL_EXPIRED = -10,
00073 IPSEC_STATUS_NOT_INITIALIZED = -100
00074 } ipsec_status;
00075
00076
00077 typedef enum ipsec_audit_list {
00078 IPSEC_AUDIT_SUCCESS = 0,
00079 IPSEC_AUDIT_NOT_IMPLEMENTED = 1,
00080 IPSEC_AUDIT_FAILURE = 2,
00081 IPSEC_AUDIT_APPLY = 3,
00082 IPSEC_AUDIT_BYPASS = 4,
00083 IPSEC_AUDIT_DISCARD = 5,
00084 IPSEC_AUDIT_SPI_MISMATCH = 6,
00085 IPSEC_AUDIT_SEQ_MISMATCH = 7,
00086 IPSEC_AUDIT_POLICY_MISMATCH = 8
00087 } ipsec_audit;
00088
00089
00090 typedef enum ipsec_ip_protocol_list {
00091 IPSEC_PROTO_ICMP = 0x01,
00092 IPSEC_PROTO_TCP = 0x06,
00093 IPSEC_PROTO_UDP = 0x11,
00094 IPSEC_PROTO_ESP = 0x32,
00095 IPSEC_PROTO_AH = 0x33
00096 } ipsec_ip_protocol;
00097
00098
00099 #pragma pack(1)
00100 #pragma bytealign
00101
00102 typedef struct ipsec_ip_hdr_struct
00103 {
00104 __u8 v_hl;
00105 __u8 tos;
00106 __u16 len;
00107 __u16 id;
00108 __u16 offset;
00109 __u8 ttl;
00110 __u8 protocol;
00111 __u16 chksum;
00112 __u32 src;
00113 __u32 dest;
00114 } ipsec_ip_header;
00115
00116 typedef struct ipsec_tcp_hdr_struct
00117 {
00118 __u16 src;
00119 __u16 dest;
00120 __u32 seqno;
00121 __u32 ackno;
00122 __u16 offset_flags;
00123 __u16 wnd;
00124 __u16 chksum;
00125 __u16 urgp;
00126 } ipsec_tcp_header;
00127
00128 typedef struct ipsec_udp_hdr_struct
00129 {
00130 __u16 src ;
00131 __u16 dest ;
00132 __u16 len ;
00133 __u16 chksum ;
00134 } ipsec_udp_header ;
00135
00136
00137
00138 #endif