diff --git a/srsepc/hdr/mbms-gw/mbms-gw.h b/srsepc/hdr/mbms-gw/mbms-gw.h index 45046b1d9..ba1641c27 100644 --- a/srsepc/hdr/mbms-gw/mbms-gw.h +++ b/srsepc/hdr/mbms-gw/mbms-gw.h @@ -52,6 +52,7 @@ typedef struct { std::string sgi_mb_if_mask; std::string m1u_multi_addr; std::string m1u_multi_if; + int m1u_multi_ttl; } mbms_gw_args_t; struct pseudo_hdr diff --git a/srsepc/mbms.conf.example b/srsepc/mbms.conf.example index efe8489d8..3c0a03696 100644 --- a/srsepc/mbms.conf.example +++ b/srsepc/mbms.conf.example @@ -16,6 +16,7 @@ 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 +m1u_multi_ttl = 1 #################################################################### # Log configuration diff --git a/srsepc/src/mbms-gw/main.cc b/srsepc/src/mbms-gw/main.cc index 046b9e27b..64037c0ad 100644 --- a/srsepc/src/mbms-gw/main.cc +++ b/srsepc/src/mbms-gw/main.cc @@ -105,6 +105,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) { ("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.") + ("mbms_gw.m1u_multi_ttl", bpo::value(&args->mbms_gw_args.m1u_multi_ttl)->default_value(1), "TTL 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") diff --git a/srsepc/src/mbms-gw/mbms-gw.cc b/srsepc/src/mbms-gw/mbms-gw.cc index d8ae96182..eed2f5b95 100644 --- a/srsepc/src/mbms-gw/mbms-gw.cc +++ b/srsepc/src/mbms-gw/mbms-gw.cc @@ -238,7 +238,13 @@ mbms_gw::init_m1_u(mbms_gw_args_t *args) if(setsockopt(m_m1u, IPPROTO_IP, IP_MULTICAST_IF, (char*)&local_if, sizeof(struct in_addr))<0){ perror("Error setting multicast interface.\n"); } else { - printf("Multicast interface specified.\n"); + printf("Multicast interface specified. Address: %s\n", args->m1u_multi_if.c_str()); + } + + /*Set Multicast TTL*/ + if ( setsockopt(m_m1u, IPPROTO_IP,IP_MULTICAST_TTL,&args->m1u_multi_ttl,sizeof(args->m1u_multi_ttl)) <0 ) { + perror("Error setting multicast ttl.\n"); + return srslte::ERROR_CANT_START; } bzero(&m_m1u_multi_addr,sizeof(m_m1u_multi_addr));