mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Merge remote-tracking branch 'origin/further_unused_arguments_cleanup' into integration_2026_w15 (!3977)
Further unused arguments cleanup More fixes for unused function arguments (see #1057), add_compile_options(-Wunused-parameter) added in folders: - nfapi - openair2 - openair3 - USRP - rfsimulator
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
||||
|
||||
add_compile_options(-Wunused-parameter)
|
||||
add_subdirectory(LPP)
|
||||
add_subdirectory(ocp-gtpu)
|
||||
add_subdirectory(M3AP)
|
||||
|
||||
@@ -32,7 +32,7 @@ int decode_authentication_response_parameter(AuthenticationResponseParameter *au
|
||||
decoded += decode_result;
|
||||
|
||||
#if defined (NAS_DEBUG)
|
||||
dump_authentication_response_parameter_xml(authenticationresponseparameter, iei);
|
||||
dump_authentication_response_parameter_xml(authenticationresponseparameter);
|
||||
#endif
|
||||
return decoded;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ int encode_authentication_response_parameter(const AuthenticationResponseParamet
|
||||
/* Checking IEI and pointer */
|
||||
CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, AUTHENTICATION_RESPONSE_PARAMETER_MINIMUM_LENGTH, len);
|
||||
#if defined (NAS_DEBUG)
|
||||
dump_authentication_response_parameter_xml(authenticationresponseparameter, iei);
|
||||
dump_authentication_response_parameter_xml(authenticationresponseparameter);
|
||||
#endif
|
||||
|
||||
if (iei > 0) {
|
||||
@@ -67,7 +67,7 @@ int encode_authentication_response_parameter(const AuthenticationResponseParamet
|
||||
return encoded;
|
||||
}
|
||||
|
||||
void dump_authentication_response_parameter_xml(AuthenticationResponseParameter *authenticationresponseparameter, uint8_t iei)
|
||||
void dump_authentication_response_parameter_xml(AuthenticationResponseParameter *authenticationresponseparameter)
|
||||
{
|
||||
printf("<Authentication Response Parameter>\n");
|
||||
dump_octet_string_xml(&authenticationresponseparameter->res);
|
||||
|
||||
@@ -25,7 +25,7 @@ int encode_authentication_response_parameter(const AuthenticationResponseParamet
|
||||
|
||||
int decode_authentication_response_parameter(AuthenticationResponseParameter *authenticationresponseparameter, uint8_t iei, uint8_t *buffer, uint32_t len);
|
||||
|
||||
void dump_authentication_response_parameter_xml(AuthenticationResponseParameter *authenticationresponseparameter, uint8_t iei);
|
||||
void dump_authentication_response_parameter_xml(AuthenticationResponseParameter *authenticationresponseparameter);
|
||||
|
||||
#endif /* AUTHENTICATION RESPONSE PARAMETER_H_ */
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#define NO_FOLLOW_ON_REQUEST 0x0
|
||||
#define FOLLOW_ON_REQUEST 0x08
|
||||
|
||||
int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8_t iei, uint8_t value, uint32_t len)
|
||||
int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8_t iei, uint8_t value)
|
||||
{
|
||||
int decoded = 0;
|
||||
uint8_t *buffer = &value;
|
||||
|
||||
@@ -28,6 +28,6 @@ typedef uint8_t FGSRegistrationType;
|
||||
|
||||
int encode_5gs_registration_type(const FGSRegistrationType *fgsregistrationtype, bool follow_on_request);
|
||||
|
||||
int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8_t iei, uint8_t value, uint32_t len);
|
||||
int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8_t iei, uint8_t value);
|
||||
|
||||
#endif /* FGS_REGISTRATION_TYPE_H_*/
|
||||
|
||||
@@ -10,10 +10,7 @@
|
||||
#include "TLVDecoder.h"
|
||||
#include "NrUESecurityCapability.h"
|
||||
|
||||
int encode_nrue_security_capability(const NrUESecurityCapability *nruesecuritycapability,
|
||||
uint8_t iei,
|
||||
uint8_t *buffer,
|
||||
uint32_t len)
|
||||
int encode_nrue_security_capability(const NrUESecurityCapability *nruesecuritycapability, uint8_t iei, uint8_t *buffer)
|
||||
{
|
||||
int encoded = 0;
|
||||
if (iei) {
|
||||
|
||||
@@ -20,9 +20,6 @@ typedef struct {
|
||||
uint8_t EIA;
|
||||
} NrUESecurityCapability;
|
||||
|
||||
int encode_nrue_security_capability(const NrUESecurityCapability *nruesecuritycapability,
|
||||
uint8_t iei,
|
||||
uint8_t *buffer,
|
||||
uint32_t len);
|
||||
int encode_nrue_security_capability(const NrUESecurityCapability *nruesecuritycapability, uint8_t iei, uint8_t *buffer);
|
||||
|
||||
#endif /* NRUE_SECURITY_CAPABILITY_H_ */
|
||||
|
||||
@@ -23,7 +23,7 @@ int decode_registration_request(registration_request_msg *registration_request,
|
||||
|
||||
/* Decoding mandatory fields */
|
||||
if ((decoded_result =
|
||||
decode_5gs_registration_type(®istration_request->fgsregistrationtype, 0, *(buffer + decoded) & 0x0f, len - decoded))
|
||||
decode_5gs_registration_type(®istration_request->fgsregistrationtype, 0, *(buffer + decoded) & 0x0f))
|
||||
< 0) {
|
||||
LOG_FUNC_RETURN(decoded_result);
|
||||
}
|
||||
@@ -76,8 +76,7 @@ int encode_registration_request(const registration_request_msg *registration_req
|
||||
== REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_PRESENT) {
|
||||
if ((encode_result = encode_nrue_security_capability(®istration_request->nruesecuritycapability,
|
||||
REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_IEI,
|
||||
buffer + encoded,
|
||||
len - encoded))
|
||||
buffer + encoded))
|
||||
< 0)
|
||||
// Return in case of error
|
||||
return encode_result;
|
||||
|
||||
@@ -235,11 +235,10 @@ static void nas_security_compute_mac(nr_ue_nas_t *nas,
|
||||
* @brief: Decrypt the payload of a NAS message. The buffer is modified in place
|
||||
* @param[in] nas The NAS context
|
||||
* @param[in] pdu_buffer The buffer containing the full (header + payload) NAS message
|
||||
* @param[in] is_uplink True if the message is uplink, false Downlink
|
||||
* @param[in] is3gpp_access True if the message is 3GPP access, false otherwise
|
||||
* @param[in] pdu_length The length of the NAS message
|
||||
*/
|
||||
static void nas_security_decrypt_payload(nr_ue_nas_t *nas, byte_array_t buffer, const bool is_uplink, const bool is3gpp_access)
|
||||
static void nas_security_decrypt_payload(nr_ue_nas_t *nas, byte_array_t buffer, const bool is3gpp_access)
|
||||
{
|
||||
Security_header_t sec_hdr;
|
||||
|
||||
@@ -393,7 +392,7 @@ static security_state_t nas_security_rx_process(nr_ue_nas_t *nas, byte_array_t b
|
||||
return NAS_SECURITY_INTEGRITY_FAILED;
|
||||
|
||||
/* decipher */
|
||||
nas_security_decrypt_payload(nas, buffer, false, true);
|
||||
nas_security_decrypt_payload(nas, buffer, true);
|
||||
|
||||
/* update estimated DL Counter */
|
||||
nas->security.nas_count_dl++;
|
||||
@@ -802,7 +801,7 @@ static FGSRegistrationType set_fgs_ksi(nr_ue_nas_t *nas)
|
||||
* @brief Set contents of 5GMM capability
|
||||
* @note Currently hardcoded, sending min length only (1 octet)
|
||||
*/
|
||||
static FGMMCapability set_fgmm_capability(nr_ue_nas_t *nas)
|
||||
static FGMMCapability set_fgmm_capability()
|
||||
{
|
||||
FGMMCapability cap = {0};
|
||||
cap.iei = REGISTRATION_REQUEST_5GMM_CAPABILITY_IEI;
|
||||
@@ -927,7 +926,7 @@ void generateRegistrationRequest(as_nas_info_t *initialNasMsg, nr_ue_nas_t *nas,
|
||||
if (full_rr->fgsregistrationtype != PERIODIC_REGISTRATION_UPDATING) {
|
||||
cleartext_only = false; // The UE needs to send non-cleartext IE
|
||||
full_rr->presencemask |= REGISTRATION_REQUEST_5GMM_CAPABILITY_PRESENT;
|
||||
full_rr->fgmmcapability = set_fgmm_capability(nas);
|
||||
full_rr->fgmmcapability = set_fgmm_capability();
|
||||
FGMMCapability *cap = &full_rr->fgmmcapability;
|
||||
size_nct += sizeof(cap->length) + sizeof(cap->iei) + cap->length;
|
||||
}
|
||||
@@ -1155,7 +1154,7 @@ static void generateAuthenticationResp(nr_ue_nas_t *nas, as_nas_info_t *initialN
|
||||
|
||||
/** @brief Send Authentication Failure message from the UE to the AMF to
|
||||
* indicate that authentication of the network has failed */
|
||||
static void generateAuthenticationFailure(nr_ue_nas_t *nas, as_nas_info_t *initialNasMsg, cause_id_t cause)
|
||||
static void generateAuthenticationFailure(as_nas_info_t *initialNasMsg, cause_id_t cause)
|
||||
{
|
||||
int size = sizeof(fgmm_msg_header_t);
|
||||
fgmm_nas_message_plain_t plain = {0};
|
||||
@@ -1199,7 +1198,7 @@ static void handle_fgmm_authentication_request(nr_ue_nas_t *nas, as_nas_info_t *
|
||||
/* If the ngKSI value received is already associated with one
|
||||
of the 5G security contexts stored in the UE, send failure message */
|
||||
LOG_E(NAS, "Invalid NAS Key Set Identifier: send Authentication Failure\n");
|
||||
generateAuthenticationFailure(nas, initialNasMsg, ngKSI_already_in_use);
|
||||
generateAuthenticationFailure(initialNasMsg, ngKSI_already_in_use);
|
||||
return;
|
||||
}
|
||||
generateAuthenticationResp(nas, initialNasMsg, buffer->buf);
|
||||
@@ -1211,7 +1210,7 @@ static void handle_fgmm_authentication_request(nr_ue_nas_t *nas, as_nas_info_t *
|
||||
* @todo The UE shall performs actions as per 5.4.1.3.5 of 3GPP TS 24.501, including
|
||||
* (1) Abort any ongoing 5GMM procedure (2) Stop all active timers: T3510, T3516, T3517,
|
||||
* T3519, T3520, T3521 (3) Delete stored SUCI. (4) handle EAP-failure message. */
|
||||
static void handle_authentication_reject(nr_ue_nas_t *nas, as_nas_info_t *initialNasMsg, uint8_t *pdu, int pdu_length)
|
||||
static void handle_authentication_reject(nr_ue_nas_t *nas, uint8_t *pdu, int pdu_length)
|
||||
{
|
||||
LOG_E(NAS, "Received Authentication Reject message from the network\n");
|
||||
uint8_t eap_msg[MAX_EAP_CONTENTS_LEN] = {0};
|
||||
@@ -1707,7 +1706,7 @@ void handleDownlinkNASTransport(const nr_ue_nas_t *nas, uint8_t * pdu_buffer, in
|
||||
}
|
||||
}
|
||||
|
||||
static void generateDeregistrationRequest(nr_ue_nas_t *nas, as_nas_info_t *initialNasMsg, const nas_deregistration_req_t *req)
|
||||
static void generateDeregistrationRequest(nr_ue_nas_t *nas, as_nas_info_t *initialNasMsg)
|
||||
{
|
||||
fgmm_nas_msg_security_protected_t sp_msg = {0};
|
||||
fgs_nas_message_security_header_t *sp_header = &sp_msg.header;
|
||||
@@ -1935,6 +1934,7 @@ static int get_user_nssai_idx(nssai_t ch_nssai, const nr_nas_msg_snssai_t allowe
|
||||
|
||||
void *nas_nrue_task(void *args_p)
|
||||
{
|
||||
UNUSED(args_p);
|
||||
while (1) {
|
||||
nas_nrue(NULL);
|
||||
}
|
||||
@@ -2075,6 +2075,7 @@ static void handle_service_reject(nr_ue_nas_t *nas, const byte_array_t *buffer)
|
||||
|
||||
void *nas_nrue(void *args_p)
|
||||
{
|
||||
UNUSED(args_p);
|
||||
// Wait for a message or an event
|
||||
MessageDef *msg_p;
|
||||
itti_receive_msg(TASK_NAS_NRUE, &msg_p);
|
||||
@@ -2205,7 +2206,7 @@ void *nas_nrue(void *args_p)
|
||||
send_nas_detach_req(nas, true);
|
||||
}
|
||||
as_nas_info_t initialNasMsg = {0};
|
||||
generateDeregistrationRequest(nas, &initialNasMsg, req);
|
||||
generateDeregistrationRequest(nas, &initialNasMsg);
|
||||
send_nas_uplink_data_req(nas, &initialNasMsg);
|
||||
} else {
|
||||
LOG_W(NAS, "No GUTI, cannot trigger deregistration request.\n");
|
||||
@@ -2241,7 +2242,7 @@ void *nas_nrue(void *args_p)
|
||||
handle_fgmm_authentication_request(nas, &initialNasMsg, &buffer);
|
||||
break;
|
||||
case FGS_AUTHENTICATION_REJECT:
|
||||
handle_authentication_reject(nas, &initialNasMsg, pdu_buffer, pdu_length);
|
||||
handle_authentication_reject(nas, pdu_buffer, pdu_length);
|
||||
break;
|
||||
case FGS_SECURITY_MODE_COMMAND:
|
||||
handle_security_mode_command(nas, &initialNasMsg, pdu_buffer, pdu_length);
|
||||
|
||||
@@ -455,6 +455,8 @@ int usim_api_authenticate(usim_data_t *usim_data, const OctetString* rand_pP, co
|
||||
static int _usim_api_check_sqn(uint32_t seq, uint8_t ind)
|
||||
{
|
||||
/* TODO */
|
||||
UNUSED(seq);
|
||||
UNUSED(ind);
|
||||
return (RETURNok);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ void nrppa_gNB_init(void)
|
||||
|
||||
void *nrppa_gNB_process_itti_msg(void *notUsed)
|
||||
{
|
||||
UNUSED(notUsed);
|
||||
MessageDef *received_msg = NULL;
|
||||
int result;
|
||||
itti_receive_msg(TASK_NRPPA, &received_msg);
|
||||
@@ -65,6 +66,7 @@ void *nrppa_gNB_process_itti_msg(void *notUsed)
|
||||
|
||||
void *nrppa_gNB_task(void *arg)
|
||||
{
|
||||
UNUSED(arg);
|
||||
nrppa_gNB_init();
|
||||
|
||||
while (1) {
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
static int config_check_dnn(configmodule_interface_t *cfg, paramdef_t *param)
|
||||
{
|
||||
UNUSED(cfg);
|
||||
const char *dnn = *param->strptr;
|
||||
int dnn_len = strlen(dnn);
|
||||
if (dnn_len > 102) {
|
||||
|
||||
@@ -908,6 +908,9 @@ int gtpv1u_create_x2u_tunnel(const instance_t instanceP,
|
||||
const gtpv1u_enb_create_x2u_tunnel_req_t *const create_tunnel_req_pP,
|
||||
gtpv1u_enb_create_x2u_tunnel_resp_t *const create_tunnel_resp_pP)
|
||||
{
|
||||
UNUSED(instanceP);
|
||||
UNUSED(create_tunnel_req_pP);
|
||||
UNUSED(create_tunnel_resp_pP);
|
||||
AssertFatal(false, "to be developped\n");
|
||||
}
|
||||
|
||||
@@ -1002,6 +1005,8 @@ int gtpv1u_delete_all_s1u_tunnel(const instance_t instance, const rnti_t rnti)
|
||||
|
||||
int gtpv1u_delete_x2u_tunnel(const instance_t instanceP, const gtpv1u_enb_delete_tunnel_req_t *const req_pP)
|
||||
{
|
||||
UNUSED(instanceP);
|
||||
UNUSED(req_pP);
|
||||
LOG_E(GTPU, "x2 tunnel not implemented\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -1013,7 +1018,7 @@ static gtpv1u_bearer_t create_bearer(int socket, const struct sockaddr_in *addr,
|
||||
return bearer;
|
||||
}
|
||||
|
||||
static int Gtpv1uHandleEchoReq(int h, uint8_t *msgBuf, uint32_t msgBufLen, const struct sockaddr_in *addr)
|
||||
static int Gtpv1uHandleEchoReq(int h, uint8_t *msgBuf, const struct sockaddr_in *addr)
|
||||
{
|
||||
Gtpv1uMsgHeaderT *msgHdr = (Gtpv1uMsgHeaderT *)msgBuf;
|
||||
|
||||
@@ -1041,7 +1046,7 @@ static int Gtpv1uHandleEchoReq(int h, uint8_t *msgBuf, uint32_t msgBufLen, const
|
||||
0);
|
||||
}
|
||||
|
||||
static int Gtpv1uHandleError(int h, uint8_t *msgBuf, uint32_t msgBufLen, const struct sockaddr_in *addr)
|
||||
static int Gtpv1uHandleError(uint8_t *msgBuf, uint32_t msgBufLen)
|
||||
{
|
||||
if (msgBufLen < sizeof(Gtpv1uError))
|
||||
LOG_E(GTPU, "Received GTP error indication with truncated size %u (mini size: %lu)\n", msgBufLen,sizeof(Gtpv1uError)+4);
|
||||
@@ -1063,7 +1068,7 @@ static int Gtpv1uHandleError(int h, uint8_t *msgBuf, uint32_t msgBufLen, const s
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int Gtpv1uHandleSupportedExt(int h, uint8_t *msgBuf, uint32_t msgBufLen, const sockaddr_in *addr)
|
||||
static int Gtpv1uHandleSupportedExt()
|
||||
{
|
||||
LOG_E(GTPU, "Supported extensions to be dev\n");
|
||||
int rc = GTPNOK;
|
||||
@@ -1073,7 +1078,7 @@ static int Gtpv1uHandleSupportedExt(int h, uint8_t *msgBuf, uint32_t msgBufLen,
|
||||
// When end marker arrives, we notify the client with buffer size = 0
|
||||
// The client will likely call "delete tunnel"
|
||||
// nevertheless we don't take the initiative
|
||||
static int Gtpv1uHandleEndMarker(int h, uint8_t *msgBuf, uint32_t msgBufLen, const sockaddr_in *addr)
|
||||
static int Gtpv1uHandleEndMarker(int h, uint8_t *msgBuf)
|
||||
{
|
||||
Gtpv1uMsgHeaderT *msgHdr = (Gtpv1uMsgHeaderT *)msgBuf;
|
||||
|
||||
@@ -1302,19 +1307,19 @@ static bool gtpv1uReceiveHandleMessage(int h)
|
||||
break;
|
||||
|
||||
case GTP_ECHO_REQ:
|
||||
Gtpv1uHandleEchoReq(h, udpData, udpDataLen, &addr);
|
||||
Gtpv1uHandleEchoReq(h, udpData, &addr);
|
||||
break;
|
||||
|
||||
case GTP_ERROR_INDICATION:
|
||||
Gtpv1uHandleError(h, udpData, udpDataLen, &addr);
|
||||
Gtpv1uHandleError(udpData, udpDataLen);
|
||||
break;
|
||||
|
||||
case GTP_SUPPORTED_EXTENSION_HEADER_INDICATION:
|
||||
Gtpv1uHandleSupportedExt(h, udpData, udpDataLen, &addr);
|
||||
Gtpv1uHandleSupportedExt();
|
||||
break;
|
||||
|
||||
case GTP_END_MARKER:
|
||||
Gtpv1uHandleEndMarker(h, udpData, udpDataLen, &addr);
|
||||
Gtpv1uHandleEndMarker(h, udpData);
|
||||
break;
|
||||
|
||||
case GTP_GPDU:
|
||||
@@ -1351,6 +1356,7 @@ static void gtpv1uReceiverCancel(pthread_t t)
|
||||
|
||||
void *gtpv1uTask(void *args)
|
||||
{
|
||||
UNUSED(args);
|
||||
while (1) {
|
||||
/* Trying to fetch a message from the message queue.
|
||||
If the queue is empty, this function will block till a
|
||||
|
||||
Reference in New Issue
Block a user