diff --git a/srsepc/hdr/mbms-gw/mbms-gw.h b/srsepc/hdr/mbms-gw/mbms-gw.h index 2beca7dcb..c238c0a18 100644 --- a/srsepc/hdr/mbms-gw/mbms-gw.h +++ b/srsepc/hdr/mbms-gw/mbms-gw.h @@ -49,6 +49,7 @@ const uint16_t GTPU_RX_PORT = 2152; typedef struct { std::string name; std::string sgi_mb_if_addr; + std::string sgi_mb_if_mask; std::string m1u_multi_addr; } mbms_gw_args_t; diff --git a/srsepc/mbms.conf.example b/srsepc/mbms.conf.example index 393be7648..d92306328 100644 --- a/srsepc/mbms.conf.example +++ b/srsepc/mbms.conf.example @@ -12,7 +12,8 @@ ##################################################################### [mbms_gw] name = srsmbmsgw01 -sgi_mb_if_addr = 172.16.1.1 +sgi_mb_if_addr = 172.16.0.254 +sgi_mb_if_mask = 255.255.255.255 m1u_multi_addr = 239.255.0.1 #################################################################### diff --git a/srsepc/src/mbms-gw/main.cc b/srsepc/src/mbms-gw/main.cc index a54f071c8..8aefc248d 100644 --- a/srsepc/src/mbms-gw/main.cc +++ b/srsepc/src/mbms-gw/main.cc @@ -99,8 +99,9 @@ parse_args(all_args_t *args, int argc, char* argv[]) { common.add_options() ("mbms_gw.name", bpo::value(&mbms_gw_name)->default_value("srsmbmsgw01"), "MBMS-GW Name") - ("mbms_gw.sgi_mb_if_addr", bpo::value(&mbms_gw_sgi_mb_if_addr)->default_value("172.16.1.1"), "SGi-mb TUN interface Address") - ("mbms_gw.m1u_multi_addr", bpo::value(&mbms_gw_m1u_multi_addr)->default_value("239.255.0.1"), "M1-u GTPu destination multicast address") + ("mbms_gw.sgi_mb_if_addr", bpo::value(&mbms_gw_sgi_mb_if_addr)->default_value("172.16.1.1"), "SGi-mb TUN interface Address.") + ("mbms_gw.m1u_multi_addr", bpo::value(&mbms_gw_sgi_mb_if_mask)->default_value("255.255.255.255"), "SGi-mb TUN interface mask.") + ("mbms_gw.m1u_multi_addr", bpo::value(&mbms_gw_m1u_multi_addr)->default_value("239.255.0.1"), "M1-u GTPu destination multicast address.") ("log.all_level", bpo::value(&args->log_args.all_level)->default_value("info"), "ALL log level") ("log.all_hex_limit", bpo::value(&args->log_args.all_hex_limit)->default_value(32), "ALL log hex dump limit") @@ -152,7 +153,9 @@ parse_args(all_args_t *args, int argc, char* argv[]) { args->mbms_gw_args.name = mbms_gw_name; args->mbms_gw_args.sgi_mb_if_addr = mbms_gw_sgi_mb_if_addr; + args->mbms_gw_args.sgi_mb_if_mask = mbms_gw_sgi_mb_if_mask; args->mbms_gw_args.m1u_multi_addr = mbms_gw_m1u_multi_addr; + // Apply all_level to any unset layers if (vm.count("log.all_level")) { if(!vm.count("log.mbms_gw_level")) { diff --git a/srsepc/src/mbms-gw/mbms-gw.cc b/srsepc/src/mbms-gw/mbms-gw.cc index e29b6629f..b373df4e7 100644 --- a/srsepc/src/mbms-gw/mbms-gw.cc +++ b/srsepc/src/mbms-gw/mbms-gw.cc @@ -196,7 +196,7 @@ mbms_gw::init_sgi_mb_if(mbms_gw_args_t *args) } ifr.ifr_netmask.sa_family = AF_INET; - ((struct sockaddr_in *)&ifr.ifr_netmask)->sin_addr.s_addr = inet_addr("255.255.255.0"); + ((struct sockaddr_in *)&ifr.ifr_netmask)->sin_addr.s_addr = inet_addr(args->sgi_mb_if_mask.c_str()); if (ioctl(sgi_mb_sock, SIOCSIFNETMASK, &ifr) < 0) { m_mbms_gw_log->error("Failed to set TUN interface Netmask. Error: %s\n", strerror(errno)); close(m_sgi_mb_if);