Adding TTL option

master
Pedro Alvarez 6 years ago committed by Andre Puschmann
parent 3ecacdf3a6
commit 35ca9ffd34

@ -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

@ -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

@ -105,6 +105,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) {
("mbms_gw.sgi_mb_if_mask", bpo::value<string>(&mbms_gw_sgi_mb_if_mask)->default_value("255.255.255.255"), "SGi-mb TUN interface mask.")
("mbms_gw.m1u_multi_addr", bpo::value<string>(&mbms_gw_m1u_multi_addr)->default_value("239.255.0.1"), "M1-u GTPu destination multicast address.")
("mbms_gw.m1u_multi_if", bpo::value<string>(&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<int>(&args->mbms_gw_args.m1u_multi_ttl)->default_value(1), "TTL for M1-U multicast packets.")
("log.all_level", bpo::value<string>(&args->log_args.all_level)->default_value("info"), "ALL log level")
("log.all_hex_limit", bpo::value<int>(&args->log_args.all_hex_limit)->default_value(32), "ALL log hex dump limit")

@ -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));

Loading…
Cancel
Save