]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ike: Publish getter for the current message ID on IKE_SA
authorTobias Brunner <tobias@strongswan.org>
Fri, 16 Sep 2016 14:19:25 +0000 (16:19 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 Feb 2017 14:03:25 +0000 (15:03 +0100)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ike_sa.h

index 7b87918d36b22c93e1b8469af80de22121926f81..f180bfb017e2dc17abf87e72cc4eb692ef072bec 100644 (file)
@@ -617,6 +617,12 @@ METHOD(ike_sa_t, set_message_id, void,
        }
 }
 
+METHOD(ike_sa_t, get_message_id, uint32_t,
+       private_ike_sa_t *this, bool initiate)
+{
+       return this->task_manager->get_mid(this->task_manager, initiate);
+}
+
 METHOD(ike_sa_t, send_keepalive, void,
        private_ike_sa_t *this, bool scheduled)
 {
@@ -2885,6 +2891,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
                        .get_other_host = _get_other_host,
                        .set_other_host = _set_other_host,
                        .set_message_id = _set_message_id,
+                       .get_message_id = _get_message_id,
                        .float_ports = _float_ports,
                        .update_hosts = _update_hosts,
                        .get_my_id = _get_my_id,
index 6f5040d7cb927e9485b145ec999a131c46a1f699..e78f4deb9e9db8137027b903c540962e23258cc8 100644 (file)
@@ -554,7 +554,7 @@ struct ike_sa_t {
        void (*set_proposal)(ike_sa_t *this, proposal_t *proposal);
 
        /**
-        * Set the message id of the IKE_SA.
+        * Set the message ID of the IKE_SA.
         *
         * The IKE_SA stores two message IDs, one for initiating exchanges (send)
         * and one to respond to exchanges (expect).
@@ -564,6 +564,17 @@ struct ike_sa_t {
         */
        void (*set_message_id)(ike_sa_t *this, bool initiate, uint32_t mid);
 
+       /**
+        * Get the message ID of the IKE_SA.
+        *
+        * The IKE_SA stores two message IDs, one for initiating exchanges (send)
+        * and one to respond to exchanges (expect).
+        *
+        * @param initiate              TRUE to get message ID for initiating
+        * @return                              current message
+        */
+       uint32_t (*get_message_id)(ike_sa_t *this, bool initiate);
+
        /**
         * Add an additional address for the peer.
         *