48 const void *
rsp,
size_t rsp_len ) {
55 len = (
sizeof ( *msg ) + rsp_len );
62 msg->hdr.id = supplicant->
id;
66 DBGC (
netdev,
"EAP %s Response id %#02x type %d\n",
70 if ( (
rc = supplicant->
tx ( supplicant,
msg,
len ) ) != 0 ) {
71 DBGC (
netdev,
"EAP %s could not transmit: %s\n",
92 unsigned int count = 0;
123 const void *req,
size_t req_len ) {
130 DBGC (
netdev,
"EAP %s Request-Identity blocking link\n",
140 &username_setting, &
rsp );
184 if (
len <
sizeof ( *
msg ) ) {
195 req_len = (
ntohs (
msg->hdr.len ) -
sizeof ( *msg ) );
198 supplicant->
id =
msg->hdr.id;
200 DBGC (
netdev,
"EAP %s Request id %#02x type %d\n",
206 return method->rx ( supplicant, req, req_len );
208 DBGC (
netdev,
"EAP %s requested type %d unknown:\n",
269 if (
len <
sizeof ( eap->
hdr ) ) {
287 DBGC (
netdev,
"EAP %s unsupported code %d\n",
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
#define EAP_TYPE_NONE
EAP "no available types" marker.
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
struct eap_message msg
Request/response message.
int fetch_raw_setting_copy(struct settings *settings, const struct setting *setting, void **data)
Fetch value of setting.
static int eap_rx_failure(struct eap_supplicant *supplicant)
Handle EAP Failure.
#define EAP_CODE_REQUEST
EAP request.
struct eap_header hdr
Header.
#define EAP_METHODS
EAP method table.
int eap_rx(struct eap_supplicant *supplicant, const void *data, size_t len)
Handle EAP packet.
EAP request/response message.
uint8_t id
ID for current request/response.
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
#define ENOTSUP
Operation not supported.
#define EAP_CODE_RESPONSE
EAP response.
#define EAP_CODE_FAILURE
EAP failure.
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static int eap_rx_success(struct eap_supplicant *supplicant)
Handle EAP Success.
int eap_tx_response(struct eap_supplicant *supplicant, const void *rsp, size_t rsp_len)
Transmit EAP response.
void netdev_link_block(struct net_device *netdev, unsigned long timeout)
Mark network device link as being blocked.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
REQUIRE_OBJECT(config_eap)
void netdev_link_unblock(struct net_device *netdev)
Mark network device link as being unblocked.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static struct net_device * netdev
#define EAP_FL_PASSIVE
EAP supplicant is passive.
uint16_t count
Number of entries.
#define EAP_FL_ONGOING
EAP authentication is in progress.
static int eap_tx_nak(struct eap_supplicant *supplicant)
Transmit EAP NAK.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
#define EAP_TYPE_IDENTITY
EAP identity.
#define EAP_CODE_SUCCESS
EAP success.
void * malloc(size_t size)
Allocate memory.
static int eap_rx_request(struct eap_supplicant *supplicant, const struct eap_message *msg, size_t len)
Handle EAP Request.
#define EAP_TYPE_NAK
EAP NAK.
#define EPERM
Operation not permitted.
Network device management.
static int eap_rx_identity(struct eap_supplicant *supplicant, const void *req, size_t req_len)
Handle EAP Request-Identity.
char name[NETDEV_NAME_LEN]
Name of this network device.
int(* tx)(struct eap_supplicant *supplicant, const void *data, size_t len)
Transmit EAP response.
struct eap_method eap_identity_method __eap_method
EAP Request-Identity method.
uint8_t type
Type for current request/response.
uint8_t data[48]
Additional event data.
#define EAP_BLOCK_TIMEOUT
EAP link block timeout.
struct net_device * netdev
Network device.
Extensible Authentication Protocol.
#define table_num_entries(table)
Get number of entries in linker table.