macsec_linux: Add a driver for macsec on Linux kernels
This uses libnl3 to communicate with the macsec module available on Linux. A recent enough version of libnl is needed for the macsec.h file (which is not yet available in a formal libnl release at the time of this commit). Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
This commit is contained in:
parent
8618313b6e
commit
f014d9dbf0
7 changed files with 1299 additions and 0 deletions
|
@ -5050,6 +5050,10 @@ extern const struct wpa_driver_ops wpa_driver_wired_ops; /* driver_wired.c */
|
||||||
/* driver_macsec_qca.c */
|
/* driver_macsec_qca.c */
|
||||||
extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
|
extern const struct wpa_driver_ops wpa_driver_macsec_qca_ops;
|
||||||
#endif /* CONFIG_DRIVER_MACSEC_QCA */
|
#endif /* CONFIG_DRIVER_MACSEC_QCA */
|
||||||
|
#ifdef CONFIG_DRIVER_MACSEC_LINUX
|
||||||
|
/* driver_macsec_linux.c */
|
||||||
|
extern const struct wpa_driver_ops wpa_driver_macsec_linux_ops;
|
||||||
|
#endif /* CONFIG_DRIVER_MACSEC_LINUX */
|
||||||
#ifdef CONFIG_DRIVER_ROBOSWITCH
|
#ifdef CONFIG_DRIVER_ROBOSWITCH
|
||||||
/* driver_roboswitch.c */
|
/* driver_roboswitch.c */
|
||||||
extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
|
extern const struct wpa_driver_ops wpa_driver_roboswitch_ops;
|
||||||
|
|
1265
src/drivers/driver_macsec_linux.c
Normal file
1265
src/drivers/driver_macsec_linux.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -34,6 +34,9 @@ const struct wpa_driver_ops *const wpa_drivers[] =
|
||||||
#ifdef CONFIG_DRIVER_WIRED
|
#ifdef CONFIG_DRIVER_WIRED
|
||||||
&wpa_driver_wired_ops,
|
&wpa_driver_wired_ops,
|
||||||
#endif /* CONFIG_DRIVER_WIRED */
|
#endif /* CONFIG_DRIVER_WIRED */
|
||||||
|
#ifdef CONFIG_DRIVER_MACSEC_LINUX
|
||||||
|
&wpa_driver_macsec_linux_ops,
|
||||||
|
#endif /* CONFIG_DRIVER_MACSEC_LINUX */
|
||||||
#ifdef CONFIG_DRIVER_MACSEC_QCA
|
#ifdef CONFIG_DRIVER_MACSEC_QCA
|
||||||
&wpa_driver_macsec_qca_ops,
|
&wpa_driver_macsec_qca_ops,
|
||||||
#endif /* CONFIG_DRIVER_MACSEC_QCA */
|
#endif /* CONFIG_DRIVER_MACSEC_QCA */
|
||||||
|
|
|
@ -18,6 +18,13 @@ DRV_OBJS += ../src/drivers/driver_wired.o
|
||||||
NEED_DRV_WIRED_COMMON=1
|
NEED_DRV_WIRED_COMMON=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef CONFIG_DRIVER_MACSEC_LINUX
|
||||||
|
DRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_LINUX
|
||||||
|
DRV_OBJS += ../src/drivers/driver_macsec_linux.o
|
||||||
|
NEED_DRV_WIRED_COMMON=1
|
||||||
|
CONFIG_LIBNL3_ROUTE=y
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_DRIVER_MACSEC_QCA
|
ifdef CONFIG_DRIVER_MACSEC_QCA
|
||||||
DRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_QCA
|
DRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_QCA
|
||||||
DRV_OBJS += ../src/drivers/driver_macsec_qca.o
|
DRV_OBJS += ../src/drivers/driver_macsec_qca.o
|
||||||
|
|
|
@ -18,6 +18,13 @@ DRV_OBJS += src/drivers/driver_wired.c
|
||||||
NEED_DRV_WIRED_COMMON=1
|
NEED_DRV_WIRED_COMMON=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef CONFIG_DRIVER_MACSEC_LINUX
|
||||||
|
DRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_LINUX
|
||||||
|
DRV_OBJS += src/drivers/driver_macsec_linux.c
|
||||||
|
NEED_DRV_WIRED_COMMON=1
|
||||||
|
CONFIG_LIBNL3_ROUTE=y
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef NEED_DRV_WIRED_COMMON
|
ifdef NEED_DRV_WIRED_COMMON
|
||||||
DRV_OBJS += src/drivers/driver_wired_common.c
|
DRV_OBJS += src/drivers/driver_wired_common.c
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -379,6 +379,17 @@ ieee802_1x_kay_get_cipher_suite(struct ieee802_1x_mka_participant *participant,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
u64 mka_sci_u64(struct ieee802_1x_mka_sci *sci)
|
||||||
|
{
|
||||||
|
struct ieee802_1x_mka_sci tmp;
|
||||||
|
|
||||||
|
os_memcpy(tmp.addr, sci->addr, ETH_ALEN);
|
||||||
|
tmp.port = sci->port;
|
||||||
|
|
||||||
|
return *((u64 *) &tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static Boolean sci_equal(const struct ieee802_1x_mka_sci *a,
|
static Boolean sci_equal(const struct ieee802_1x_mka_sci *a,
|
||||||
const struct ieee802_1x_mka_sci *b)
|
const struct ieee802_1x_mka_sci *b)
|
||||||
{
|
{
|
||||||
|
|
|
@ -231,6 +231,8 @@ struct ieee802_1x_kay {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
u64 mka_sci_u64(struct ieee802_1x_mka_sci *sci);
|
||||||
|
|
||||||
struct ieee802_1x_kay *
|
struct ieee802_1x_kay *
|
||||||
ieee802_1x_kay_init(struct ieee802_1x_kay_ctx *ctx, enum macsec_policy policy,
|
ieee802_1x_kay_init(struct ieee802_1x_kay_ctx *ctx, enum macsec_policy policy,
|
||||||
u16 port, const char *ifname, const u8 *addr);
|
u16 port, const char *ifname, const u8 *addr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue