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

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