1 /*****************************************************************************
3 # Copyright 2019 AT&T Intellectual Property *
4 # Copyright 2019 Nokia *
6 # Licensed under the Apache License, Version 2.0 (the "License"); *
7 # you may not use this file except in compliance with the License. *
8 # You may obtain a copy of the License at *
10 # http://www.apache.org/licenses/LICENSE-2.0 *
12 # Unless required by applicable law or agreed to in writing, software *
13 # distributed under the License is distributed on an "AS IS" BASIS, *
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
15 # See the License for the specific language governing permissions and *
16 # limitations under the License. *
18 ******************************************************************************/
24 #include "e2sim_sctp.hpp"
25 #include "e2ap_message_handler.hpp"
28 #include "e2sim_defs.h"
30 #include "e2ap_asn1c_codec.h"
32 #include "ProtocolIE-Field.h"
38 int main(int argc, char* argv[]){
39 LOG_I("Start RIC WLG");
41 options_t ops = read_input_options(argc, argv);
43 int server_fd = sctp_start_server(ops.server_ip, ops.server_port);
44 int client_fd = sctp_accept_connection(ops.server_ip, server_fd);
46 sctp_buffer_t recv_buf;
48 LOG_I("[SCTP] Waiting for SCTP data");
50 while(1) //constantly looking for data on SCTP interface
52 if(sctp_receive_data(client_fd, recv_buf) <= 0)
55 LOG_I("[SCTP] Received new data of size %d", recv_buf.len);
57 e2ap_handle_sctp_data(client_fd, recv_buf);