1 /*****************************************************************************
3 # Copyright 2020 AT&T Intellectual Property *
4 # Copyright 2020 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 ******************************************************************************/
21 #include "e2sim_defs.h"
27 wg_options_t wg_input_options(int argc, char *argv[]) {
29 options.server_ip = (char*)DEFAULT_SCTP_IP;
30 options.server_port = X2AP_SCTP_PORT;
33 options.server_ip = argv[1];
34 options.server_port = atoi(argv[2]);
35 options.rate = atoi(argv[3]);
36 } else if (argc == 3) {
37 options.server_ip = argv[1];
38 options.server_port = atoi(argv[2]);
39 if (options.server_port < 1 || options.server_port > 65535) {
40 LOG_E("Invalid port number (%d). Valid values are between 1 and 65535.\n",
44 } else if (argc == 2) {
45 options.server_ip = argv[1];
46 } else if (argc == 1) {
47 options.server_ip = (char*)DEFAULT_SCTP_IP;
49 LOG_I("Unrecognized option.\n");
50 LOG_I("Usage: %s [SERVER IP ADDRESS] [SERVER PORT] [RATE]\n", argv[0]);