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

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