From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH v4 2/5] auth-proto: document acceptable return values for auth-protos
Date: Wed, 08 Sep 2021 14:31:58 -0700 [thread overview]
Message-ID: <20210908213201.97115-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20210908213201.97115-1-prestwoj@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]
Since all auth-protos are hidden behind an abstraction they need
to be consisten with the return values as some should be handled
specially.
---
src/auth-proto.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/auth-proto.h b/src/auth-proto.h
index d3c4686f..33a74291 100644
--- a/src/auth-proto.h
+++ b/src/auth-proto.h
@@ -25,6 +25,21 @@
struct auth_proto {
bool (*start)(struct auth_proto *ap);
void (*free)(struct auth_proto *ap);
+ /*
+ * Callback to receive an Authenticate frame. auth-protos should
+ * return error codes consistent with one another as some are treated
+ * specially:
+ *
+ * 0 indicates success, and that a state transition occurred.
+ * -ENOMSG or -EBADMSG indicates the message should be ignored silently
+ * -EAGAIN indicates a retry, and no state transition occurred. Any
+ * retry is handled by the auth-proto internally
+ * -EPROTO indicates a fatal error
+ * Any other < 0 return will be treated as a fatal error
+ * > 0 indicates a fatal error with status code. This only applies to
+ * non-sta cases as non-zero status codes are rejected by the
+ * kernel when in station mode.
+ */
int (*rx_authenticate)(struct auth_proto *driver,
const uint8_t *frame, size_t len);
int (*rx_associate)(struct auth_proto *driver,
--
2.31.1
next prev parent reply other threads:[~2021-09-08 21:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-08 21:31 [PATCH v4 1/5] sae: don't send commit/confirm in confirmed state James Prestwood
2021-09-08 21:31 ` James Prestwood [this message]
2021-09-08 21:31 ` [PATCH v4 3/5] mpdu: add MMPDU_STATUS_CODE_SAE_PK James Prestwood
2021-09-08 21:32 ` [PATCH v4 4/5] netdev: handle non-fatal auth-proto returns James Prestwood
2021-09-08 21:32 ` [PATCH v4 5/5] auto-t: add sae test for non-acked commit James Prestwood
2021-09-08 21:48 ` [PATCH v4 1/5] sae: don't send commit/confirm in confirmed state Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210908213201.97115-2-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox