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

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