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

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