aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/charon/encoding/payloads/endpoint_notify.c9
-rw-r--r--src/charon/encoding/payloads/endpoint_notify.h17
-rw-r--r--src/charon/sa/connect_manager.c2
-rw-r--r--src/charon/sa/tasks/ike_auth.c3
-rw-r--r--src/charon/sa/tasks/ike_p2p.c3
5 files changed, 31 insertions, 3 deletions
diff --git a/src/charon/encoding/payloads/endpoint_notify.c b/src/charon/encoding/payloads/endpoint_notify.c
index 30f3ecd5f..34baa5db6 100644
--- a/src/charon/encoding/payloads/endpoint_notify.c
+++ b/src/charon/encoding/payloads/endpoint_notify.c
@@ -76,6 +76,13 @@ struct private_endpoint_notify_t {
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
+ENUM(p2p_endpoint_type_names, HOST, RELAYED,
+ "HOST",
+ "SERVER_REFLEXIVE",
+ "PEER_REFLEXIVE",
+ "RELAYED"
+);
+
/**
* Helper functions to parse integer values
*/
@@ -251,7 +258,7 @@ static u_int32_t get_priority(private_endpoint_notify_t *this)
*/
static void set_priority(private_endpoint_notify_t *this, u_int32_t priority)
{
- return this->priority = priority;
+ this->priority = priority;
}
/**
diff --git a/src/charon/encoding/payloads/endpoint_notify.h b/src/charon/encoding/payloads/endpoint_notify.h
index 272301d5b..4a3a68f95 100644
--- a/src/charon/encoding/payloads/endpoint_notify.h
+++ b/src/charon/encoding/payloads/endpoint_notify.h
@@ -35,6 +35,11 @@ typedef struct endpoint_notify_t endpoint_notify_t;
#include <encoding/payloads/notify_payload.h>
+/**
+ * @brief P2P endpoint families.
+ *
+ * @ingroup payloads
+ */
enum p2p_endpoint_family_t {
NO_FAMILY = 0,
@@ -47,6 +52,11 @@ enum p2p_endpoint_family_t {
};
+/**
+ * @brief P2P endpoint types.
+ *
+ * @ingroup payloads
+ */
enum p2p_endpoint_type_t {
NO_TYPE = 0,
@@ -64,6 +74,13 @@ enum p2p_endpoint_type_t {
};
/**
+ * enum name for p2p_endpoint_type_t.
+ *
+ * @ingroup payloads
+ */
+extern enum_name_t *p2p_endpoint_type_names;
+
+/**
* @brief Class representing a P2P_ENDPOINT notify. In fact it's not
* the notify per se, but the notification data of that notify that is
* handled with this class.
diff --git a/src/charon/sa/connect_manager.c b/src/charon/sa/connect_manager.c
index 9a1acb219..e53fdeed6 100644
--- a/src/charon/sa/connect_manager.c
+++ b/src/charon/sa/connect_manager.c
@@ -936,7 +936,7 @@ static status_t process_payloads(message_t *message, check_t *check)
}
check->endpoint = endpoint;
check->endpoint_raw = chunk_clone(notify->get_notification_data(notify));
- DBG3(DBG_IKE, "received P2P_ENDPOINT notify");
+ DBG2(DBG_IKE, "received P2P_ENDPOINT notify");
break;
}
case P2P_SESSIONID:
diff --git a/src/charon/sa/tasks/ike_auth.c b/src/charon/sa/tasks/ike_auth.c
index e8fab1dc6..29c38ee83 100644
--- a/src/charon/sa/tasks/ike_auth.c
+++ b/src/charon/sa/tasks/ike_auth.c
@@ -650,6 +650,9 @@ static status_t process_i(private_ike_auth_t *this, message_t *message)
case AUTH_LIFETIME:
/* handled in ike_auth_lifetime task */
break;
+ case P2P_ENDPOINT:
+ /* handled in ike_p2p task */
+ break;
default:
{
if (type < 16383)
diff --git a/src/charon/sa/tasks/ike_p2p.c b/src/charon/sa/tasks/ike_p2p.c
index de5a2e30e..adae09e9d 100644
--- a/src/charon/sa/tasks/ike_p2p.c
+++ b/src/charon/sa/tasks/ike_p2p.c
@@ -215,7 +215,8 @@ static void process_payloads(private_ike_p2p_t *this, message_t *message)
DBG1(DBG_IKE, "received invalid P2P_ENDPOINT notify");
break;
}
- DBG2(DBG_IKE, "received P2P_ENDPOINT notify");
+ DBG1(DBG_IKE, "received %N P2P_ENDPOINT %#H", p2p_endpoint_type_names,
+ endpoint->get_type(endpoint), endpoint->get_host(endpoint));
this->remote_endpoints->insert_last(this->remote_endpoints, endpoint);
break;