![]() |
TrustCore SDK NanoSec API reference
version 7.0
|
Provides all EAP1X functions. More...
Functions | |
MOC_EXTERN MSTATUS | EAP1X_authCheckTimers (void) |
Call expired timers' callbacks. More... | |
MOC_EXTERN MSTATUS | EAP1X_authDeInit (void) |
Destroy EAP1X timers. More... | |
MOC_EXTERN MSTATUS | EAP1X_authGetSesssionStats (ubyte *session, eap1xSessionStats *stats) |
Get an EAP1X session's current statistics. More... | |
MOC_EXTERN MSTATUS | EAP1X_authInit (void) |
Start the EAP1X state machine and initialize the EAP1X stack and timers. More... | |
MOC_EXTERN MSTATUS | EAP1X_authReceivePkt (ubyte *session, ubyte *pPkt, ubyte4 pktLen) |
Send the received EAP1X packets to the EAP1X layer. More... | |
MOC_EXTERN MSTATUS | EAP1X_authSendEAP (ubyte *session, eapHdr_t *eap_hdr, ubyte *eap_data, ubyte4 eap_data_len, ubyte4 headRoom, ubyte **ppPkt, ubyte2 *pPktLen) |
Encapsulate an EAP packet with an EAP1X header. More... | |
MOC_EXTERN MSTATUS | EAP1X_authSessionCreate (ubyte *appHdl, ubyte **session, eap1xAuthSessionCfg *cfg) |
Create an EAP1X authenticator session. More... | |
MOC_EXTERN MSTATUS | EAP1X_authSessionDelete (ubyte *appHdl, ubyte *session) |
Delete an EAP1X authenticator session. More... | |
MOC_EXTERN MSTATUS | EAP1X_authUpdatePortControl (ubyte *session, eap1xPortMode portMode) |
Set (update) an EAP1X session's port control mode. More... | |
MOC_EXTERN MSTATUS | EAP1X_authUpdateSetState (ubyte *session, ubyte4 stateInfo) |
Set an EAP1X session's state parameters (which in turn control the EAP state machine). More... | |
MOC_EXTERN MSTATUS | EAP1X_authUpdateUnsetState (ubyte *session, ubyte4 stateInfo) |
Clear (unset) an EAP1X session's state parameters (which in turn control the EAP state machine). More... | |
MOC_EXTERN MSTATUS | EAP1X_peerCheckTimers () |
Call expired timers' callbacks. More... | |
MOC_EXTERN MSTATUS | EAP1X_peerdeinit () |
Destroy EAP1X timers. More... | |
MOC_EXTERN MSTATUS | EAP1X_peerGetSesssionState (ubyte *session, eap1XPeerState_t *state) |
Get an EAP1X session's current state. More... | |
MOC_EXTERN MSTATUS | EAP1X_peerGetSesssionStats (ubyte *session, eap1xPeerStats *stats) |
Get an EAP1X session's current statistics. More... | |
MOC_EXTERN MSTATUS | EAP1X_peerInit () |
Start the EAP1X state machine and initialize the EAP1X stack and timers. More... | |
MOC_EXTERN MSTATUS | EAP1X_peerReceivePkt (ubyte *session, ubyte *pPkt, ubyte4 pktLen) |
Send the received EAP1X packets to the EAP1X layer. More... | |
MOC_EXTERN MSTATUS | EAP1X_peerSendEAP (ubyte *session, eapHdr_t *eap_hdr, ubyte *eap_data, ubyte4 eap_data_len, ubyte4 headRoom, ubyte **ppPkt, ubyte2 *pPktLen) |
Encapsulate an EAP packet with an EAP1X header. More... | |
MOC_EXTERN MSTATUS | EAP1X_peerSessionCreate (ubyte *appHdl, ubyte **session, eap1xPeerSessionCfg *cfg) |
Create an EAP1X peer session. More... | |
MOC_EXTERN MSTATUS | EAP1X_peerSessionDelete (ubyte *appHdl, ubyte *session) |
Delete an EAP1X peer session. More... | |
MOC_EXTERN MSTATUS | EAP1X_peerUpdatePortControl (ubyte *session, eap1xPortMode portMode) |
Set (update) an EAP1X session's port control mode. More... | |
MOC_EXTERN MSTATUS | EAP1X_peerUpdateSetState (ubyte *session, ubyte4 stateInfo) |
Set an EAP1X session's state parameters (which in turn control the EAP state machine). More... | |
MOC_EXTERN MSTATUS | EAP1X_peerUpdateUnsetState (ubyte *session, ubyte4 stateInfo) |
Clear (unset) an EAP1X session's state parameters (which in turn control the EAP state machine). More... | |
MOC_EXTERN MSTATUS | EAP1X_sendEAPOLLogoff (ubyte *session, ubyte **ppPkt, ubyte4 *pPktLen, ubyte4 headRoom) |
Build an EAPOL-Logoff message. More... | |
MOC_EXTERN MSTATUS | EAP1X_sendEAPOLStart (ubyte *session, ubyte **ppPkt, ubyte4 *pPktLen, ubyte4 headRoom) |
Build an EAPOL-Start message. More... | |
MOC_EXTERN MSTATUS EAP1X_authCheckTimers | ( | void | ) |
This function determines whether any timers have expired, and if so then calls each expired expired timer's callback function. Your application should call this function on every clock tick (every 300 to 500 milliseconds) to provide time to the EAP1X stack.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_authDeInit | ( | void | ) |
This function destroys EAP1X timers that were created by EAP1X_authInit. You should call this function after calling EAP1X_authSessionDelete.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_authGetSesssionStats | ( | ubyte * | session, |
eap1xSessionStats * | stats | ||
) |
This function retrieves an EAP1X session's current statistics.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
session | Pointer to EAP1X session handle returned from EAP1X_authSessionCreate. |
stats | On return, pointer to the session's current statistics values. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_authInit | ( | void | ) |
This function starts the EAP1X state machine and initializes the EAP1X stack and timers. This function needs to be called before calling EAP1X_authSessionCreate.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_authReceivePkt | ( | ubyte * | session, |
ubyte * | pPkt, | ||
ubyte4 | pktLen | ||
) |
This function sends the received EAP1X packets to the EAP1X layer. First the packet header's type is evaluated. Then based on the type, this function either updates the EAP1X session's state parameters (which in turn control the EAP state machine) or invokes the session's funcPtrEAPOLCallback
function.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
session | Pointer to EAP1X session handle returned from EAP1X_authSessionCreate. |
pPkt | Pointer to received EAP1X packet. |
pktLen | Number of bytes in the received packet (pPkt ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_authSendEAP | ( | ubyte * | session, |
eapHdr_t * | eap_hdr, | ||
ubyte * | eap_data, | ||
ubyte4 | eap_data_len, | ||
ubyte4 | headRoom, | ||
ubyte ** | ppPkt, | ||
ubyte2 * | pPktLen | ||
) |
This function encapsulates an EAP packet with an EAP1X header. The calling application must provide necessary data headroom for any required prepended data, such as the source or destination MAC address in the EAP1X header.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
ppPkt
) after your application is done with it.session | Pointer to EAP1X session handle returned from EAP1X_authSessionCreate. |
eap_hdr | Pointer to EAP packet header. |
eap_data | Pointer to EAP packet payload. |
eap_data_len | Number of bytes in EAP packet payload (eap_data ). |
headRoom | Number of bytes available to fill in the lower layer header. (These bytes will be included in the returned pPktLen value.) |
ppPkt | On return, pointer to resulting encapsulated packet. |
pPktLen | On return, pointer to number of bytes (including the headRoom ) in the resulting encapsulated packet (ppPkt ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_authSessionCreate | ( | ubyte * | appHdl, |
ubyte ** | session, | ||
eap1xAuthSessionCfg * | cfg | ||
) |
This function creates an EAP1X authenticator session based on the specified parameters, returning the resultant session handle through the session
parameter. Before calling this function, your application must first call EAP1X_authInit.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
appHdl | Pointer to application cookie. |
session | On return, pointer to EAP1X session handle. |
cfg | Pointer to desired EAP1X session parameters. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_authSessionDelete | ( | ubyte * | appHdl, |
ubyte * | session | ||
) |
This function deletes an EAP1X authenticator session.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
appHdl | Pointer to application cookie. |
session | Pointer to EAP1X session handle returned from EAP1X_authSessionCreate. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_authUpdatePortControl | ( | ubyte * | session, |
eap1xPortMode | portMode | ||
) |
This function sets (updates) an EAP1X session's port control mode.
For EAP-based authentication, the port control mode should be set to EAP1X_PORT_MODE_AUTO
. You can force the port into an authorized or unauthorized state by setting the port control mode parameter to EAP1X_PORT_MODE_FORCED_AUTHORIZED
or EAP1X_PORT_MODE_FORCED_UNAUTHORIZED
, respectively.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
session | EAP session handle returned from EAP1X_authSessionCreate. |
portMode | Any of the eap1xPortMode enumerated values (defined in eap1x.h). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_authUpdateSetState | ( | ubyte * | session, |
ubyte4 | stateInfo | ||
) |
This function sets an EAP1X session's state parameters (which in turn control the EAP state machine).
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
session | EAP session handle returned from EAP1X_authSessionCreate. |
stateInfo | Bitmask combination (created by OR — ing definitions together) of desired state parameters to set. Valid state parameter definitions are:
|
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_authUpdateUnsetState | ( | ubyte * | session, |
ubyte4 | stateInfo | ||
) |
This function clears (unsets) an EAP1X session's state parameters (which in turn control the EAP state machine).
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_AUTH__
session | EAP session handle returned from EAP1X_authSessionCreate. |
stateInfo | Bitmask combination (created by OR — ing definitions together) of desired state parameters to clear (unset). Valid state parameter definitions are:
|
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerCheckTimers | ( | ) |
This function determines whether any timers have expired, and if so then calls each expired expired timer's callback function. Your application should call this function on every clock tick (every 300 to 500 milliseconds) to provide time to the EAP1X stack.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerdeinit | ( | ) |
This function destroys EAP1X timers that were created by EAP1X_peerInit. You should call this function after calling EAP1X_peerSessionDelete.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerGetSesssionState | ( | ubyte * | session, |
eap1XPeerState_t * | state | ||
) |
This function retrieves an EAP1X session's current state.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
session | Pointer to EAP1X session handle returned from EAP1X_peerSessionCreate. |
state | On return, pointer to the session's current state values. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerGetSesssionStats | ( | ubyte * | session, |
eap1xPeerStats * | stats | ||
) |
This function retrieves an EAP1X session's current statistics.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
session | Pointer to EAP1X session handle returned from EAP1X_peerSessionCreate. |
stats | On return, pointer to the session's current statistics values. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerInit | ( | ) |
This function starts the EAP1X state machine and initializes the EAP1X stack and timers. This function needs to be called before calling EAP1X_peerSessionCreate.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerReceivePkt | ( | ubyte * | session, |
ubyte * | pPkt, | ||
ubyte4 | pktLen | ||
) |
This function sends the received EAP1X packets to the EAP1X layer. First the packet header's type is evaluated. For EAP1X_EAP_EAPOL messages, this function invokes the session's funcPtrEAPOLCallback
function.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
session | Pointer to EAP1X session handle returned from EAP1X_peerSessionCreate. |
pPkt | Pointer to received EAP1X packet. |
pktLen | Number of bytes in the received packet (pPkt ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerSendEAP | ( | ubyte * | session, |
eapHdr_t * | eap_hdr, | ||
ubyte * | eap_data, | ||
ubyte4 | eap_data_len, | ||
ubyte4 | headRoom, | ||
ubyte ** | ppPkt, | ||
ubyte2 * | pPktLen | ||
) |
This function encapsulates an EAP packet with an EAP1X header. The calling application must provide necessary data headroom for any required prepended data, such as the source or destination MAC address in the EAP1X header.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
ppPkt
) after your application is done with it.session | Pointer to EAP1X session handle returned from EAP1X_peerSessionCreate. |
eap_hdr | Pointer to EAP packet header. |
eap_data | Pointer to EAP packet payload. |
eap_data_len | Number of bytes in EAP packet payload (eap_data ). |
headRoom | Number of bytes available to fill in the lower layer header. (These bytes will be included in the returned pPktLen value.) |
ppPkt | On return, pointer to resulting encapsulated packet. |
pPktLen | On return, pointer to number of bytes (including the headRoom ) in the resulting encapsulated packet (ppPkt ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerSessionCreate | ( | ubyte * | appHdl, |
ubyte ** | session, | ||
eap1xPeerSessionCfg * | cfg | ||
) |
This function creates an EAP1X peer session based on the specified parameters, returning the resultant session handle through the session
parameter. Before calling this function, your application must first call EAP1X_peerInit.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
appHdl | Pointer to application cookie. |
session | On return, pointer to EAP1X session handle. |
cfg | Pointer to desired EAP1X session parameters. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerSessionDelete | ( | ubyte * | appHdl, |
ubyte * | session | ||
) |
This function deletes an EAP1X peer session. After you delete the session, you should call EAP1X_peerdeinit to destroy the session's timers.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
appHdl | Pointer to application cookie. |
session | Pointer to EAP1X session handle returned from EAP1X_peerSessionCreate. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerUpdatePortControl | ( | ubyte * | session, |
eap1xPortMode | portMode | ||
) |
This function sets (updates) an EAP1X session's port control mode.
For EAP-based authentication, the port control mode should be set to EAP1X_PORT_MODE_AUTO
. You can force the port into an authorized or unauthorized state by setting the port control mode parameter to EAP1X_PORT_MODE_FORCED_AUTHORIZED
or EAP1X_PORT_MODE_FORCED_UNAUTHORIZED
, respectively.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
session | EAP session handle returned from EAP1X_peerSessionCreate. |
portMode | Any of the eap1xPortMode enumerated values (defined in eap1x.h). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerUpdateSetState | ( | ubyte * | session, |
ubyte4 | stateInfo | ||
) |
This function sets an EAP1X session's state parameters (which in turn control the EAP state machine).
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
session | EAP session handle returned from EAP1X_peerSessionCreate. |
stateInfo | Bitmask combination (created by OR — ing definitions together) of desired state parameters to set. Valid state parameter definitions are:
|
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_peerUpdateUnsetState | ( | ubyte * | session, |
ubyte4 | stateInfo | ||
) |
This function clears (unsets) an EAP1X session's state parameters (which in turn control the EAP state machine).
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
session | EAP session handle returned from EAP1X_peerSessionCreate. |
stateInfo | Bitmask combination (created by OR — ing definitions together) of desired state parameters to clear (unset). Valid state parameter definitions are:
|
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_sendEAPOLLogoff | ( | ubyte * | session, |
ubyte ** | ppPkt, | ||
ubyte4 * | pPktLen, | ||
ubyte4 | headRoom | ||
) |
This function builds an EAPOL-Logoff message, returning it through the ppPkt
parameter. Your application can then send the message using the appropriate transport layer functions
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
ppPkt
) after your application is done with it.session | EAP session handle returned from EAP1X_peerSessionCreate. |
ppPkt | On return, pointer to resultant EAPOL-Logoff message packet. |
pPktLen | On return, pointer to number of bytes (including the headRoom ) in resultant EAPOL-Logoff message packet (ppPkt ). |
headRoom | Number of bytes available to fill in the lower layer header. (These bytes will be included in the returned pPktLen value.) |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS EAP1X_sendEAPOLStart | ( | ubyte * | session, |
ubyte ** | ppPkt, | ||
ubyte4 * | pPktLen, | ||
ubyte4 | headRoom | ||
) |
This function builds an EAPOL-Start message, returning it through the ppPkt
parameter. Your application can then send the message using the appropriate transport layer functions
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_EAP_PEER__
ppPkt
) after your application is done with it.session | EAP session handle returned from EAP1X_peerSessionCreate. |
ppPkt | On return, pointer to resultant EAPOL-Start message packet. |
pPktLen | On return, pointer to number of bytes (including the headRoom ) in resultant EAPOL-Start message packet (ppPkt ). |
headRoom | Number of bytes available to fill in the lower layer header. (These bytes will be included in the returned pPktLen value.) |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.