Commit c7bdb449 authored by laurent's avatar laurent

Compiles, hard coded noS1 mode replacing gtp

parent 85669c6b
...@@ -17,24 +17,52 @@ ...@@ -17,24 +17,52 @@
#include "gtpv1u_eNB_defs.h" #include "gtpv1u_eNB_defs.h"
int noS1_create_s1u_tunnel( const instance_t instanceP, int noS1_create_s1u_tunnel( const instance_t instanceP,
const gtpv1u_enb_create_tunnel_req_t * create_tunnel_req_pP, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
gtpv1u_enb_create_tunnel_resp_t * create_tunnel_resp_pP){ gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp_pP) {
LOG_D(GTPU, "Start create tunnels for RNTI %x, num_tunnels %d, sgw_S1u_teid %d, eps_bearer_id %d \n",
create_tunnel_req->rnti,
create_tunnel_req->num_tunnels,
create_tunnel_req->sgw_S1u_teid[0],
create_tunnel_req->eps_bearer_id[0]);
/*
on a pas l'adresse IP du UE, mais on l'aura dans le premier paquet sortant
Sinon, il faut la passer dans le create tunnel
*/
return 0; return 0;
} }
int noS1_update_s1u_tunnel( const instance_t instanceP, int noS1_update_s1u_tunnel( const instance_t instanceP,
const gtpv1u_enb_create_tunnel_req_t * create_tunnel_req_pP, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
const rnti_t prior_rnti) { const rnti_t prior_rnti) {
LOG_D(GTPU, "Start update tunnels for old RNTI %x, new RNTI %x, num_tunnels %d, sgw_S1u_teid %d, eps_bearer_id %d\n",
prior_rnti,
create_tunnel_req->rnti,
create_tunnel_req->num_tunnels,
create_tunnel_req->sgw_S1u_teid[0],
create_tunnel_req->eps_bearer_id[0]);
return 0; return 0;
} }
int noS1_delete_s1u_tunnel(const instance_t instance, int noS1_delete_s1u_tunnel(const instance_t instance,
gtpv1u_enb_delete_tunnel_req_t *udp_data_ind) { gtpv1u_enb_delete_tunnel_req_t *req_pP) {
LOG_D(GTPU, "Start delete tunnels for RNTI %x, num_erab %d, eps_bearer_id %d \n",
req_pP->rnti,
req_pP->num_erab,
req_pP->eps_bearer_id[0]);
return 0; return 0;
} }
int noS1_send(const instance_t instance, int noS1_send(const instance_t instance,
gtpv1u_enb_tunnel_data_req_t * req){ gtpv1u_enb_tunnel_data_req_t *req) {
uint8_t *buffer=req->buffer+req->offset;;
size_t length=req->length;
uint64_t rnti=req->rnti;
int rab_id=req->rab_id;
/*
il faut lire l'adresse source du UE (si on l'a pas rajoutée dans le create tunnel
la ranger dans la table des IP->teid
et envoyer le paquet (probablement en raw car l'entête ip est déja faite)
*/
return 0; return 0;
} }
...@@ -44,6 +72,8 @@ int noS1_init(int a) { ...@@ -44,6 +72,8 @@ int noS1_init(int a) {
int noS1_receiver(int fd) { int noS1_receiver(int fd) {
/* /*
il faut trouver le teid à partir de l'adresse destination (l'adresse du UE)
puis adapter le code ci dessous
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES, gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id);
result = pdcp_data_req( result = pdcp_data_req(
&ctxt, &ctxt,
...@@ -54,17 +84,15 @@ int noS1_receiver(int fd) { ...@@ -54,17 +84,15 @@ int noS1_receiver(int fd) {
buffer_len, buffer_len,
buffer, buffer,
PDCP_TRANSMISSION_MODE_DATA PDCP_TRANSMISSION_MODE_DATA
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,NULL, NULL ,NULL, NULL
#endif #endif
); );
*/ */
return 0; return 0;
} }
void *noS1_eNB_task(void *args) void *noS1_eNB_task(void *args) {
{
int sd; int sd;
AssertFatal((sd=noS1_init(0))>=0,""); AssertFatal((sd=noS1_init(0))>=0,"");
itti_subscribe_event_fd(TASK_GTPV1_U, sd); itti_subscribe_event_fd(TASK_GTPV1_U, sd);
...@@ -72,8 +100,10 @@ void *noS1_eNB_task(void *args) ...@@ -72,8 +100,10 @@ void *noS1_eNB_task(void *args)
while(1) { while(1) {
MessageDef *received_message_p = NULL; MessageDef *received_message_p = NULL;
itti_receive_msg(TASK_GTPV1_U, &received_message_p); itti_receive_msg(TASK_GTPV1_U, &received_message_p);
if (received_message_p != NULL) { if (received_message_p != NULL) {
instance_t instance = ITTI_MSG_INSTANCE(received_message_p); instance_t instance = ITTI_MSG_INSTANCE(received_message_p);
switch (ITTI_MSG_ID(received_message_p)) { switch (ITTI_MSG_ID(received_message_p)) {
case GTPV1U_ENB_DELETE_TUNNEL_REQ: { case GTPV1U_ENB_DELETE_TUNNEL_REQ: {
noS1_delete_s1u_tunnel(instance, noS1_delete_s1u_tunnel(instance,
...@@ -106,18 +136,21 @@ void *noS1_eNB_task(void *args) ...@@ -106,18 +136,21 @@ void *noS1_eNB_task(void *args)
} }
break; break;
} }
AssertFatal( EXIT_SUCCESS == itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p), AssertFatal( EXIT_SUCCESS == itti_free(ITTI_MSG_ORIGIN_ID(received_message_p), received_message_p),
"Failed to free memory !\n"); "Failed to free memory !\n");
received_message_p = NULL; received_message_p = NULL;
} }
struct epoll_event *events; struct epoll_event *events;
int nb_events = itti_get_events(TASK_GTPV1_U, &events); int nb_events = itti_get_events(TASK_GTPV1_U, &events);
if (nb_events > 0 && events!= NULL ) if (nb_events > 0 && events!= NULL )
for (int i = 0; i < nb_events; i++) for (int i = 0; i < nb_events; i++)
if (events[i].data.fd==sd) if (events[i].data.fd==sd)
noS1_receiver(events[i].data.fd); noS1_receiver(events[i].data.fd);
} }
return NULL; return NULL;
} }
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