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

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