Commit 73691de7 authored by Nikos Makris's avatar Nikos Makris

Fixes that were affecting the communication between PDCP and RLC, cleanup

parent fc43139e
This diff is collapsed.
......@@ -190,7 +190,7 @@ int proto_agent_serialize_message(Protocol__FlexsplitMessage *msg, void **buf, i
return 0;
error:
LOG_E(PROTO_AGENT, "an error occured\n");
LOG_E(MAC, "an error occured\n");
return -1;
}
......@@ -344,7 +344,7 @@ int proto_agent_pdcp_data_req(mid_t mod_id, const void *params, Protocol__Flexsp
free(data_req);
if(*msg != NULL)
free(*msg);
LOG_E(PROTO_AGENT, "%s: an error occured\n", __FUNCTION__);
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return -1;
}
......@@ -363,7 +363,7 @@ int proto_agent_destroy_pdcp_data_req(Protocol__FlexsplitMessage *msg) {
return 0;
error:
LOG_E(PROTO_AGENT, "%s: an error occured\n", __FUNCTION__);
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return -1;
}
......@@ -372,10 +372,11 @@ int proto_agent_get_ack_result(mid_t mod_id, const void *params, Protocol__Flexs
Protocol__FspHeader *header;
xid_t xid;
rlc_op_status_t result = 0;
LOG_D(PROTO_AGENT, "handling the data_req_ack message\n");
//printf("PROTO_AGENT: handling the data_req_ack message\n");
Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params;
Protocol__FspRlcDataReqAck *data_ack = input->data_req_ack;
result = data_ack->result;
//printf("PROTO_AGENT: ACK RESULT IS %u\n", result);
ack_result = result;
return 0;
......@@ -485,7 +486,7 @@ int proto_agent_destroy_pdcp_data_req_ack(Protocol__FlexsplitMessage *msg) {
return 0;
error:
LOG_E(PROTO_AGENT, "%s: an error occured\n", __FUNCTION__);
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return -1;
}
......@@ -500,7 +501,7 @@ int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg) {
return 0;
error:
LOG_E(PROTO_AGENT, "%s: an error occured\n", __FUNCTION__);
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return -1;
}
......@@ -611,7 +612,7 @@ int proto_agent_pdcp_data_ind(mid_t mod_id, const void *params, Protocol__Flexsp
free(data_ind);
if(*msg != NULL)
free(*msg);
LOG_E(PROTO_AGENT, "%s: an error occured\n", __FUNCTION__);
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return -1;
}
......@@ -623,7 +624,7 @@ int proto_agent_pdcp_data_ind_ack(mid_t mod_id, const void *params, Protocol__Fl
xid_t xid;
rlc_op_status_t result = 0;
LOG_I(PROTO_AGENT, "creating the data_ind_ack message\n");
//printf("PROTO_AGENT: creating the data_ind_ack message\n");
Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params;
Protocol__FspPdcpDataInd *data_ind = input->data_ind_msg;
......@@ -696,18 +697,6 @@ int proto_agent_pdcp_data_ind_ack(mid_t mod_id, const void *params, Protocol__Fl
(*msg)->has_msg_dir = 1;
(*msg)->data_req_ack = ack;
//pdcp_control_plane_data_pdu_header* pdcp_header = (pdcp_control_plane_data_pdu_header*) pdcp_pdu_p;
// int sequence_number = pdcp_get_sequence_number_of_pdu_with_long_sn((unsigned char*)pdcp_pdu_p);
// LOG_I(PROTO_AGENT,"RECEIVED DATA IND WITH SEQ NO %d\n", sequence_number);
return 0;
error:
......@@ -736,7 +725,7 @@ int proto_agent_destroy_pdcp_data_ind_ack(Protocol__FlexsplitMessage *msg) {
return 0;
error:
LOG_E(PROTO_AGENT, "%s: an error occured\n", __FUNCTION__);
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
return -1;
}
......
......@@ -61,7 +61,7 @@ socket_link_t *new_link_server(int port)
ret->socket_fd = -1;
printf("MAC create a new link server socket at port %d\n", port);
//printf("MAC create a new link server socket at port %d\n", port);
socket_server = socket(AF_INET, SOCK_STREAM, 0);
if (socket_server == -1) {
......@@ -103,9 +103,7 @@ socket_link_t *new_link_server(int port)
goto error;
}
close(socket_server);
printf("MAC connection from %s:%d\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
//printf("MAC connection from %s:%d\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
return ret;
error:
......@@ -180,7 +178,7 @@ socket_link_t *new_link_udp_server(int port){
}
ret->socket_fd = -1;
LOG_I(PROTO_AGENT, "create a new udp link server socket at port %d\n", port);
//printf("PROTO_AGENT: create a new udp link server socket at port %d\n", port);
//create a UDP socket
if ((socket_server=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
......@@ -206,7 +204,7 @@ error:
close(socket_server);
if (ret != NULL) close(ret->socket_fd);
free(ret);
LOG_E(PROTO_AGENT, "ERROR in new_link_udp_server (see above), returning NULL\n");
//printf("\n\n\nERROR PROTO_AGENT: ERROR in new_link_udp_server (see above), returning NULL\n");
return NULL;
}
......@@ -307,7 +305,7 @@ error:
close(listenSock);
if (ret != NULL) close(ret->socket_fd);
free(ret);
LOG_E(PROTO_AGENT, "ERROR in new_link_sctp_server (see above), returning NULL\n");
LOG_E(MAC,"ERROR in new_link_sctp_server (see above), returning NULL\n");
return NULL;
}
......@@ -336,9 +334,9 @@ socket_link_t *new_link_sctp_client(char *server, int port)
bzero ((void *) &servaddr, sizeof (servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons (port);
LOG_E(PROTO_AGENT, "invalid IP address '%s', use a.b.c.d notation\n", server);
if (inet_aton(server, &servaddr.sin_addr) == 0) {
LOG_E(PROTO_AGENT, "invalid IP address '%s', use a.b.c.d notation\n", server);
LOG_E(MAC,"invalid IP address '%s', use a.b.c.d notation\n", server);
goto error;
}
......@@ -385,14 +383,14 @@ static int socket_udp_send(int socket_fd, void *buf, int size, char *peer_addr,
while (size) {
l = sendto(my_socket, s, size, 0, (struct sockaddr *) &si_other, slen);
if (l == -1) goto error;
if (l == 0) { LOG_E(PROTO_AGENT, "%s:%d: this cannot happen, normally...\n", __FILE__, __LINE__); abort(); }
if (l == 0) { printf("\n\n\nERROR PROTO_AGENT: %s:%d: this cannot happen, normally...\n", __FILE__, __LINE__); abort(); }
size -= l;
s += l;
}
return 0;
error:
LOG_E(PROTO_AGENT, "socket_udp_send: ERROR: %s\n", strerror(errno));
LOG_E(MAC,"socket_udp_send: ERROR: %s\n", strerror(errno));
return -1;
}
......@@ -541,8 +539,6 @@ int link_receive_packet(socket_link_t *link, void **ret_data, int *ret_size, uin
int peer_port = 0;
/* received the size first, maximum is 2^31 bytes */
if (socket_receive(link->socket_fd, sizebuf, 4) == -1)
goto error;
if ((proto_type == 0) || (proto_type == 2))
{
if (socket_receive(link->socket_fd, sizebuf, 4) == -1)
......
......@@ -140,7 +140,7 @@ eNBs =
////////// MME parameters:
mme_ip_address = ( { ipv4 = "10.64.93.26";
mme_ip_address = ( { ipv4 = "10.64.93.19";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......@@ -164,7 +164,7 @@ DU = (
{
DU_INTERFACE_NAME_FOR_F1U = "lo";
DU_IPV4_ADDRESS_FOR_F1U = "127.0.0.1/16";
DU_PORT_FOR_F1U = 2210;
DU_PORT_FOR_F1U = 22100;
F1_U_DU_TRANSPORT_TYPE = "TCP";
}
);
......@@ -173,7 +173,7 @@ CU = (
{
CU_INTERFACE_NAME_FOR_F1U = "lo";
CU_IPV4_ADDRESS_FOR_F1U = "127.0.0.1"; //Address to search the DU
CU_PORT_FOR_F1U = 2210;
CU_PORT_FOR_F1U = 22100;
F1_U_CU_TRANSPORT_TYPE = "TCP"; // One of TCP/UDP/SCTP
DU_TYPE = "LTE";
}//,
......
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