Pass initiator parameter to distinguish between original and exchange initiator
authorMartin Willi <martin@revosec.ch>
Mon, 26 Jul 2010 10:07:38 +0000 (12:07 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 26 Jul 2010 11:53:53 +0000 (13:53 +0200)
src/libcharon/plugins/ha/ha_child.c
src/libcharon/plugins/ha/ha_dispatcher.c
src/libcharon/plugins/ha/ha_message.c
src/libcharon/plugins/ha/ha_message.h

index 464353e..640aa16 100644 (file)
@@ -63,6 +63,7 @@ METHOD(listener_t, child_keys, bool,
        m = ha_message_create(HA_CHILD_ADD);
 
        m->add_attribute(m, HA_IKE_ID, ike_sa->get_id(ike_sa));
+       m->add_attribute(m, HA_INITIATOR, (u_int8_t)initiator);
        m->add_attribute(m, HA_INBOUND_SPI, child_sa->get_spi(child_sa, TRUE));
        m->add_attribute(m, HA_OUTBOUND_SPI, child_sa->get_spi(child_sa, FALSE));
        m->add_attribute(m, HA_INBOUND_CPI, child_sa->get_cpi(child_sa, TRUE));
index d956304..af45429 100644 (file)
@@ -443,11 +443,13 @@ static void process_child_add(private_ha_dispatcher_t *this,
                        case HA_IKE_ID:
                                ike_sa = charon->ike_sa_manager->checkout(charon->ike_sa_manager,
                                                                                                                  value.ike_sa_id);
-                               initiator = value.ike_sa_id->is_initiator(value.ike_sa_id);
                                break;
                        case HA_CONFIG_NAME:
                                config_name = value.str;
                                break;
+                       case HA_INITIATOR:
+                               initiator = value.u8;
+                               break;
                        case HA_INBOUND_SPI:
                                inbound_spi = value.u32;
                                break;
index da05d93..16e214b 100644 (file)
@@ -212,6 +212,7 @@ METHOD(ha_message_t, add_attribute, void,
                        break;
                }
                /* u_int8_t */
+               case HA_INITIATOR:
                case HA_IPSEC_MODE:
                case HA_IPCOMP:
                {
@@ -422,6 +423,7 @@ METHOD(enumerator_t, attribute_enumerate, bool,
                        return TRUE;
                }
                /* u_int8_t */
+               case HA_INITIATOR:
                case HA_IPSEC_MODE:
                case HA_IPCOMP:
                {
index 50ba032..4034dbe 100644 (file)
@@ -98,6 +98,8 @@ enum ha_message_attribute_t {
        HA_REMOTE_VIP,
        /** host_t*, additional MOBIKE peer address */
        HA_ADDITIONAL_ADDR,
+       /** u_int8_t, initiator of an exchange, TRUE for local */
+       HA_INITIATOR,
        /** chunk_t, initiators nonce */
        HA_NONCE_I,
        /** chunk_t, responders nonce */