Blame SOURCES/macsec-0001-mka-Move-structs-transmit-receive-_-sa-sc-to-a-commo.patch

41389a
From f75f6e2b03fa5e807142a37039b0b613565eafa7 Mon Sep 17 00:00:00 2001
41389a
Message-Id: <f75f6e2b03fa5e807142a37039b0b613565eafa7.1488376601.git.dcaratti@redhat.com>
41389a
From: Sabrina Dubroca <sd@queasysnail.net>
41389a
Date: Tue, 20 Sep 2016 09:43:04 +0200
41389a
Subject: [PATCH] mka: Move structs {transmit,receive}_{sa,sc} to a common
41389a
 header
41389a
41389a
These structs will be passed down to macsec drivers in a coming patch to
41389a
make the driver interface cleaner, so they need to be shared between the
41389a
core MKA implementation and the drivers.
41389a
41389a
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
41389a
---
41389a
 src/drivers/driver.h          |  3 ++
41389a
 src/pae/ieee802_1x_kay.h      | 82 +++++++++++++++++++++++++++++++++++++++++++
41389a
 src/pae/ieee802_1x_kay_i.h    | 82 -------------------------------------------
41389a
 src/pae/ieee802_1x_secy_ops.h |  4 ---
41389a
 4 files changed, 85 insertions(+), 86 deletions(-)
41389a
41389a
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
41389a
index a449cc9..073219e 100644
41389a
--- a/src/drivers/driver.h
41389a
+++ b/src/drivers/driver.h
41389a
@@ -21,6 +21,9 @@
41389a
 
41389a
 #include "common/defs.h"
41389a
 #include "common/ieee802_11_defs.h"
41389a
+#ifdef CONFIG_MACSEC
41389a
+#include "pae/ieee802_1x_kay.h"
41389a
+#endif /* CONFIG_MACSEC */
41389a
 #include "utils/list.h"
41389a
 
41389a
 #define HOSTAPD_CHAN_DISABLED 0x00000001
41389a
diff --git a/src/pae/ieee802_1x_kay.h b/src/pae/ieee802_1x_kay.h
41389a
index afbaa33..0361e1a 100644
41389a
--- a/src/pae/ieee802_1x_kay.h
41389a
+++ b/src/pae/ieee802_1x_kay.h
41389a
@@ -49,6 +49,88 @@ enum mka_created_mode {
41389a
 	EAP_EXCHANGE,
41389a
 };
41389a
 
41389a
+struct data_key {
41389a
+	u8 *key;
41389a
+	int key_len;
41389a
+	struct ieee802_1x_mka_ki key_identifier;
41389a
+	enum confidentiality_offset confidentiality_offset;
41389a
+	u8 an;
41389a
+	Boolean transmits;
41389a
+	Boolean receives;
41389a
+	struct os_time created_time;
41389a
+	u32 next_pn;
41389a
+
41389a
+	/* not defined data */
41389a
+	Boolean rx_latest;
41389a
+	Boolean tx_latest;
41389a
+
41389a
+	int user;  /* FIXME: to indicate if it can be delete safely */
41389a
+
41389a
+	struct dl_list list;
41389a
+};
41389a
+
41389a
+/* TransmitSC in IEEE Std 802.1AE-2006, Figure 10-6 */
41389a
+struct transmit_sc {
41389a
+	struct ieee802_1x_mka_sci sci; /* const SCI sci */
41389a
+	Boolean transmitting; /* bool transmitting (read only) */
41389a
+
41389a
+	struct os_time created_time; /* Time createdTime */
41389a
+
41389a
+	u8 encoding_sa; /* AN encodingSA (read only) */
41389a
+	u8 enciphering_sa; /* AN encipheringSA (read only) */
41389a
+
41389a
+	/* not defined data */
41389a
+	unsigned int channel;
41389a
+
41389a
+	struct dl_list list;
41389a
+	struct dl_list sa_list;
41389a
+};
41389a
+
41389a
+/* TransmitSA in IEEE Std 802.1AE-2006, Figure 10-6 */
41389a
+struct transmit_sa {
41389a
+	Boolean in_use; /* bool inUse (read only) */
41389a
+	u32 next_pn; /* PN nextPN (read only) */
41389a
+	struct os_time created_time; /* Time createdTime */
41389a
+
41389a
+	Boolean enable_transmit; /* bool EnableTransmit */
41389a
+
41389a
+	u8 an;
41389a
+	Boolean confidentiality;
41389a
+	struct data_key *pkey;
41389a
+
41389a
+	struct transmit_sc *sc;
41389a
+	struct dl_list list; /* list entry in struct transmit_sc::sa_list */
41389a
+};
41389a
+
41389a
+/* ReceiveSC in IEEE Std 802.1AE-2006, Figure 10-6 */
41389a
+struct receive_sc {
41389a
+	struct ieee802_1x_mka_sci sci; /* const SCI sci */
41389a
+	Boolean receiving; /* bool receiving (read only) */
41389a
+
41389a
+	struct os_time created_time; /* Time createdTime */
41389a
+
41389a
+	unsigned int channel;
41389a
+
41389a
+	struct dl_list list;
41389a
+	struct dl_list sa_list;
41389a
+};
41389a
+
41389a
+/* ReceiveSA in IEEE Std 802.1AE-2006, Figure 10-6 */
41389a
+struct receive_sa {
41389a
+	Boolean enable_receive; /* bool enableReceive */
41389a
+	Boolean in_use; /* bool inUse (read only) */
41389a
+
41389a
+	u32 next_pn; /* PN nextPN (read only) */
41389a
+	u32 lowest_pn; /* PN lowestPN (read only) */
41389a
+	u8 an;
41389a
+	struct os_time created_time;
41389a
+
41389a
+	struct data_key *pkey;
41389a
+	struct receive_sc *sc; /* list entry in struct receive_sc::sa_list */
41389a
+
41389a
+	struct dl_list list;
41389a
+};
41389a
+
41389a
 struct ieee802_1x_kay_ctx {
41389a
 	/* pointer to arbitrary upper level context */
41389a
 	void *ctx;
41389a
diff --git a/src/pae/ieee802_1x_kay_i.h b/src/pae/ieee802_1x_kay_i.h
41389a
index 622282e..e3d7db4 100644
41389a
--- a/src/pae/ieee802_1x_kay_i.h
41389a
+++ b/src/pae/ieee802_1x_kay_i.h
41389a
@@ -54,88 +54,6 @@ struct ieee802_1x_kay_peer {
41389a
 	struct dl_list list;
41389a
 };
41389a
 
41389a
-struct data_key {
41389a
-	u8 *key;
41389a
-	int key_len;
41389a
-	struct ieee802_1x_mka_ki key_identifier;
41389a
-	enum confidentiality_offset confidentiality_offset;
41389a
-	u8 an;
41389a
-	Boolean transmits;
41389a
-	Boolean receives;
41389a
-	struct os_time created_time;
41389a
-	u32 next_pn;
41389a
-
41389a
-	/* not defined data */
41389a
-	Boolean rx_latest;
41389a
-	Boolean tx_latest;
41389a
-
41389a
-	int user;  /* FIXME: to indicate if it can be delete safely */
41389a
-
41389a
-	struct dl_list list;
41389a
-};
41389a
-
41389a
-/* TransmitSC in IEEE Std 802.1AE-2006, Figure 10-6 */
41389a
-struct transmit_sc {
41389a
-	struct ieee802_1x_mka_sci sci; /* const SCI sci */
41389a
-	Boolean transmitting; /* bool transmitting (read only) */
41389a
-
41389a
-	struct os_time created_time; /* Time createdTime */
41389a
-
41389a
-	u8 encoding_sa; /* AN encodingSA (read only) */
41389a
-	u8 enciphering_sa; /* AN encipheringSA (read only) */
41389a
-
41389a
-	/* not defined data */
41389a
-	unsigned int channel;
41389a
-
41389a
-	struct dl_list list;
41389a
-	struct dl_list sa_list;
41389a
-};
41389a
-
41389a
-/* TransmitSA in IEEE Std 802.1AE-2006, Figure 10-6 */
41389a
-struct transmit_sa {
41389a
-	Boolean in_use; /* bool inUse (read only) */
41389a
-	u32 next_pn; /* PN nextPN (read only) */
41389a
-	struct os_time created_time; /* Time createdTime */
41389a
-
41389a
-	Boolean enable_transmit; /* bool EnableTransmit */
41389a
-
41389a
-	u8 an;
41389a
-	Boolean confidentiality;
41389a
-	struct data_key *pkey;
41389a
-
41389a
-	struct transmit_sc *sc;
41389a
-	struct dl_list list; /* list entry in struct transmit_sc::sa_list */
41389a
-};
41389a
-
41389a
-/* ReceiveSC in IEEE Std 802.1AE-2006, Figure 10-6 */
41389a
-struct receive_sc {
41389a
-	struct ieee802_1x_mka_sci sci; /* const SCI sci */
41389a
-	Boolean receiving; /* bool receiving (read only) */
41389a
-
41389a
-	struct os_time created_time; /* Time createdTime */
41389a
-
41389a
-	unsigned int channel;
41389a
-
41389a
-	struct dl_list list;
41389a
-	struct dl_list sa_list;
41389a
-};
41389a
-
41389a
-/* ReceiveSA in IEEE Std 802.1AE-2006, Figure 10-6 */
41389a
-struct receive_sa {
41389a
-	Boolean enable_receive; /* bool enableReceive */
41389a
-	Boolean in_use; /* bool inUse (read only) */
41389a
-
41389a
-	u32 next_pn; /* PN nextPN (read only) */
41389a
-	u32 lowest_pn; /* PN lowestPN (read only) */
41389a
-	u8 an;
41389a
-	struct os_time created_time;
41389a
-
41389a
-	struct data_key *pkey;
41389a
-	struct receive_sc *sc; /* list entry in struct receive_sc::sa_list */
41389a
-
41389a
-	struct dl_list list;
41389a
-};
41389a
-
41389a
 struct macsec_ciphersuite {
41389a
 	u64 id;
41389a
 	char name[32];
41389a
diff --git a/src/pae/ieee802_1x_secy_ops.h b/src/pae/ieee802_1x_secy_ops.h
41389a
index f5057ee..120ca3c 100644
41389a
--- a/src/pae/ieee802_1x_secy_ops.h
41389a
+++ b/src/pae/ieee802_1x_secy_ops.h
41389a
@@ -13,10 +13,6 @@
41389a
 #include "common/ieee802_1x_defs.h"
41389a
 
41389a
 struct ieee802_1x_kay_conf;
41389a
-struct receive_sa;
41389a
-struct transmit_sa;
41389a
-struct receive_sc;
41389a
-struct transmit_sc;
41389a
 
41389a
 int secy_init_macsec(struct ieee802_1x_kay *kay);
41389a
 int secy_deinit_macsec(struct ieee802_1x_kay *kay);
41389a
-- 
41389a
2.7.4
41389a