__u32   bitmap;
 };
 
+struct xfrm_replay_state_esn {
+       unsigned int    bmp_len;
+       __u32           oseq;
+       __u32           seq;
+       __u32           oseq_hi;
+       __u32           seq_hi;
+       __u32           replay_window;
+       __u32           bmp[0];
+};
+
 struct xfrm_algo {
        char            alg_name[64];
        unsigned int    alg_key_len;    /* in bits */
        XFRMA_ALG_AUTH_TRUNC,   /* struct xfrm_algo_auth */
        XFRMA_MARK,             /* struct xfrm_mark */
        XFRMA_TFCPAD,           /* __u32 */
+       XFRMA_REPLAY_ESN_VAL,   /* struct xfrm_replay_esn */
        __XFRMA_MAX
 
 #define XFRMA_MAX (__XFRMA_MAX - 1)
 #define XFRM_STATE_ICMP                16
 #define XFRM_STATE_AF_UNSPEC   32
 #define XFRM_STATE_ALIGN4      64
+#define XFRM_STATE_ESN         128
 };
 
 struct xfrm_usersa_id {
 
 
        /* State for replay detection */
        struct xfrm_replay_state replay;
+       struct xfrm_replay_state_esn *replay_esn;
 
        /* Replay detection state at the time we sent the last notification */
        struct xfrm_replay_state preplay;
+       struct xfrm_replay_state_esn *preplay_esn;
 
        /* internal flag that only holds state for delayed aevent at the
         * moment
        return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
 }
 
+static inline int xfrm_replay_state_esn_len(struct xfrm_replay_state_esn *replay_esn)
+{
+       return sizeof(*replay_esn) + replay_esn->bmp_len * sizeof(__u32);
+}
+
 #ifdef CONFIG_XFRM_MIGRATE
 static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig)
 {