From 3ecacdf3a6332048def4d1f007b202ab4db628db Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 2 Oct 2018 16:29:45 +0100 Subject: [PATCH] Adding selection of local interface at the MBMS-GW. --- srsepc/hdr/mbms-gw/mbms-gw.h | 1 + srsepc/mbms.conf.example | 1 + srsepc/src/mbms-gw/main.cc | 3 +++ srsepc/src/mbms-gw/mbms-gw.cc | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/srsepc/hdr/mbms-gw/mbms-gw.h b/srsepc/hdr/mbms-gw/mbms-gw.h index c238c0a18..45046b1d9 100644 --- a/srsepc/hdr/mbms-gw/mbms-gw.h +++ b/srsepc/hdr/mbms-gw/mbms-gw.h @@ -51,6 +51,7 @@ typedef struct { std::string sgi_mb_if_addr; std::string sgi_mb_if_mask; std::string m1u_multi_addr; + std::string m1u_multi_if; } mbms_gw_args_t; struct pseudo_hdr diff --git a/srsepc/mbms.conf.example b/srsepc/mbms.conf.example index d92306328..efe8489d8 100644 --- a/srsepc/mbms.conf.example +++ b/srsepc/mbms.conf.example @@ -15,6 +15,7 @@ name = srsmbmsgw01 sgi_mb_if_addr = 172.16.0.254 sgi_mb_if_mask = 255.255.255.255 m1u_multi_addr = 239.255.0.1 +m1u_multi_if = 127.0.1.200 #################################################################### # Log configuration diff --git a/srsepc/src/mbms-gw/main.cc b/srsepc/src/mbms-gw/main.cc index f99356071..046b9e27b 100644 --- a/srsepc/src/mbms-gw/main.cc +++ b/srsepc/src/mbms-gw/main.cc @@ -85,6 +85,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) { string mbms_gw_sgi_mb_if_addr; string mbms_gw_sgi_mb_if_mask; string mbms_gw_m1u_multi_addr; + string mbms_gw_m1u_multi_if; string log_filename; @@ -103,6 +104,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) { ("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.sgi_mb_if_mask", 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.") + ("mbms_gw.m1u_multi_if", bpo::value(&mbms_gw_m1u_multi_if)->default_value("127.0.1.200"), "Local interface IP for M1-U multicast packets.") ("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") @@ -156,6 +158,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) { 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; + args->mbms_gw_args.m1u_multi_if = mbms_gw_m1u_multi_if; // Apply all_level to any unset layers if (vm.count("log.all_level")) { diff --git a/srsepc/src/mbms-gw/mbms-gw.cc b/srsepc/src/mbms-gw/mbms-gw.cc index dc8199e27..d8ae96182 100644 --- a/srsepc/src/mbms-gw/mbms-gw.cc +++ b/srsepc/src/mbms-gw/mbms-gw.cc @@ -234,7 +234,7 @@ mbms_gw::init_m1_u(mbms_gw_args_t *args) /* Set local interface for outbound multicast packets*/ /* The IP must be associated with a local multicast capable interface */ struct in_addr local_if; - local_if.s_addr = inet_addr("127.0.1.200"); + local_if.s_addr = inet_addr(args->m1u_multi_if.c_str()); if(setsockopt(m_m1u, IPPROTO_IP, IP_MULTICAST_IF, (char*)&local_if, sizeof(struct in_addr))<0){ perror("Error setting multicast interface.\n"); } else {