@ -33,7 +33,7 @@ namespace srsenb {
gtpu : : gtpu ( ) : m1u ( this ) , gtpu_log ( " GTPU " ) { }
gtpu : : gtpu ( ) : m1u ( this ) , gtpu_log ( " GTPU " ) { }
bool gtpu : : init ( std : : string gtp_bind_addr_ ,
int gtpu : : init ( std : : string gtp_bind_addr_ ,
std : : string mme_addr_ ,
std : : string mme_addr_ ,
std : : string m1u_multiaddr_ ,
std : : string m1u_multiaddr_ ,
std : : string m1u_if_addr_ ,
std : : string m1u_if_addr_ ,
@ -47,13 +47,13 @@ bool gtpu::init(std::string gtp_bind_addr_,
pool = byte_buffer_pool : : get_instance ( ) ;
pool = byte_buffer_pool : : get_instance ( ) ;
stack = stack_ ;
stack = stack_ ;
char errbuf [ 128 ] ;
char errbuf [ 128 ] = { } ;
// Set up socket
// Set up socket
fd = socket ( AF_INET , SOCK_DGRAM , 0 ) ;
fd = socket ( AF_INET , SOCK_DGRAM , 0 ) ;
if ( fd < 0 ) {
if ( fd < 0 ) {
gtpu_log - > error ( " Failed to create socket \n " ) ;
gtpu_log - > error ( " Failed to create socket \n " ) ;
return false ;
return SRSLTE_ERROR ;
}
}
int enable = 1 ;
int enable = 1 ;
# if defined(SO_REUSEADDR)
# if defined(SO_REUSEADDR)
@ -75,7 +75,7 @@ bool gtpu::init(std::string gtp_bind_addr_,
snprintf ( errbuf , sizeof ( errbuf ) , " %s " , strerror ( errno ) ) ;
snprintf ( errbuf , sizeof ( errbuf ) , " %s " , strerror ( errno ) ) ;
gtpu_log - > error ( " Failed to bind on address %s, port %d: %s \n " , gtp_bind_addr . c_str ( ) , GTPU_PORT , errbuf ) ;
gtpu_log - > error ( " Failed to bind on address %s, port %d: %s \n " , gtp_bind_addr . c_str ( ) , GTPU_PORT , errbuf ) ;
gtpu_log - > console ( " Failed to bind on address %s, port %d: %s \n " , gtp_bind_addr . c_str ( ) , GTPU_PORT , errbuf ) ;
gtpu_log - > console ( " Failed to bind on address %s, port %d: %s \n " , gtp_bind_addr . c_str ( ) , GTPU_PORT , errbuf ) ;
return false ;
return SRSLTE_ERROR ;
}
}
stack - > add_gtpu_s1u_socket_handler ( fd ) ;
stack - > add_gtpu_s1u_socket_handler ( fd ) ;
@ -84,10 +84,10 @@ bool gtpu::init(std::string gtp_bind_addr_,
enable_mbsfn = enable_mbsfn_ ;
enable_mbsfn = enable_mbsfn_ ;
if ( enable_mbsfn ) {
if ( enable_mbsfn ) {
if ( not m1u . init ( m1u_multiaddr_ , m1u_if_addr_ ) ) {
if ( not m1u . init ( m1u_multiaddr_ , m1u_if_addr_ ) ) {
return false ;
return SRSLTE_ERROR ;
}
}
}
}
return true ;
return SRSLTE_SUCCESS ;
}
}
void gtpu : : stop ( )
void gtpu : : stop ( )