]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mka: Move structs {transmit,receive}_{sa,sc} to a common header
authorSabrina Dubroca <sd@queasysnail.net>
Tue, 20 Sep 2016 07:43:04 +0000 (09:43 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 3 Oct 2016 09:50:07 +0000 (12:50 +0300)
These structs will be passed down to macsec drivers in a coming patch to
make the driver interface cleaner, so they need to be shared between the
core MKA implementation and the drivers.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
src/drivers/driver.h
src/pae/ieee802_1x_kay.h
src/pae/ieee802_1x_kay_i.h
src/pae/ieee802_1x_secy_ops.h

index a449cc93473520397a11fc11c0ec0f7014cc1ceb..073219ee198c5a89f9ddb836fb979271d9301489 100644 (file)
@@ -21,6 +21,9 @@
 
 #include "common/defs.h"
 #include "common/ieee802_11_defs.h"
+#ifdef CONFIG_MACSEC
+#include "pae/ieee802_1x_kay.h"
+#endif /* CONFIG_MACSEC */
 #include "utils/list.h"
 
 #define HOSTAPD_CHAN_DISABLED 0x00000001
index afbaa336cbda6b6620e8534d523c8b8d1980c1f8..0361e1ac49a7304267dd9575f5e55adf722aa280 100644 (file)
@@ -49,6 +49,88 @@ enum mka_created_mode {
        EAP_EXCHANGE,
 };
 
+struct data_key {
+       u8 *key;
+       int key_len;
+       struct ieee802_1x_mka_ki key_identifier;
+       enum confidentiality_offset confidentiality_offset;
+       u8 an;
+       Boolean transmits;
+       Boolean receives;
+       struct os_time created_time;
+       u32 next_pn;
+
+       /* not defined data */
+       Boolean rx_latest;
+       Boolean tx_latest;
+
+       int user;  /* FIXME: to indicate if it can be delete safely */
+
+       struct dl_list list;
+};
+
+/* TransmitSC in IEEE Std 802.1AE-2006, Figure 10-6 */
+struct transmit_sc {
+       struct ieee802_1x_mka_sci sci; /* const SCI sci */
+       Boolean transmitting; /* bool transmitting (read only) */
+
+       struct os_time created_time; /* Time createdTime */
+
+       u8 encoding_sa; /* AN encodingSA (read only) */
+       u8 enciphering_sa; /* AN encipheringSA (read only) */
+
+       /* not defined data */
+       unsigned int channel;
+
+       struct dl_list list;
+       struct dl_list sa_list;
+};
+
+/* TransmitSA in IEEE Std 802.1AE-2006, Figure 10-6 */
+struct transmit_sa {
+       Boolean in_use; /* bool inUse (read only) */
+       u32 next_pn; /* PN nextPN (read only) */
+       struct os_time created_time; /* Time createdTime */
+
+       Boolean enable_transmit; /* bool EnableTransmit */
+
+       u8 an;
+       Boolean confidentiality;
+       struct data_key *pkey;
+
+       struct transmit_sc *sc;
+       struct dl_list list; /* list entry in struct transmit_sc::sa_list */
+};
+
+/* ReceiveSC in IEEE Std 802.1AE-2006, Figure 10-6 */
+struct receive_sc {
+       struct ieee802_1x_mka_sci sci; /* const SCI sci */
+       Boolean receiving; /* bool receiving (read only) */
+
+       struct os_time created_time; /* Time createdTime */
+
+       unsigned int channel;
+
+       struct dl_list list;
+       struct dl_list sa_list;
+};
+
+/* ReceiveSA in IEEE Std 802.1AE-2006, Figure 10-6 */
+struct receive_sa {
+       Boolean enable_receive; /* bool enableReceive */
+       Boolean in_use; /* bool inUse (read only) */
+
+       u32 next_pn; /* PN nextPN (read only) */
+       u32 lowest_pn; /* PN lowestPN (read only) */
+       u8 an;
+       struct os_time created_time;
+
+       struct data_key *pkey;
+       struct receive_sc *sc; /* list entry in struct receive_sc::sa_list */
+
+       struct dl_list list;
+};
+
 struct ieee802_1x_kay_ctx {
        /* pointer to arbitrary upper level context */
        void *ctx;
index 622282e97c5133171d0a20a0fe264278c992601a..e3d7db4aad34834d4160bdf49e7da53abc852007 100644 (file)
@@ -54,88 +54,6 @@ struct ieee802_1x_kay_peer {
        struct dl_list list;
 };
 
-struct data_key {
-       u8 *key;
-       int key_len;
-       struct ieee802_1x_mka_ki key_identifier;
-       enum confidentiality_offset confidentiality_offset;
-       u8 an;
-       Boolean transmits;
-       Boolean receives;
-       struct os_time created_time;
-       u32 next_pn;
-
-       /* not defined data */
-       Boolean rx_latest;
-       Boolean tx_latest;
-
-       int user;  /* FIXME: to indicate if it can be delete safely */
-
-       struct dl_list list;
-};
-
-/* TransmitSC in IEEE Std 802.1AE-2006, Figure 10-6 */
-struct transmit_sc {
-       struct ieee802_1x_mka_sci sci; /* const SCI sci */
-       Boolean transmitting; /* bool transmitting (read only) */
-
-       struct os_time created_time; /* Time createdTime */
-
-       u8 encoding_sa; /* AN encodingSA (read only) */
-       u8 enciphering_sa; /* AN encipheringSA (read only) */
-
-       /* not defined data */
-       unsigned int channel;
-
-       struct dl_list list;
-       struct dl_list sa_list;
-};
-
-/* TransmitSA in IEEE Std 802.1AE-2006, Figure 10-6 */
-struct transmit_sa {
-       Boolean in_use; /* bool inUse (read only) */
-       u32 next_pn; /* PN nextPN (read only) */
-       struct os_time created_time; /* Time createdTime */
-
-       Boolean enable_transmit; /* bool EnableTransmit */
-
-       u8 an;
-       Boolean confidentiality;
-       struct data_key *pkey;
-
-       struct transmit_sc *sc;
-       struct dl_list list; /* list entry in struct transmit_sc::sa_list */
-};
-
-/* ReceiveSC in IEEE Std 802.1AE-2006, Figure 10-6 */
-struct receive_sc {
-       struct ieee802_1x_mka_sci sci; /* const SCI sci */
-       Boolean receiving; /* bool receiving (read only) */
-
-       struct os_time created_time; /* Time createdTime */
-
-       unsigned int channel;
-
-       struct dl_list list;
-       struct dl_list sa_list;
-};
-
-/* ReceiveSA in IEEE Std 802.1AE-2006, Figure 10-6 */
-struct receive_sa {
-       Boolean enable_receive; /* bool enableReceive */
-       Boolean in_use; /* bool inUse (read only) */
-
-       u32 next_pn; /* PN nextPN (read only) */
-       u32 lowest_pn; /* PN lowestPN (read only) */
-       u8 an;
-       struct os_time created_time;
-
-       struct data_key *pkey;
-       struct receive_sc *sc; /* list entry in struct receive_sc::sa_list */
-
-       struct dl_list list;
-};
-
 struct macsec_ciphersuite {
        u64 id;
        char name[32];
index f5057ee11958319424219fa8ce65dc3a2e54302a..120ca3c7e883fbb9cd34b589feec8f6a2d1b482a 100644 (file)
 #include "common/ieee802_1x_defs.h"
 
 struct ieee802_1x_kay_conf;
-struct receive_sa;
-struct transmit_sa;
-struct receive_sc;
-struct transmit_sc;
 
 int secy_init_macsec(struct ieee802_1x_kay *kay);
 int secy_deinit_macsec(struct ieee802_1x_kay *kay);