Fix trailing whitespace (#1402)

This commit is contained in:
Pau Espin 2022-03-01 09:13:40 +01:00 committed by GitHub
parent bc69ddfc6d
commit d06acc7f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 70 additions and 70 deletions

View File

@ -53,12 +53,12 @@ void ogs_socket_final(void)
ogs_sock_t *ogs_sock_create(void)
{
ogs_sock_t *sock = NULL;
sock = ogs_calloc(1, sizeof(*sock));
ogs_expect_or_return_val(sock, NULL);
sock->fd = INVALID_SOCKET;
return sock;
}
@ -131,7 +131,7 @@ int ogs_sock_connect(ogs_sock_t *sock, ogs_sockaddr_t *addr)
ogs_assert(addrlen);
if (connect(sock->fd, &addr->sa, addrlen) != 0) {
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
"socket connect[%s]:%d failed",
OGS_ADDR(addr, buf), OGS_PORT(addr));
return OGS_ERROR;

View File

@ -589,7 +589,7 @@ void ogs_gtp_node_remove(ogs_list_t *list, ogs_gtp_node_t *node)
void ogs_gtp_node_remove_all(ogs_list_t *list)
{
ogs_gtp_node_t *node = NULL, *next_node = NULL;
ogs_list_for_each_safe(list, next_node, node)
ogs_gtp_node_remove(list, node);
}

View File

@ -48,9 +48,9 @@ void ogs_pfcp_context_init(void)
/*
* PFCP entity uses NTP timestamp(1900), but Open5GS uses UNIX(1970).
*
* One is the offset between the two epochs.
* One is the offset between the two epochs.
* Unix uses an epoch located at 1/1/1970-00:00h (UTC) and
* NTP uses 1/1/1900-00:00h. This leads to an offset equivalent
* NTP uses 1/1/1900-00:00h. This leads to an offset equivalent
* to 70 years in seconds (there are 17 leap years
* between the two dates so the offset is
*
@ -611,7 +611,7 @@ int ogs_pfcp_context_parse_config(const char *local, const char *remote)
node->num_of_dnn = num_of_dnn;
if (num_of_dnn != 0)
memcpy(node->dnn, dnn, sizeof(node->dnn));
node->num_of_e_cell_id = num_of_e_cell_id;
if (num_of_e_cell_id != 0)
memcpy(node->e_cell_id, e_cell_id,
@ -718,7 +718,7 @@ void ogs_pfcp_node_remove_all(ogs_list_t *list)
ogs_pfcp_node_t *node = NULL, *next_node = NULL;
ogs_assert(list);
ogs_list_for_each_safe(list, next_node, node)
ogs_pfcp_node_remove(list, node);
}

View File

@ -184,7 +184,7 @@ int ogs_sbi_context_parse_config(const char *local, const char *remote)
family != AF_INET && family != AF_INET6) {
ogs_warn("Ignore family(%d) : "
"AF_UNSPEC(%d), "
"AF_INET(%d), AF_INET6(%d) ",
"AF_INET(%d), AF_INET6(%d) ",
family, AF_UNSPEC, AF_INET, AF_INET6);
family = AF_UNSPEC;
}
@ -205,7 +205,7 @@ int ogs_sbi_context_parse_config(const char *local, const char *remote)
}
ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME);
hostname[num++] =
hostname[num++] =
ogs_yaml_iter_value(&hostname_iter);
} while (
ogs_yaml_iter_type(&hostname_iter) ==
@ -393,7 +393,7 @@ int ogs_sbi_context_parse_config(const char *local, const char *remote)
family != AF_INET && family != AF_INET6) {
ogs_warn("Ignore family(%d) : "
"AF_UNSPEC(%d), "
"AF_INET(%d), AF_INET6(%d) ",
"AF_INET(%d), AF_INET6(%d) ",
family, AF_UNSPEC, AF_INET, AF_INET6);
family = AF_UNSPEC;
}
@ -413,7 +413,7 @@ int ogs_sbi_context_parse_config(const char *local, const char *remote)
}
ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME);
hostname[num++] =
hostname[num++] =
ogs_yaml_iter_value(&hostname_iter);
} while (
ogs_yaml_iter_type(&hostname_iter) ==
@ -675,7 +675,7 @@ void ogs_sbi_nf_service_add_version(ogs_sbi_nf_service_t *nf_service,
ogs_strdup(expiry);
ogs_assert(
nf_service->versions[nf_service->num_of_version].expiry);
}
nf_service->num_of_version++;
}

View File

@ -697,22 +697,22 @@ int amf_context_parse_config(void)
v = ogs_yaml_iter_value(&integrity_order_iter);
if (v) {
int integrity_index =
int integrity_index =
self.num_of_integrity_order;
if (strcmp(v, "NIA0") == 0) {
self.integrity_order[integrity_index] =
self.integrity_order[integrity_index] =
OGS_NAS_SECURITY_ALGORITHMS_NIA0;
self.num_of_integrity_order++;
} else if (strcmp(v, "NIA1") == 0) {
self.integrity_order[integrity_index] =
self.integrity_order[integrity_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_NIA1;
self.num_of_integrity_order++;
} else if (strcmp(v, "NIA2") == 0) {
self.integrity_order[integrity_index] =
self.integrity_order[integrity_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_NIA2;
self.num_of_integrity_order++;
} else if (strcmp(v, "NIA3") == 0) {
self.integrity_order[integrity_index] =
self.integrity_order[integrity_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_NIA3;
self.num_of_integrity_order++;
}
@ -739,22 +739,22 @@ int amf_context_parse_config(void)
v = ogs_yaml_iter_value(&ciphering_order_iter);
if (v) {
int ciphering_index =
int ciphering_index =
self.num_of_ciphering_order;
if (strcmp(v, "NEA0") == 0) {
self.ciphering_order[ciphering_index] =
self.ciphering_order[ciphering_index] =
OGS_NAS_SECURITY_ALGORITHMS_NEA0;
self.num_of_ciphering_order++;
} else if (strcmp(v, "NEA1") == 0) {
self.ciphering_order[ciphering_index] =
self.ciphering_order[ciphering_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_NEA1;
self.num_of_ciphering_order++;
} else if (strcmp(v, "NEA2") == 0) {
self.ciphering_order[ciphering_index] =
self.ciphering_order[ciphering_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_NEA2;
self.num_of_ciphering_order++;
} else if (strcmp(v, "NEA3") == 0) {
self.ciphering_order[ciphering_index] =
self.ciphering_order[ciphering_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_NEA3;
self.num_of_ciphering_order++;
}
@ -772,7 +772,7 @@ int amf_context_parse_config(void)
const char *network_name_key =
ogs_yaml_iter_key(&network_name_iter);
ogs_assert(network_name_key);
if (!strcmp(network_name_key, "full")) {
if (!strcmp(network_name_key, "full")) {
ogs_nas_network_name_t *network_full_name =
&self.full_name;
const char *c_network_name =
@ -968,7 +968,7 @@ ran_ue_t *ran_ue_add(amf_gnb_t *gnb, uint32_t ran_ue_ngap_id)
* SCTP output stream identification
* Default ogs_app()->parameter.sctp_streams : 30
* 0 : Non UE signalling
* 1-29 : UE specific association
* 1-29 : UE specific association
*/
ran_ue->gnb_ostream_id =
OGS_NEXT_ID(gnb->ostream_id, 1, gnb->max_num_of_ostreams-1);
@ -1021,7 +1021,7 @@ ran_ue_t *ran_ue_find_by_ran_ue_ngap_id(
amf_gnb_t *gnb, uint32_t ran_ue_ngap_id)
{
ran_ue_t *ran_ue = NULL;
ogs_list_for_each(&gnb->ran_ue_list, ran_ue) {
if (ran_ue_ngap_id == ran_ue->ran_ue_ngap_id)
break;

View File

@ -269,7 +269,7 @@ int mme_context_parse_config()
const char *mme_key = ogs_yaml_iter_key(&mme_iter);
ogs_assert(mme_key);
if (!strcmp(mme_key, "freeDiameter")) {
yaml_node_t *node =
yaml_node_t *node =
yaml_document_get_node(document, mme_iter.pair->value);
ogs_assert(node);
if (node->type == YAML_SCALAR_NODE) {
@ -282,10 +282,10 @@ int mme_context_parse_config()
const char *fd_key = ogs_yaml_iter_key(&fd_iter);
ogs_assert(fd_key);
if (!strcmp(fd_key, "identity")) {
self.diam_config->cnf_diamid =
self.diam_config->cnf_diamid =
ogs_yaml_iter_value(&fd_iter);
} else if (!strcmp(fd_key, "realm")) {
self.diam_config->cnf_diamrlm =
self.diam_config->cnf_diamrlm =
ogs_yaml_iter_value(&fd_iter);
} else if (!strcmp(fd_key, "port")) {
const char *v = ogs_yaml_iter_value(&fd_iter);
@ -294,7 +294,7 @@ int mme_context_parse_config()
const char *v = ogs_yaml_iter_value(&fd_iter);
if (v) self.diam_config->cnf_port_tls = atoi(v);
} else if (!strcmp(fd_key, "listen_on")) {
self.diam_config->cnf_addr =
self.diam_config->cnf_addr =
ogs_yaml_iter_value(&fd_iter);
} else if (!strcmp(fd_key, "no_fwd")) {
self.diam_config->cnf_flags.no_fwd =
@ -449,7 +449,7 @@ int mme_context_parse_config()
family != AF_INET && family != AF_INET6) {
ogs_warn("Ignore family(%d) : "
"AF_UNSPEC(%d), "
"AF_INET(%d), AF_INET6(%d) ",
"AF_INET(%d), AF_INET6(%d) ",
family, AF_UNSPEC, AF_INET, AF_INET6);
family = AF_UNSPEC;
}
@ -469,7 +469,7 @@ int mme_context_parse_config()
}
ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME);
hostname[num++] =
hostname[num++] =
ogs_yaml_iter_value(&hostname_iter);
} while (
ogs_yaml_iter_type(&hostname_iter) ==
@ -837,22 +837,22 @@ int mme_context_parse_config()
v = ogs_yaml_iter_value(&integrity_order_iter);
if (v) {
int integrity_index =
int integrity_index =
self.num_of_integrity_order;
if (strcmp(v, "EIA0") == 0) {
self.integrity_order[integrity_index] =
self.integrity_order[integrity_index] =
OGS_NAS_SECURITY_ALGORITHMS_EIA0;
self.num_of_integrity_order++;
} else if (strcmp(v, "EIA1") == 0) {
self.integrity_order[integrity_index] =
self.integrity_order[integrity_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_EIA1;
self.num_of_integrity_order++;
} else if (strcmp(v, "EIA2") == 0) {
self.integrity_order[integrity_index] =
self.integrity_order[integrity_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_EIA2;
self.num_of_integrity_order++;
} else if (strcmp(v, "EIA3") == 0) {
self.integrity_order[integrity_index] =
self.integrity_order[integrity_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_EIA3;
self.num_of_integrity_order++;
}
@ -879,22 +879,22 @@ int mme_context_parse_config()
v = ogs_yaml_iter_value(&ciphering_order_iter);
if (v) {
int ciphering_index =
int ciphering_index =
self.num_of_ciphering_order;
if (strcmp(v, "EEA0") == 0) {
self.ciphering_order[ciphering_index] =
self.ciphering_order[ciphering_index] =
OGS_NAS_SECURITY_ALGORITHMS_EEA0;
self.num_of_ciphering_order++;
} else if (strcmp(v, "EEA1") == 0) {
self.ciphering_order[ciphering_index] =
self.ciphering_order[ciphering_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_EEA1;
self.num_of_ciphering_order++;
} else if (strcmp(v, "EEA2") == 0) {
self.ciphering_order[ciphering_index] =
self.ciphering_order[ciphering_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_EEA2;
self.num_of_ciphering_order++;
} else if (strcmp(v, "EEA3") == 0) {
self.ciphering_order[ciphering_index] =
self.ciphering_order[ciphering_index] =
OGS_NAS_SECURITY_ALGORITHMS_128_EEA3;
self.num_of_ciphering_order++;
}
@ -912,7 +912,7 @@ int mme_context_parse_config()
const char *network_name_key =
ogs_yaml_iter_key(&network_name_iter);
ogs_assert(network_name_key);
if (!strcmp(network_name_key, "full")) {
if (!strcmp(network_name_key, "full")) {
ogs_nas_network_name_t *network_full_name =
&self.full_name;
const char *c_network_name =
@ -992,7 +992,7 @@ int mme_context_parse_config()
family != AF_INET && family != AF_INET6) {
ogs_warn("Ignore family(%d) : "
"AF_UNSPEC(%d), "
"AF_INET(%d), AF_INET6(%d) ",
"AF_INET(%d), AF_INET6(%d) ",
family, AF_UNSPEC, AF_INET, AF_INET6);
family = AF_UNSPEC;
}
@ -1044,7 +1044,7 @@ int mme_context_parse_config()
ogs_yaml_iter_t tai_iter;
ogs_yaml_iter_recurse(&map_iter,
&tai_iter);
while (ogs_yaml_iter_next(&tai_iter)) {
const char *tai_key =
ogs_yaml_iter_key(&tai_iter);
@ -1064,7 +1064,7 @@ int mme_context_parse_config()
if (!strcmp(plmn_id_key,
"mcc")) {
map[map_num].tai_mcc =
map[map_num].tai_mcc =
ogs_yaml_iter_value(
&plmn_id_iter);
} else if (!strcmp(
@ -1299,7 +1299,7 @@ int mme_context_parse_config()
family != AF_INET && family != AF_INET6) {
ogs_warn("Ignore family(%d) : "
"AF_UNSPEC(%d), "
"AF_INET(%d), AF_INET6(%d) ",
"AF_INET(%d), AF_INET6(%d) ",
family, AF_UNSPEC, AF_INET, AF_INET6);
family = AF_UNSPEC;
}
@ -1319,7 +1319,7 @@ int mme_context_parse_config()
}
ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME);
hostname[num++] =
hostname[num++] =
ogs_yaml_iter_value(&hostname_iter);
} while (
ogs_yaml_iter_type(&hostname_iter) ==
@ -1457,7 +1457,7 @@ int mme_context_parse_config()
family != AF_INET && family != AF_INET6) {
ogs_warn("Ignore family(%d) : "
"AF_UNSPEC(%d), "
"AF_INET(%d), AF_INET6(%d) ",
"AF_INET(%d), AF_INET6(%d) ",
family, AF_UNSPEC, AF_INET, AF_INET6);
family = AF_UNSPEC;
}
@ -1477,7 +1477,7 @@ int mme_context_parse_config()
}
ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME);
hostname[num++] =
hostname[num++] =
ogs_yaml_iter_value(&hostname_iter);
} while (
ogs_yaml_iter_type(&hostname_iter) ==
@ -1915,9 +1915,9 @@ enb_ue_t *enb_ue_add(mme_enb_t *enb, uint32_t enb_ue_s1ap_id)
* SCTP output stream identification
* Default ogs_app()->parameter.sctp_streams : 30
* 0 : Non UE signalling
* 1-29 : UE specific association
* 1-29 : UE specific association
*/
enb_ue->enb_ostream_id =
enb_ue->enb_ostream_id =
OGS_NEXT_ID(enb->ostream_id, 1, enb->max_num_of_ostreams-1);
enb_ue->t_s1_holding = ogs_timer_add(
@ -1971,7 +1971,7 @@ enb_ue_t *enb_ue_find_by_enb_ue_s1ap_id(
mme_enb_t *enb, uint32_t enb_ue_s1ap_id)
{
enb_ue_t *enb_ue = NULL;
ogs_list_for_each(&enb->enb_ue_list, enb_ue) {
if (enb_ue_s1ap_id == enb_ue->enb_ue_s1ap_id)
break;
@ -2655,7 +2655,7 @@ void mme_sess_remove(mme_sess_t *sess)
ogs_assert(sess);
mme_ue = sess->mme_ue;
ogs_assert(mme_ue);
ogs_list_remove(&mme_ue->sess_list, sess);
mme_bearer_remove_all(sess);
@ -2671,7 +2671,7 @@ void mme_sess_remove(mme_sess_t *sess)
void mme_sess_remove_all(mme_ue_t *mme_ue)
{
mme_sess_t *sess = NULL, *next_sess = NULL;
sess = mme_sess_first(mme_ue);
while (sess) {
next_sess = mme_sess_next(sess);
@ -2796,7 +2796,7 @@ mme_bearer_t *mme_bearer_add(mme_sess_t *sess)
bearer->t3489.timer = ogs_timer_add(
ogs_app()->timer_mgr, mme_timer_t3489_expire, bearer);
bearer->t3489.pkbuf = NULL;
memset(&e, 0, sizeof(e));
e.bearer = bearer;
ogs_fsm_create(&bearer->sm, esm_state_initial, esm_state_final);
@ -2827,7 +2827,7 @@ void mme_bearer_remove(mme_bearer_t *bearer)
ogs_assert(bearer->ebi_node);
ogs_pool_free(&bearer->mme_ue->ebi_pool, bearer->ebi_node);
ogs_pool_free(&mme_bearer_pool, bearer);
}
@ -2836,7 +2836,7 @@ void mme_bearer_remove_all(mme_sess_t *sess)
mme_bearer_t *bearer = NULL, *next_bearer = NULL;
ogs_assert(sess);
bearer = mme_bearer_first(sess);
while (bearer) {
next_bearer = mme_bearer_next(bearer);
@ -2868,7 +2868,7 @@ mme_bearer_t *mme_bearer_find_by_ue_ebi(mme_ue_t *mme_ue, uint8_t ebi)
{
mme_sess_t *sess = NULL;
mme_bearer_t *bearer = NULL;
ogs_assert(mme_ue);
sess = mme_sess_first(mme_ue);
@ -2926,7 +2926,7 @@ mme_bearer_t *mme_bearer_find_or_add_by_message(
}
if (message->esm.h.message_type == OGS_NAS_EPS_PDN_DISCONNECT_REQUEST) {
ogs_nas_eps_pdn_disconnect_request_t *pdn_disconnect_request =
ogs_nas_eps_pdn_disconnect_request_t *pdn_disconnect_request =
&message->esm.pdn_disconnect_request;
ogs_nas_linked_eps_bearer_identity_t *linked_eps_bearer_identity =
&pdn_disconnect_request->linked_eps_bearer_identity;
@ -2934,7 +2934,7 @@ mme_bearer_t *mme_bearer_find_or_add_by_message(
bearer = mme_bearer_find_by_ue_ebi(mme_ue,
linked_eps_bearer_identity->eps_bearer_identity);
if (!bearer) {
ogs_error("No Bearer : Linked-EBI[%d]",
ogs_error("No Bearer : Linked-EBI[%d]",
linked_eps_bearer_identity->eps_bearer_identity);
ogs_assert(OGS_OK ==
nas_eps_send_attach_reject(mme_ue,
@ -2953,7 +2953,7 @@ mme_bearer_t *mme_bearer_find_or_add_by_message(
bearer = mme_bearer_find_by_ue_ebi(mme_ue,
linked_eps_bearer_identity->eps_bearer_identity);
if (!bearer) {
ogs_error("No Bearer : Linked-EBI[%d]",
ogs_error("No Bearer : Linked-EBI[%d]",
linked_eps_bearer_identity->eps_bearer_identity);
ogs_assert(OGS_OK ==
nas_eps_send_bearer_resource_allocation_reject(
@ -3077,7 +3077,7 @@ ogs_session_t *mme_session_find_by_apn(mme_ue_t *mme_ue, char *apn)
{
ogs_session_t *session = NULL;
int i = 0;
ogs_assert(mme_ue);
ogs_assert(apn);
@ -3095,7 +3095,7 @@ ogs_session_t *mme_default_session(mme_ue_t *mme_ue)
{
ogs_session_t *session = NULL;
int i = 0;
ogs_assert(mme_ue);
for (i = 0; i < mme_ue->num_of_session; i++) {
@ -3125,7 +3125,7 @@ int mme_find_served_tai(ogs_eps_tai_t *tai)
for (k = 0; k < list0->tai[j].num; k++) {
if (memcmp(&list0->tai[j].plmn_id,
&tai->plmn_id, OGS_PLMN_ID_LEN) == 0 &&
&tai->plmn_id, OGS_PLMN_ID_LEN) == 0 &&
list0->tai[j].tac[k] == tai->tac) {
return i;
}
@ -3139,7 +3139,7 @@ int mme_find_served_tai(ogs_eps_tai_t *tai)
for (j = 0; j < list2->num; j++) {
if (memcmp(&list2->tai[j].plmn_id,
&tai->plmn_id, OGS_PLMN_ID_LEN) == 0 &&
&tai->plmn_id, OGS_PLMN_ID_LEN) == 0 &&
list2->tai[j].tac == tai->tac) {
return i;
}
@ -3245,7 +3245,7 @@ uint8_t mme_selected_int_algorithm(mme_ue_t *mme_ue)
ogs_assert(mme_ue);
for (i = 0; i < mme_self()->num_of_integrity_order; i++) {
if (mme_ue->ue_network_capability.eia &
if (mme_ue->ue_network_capability.eia &
(0x80 >> mme_self()->integrity_order[i])) {
return mme_self()->integrity_order[i];
}
@ -3261,7 +3261,7 @@ uint8_t mme_selected_enc_algorithm(mme_ue_t *mme_ue)
ogs_assert(mme_ue);
for (i = 0; i < mme_self()->num_of_ciphering_order; i++) {
if (mme_ue->ue_network_capability.eea &
if (mme_ue->ue_network_capability.eea &
(0x80 >> mme_self()->ciphering_order[i])) {
return mme_self()->ciphering_order[i];
}

View File

@ -100,7 +100,7 @@ static int test_context_validation(void)
if (snode) test_self()->ngap_addr6 = snode->addr;
if (test_self()->e_served_tai[0].list2.num) {
memcpy(&test_self()->e_tai,
memcpy(&test_self()->e_tai,
&test_self()->e_served_tai[0].list2.tai[0], sizeof(ogs_5gs_tai_t));
} else if (test_self()->e_served_tai[0].list0.tai[0].num) {
test_self()->e_tai.tac =
@ -111,7 +111,7 @@ static int test_context_validation(void)
}
if (test_self()->nr_served_tai[0].list2.num) {
memcpy(&test_self()->nr_tai,
memcpy(&test_self()->nr_tai,
&test_self()->nr_served_tai[0].list2.tai[0], sizeof(ogs_5gs_tai_t));
} else if (test_self()->nr_served_tai[0].list0.tai[0].num) {
test_self()->nr_tai.tac =