Commit e7e95ce3 authored by gauthier's avatar gauthier

reverting last 2 commits, do it later

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7696 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent a458ab17
Branches unavailable
2024.w06 2024.w05 2024.w04 2024.w03 2024.w02 2024.w01 2023.w51 2023.w50 2023.w49 2023.w48 2023.w47 2023.w45 2023.w43 2023.w42 2023.w41 2023.w40 2023.w39 2023.w38 2023.w37 2023.w36 2023.w34 2023.w33 2023.w32 2023.w31 2023.w30 2023.w29 2023.w28 2023.w27 2023.w26 2023.w25 2023.w24 2023.w23 2023.w22 2023.w21 2023.w20 2023.w19 2023.w18 2023.w18b 2023.w16 2023.w15 2023.w14 2023.w13 2023.w12 2023.w11 2023.w11b 2023.w10 2023.w10b 2023.w09 2023.w08 2023.w08b 2023.w07 2023.w06 2023.w05 2023.w03 2023.w02 2022.42 2022.41 2022.w51 2022.w50 2022.w49 2022.w48 2022.w47 2022.w46 2022.w45 2022.w43 2022.w42 2022.w42b 2022.w41 2022.w40 2022.w39 2022.w38 2022.w37 2022.w37b 2022.w36 2022.w35 2022.w33 2022.w32 2022.w31 2022.w31b 2022.w30 2022.w29 2022.w26 2022.w25 2022.w24 2022.w24b 2022.w23 2022.w22 2022.w21 2022.w20 2022.w19 2022.w18 2022.w17 2022.w15 2022.w15b 2022.w14a 2022.w13 2022.w13b 2022.w13a 2022.w12 2022.w10 2022.w09 2022.w09b 2022.w08 2022.w08b 2022.w07 2022.w07b 2022.w06 2022.w06a 2022.w05 2022.w05b 2022.w03_hotfix 2022.w03_b 2022.w02 2022.w01 2021.wk46 2021.wk14_a 2021.wk13_d 2021.wk13_c 2021.w51_c 2021.w51_a 2021.w50_a 2021.w49_b 2021.w49_a 2021.w48 2021.w47 2021.w46 2021.w46-powder 2021.w45 2021.w45_b 2021.w44 2021.w43 2021.w42 2021.w37 2021.w36 2021.w35 2021.w34 2021.w33 2021.w32 2021.w31 2021.w30 2021.w29 2021.w28 2021.w27 2021.w26 2021.w25 2021.w24 2021.w23 2021.w22 2021.w20 2021.w19 2021.w18_b 2021.w18_a 2021.w17_b 2021.w16 2021.w15 2021.w14 2021.w13_a 2021.w12 2021.w11 2021.w10 2021.w09 2021.w08 2021.w06 2021.w05 2021.w04 2021.w02 2020.w51_2 2020.w51 2020.w50 2020.w49 2020.w48_2 2020.w48 2020.w47 2020.w46_2 2020.w46 2020.w45_2 2020.w45 2020.w44 2020.w42_2 2020.w42 2020.w41 2020.w39 2020.w38 2020.w37 2020.w36 2020.w34 2020.w33 2020.w31 2020.w30 2020.w29 2020.w28 2020.w26 2020.w25 2020.w24 2020.w23 2020.w22 2020.w19 2020.w17 2020.w16 2020.w15 2020.w11 2020.w09 2020.w06 2020.w05 2020.w04 2020.w03 2019.w51 2019.w44 2019.w41 2019.w36 2019.w30 2019.w28 2019.w27 2019.w25 2019.w23 2019.w21 2019.w17 2019.w15 2019.w13 2019.w11 2019.w10 2019.w09 2019.w08 2019.w07 2019.w06 2019.w04 2019.w03 2018.w51 2018.w48 2018.w47 2018.w46 2018.w44 2018.w41 2018.w40 2018.w39 2018.w36 2018.w33 2018.w31 2018.w29 2018.w25 2018.w19 2018.w15 2018.w12 2018.w11 2018.w10 2018.w09 2018.w08 2018.w07 2018.w06 2018.w05 2018.w04 2018.w03 2018.w02 2017.w48 2017.w46 2017.w43 2017.w42 2017.w34 2017.w30 2017.w25 2017.w24 2017.w22 2017.w20 2017.w19 2017.w15 2017.w14 2017.w13 2017.w12 2017.w11 2017.w10 2017.w09 2017.w08 2017.w07 2017.w06 2017.w05 2017.w04 2017.w03 2017.w02 2017.w01 2016.w50 2016.w49 v2.1.0 v2.0.0 v1.2.2 v1.2.1 v1.2.0 v1.1.1 v1.1.0 v1.0.3 v1.0.2 v1.0.1 v1.0.0 v1B0.8 v1B0.7 v1B0.6 v1B0.5 v1B0.4 v1B0.3 v1B0.2 v1B0.1 v0.6.1 v0.6.1_tdd v0.6 v0.5.2 v0.5.1_tdd v0.5 v0.4 v0.3 v0.2 v0.1 testing-cmw500 setparam osa-etsi-ws-ue osa-etsi-ws-try2 osa-etsi-ws-try1 osa-etsi-ws-gNB oai_nr_sync nr-ip-over-lte nr-ip-over-lte-v.1.5 nr-ip-over-lte-v.1.4 nr-ip-over-lte-v.1.3 nr-ip-over-lte-v.1.2 nr-ip-over-lte-v.1.1 nr-ip-over-lte-v.1.0 flexran-eol develop-nr-pdcch develop-nr-2020w03 develop-nr-2020w02 develop-nr-2019w51 develop-nr-2019w50 develop-nr-2019w48 develop-nr-2019w47 develop-nr-2019w45 develop-nr-2019w43 develop-nr-2019w42 develop-nr-2019w40 develop-nr-2019w28 develop-nr-2019w23 benetel_phase_rotation benetel_gnb_rel_2.0 benetel_gnb_rel_1.0 benetel_enb_rel_2.0 benetel_enb_rel_1.0
No related merge requests found
...@@ -172,19 +172,14 @@ hashtable_rc_t hashtable_apply_funct_on_elements (hash_table_t *const hashtblP, ...@@ -172,19 +172,14 @@ hashtable_rc_t hashtable_apply_funct_on_elements (hash_table_t *const hashtblP,
return HASH_TABLE_OK; return HASH_TABLE_OK;
} }
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
hashtable_rc_t hashtable_dump_content ( hashtable_rc_t hashtable_dump_content (const hash_table_t * const hashtblP, char * const buffer_pP, int * const remaining_bytes_in_buffer_pP )
const hash_table_t * const hashtblP,
char * const buffer_pP,
int * const remaining_bytes_in_buffer_pP)
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
{ {
hash_node_t *node = NULL; hash_node_t *node = NULL;
unsigned int i = 0; unsigned int i = 0;
unsigned int num_elements = 0; unsigned int num_elements = 0;
int rc;
if (hashtblP == NULL) { if (hashtblP == NULL) {
rc = snprintf( *remaining_bytes_in_buffer_pP = snprintf(
buffer_pP, buffer_pP,
*remaining_bytes_in_buffer_pP, *remaining_bytes_in_buffer_pP,
"HASH_TABLE_BAD_PARAMETER_HASHTABLE"); "HASH_TABLE_BAD_PARAMETER_HASHTABLE");
...@@ -194,18 +189,13 @@ hashtable_rc_t hashtable_dump_content ( ...@@ -194,18 +189,13 @@ hashtable_rc_t hashtable_dump_content (
if (hashtblP->nodes[i] != NULL) { if (hashtblP->nodes[i] != NULL) {
node=hashtblP->nodes[i]; node=hashtblP->nodes[i];
while(node) { while(node) {
rc = snprintf( *remaining_bytes_in_buffer_pP = snprintf(
buffer_pP, buffer_pP,
*remaining_bytes_in_buffer_pP, *remaining_bytes_in_buffer_pP,
"Key 0x%"PRIx64" Element %p\n", "Key 0x%"PRIx64" Element %p\n",
node->key, node->key,
node->data); node->data);
node=node->next; node=node->next;
if ((0 > rc) || (*remaining_bytes_in_buffer_pP < rc)) {
fprintf(stderr, "Error while dumping hashtable content");
} else {
*remaining_bytes_in_buffer_pP -= rc;
}
} }
} }
i += 1; i += 1;
...@@ -252,10 +242,10 @@ hashtable_rc_t hashtable_insert(hash_table_t * const hashtblP, const hash_key_t ...@@ -252,10 +242,10 @@ hashtable_rc_t hashtable_insert(hash_table_t * const hashtblP, const hash_key_t
} }
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
/* /*
* To free an element from the hash table, we just search for it in the linked list for that hash value, * To remove an element from the hash table, we just search for it in the linked list for that hash value,
* and free it if it is found. If it was not found, it is an error and -1 is returned. * and remove it if it is found. If it was not found, it is an error and -1 is returned.
*/ */
hashtable_rc_t hashtable_free(hash_table_t * const hashtblP, const hash_key_t keyP) hashtable_rc_t hashtable_remove(hash_table_t * const hashtblP, const hash_key_t keyP)
{ {
hash_node_t *node, *prevnode=NULL; hash_node_t *node, *prevnode=NULL;
hash_size_t hash = 0; hash_size_t hash = 0;
...@@ -281,36 +271,6 @@ hashtable_rc_t hashtable_free(hash_table_t * const hashtblP, const hash_key_t ke ...@@ -281,36 +271,6 @@ hashtable_rc_t hashtable_free(hash_table_t * const hashtblP, const hash_key_t ke
} }
return HASH_TABLE_KEY_NOT_EXISTS; return HASH_TABLE_KEY_NOT_EXISTS;
} }
//-------------------------------------------------------------------------------------------------------------------------------
/*
* To remove an element from the hash table, we just search for it in the linked list for that hash value,
* and remove it if it is found. If it was not found, it is an error and -1 is returned.
*/
hashtable_rc_t hashtable_remove(hash_table_t * const hashtblP, const hash_key_t keyP, void** dataP)
{
hash_node_t *node, *prevnode=NULL;
hash_size_t hash = 0;
if (hashtblP == NULL) {
return HASH_TABLE_BAD_PARAMETER_HASHTABLE;
}
hash=hashtblP->hashfunc(keyP)%hashtblP->size;
node=hashtblP->nodes[hash];
while(node) {
if(node->key == keyP) {
if(prevnode) prevnode->next=node->next;
else hashtblP->nodes[hash]=node->next;
*dataP = node->data;
free(node);
hashtblP->num_elements -= 1;
return HASH_TABLE_OK;
}
prevnode=node;
node=node->next;
}
return HASH_TABLE_KEY_NOT_EXISTS;
}
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
/* /*
* Searching for an element is easy. We just search through the linked list for the corresponding hash value. * Searching for an element is easy. We just search through the linked list for the corresponding hash value.
...@@ -348,7 +308,7 @@ hashtable_rc_t hashtable_get(const hash_table_t * const hashtblP, const hash_key ...@@ -348,7 +308,7 @@ hashtable_rc_t hashtable_get(const hash_table_t * const hashtblP, const hash_key
* If the number of elements are reduced, the hash table will waste memory. That is why we provide a function for resizing the table. * If the number of elements are reduced, the hash table will waste memory. That is why we provide a function for resizing the table.
* Resizing a hash table is not as easy as a realloc(). All hash values must be recalculated and each element must be inserted into its new position. * Resizing a hash table is not as easy as a realloc(). All hash values must be recalculated and each element must be inserted into its new position.
* We create a temporary hash_table_t object (newtbl) to be used while building the new hashes. * We create a temporary hash_table_t object (newtbl) to be used while building the new hashes.
* This allows us to reuse hashtable_insert() and hashtable_free(), when moving the elements to the new table. * This allows us to reuse hashtable_insert() and hashtable_remove(), when moving the elements to the new table.
* After that, we can just free the old table and copy the elements from newtbl to hashtbl. * After that, we can just free the old table and copy the elements from newtbl to hashtbl.
*/ */
...@@ -372,7 +332,7 @@ hashtable_rc_t hashtable_resize(hash_table_t * const hashtblP, const hash_size_t ...@@ -372,7 +332,7 @@ hashtable_rc_t hashtable_resize(hash_table_t * const hashtblP, const hash_size_t
next = node->next; next = node->next;
hashtable_insert(&newtbl, node->key, node->data); hashtable_insert(&newtbl, node->key, node->data);
// Lionel GAUTHIER: BAD CODE TO BE REWRITTEN // Lionel GAUTHIER: BAD CODE TO BE REWRITTEN
hashtable_free(hashtblP, node->key); hashtable_remove(hashtblP, node->key);
} }
} }
......
...@@ -49,9 +49,6 @@ typedef enum hashtable_return_code_e { ...@@ -49,9 +49,6 @@ typedef enum hashtable_return_code_e {
HASH_TABLE_CODE_MAX HASH_TABLE_CODE_MAX
} hashtable_rc_t; } hashtable_rc_t;
#define HASH_TABLE_DEFAULT_HASH_FUNC NULL
#define HASH_TABLE_DEFAULT_FREE_FUNC NULL
typedef struct hash_node_s { typedef struct hash_node_s {
hash_key_t key; hash_key_t key;
...@@ -75,8 +72,7 @@ hashtable_rc_t hashtable_is_key_exists (const hash_table_t * const hashtbl, con ...@@ -75,8 +72,7 @@ hashtable_rc_t hashtable_is_key_exists (const hash_table_t * const hashtbl, con
hashtable_rc_t hashtable_apply_funct_on_elements (hash_table_t * const hashtblP, void funct(hash_key_t keyP, void* dataP, void* parameterP), void* parameterP); hashtable_rc_t hashtable_apply_funct_on_elements (hash_table_t * const hashtblP, void funct(hash_key_t keyP, void* dataP, void* parameterP), void* parameterP);
hashtable_rc_t hashtable_dump_content (const hash_table_t * const hashtblP, char * const buffer_pP, int * const remaining_bytes_in_buffer_pP ); hashtable_rc_t hashtable_dump_content (const hash_table_t * const hashtblP, char * const buffer_pP, int * const remaining_bytes_in_buffer_pP );
hashtable_rc_t hashtable_insert (hash_table_t * const hashtbl, const hash_key_t key, void *data); hashtable_rc_t hashtable_insert (hash_table_t * const hashtbl, const hash_key_t key, void *data);
hashtable_rc_t hashtable_free (hash_table_t * const hashtbl, const hash_key_t key); hashtable_rc_t hashtable_remove (hash_table_t * const hashtbl, const hash_key_t key);
hashtable_rc_t hashtable_remove(hash_table_t * const hashtblP, const hash_key_t keyP, void** dataP);
hashtable_rc_t hashtable_get (const hash_table_t * const hashtbl, const hash_key_t key, void **dataP); hashtable_rc_t hashtable_get (const hash_table_t * const hashtbl, const hash_key_t key, void **dataP);
hashtable_rc_t hashtable_resize (hash_table_t * const hashtbl, const hash_size_t size); hashtable_rc_t hashtable_resize (hash_table_t * const hashtbl, const hash_size_t size);
......
...@@ -52,16 +52,14 @@ typedef struct obj_hash_table_s { ...@@ -52,16 +52,14 @@ typedef struct obj_hash_table_s {
void (*freedatafunc)(void*); void (*freedatafunc)(void*);
} obj_hash_table_t; } obj_hash_table_t;
obj_hash_table_t *obj_hashtable_create (const hash_size_t size, hash_size_t (*hashfunc)(const void*, int ), void (*freekeyfunc)(void*), void (*freedatafunc)(void*)); obj_hash_table_t *obj_hashtable_create (hash_size_t size, hash_size_t (*hashfunc)(const void*, int ), void (*freekeyfunc)(void*), void (*freedatafunc)(void*));
hashtable_rc_t obj_hashtable_destroy (obj_hash_table_t * const hashtblP); hashtable_rc_t obj_hashtable_destroy (obj_hash_table_t *hashtblP);
hashtable_rc_t obj_hashtable_is_key_exists (const obj_hash_table_t * const hashtblP, const void* const keyP, const int key_sizeP); hashtable_rc_t obj_hashtable_is_key_exists (obj_hash_table_t *hashtblP, void* keyP, int key_sizeP);
hashtable_rc_t obj_hashtable_insert (obj_hash_table_t * const hashtblP, const void* const keyP, const int key_sizeP, void *dataP); hashtable_rc_t obj_hashtable_insert (obj_hash_table_t *hashtblP, void* keyP, int key_sizeP, void *dataP);
hashtable_rc_t obj_hashtable_dump_content (const obj_hash_table_t * const hashtblP,char * const buffer_pP,int * const remaining_bytes_in_buffer_pP); hashtable_rc_t obj_hashtable_remove (obj_hash_table_t *hashtblP, const void* keyP, int key_sizeP);
hashtable_rc_t obj_hashtable_free (obj_hash_table_t *hashtblP, const void* keyP, const int key_sizeP); hashtable_rc_t obj_hashtable_get (obj_hash_table_t *hashtblP, const void* keyP, int key_sizeP, void ** dataP);
hashtable_rc_t obj_hashtable_remove(obj_hash_table_t *hashtblP, const void* keyP, const int key_sizeP, void** dataP); hashtable_rc_t obj_hashtable_get_keys(obj_hash_table_t *hashtblP, void ** keysP, unsigned int *sizeP);
hashtable_rc_t obj_hashtable_get (const obj_hash_table_t * const hashtblP, const void* const keyP, const int key_sizeP, void ** dataP); hashtable_rc_t obj_hashtable_resize (obj_hash_table_t *hashtblP, hash_size_t sizeP);
hashtable_rc_t obj_hashtable_get_keys(const obj_hash_table_t * const hashtblP, void ** keysP, unsigned int * sizeP);
hashtable_rc_t obj_hashtable_resize (obj_hash_table_t * const hashtblP, const hash_size_t sizeP);
#endif #endif
...@@ -194,7 +194,7 @@ int sgw_lite_cm_remove_s11_tunnel(Teid_t local_teid) ...@@ -194,7 +194,7 @@ int sgw_lite_cm_remove_s11_tunnel(Teid_t local_teid)
{ {
int temp; int temp;
temp = hashtable_free(sgw_app.s11teid2mme_hashtable, local_teid); temp = hashtable_remove(sgw_app.s11teid2mme_hashtable, local_teid);
return temp; return temp;
} }
...@@ -321,7 +321,7 @@ s_plus_p_gw_eps_bearer_context_information_t * sgw_lite_cm_create_bearer_context ...@@ -321,7 +321,7 @@ s_plus_p_gw_eps_bearer_context_information_t * sgw_lite_cm_create_bearer_context
int sgw_lite_cm_remove_bearer_context_information(Teid_t teid) int sgw_lite_cm_remove_bearer_context_information(Teid_t teid)
{ {
int temp; int temp;
temp = hashtable_free(sgw_app.s11_bearer_context_information_hashtable, teid); temp = hashtable_remove(sgw_app.s11_bearer_context_information_hashtable, teid);
return temp; return temp;
} }
...@@ -379,7 +379,7 @@ int sgw_lite_cm_remove_eps_bearer_entry(hash_table_t *eps_bearersP, ebi_t eps_be ...@@ -379,7 +379,7 @@ int sgw_lite_cm_remove_eps_bearer_entry(hash_table_t *eps_bearersP, ebi_t eps_be
return -1; return -1;
} }
temp = hashtable_free(eps_bearersP, eps_bearer_idP); temp = hashtable_remove(eps_bearersP, eps_bearer_idP);
return temp; return temp;
} }
......
...@@ -1178,26 +1178,7 @@ sgw_lite_handle_delete_session_request( ...@@ -1178,26 +1178,7 @@ sgw_lite_handle_delete_session_request(
return -1; return -1;
} }
/*
* Callback of hashtable_apply_funct_on_elements()
*/
static void sgw_lite_release_all_enb_related_information(hash_key_t keyP, void* dataP, void* parameterP)
{
sgw_eps_bearer_entry_t *eps_bearer_entry_p = (sgw_eps_bearer_entry_t*)dataP;
if (NULL != eps_bearer_entry_p) {
memset(&eps_bearer_entry_p->enb_ip_address_for_S1u,0, sizeof(eps_bearer_entry_p->enb_ip_address_for_S1u));
eps_bearer_entry_p->enb_teid_for_S1u = 0;
}
}
/* From GPP TS 23.401 version 11.11.0 Release 11, section 5.3.5 S1 release procedure:
* The S-GW releases all eNodeB related information (address and TEIDs) for the UE and responds with a Release
* Access Bearers Response message to the MME. Other elements of the UE's S-GW context are not affected. The
* S-GW retains the S1-U configuration that the S-GW allocated for the UE's bearers. The S-GW starts buffering
* downlink packets received for the UE and initiating the "Network Triggered Service Request" procedure,
* described in clause 5.3.4.3, if downlink packets arrive for the UE.
*/
int int
sgw_lite_handle_release_access_bearers_request( sgw_lite_handle_release_access_bearers_request(
const SgwReleaseAccessBearersRequest * const release_access_bearers_req_pP) const SgwReleaseAccessBearersRequest * const release_access_bearers_req_pP)
...@@ -1230,14 +1211,7 @@ sgw_lite_handle_release_access_bearers_request( ...@@ -1230,14 +1211,7 @@ sgw_lite_handle_release_access_bearers_request(
release_access_bearers_resp_p->cause = REQUEST_ACCEPTED; release_access_bearers_resp_p->cause = REQUEST_ACCEPTED;
release_access_bearers_resp_p->teid = ctx_p->sgw_eps_bearer_context_information.mme_teid_for_S11; release_access_bearers_resp_p->teid = ctx_p->sgw_eps_bearer_context_information.mme_teid_for_S11;
#warning "TODO Here the release (sgw_lite_handle_release_access_bearers_request)" #warning "TODO Here the release (sgw_lite_handle_release_access_bearers_request)"
hash_rc = hashtable_apply_funct_on_elements(ctx_p->sgw_eps_bearer_context_information.pdn_connection.sgw_eps_bearers,
sgw_lite_release_all_enb_related_information,
NULL);
// TODO The S-GW starts buffering downlink packets received for the UE
// (set target on GTPUSP to order the buffering)
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
MSC_SP_GWAPP_MME, MSC_SP_GWAPP_MME,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment