doc: fix up doxygen annotations, add some documentation
Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
parent
00c3066645
commit
1c450a1ac5
1406
doc/Doxyfile.in
1406
doc/Doxyfile.in
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,11 @@
|
|||
#ifndef _LIBDECT_DECT_AUTH_H
|
||||
#define _LIBDECT_DECT_AUTH_H
|
||||
|
||||
/**
|
||||
* @addtogroup security
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define DECT_AUTH_KEY_LEN 16
|
||||
#define DECT_AUTH_RAND_LEN 8
|
||||
#define DECT_AUTH_RES_LEN 4
|
||||
|
@ -36,4 +41,6 @@ extern void dect_auth_a12(const uint8_t *ks, uint64_t rand_f, uint8_t *dck,
|
|||
extern void dect_auth_a21(const uint8_t *k, uint64_t rs, uint8_t *ks);
|
||||
extern void dect_auth_a22(const uint8_t *ks, uint64_t rand_p, uint32_t *res2);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* _LIBDECT_DECT_AUTH_H */
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
#ifndef _LIBDECT_DECT_CC_H
|
||||
#define _LIBDECT_DECT_CC_H
|
||||
|
||||
/**
|
||||
* @addtogroup cc
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <dect/ie.h>
|
||||
|
||||
/**
|
||||
|
@ -271,4 +276,6 @@ extern int dect_mncc_iwu_info_req(struct dect_handle *dh, struct dect_call *call
|
|||
extern int dect_dl_u_data_req(const struct dect_handle *dh, struct dect_call *call,
|
||||
struct dect_msg_buf *mb);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* _LIBDECT_DECT_CC_H */
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
#ifndef _LIBDECT_DECT_IE_H
|
||||
#define _LIBDECT_DECT_IE_H
|
||||
|
||||
/**
|
||||
* @addtogroup ie
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <dect/utils.h>
|
||||
|
||||
|
@ -1172,4 +1177,6 @@ struct dect_ie_call_information {
|
|||
struct dect_ie_common common;
|
||||
};
|
||||
|
||||
/* @} */
|
||||
|
||||
#endif /* _LIBDECT_DECT_IE_H */
|
||||
|
|
|
@ -7,8 +7,17 @@
|
|||
#ifndef _LIBDECT_DECT_MM_H
|
||||
#define _LIBDECT_DECT_MM_H
|
||||
|
||||
/**
|
||||
* @addtogroup mm
|
||||
* @{
|
||||
**/
|
||||
|
||||
#include <dect/ie.h>
|
||||
|
||||
/**
|
||||
* @addtogroup mm_access_rights
|
||||
* @{
|
||||
*/
|
||||
struct dect_mm_access_rights_param {
|
||||
struct dect_ie_collection common;
|
||||
struct dect_ie_portable_identity *portable_identity;
|
||||
|
@ -27,7 +36,12 @@ struct dect_mm_access_rights_param {
|
|||
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
|
||||
struct dect_ie_codec_list *codec_list;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @addtogroup mm_access_rights_terminate
|
||||
* @{
|
||||
*/
|
||||
struct dect_mm_access_rights_terminate_param {
|
||||
struct dect_ie_collection common;
|
||||
struct dect_ie_portable_identity *portable_identity;
|
||||
|
@ -37,7 +51,12 @@ struct dect_mm_access_rights_terminate_param {
|
|||
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
|
||||
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @addtogroup mm_key_allocation
|
||||
* @{
|
||||
*/
|
||||
struct dect_mm_key_allocate_param {
|
||||
struct dect_ie_collection common;
|
||||
struct dect_ie_allocation_type *allocation_type;
|
||||
|
@ -45,7 +64,12 @@ struct dect_mm_key_allocate_param {
|
|||
struct dect_ie_auth_value *rs;
|
||||
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @addtogroup mm_auth
|
||||
* @{
|
||||
*/
|
||||
struct dect_mm_authenticate_param {
|
||||
struct dect_ie_collection common;
|
||||
struct dect_ie_auth_type *auth_type;
|
||||
|
@ -60,7 +84,12 @@ struct dect_mm_authenticate_param {
|
|||
struct dect_ie_list iwu_to_iwu;
|
||||
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @addtogroup mm_cipher
|
||||
* @{
|
||||
*/
|
||||
struct dect_mm_cipher_param {
|
||||
struct dect_ie_collection common;
|
||||
struct dect_ie_cipher_info *cipher_info;
|
||||
|
@ -70,7 +99,12 @@ struct dect_mm_cipher_param {
|
|||
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
|
||||
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @addtogroup mm_location_registration
|
||||
* @{
|
||||
*/
|
||||
struct dect_mm_locate_param {
|
||||
struct dect_ie_collection common;
|
||||
struct dect_ie_portable_identity *portable_identity;
|
||||
|
@ -95,7 +129,12 @@ struct dect_mm_detach_param {
|
|||
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
|
||||
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @addtogroup mm_identification
|
||||
* @{
|
||||
*/
|
||||
struct dect_mm_identity_param {
|
||||
struct dect_ie_collection common;
|
||||
struct dect_ie_list identity_type;
|
||||
|
@ -107,7 +146,12 @@ struct dect_mm_identity_param {
|
|||
struct dect_ie_model_identifier *model_identifier;
|
||||
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @addtogroup mm_temporary_identity_assignment
|
||||
* @{
|
||||
*/
|
||||
struct dect_mm_identity_assign_param {
|
||||
struct dect_ie_collection common;
|
||||
struct dect_ie_portable_identity *portable_identity;
|
||||
|
@ -119,7 +163,12 @@ struct dect_mm_identity_assign_param {
|
|||
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
|
||||
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @addtogroup mm_parameter_retrieval
|
||||
* @{
|
||||
*/
|
||||
struct dect_mm_info_param {
|
||||
struct dect_ie_collection common;
|
||||
struct dect_ie_info_type *info_type;
|
||||
|
@ -134,13 +183,19 @@ struct dect_mm_info_param {
|
|||
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
|
||||
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @addtogroup mm_external_protocol_information
|
||||
* @{
|
||||
*/
|
||||
struct dect_mm_iwu_param {
|
||||
struct dect_ie_collection common;
|
||||
struct dect_ie_iwu_to_iwu *iwu_to_iwu;
|
||||
struct dect_ie_iwu_packet *iwu_packet;
|
||||
struct dect_ie_escape_to_proprietary *escape_to_proprietary;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
struct dect_mm_endpoint;
|
||||
|
||||
|
@ -272,4 +327,6 @@ extern int dect_mm_info_res(struct dect_handle *dh, struct dect_mm_endpoint *mme
|
|||
extern int dect_mm_iwu_req(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
const struct dect_mm_iwu_param *param);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* _LIBDECT_DECT_MM_H */
|
||||
|
|
60
src/auth.c
60
src/auth.c
|
@ -8,6 +8,14 @@
|
|||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup security Security features
|
||||
*
|
||||
* This module implements the security processes specified in ETSI EN 300 175-7.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -21,12 +29,14 @@
|
|||
/**
|
||||
* dect_pin_to_ac - convert PIN to authentication code
|
||||
*
|
||||
* @pin: PIN code
|
||||
* @ac: buffer to store authentication code
|
||||
* @ac_len: length of destination buffer
|
||||
* @param pin PIN code
|
||||
* @param ac buffer to store authentication code
|
||||
* @param ac_len length of destination buffer
|
||||
*
|
||||
* Convert a PIN to an authentication code, which is the BCD encoded PIN,
|
||||
* left-padded with 0xf. The number of PIN digits must not exceed 2 * ac_len.
|
||||
*
|
||||
* @sa ETSI EN 300 444 (GAP), section 14.2.
|
||||
*/
|
||||
void dect_pin_to_ac(const char *pin, uint8_t *ac, unsigned int ac_len)
|
||||
{
|
||||
|
@ -46,9 +56,9 @@ EXPORT_SYMBOL(dect_pin_to_ac);
|
|||
/**
|
||||
* dect_auth_b1 - derive authentication key K from UAK/AC
|
||||
*
|
||||
* @val: user authentication key (UAK) or authentication code (AC)
|
||||
* @len: length of UAK/AC
|
||||
* @k: buffer to store authentication key of size DECT_AUTH_KEY_LEN
|
||||
* @param val user authentication key (UAK) or authentication code (AC)
|
||||
* @param len length of UAK/AC
|
||||
* @param k buffer to store authentication key of size DECT_AUTH_KEY_LEN
|
||||
*
|
||||
* Derive an authentication key from a user authentication key or an
|
||||
* authentication code.
|
||||
|
@ -65,11 +75,11 @@ EXPORT_SYMBOL(dect_auth_b1);
|
|||
/**
|
||||
* dect_auth_b2 - derive authentication key K from UAK and UPI
|
||||
*
|
||||
* @uak: user authentication key (UAK)
|
||||
* @uak_len: length of UAK
|
||||
* @upi: user personal identity (UPI)
|
||||
* @upi_len: length of UPI
|
||||
* @k: buffer to store authentication key of size DECT_AUTH_KEY_LEN
|
||||
* @param uak user authentication key (UAK)
|
||||
* @param uak_len length of UAK
|
||||
* @param upi user personal identity (UPI)
|
||||
* @param upi_len length of UPI
|
||||
* @param k buffer to store authentication key of size DECT_AUTH_KEY_LEN
|
||||
*
|
||||
* Derive an authentication key from a user authentication key and an user
|
||||
* personal identity.
|
||||
|
@ -102,9 +112,9 @@ static void dect_auth_calc(const uint8_t *key, uint64_t val, uint8_t *e)
|
|||
/**
|
||||
* dect_auth_a11 - derive authentication session key
|
||||
*
|
||||
* @k: authentication key K
|
||||
* @rs: random seed
|
||||
* @ks: buffer to store session authentication key of size DECT_AUTH_KEY_LEN
|
||||
* @param k authentication key K
|
||||
* @param rs random seed
|
||||
* @param ks buffer to store session authentication key of size DECT_AUTH_KEY_LEN
|
||||
*
|
||||
* Derive the session authentication keys KS from the authentication key K
|
||||
* and random seed RS.
|
||||
|
@ -118,10 +128,10 @@ EXPORT_SYMBOL(dect_auth_a11);
|
|||
/**
|
||||
* dect_auth_a12 - derive cipher key and authentication response
|
||||
*
|
||||
* @ks: session authentication key KS
|
||||
* @rand_f: FP random value
|
||||
* @dck: buffer to store derived cipher key (DCK) of size DECT_CIPHER_KEY_LEN
|
||||
* @res1: buffer to store authentication response
|
||||
* @param ks session authentication key KS
|
||||
* @param rand_f FP random value
|
||||
* @param dck buffer to store derived cipher key (DCK) of size DECT_CIPHER_KEY_LEN
|
||||
* @param res1 buffer to store authentication response
|
||||
*
|
||||
* Derive the derived cipher key DCK and authentication response RES1 from the
|
||||
* session authentication key KS and the random value rand_f.
|
||||
|
@ -139,9 +149,9 @@ EXPORT_SYMBOL(dect_auth_a12);
|
|||
/**
|
||||
* dect_auth_a21 - derive authentication session key
|
||||
*
|
||||
* @k: authentication key K
|
||||
* @rs: random seed
|
||||
* @ks: buffer to store session authentication key of size DECT_AUTH_KEY_LEN
|
||||
* @param k authentication key K
|
||||
* @param rs random seed
|
||||
* @param ks buffer to store session authentication key of size DECT_AUTH_KEY_LEN
|
||||
*
|
||||
* Derive the session authentication keys KS' from the authentication key K
|
||||
* and random seed RS.
|
||||
|
@ -159,9 +169,9 @@ EXPORT_SYMBOL(dect_auth_a21);
|
|||
/**
|
||||
* dect_auth_a22 - derive authentication response
|
||||
*
|
||||
* @ks: session authentication key KS'
|
||||
* @rand_p: PP random value
|
||||
* @res2: buffer to store authentication response
|
||||
* @param ks session authentication key KS'
|
||||
* @param rand_p PP random value
|
||||
* @param res2 buffer to store authentication response
|
||||
*
|
||||
* Derive the authentication response RES2 from the session authentication
|
||||
* key KS' and the random value rand_p.
|
||||
|
@ -175,6 +185,8 @@ void dect_auth_a22(const uint8_t *ks, uint64_t rand_p, uint32_t *res2)
|
|||
}
|
||||
EXPORT_SYMBOL(dect_auth_a22);
|
||||
|
||||
/** @} */
|
||||
|
||||
/*
|
||||
* DSAA/DSC key allocation test from ETS EN 300 175-7 Annex K
|
||||
*/
|
||||
|
|
10
src/cc.c
10
src/cc.c
|
@ -8,6 +8,14 @@
|
|||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup cc Call Control
|
||||
*
|
||||
* This module implements the call control processes specified in
|
||||
* ETSI EN 300 175-5, section 9.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
@ -1415,3 +1423,5 @@ static void __init dect_cc_init(void)
|
|||
{
|
||||
dect_lce_register_protocol(&cc_protocol);
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
|
7
src/ie.c
7
src/ie.c
|
@ -8,6 +8,11 @@
|
|||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup ie Information Elements
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -192,3 +197,5 @@ struct dect_ie_collection *__dect_ie_collection_hold(struct dect_ie_collection *
|
|||
return iec;
|
||||
}
|
||||
EXPORT_SYMBOL(__dect_ie_collection_hold);
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -382,8 +382,8 @@ static void dect_ddl_shutdown(struct dect_handle *dh,
|
|||
/**
|
||||
* dect_ddl_set_cipher_key - set cipher key for datalink
|
||||
*
|
||||
* @ddl: Datalink
|
||||
* @ck: Cipher key
|
||||
* @param ddl Datalink
|
||||
* @param ck Cipher key
|
||||
*/
|
||||
int dect_ddl_set_cipher_key(const struct dect_data_link *ddl,
|
||||
const uint8_t ck[DECT_CIPHER_KEY_LEN])
|
||||
|
@ -401,8 +401,8 @@ int dect_ddl_set_cipher_key(const struct dect_data_link *ddl,
|
|||
/**
|
||||
* dect_ddl_encrypt_req - enable/disable encryption for a datalink
|
||||
*
|
||||
* @ddl: Datalink
|
||||
* @status: desired ciphering state (enabled/disabled)
|
||||
* @param ddl Datalink
|
||||
* @param status desired ciphering state (enabled/disabled)
|
||||
*/
|
||||
int dect_ddl_encrypt_req(const struct dect_data_link *ddl,
|
||||
enum dect_cipher_states status)
|
||||
|
|
354
src/mm.c
354
src/mm.c
|
@ -8,6 +8,11 @@
|
|||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup mm Mobility Management
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
@ -557,16 +562,74 @@ static int dect_mm_send_msg(const struct dect_handle *dh,
|
|||
(void)0; \
|
||||
})
|
||||
|
||||
/*
|
||||
* Key Allocation
|
||||
/**
|
||||
* @defgroup mm_key_allocation Key Allocation
|
||||
*
|
||||
* This module implements the key allocation procedure specified in
|
||||
* ETSI EN 300 175-5 section 13.6. The procedure works by performing
|
||||
* mutual authentication and storing the resulting session key as UAK:
|
||||
*
|
||||
* - The F-IWU invokes the \ref dect_mm_key_allocate_req() "MM_KEY_ALLOCATE-req"
|
||||
* primitive, the F-MM entity sends a KEY-ALLOCATE message to the P-MM containing
|
||||
* a \ref dect_ie_auth_value "RAND", \ref dect_ie_auth_value "RS" and
|
||||
* \ref dect_ie_allocation_type "ALLOCATION-TYPE" information element.
|
||||
*
|
||||
* - The P-MM invokes the \ref dect_mm_ops::mm_key_allocate_ind()
|
||||
* "MM_KEY_ALLOCATE-ind" primitive, the P-IWU responds with a
|
||||
* \ref dect_mm_authenticate_req() "MM_AUTHENTICATE-req" primitive and sends
|
||||
* a AUTHENTICATION-REQUEST message to the F-MM containing a
|
||||
* \ref dect_ie_auth_value "RAND" and \ref dect_ie_auth_res "RES" information
|
||||
* element.
|
||||
*
|
||||
* - The F-MM invokes the \ref dect_mm_ops::mm_authenticate_ind()
|
||||
* "MM_AUTHENTICATE-ind" primitive. If the \ref dect_ie_auth_res "RES" value
|
||||
* matches the expected value, the PT authentication is considered successful.
|
||||
* The F-IWU responds with a \ref dect_mm_authenticate_res() "MM_AUTHENTICATE-res"
|
||||
* primitive, the F-MM sends an AUTHENTICATION-REPLY message to the P-MM
|
||||
* containing a \ref dect_ie_auth_res "RES" information element.
|
||||
*
|
||||
* - The P-MM invokes the \ref dect_mm_ops::mm_authenticate_cfm()
|
||||
* "MM_AUTHENTICATE-cfm" primitive. If the \ref dect_ie_auth_res "RES" value
|
||||
* matches the expected value, the FT authentication is considered successful.
|
||||
* The P-IWU stores the reverse session key KS' as a new user authentication
|
||||
* key under the UAK-number given in the \ref dect_ie_allocation_type
|
||||
* "ALLOCATION-TYPE" information element.
|
||||
*
|
||||
* \msc
|
||||
* "F-IWU", "F-MM", "P-MM", "P-IWU";
|
||||
*
|
||||
* "F-IWU" => "F-MM" [label="MM_KEY_ALLOCATE-req", URL="\ref dect_mm_key_allocate_req()"];
|
||||
* "F-MM" -> "P-MM" [label="KEY-ALLOCATE"];
|
||||
* "P-MM" =>> "P-IWU" [label="MM_KEY_ALLOCATE-ind", URL="\ref dect_mm_ops::mm_key_allocate_ind"];
|
||||
* "P-IWU" => "P-MM" [label="MM_AUTHENTICATE-req", URL="\ref dect_mm_authenticate_req()"];
|
||||
* "P-MM" -> "F-MM" [label="AUTHENTICATION-REQUEST"];
|
||||
* "F-MM" =>> "F-IWU" [label="MM_AUTHENTICATE-ind", URL="\ref dect_mm_ops::mm_authenticate_ind"];
|
||||
* "F-IWU" => "F-MM" [label="MM_AUTHENTICATE-res", URL="\ref dect_mm_authenticate_res()"];
|
||||
* "F-MM" -> "P-MM" [label="AUTHENTICATION-REPLY"];
|
||||
* "P-MM" =>> "P-IWU" [label="MM_AUTHENTICATE-cfm", URL="\ref dect_mm_ops::mm_authenticate_cfm"];
|
||||
* \endmsc
|
||||
*
|
||||
* @sa ETSI EN 300 175-7 (DECT Common Interface - Security Features)
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* dect_mm_key_allocate_req - MM_KEY_ALLOCATE-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: key allocate request parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param key allocate request parameters
|
||||
*
|
||||
* Begin a key allocation procedure and send a KEY-ALLOCATE message to the PT.
|
||||
*
|
||||
* When the procedure is successfully accepted by the PT, it will respond by
|
||||
* requesting authentication, in which case the #dect_mm_ops::mm_authenticate_ind()
|
||||
* callback will be invoked. If the procedure is rejected or an error occurs,
|
||||
* the #dect_mm_ops::mm_authenticate_cfm() callback will be invoked with an 'accept'
|
||||
* parameter value of 'false'.
|
||||
*
|
||||
* The key allocation procedure may only be invoked by the FT.
|
||||
*/
|
||||
int dect_mm_key_allocate_req(struct dect_handle *dh,
|
||||
struct dect_mm_endpoint *mme,
|
||||
|
@ -638,16 +701,61 @@ err1:
|
|||
dect_mm_procedure_cancel(dh, mme, mp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Authentication
|
||||
/**
|
||||
* @}
|
||||
* @defgroup mm_auth Authentication
|
||||
*
|
||||
* This module implements the authentication procedures specified in
|
||||
* ETSI EN 300 175-5 section 13.3. Authentication may be invoked by either
|
||||
* side, the procedure works as follows:
|
||||
*
|
||||
* - The IWU-1 invokes the \ref dect_mm_authenticate_req() "MM_AUTHENTICATE-req"
|
||||
* primitive, the MM-1 sends a AUTHENTICATION-REQUEST message to the MM-2
|
||||
* containing a \ref dect_ie_auth_value "RAND" and \ref dect_ie_auth_value "RS"
|
||||
* information element.
|
||||
*
|
||||
* - The MM-2 invokes the \ref dect_mm_ops::mm_authenticate_ind()
|
||||
* "MM_AUTHENTICATE-ind" primitive. The IWU-2 responds with a \ref dect_mm_authenticate_res()
|
||||
* "MM_AUTHENTICATE-res" primitive, the MM-2 sends an AUTHENTICATION-REPLY
|
||||
* message to the MM-1 containing a \ref dect_ie_auth_res "RES" information
|
||||
* element.
|
||||
*
|
||||
* - The MM-1 invokes the \ref dect_mm_ops::mm_authenticate_cfm() "MM_AUTHENTICATE-cfm"
|
||||
* primitive. If the \ref dect_ie_auth_res "RES" value matches the expected value,
|
||||
* the authentication is considered successful.
|
||||
*
|
||||
* \msc
|
||||
* "IWU-1", "MM-1", "MM-2", "IWU-2";
|
||||
*
|
||||
* "IWU-1" => "MM-1" [label="MM_AUTHENTICATE-req", URL="\ref dect_mm_authenticate_req()"];
|
||||
* "MM-1" -> "MM-2" [label="AUTHENTICATION-REQUEST"];
|
||||
* "MM-2" =>> "IWU-2" [label="MM_AUTHENTICATE-ind", URL="\ref dect_mm_ops::mm_authenticate_ind"];
|
||||
* "IWU-2" => "MM-2" [label="MM_AUTHENTICATE-res", URL="\ref dect_mm_authenticate_res()"];
|
||||
* "MM-2" -> "MM-1" [label="AUTHENTICATION-REPLY"];
|
||||
* "MM-1" =>> "IWU-1" [label="MM_AUTHENTICATE-cfm", URL="\ref dect_mm_ops::mm_authenticate_cfm"];
|
||||
* \endmsc
|
||||
*
|
||||
* @sa ETSI EN 300 175-7 (DECT Common Interface - Security Features)
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* dect_mm_authenticate_req - MM_AUTHENTICATE-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: authenticate request parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param authenticate request parameters
|
||||
*
|
||||
* Begin an authentication procedure and send an AUTHENTICATION-REQUEST message
|
||||
* to the peer.
|
||||
*
|
||||
* When the procedure is successfully accepted by the peer, it will respond
|
||||
* with an AUTHENTICATION-REPLY message, in which case the
|
||||
* #dect_mm_ops::mm_authenticate_cfm() callback will be invoked with an 'accept'
|
||||
* parameter value of 'true'. If the procedure is rejected or an error occurs,
|
||||
* the dect_mm_ops::mm_authenticate_cfm() callback will be invoked with an
|
||||
* 'accept' parameter value of 'false'.
|
||||
*/
|
||||
int dect_mm_authenticate_req(struct dect_handle *dh,
|
||||
struct dect_mm_endpoint *mme,
|
||||
|
@ -719,12 +827,14 @@ static int dect_mm_send_authenticate_reject(const struct dect_handle *dh,
|
|||
}
|
||||
|
||||
/**
|
||||
* dect_mm_authenticate_req - MM_AUTHENTICATE-res primitive
|
||||
* dect_mm_authenticate_res - MM_AUTHENTICATE-res primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @accept: accept/reject authentication
|
||||
* @param: authenticate response parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param accept accept/reject authentication
|
||||
* @param param authenticate response parameters
|
||||
*
|
||||
* Respond to an authentication request and complete the authentication procedure.
|
||||
*/
|
||||
int dect_mm_authenticate_res(struct dect_handle *dh,
|
||||
struct dect_mm_endpoint *mme, bool accept,
|
||||
|
@ -871,17 +981,39 @@ err1:
|
|||
dect_msg_free(dh, &mm_authentication_reject_msg_desc, &msg.common);
|
||||
}
|
||||
|
||||
/*
|
||||
* Ciphering
|
||||
/**
|
||||
* @}
|
||||
* @defgroup mm_cipher Ciphering
|
||||
*
|
||||
* This module implements the ciphering related procedure specified in
|
||||
* ETSI EN 300 175-5 section 13.8.
|
||||
*
|
||||
* \msc
|
||||
* "F-IWU", "F-MM", "F-DLC", "P-DLC", "P-MM", "P-IWU";
|
||||
*
|
||||
* "F-IWU" => "F-MM" [label="MM_CIPHER-req", URL="\ref dect_mm_cipher_req()"];
|
||||
* "F-MM" => "F-DLC" [label="DL_ENC_KEY-req"];
|
||||
* "F-MM" -> "P-MM" [label="CIPHER-REQUEST"];
|
||||
* "P-MM" =>> "P-IWU" [label="MM_CIPHER-ind", URL="\ref dect_mm_ops::mm_ciphere_ind"];
|
||||
* "P-IWU" => "P-MM" [label="MM_CIPHER-res", URL="\ref dect_mm_cipher_res()"];
|
||||
* "P-MM" => "P-DLC" [label="DL_ENC_KEY-req"];
|
||||
* "P-MM" => "P-DLC" [label="DL_ENCRYPT-req"];
|
||||
* ... [label="Establish MAC bearer encryption"];
|
||||
* "P-DLC" =>> "P-MM" [label="DL_ENCRYPT-cfm"];
|
||||
* "F-DLC" =>> "F-MM" [label="DL_ENCRYPT-ind"];
|
||||
* "F-MM" =>> "F-IWU" [label="MM_CIPHER-cfm", URL="\ref dect_mm_ops::mm_cipher_cfm"];
|
||||
* \endmsc
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* dect_mm_cipher_req - MM_CIPHER-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: cipher request parameters
|
||||
* @ck: cipher key
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param cipher request parameters
|
||||
* @param ck cipher key
|
||||
*/
|
||||
int dect_mm_cipher_req(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
const struct dect_mm_cipher_param *param,
|
||||
|
@ -944,11 +1076,11 @@ static int dect_mm_send_cipher_reject(const struct dect_handle *dh,
|
|||
/**
|
||||
* dect_mm_cipher_res - MM_CIPHER-res primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @accept: accept/reject ciphering
|
||||
* @param: cipher respond parameters
|
||||
* @ck: cipher key
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param accept accept/reject ciphering
|
||||
* @param param cipher respond parameters
|
||||
* @param ck cipher key
|
||||
*/
|
||||
int dect_mm_cipher_res(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
bool accept, const struct dect_mm_cipher_param *param,
|
||||
|
@ -1120,16 +1252,22 @@ static void dect_mm_encrypt_ind(struct dect_handle *dh, struct dect_transaction
|
|||
dect_mm_cipher_cfm(dh, mme);
|
||||
}
|
||||
|
||||
/*
|
||||
* Access rights requests
|
||||
/**
|
||||
* @}
|
||||
* @defgroup mm_access_rights Access Rights requests
|
||||
*
|
||||
* This module implements the access rights procedure specified in
|
||||
* ETSI EN 300 175-5 section 13.5.1.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* dect_mm_access_rights_req - MM_ACCESS_RIGHTS-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: access rights request parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param access rights request parameters
|
||||
*/
|
||||
int dect_mm_access_rights_req(struct dect_handle *dh,
|
||||
struct dect_mm_endpoint *mme,
|
||||
|
@ -1215,10 +1353,10 @@ static int dect_mm_send_access_rights_reject(const struct dect_handle *dh,
|
|||
/**
|
||||
* dect_mm_access_rights_res - MM_ACCESS_RIGHTS-res primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @accept: accept/reject access rights request
|
||||
* @param: access rights response parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param accept accept/reject access rights request
|
||||
* @param param access rights response parameters
|
||||
*/
|
||||
int dect_mm_access_rights_res(struct dect_handle *dh,
|
||||
struct dect_mm_endpoint *mme, bool accept,
|
||||
|
@ -1371,16 +1509,22 @@ err1:
|
|||
dect_msg_free(dh, &mm_access_rights_reject_msg_desc, &msg.common);
|
||||
}
|
||||
|
||||
/*
|
||||
* Access rights termination
|
||||
/**
|
||||
* @}
|
||||
* @defgroup mm_access_rights_terminate Access rights termination
|
||||
*
|
||||
* This module implements the access rights termination procedure specified in
|
||||
* ETSI EN 300 175-5 section 13.5.2.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* dect_mm_access_rights_terminate_req - MM_ACCESS_RIGHTS_TERMINATE-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: access rights terminate request parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param access rights terminate request parameters
|
||||
*/
|
||||
int dect_mm_access_rights_terminate_req(struct dect_handle *dh,
|
||||
struct dect_mm_endpoint *mme,
|
||||
|
@ -1450,12 +1594,12 @@ static int dect_mm_send_access_rights_terminate_reject(const struct dect_handle
|
|||
}
|
||||
|
||||
/**
|
||||
* dect_mm_access_rights_terminate_res - MM_ACCESS_RUGHTS_TERMINATE-res primitive
|
||||
* dect_mm_access_rights_terminate_res - MM_ACCESS_RIGHTS_TERMINATE-res primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @accept: accept/reject access rights termination
|
||||
* @param: access rights terminate response parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param accept accept/reject access rights termination
|
||||
* @param param access rights terminate response parameters
|
||||
*/
|
||||
int dect_mm_access_rights_terminate_res(struct dect_handle *dh,
|
||||
struct dect_mm_endpoint *mme, bool accept,
|
||||
|
@ -1594,16 +1738,22 @@ err1:
|
|||
dect_msg_free(dh, &mm_access_rights_terminate_reject_msg_desc, &msg.common);
|
||||
}
|
||||
|
||||
/*
|
||||
* Location registration
|
||||
/**
|
||||
* @}
|
||||
* @defgroup mm_location_registration Location registration
|
||||
*
|
||||
* This module implements the location registration procedure specified in
|
||||
* ETSI EN 300 175-5 section 13.4.1.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* dect_mm_locate_req - MM_LOCATE-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: locate request parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param locate request parameters
|
||||
*/
|
||||
int dect_mm_locate_req(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
const struct dect_mm_locate_param *param)
|
||||
|
@ -1686,10 +1836,10 @@ static int dect_mm_send_locate_reject(const struct dect_handle *dh,
|
|||
/**
|
||||
* dect_mm_locate_res - MM_LOCATE-res primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @accept: accept/reject location registration/update
|
||||
* @param: access rights response parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme obility Management Endpoint
|
||||
* @param accept accept/reject location registration/update
|
||||
* @param param ccess rights response parameters
|
||||
*/
|
||||
int dect_mm_locate_res(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
bool accept, const struct dect_mm_locate_param *param)
|
||||
|
@ -1869,9 +2019,9 @@ err1:
|
|||
/**
|
||||
* dect_mm_detach_req - MM_DETACH-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: detach parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param detach parameters
|
||||
*/
|
||||
int dect_mm_detach_req(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
struct dect_mm_detach_param *param)
|
||||
|
@ -1942,16 +2092,22 @@ err1:
|
|||
dect_msg_free(dh, &mm_detach_msg_desc, &msg.common);
|
||||
}
|
||||
|
||||
/*
|
||||
* Identification
|
||||
/**
|
||||
* @}
|
||||
* @defgroup mm_identification Identification
|
||||
*
|
||||
* This module implements the identification procedure specified in
|
||||
* ETSI EN 300 175-5 section 13.2.1.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* dect_mm_identity_req - MM_IDENTITY-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: identity request parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param identity request parameters
|
||||
*/
|
||||
int dect_mm_identity_req(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
const struct dect_mm_identity_param *param)
|
||||
|
@ -1988,9 +2144,9 @@ EXPORT_SYMBOL(dect_mm_identity_req);
|
|||
/**
|
||||
* dect_mm_identity_res - MM_IDENTITY_res primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: identity response parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param identity response parameters
|
||||
*/
|
||||
int dect_mm_identity_res(struct dect_handle *dh,
|
||||
struct dect_mm_endpoint *mme,
|
||||
|
@ -2105,16 +2261,22 @@ err1:
|
|||
dect_msg_free(dh, &mm_identity_reply_msg_desc, &msg.common);
|
||||
}
|
||||
|
||||
/*
|
||||
* Temporary identity assignment
|
||||
/**
|
||||
* @}
|
||||
* @defgroup mm_temporary_identity_assignment Temporary Identity assigment
|
||||
*
|
||||
* This module implements the temporary identity assigment procedure specified
|
||||
* in ETSI EN 300 175-5 section 13.2.2.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* dect_mm_identity_assign_req - MM_IDENTITY_ASSIGN-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: identity request parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param identity request parameters
|
||||
*/
|
||||
int dect_mm_identity_assign_req(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
const struct dect_mm_identity_assign_param *param)
|
||||
|
@ -2180,10 +2342,10 @@ static int dect_mm_send_temporary_identity_assign_rej(const struct dect_handle *
|
|||
/**
|
||||
* dect_mm_identity_assign_res - MM_IDENTITY_ASSIGN-res primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @accept: accept/reject identity assignment
|
||||
* @param: identity assigment response parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param accept accept/reject identity assignment
|
||||
* @param param identity assigment response parameters
|
||||
*/
|
||||
int dect_mm_identity_assign_res(struct dect_handle *dh,
|
||||
struct dect_mm_endpoint *mme, bool accept,
|
||||
|
@ -2332,16 +2494,22 @@ err1:
|
|||
dect_msg_free(dh, &mm_temporary_identity_assign_rej_msg_desc, &msg.common);
|
||||
}
|
||||
|
||||
/*
|
||||
* Parameter retrieval
|
||||
/**
|
||||
* @}
|
||||
* @defgroup mm_parameter_retrieval Parameter retrieval
|
||||
*
|
||||
* This module implements the parameter retrieval procedure specified in
|
||||
* ETSI EN 300 175-5 section 13.7.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* dect_mm_info_req - MM_INFO-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: info parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param info parameters
|
||||
*/
|
||||
int dect_mm_info_req(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
struct dect_mm_info_param *param)
|
||||
|
@ -2442,10 +2610,10 @@ static int dect_mm_send_info_reject(const struct dect_handle *dh,
|
|||
/**
|
||||
* dect_mm_info_res - MM_INFO-res primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @accept: accept/reject info request
|
||||
* @param: info parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param accept accept/reject info request
|
||||
* @param param info parameters
|
||||
*/
|
||||
int dect_mm_info_res(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
bool accept, struct dect_mm_info_param *param)
|
||||
|
@ -2635,16 +2803,22 @@ err1:
|
|||
dect_msg_free(dh, &mm_info_suggest_msg_desc, &msg.common);
|
||||
}
|
||||
|
||||
/*
|
||||
* External protocol information
|
||||
/**
|
||||
* @}
|
||||
* @defgroup mm_external_protocol_information External protocol information
|
||||
*
|
||||
* This module implements the external protocol information procedure specified
|
||||
* in ETSI EN 300 175-5 section 13.9.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* dect_mm_iwu_req - MM_IWU-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @mme: Mobility Management Endpoint
|
||||
* @param: IWU request parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param mme Mobility Management Endpoint
|
||||
* @param param IWU request parameters
|
||||
*/
|
||||
int dect_mm_iwu_req(struct dect_handle *dh, struct dect_mm_endpoint *mme,
|
||||
const struct dect_mm_iwu_param *param)
|
||||
|
@ -2708,6 +2882,8 @@ err1:
|
|||
dect_msg_free(dh, &mm_iwu_msg_desc, &msg.common);
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
static const struct dect_mm_proc dect_mm_proc[DECT_MMP_MAX + 1] = {
|
||||
[DECT_MMP_ACCESS_RIGHTS] = {
|
||||
.name = "access rights",
|
||||
|
@ -2969,3 +3145,5 @@ static void __init dect_mm_init(void)
|
|||
{
|
||||
dect_lce_register_protocol(&mm_protocol);
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
|
27
src/ss.c
27
src/ss.c
|
@ -8,6 +8,11 @@
|
|||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup ss Supplementary Services
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
@ -114,10 +119,10 @@ static struct dect_ss_endpoint *dect_ss_endpoint(struct dect_transaction *ta)
|
|||
/**
|
||||
* dect_mnss_setup_req - MNSS_SETUP-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @sse: Supplementary Services Endpoint
|
||||
* @ipui: PT IPUI
|
||||
* @param: Supplementary Services parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param sse Supplementary Services Endpoint
|
||||
* @param ipui PT IPUI
|
||||
* @param param Supplementary Services parameters
|
||||
*/
|
||||
int dect_mnss_setup_req(struct dect_handle *dh, struct dect_ss_endpoint *sse,
|
||||
const struct dect_ipui *ipui,
|
||||
|
@ -157,9 +162,9 @@ EXPORT_SYMBOL(dect_mnss_setup_req);
|
|||
/**
|
||||
* dect_mnss_facility_req - MNSS_FACILITY-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @sse: Supplementary Services Endpoint
|
||||
* @param: Supplementary Services parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param sse Supplementary Services Endpoint
|
||||
* @param param Supplementary Services parameters
|
||||
*/
|
||||
int dect_mnss_facility_req(struct dect_handle *dh, struct dect_ss_endpoint *sse,
|
||||
const struct dect_mnss_param *param)
|
||||
|
@ -210,9 +215,9 @@ out:
|
|||
/**
|
||||
* dect_mnss_release_req - MNSS_RELEASE-req primitive
|
||||
*
|
||||
* @dh: libdect DECT handle
|
||||
* @sse: Supplementary Services Endpoint
|
||||
* @param: Supplementary Services parameters
|
||||
* @param dh libdect DECT handle
|
||||
* @param sse Supplementary Services Endpoint
|
||||
* @param param Supplementary Services parameters
|
||||
*/
|
||||
int dect_mnss_release_req(struct dect_handle *dh, struct dect_ss_endpoint *sse,
|
||||
const struct dect_mnss_param *param)
|
||||
|
@ -346,3 +351,5 @@ static void __init dect_ciss_init(void)
|
|||
{
|
||||
dect_lce_register_protocol(&ciss_protocol);
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
|
Reference in New Issue