sub run_ssl {
my $heartbeat;
my $parent_msg;
my $sub = 'run_ssl()';
my $test;
my $mesg;
my $flags = '';
my $sock;
my $client_socket;
my $sel;
my $ext_mesg;
my $peer_ref;
my $answer;
#$sock = IO::Socket::SSL->new(
# LocalAddr => $ssl_addr,
# LocalPort => $ssl_port,
# Listen => 5,
# Reuse => 1,
# Proto => 'tcp',
# SSL_cert_file => 'server.crt',
# SSL_key_file => 'server.key',
#) || die "Can't bind TCP SSL port";
$sock = new IO::Socket::INET (
LocalHost => $ssl_addr,
LocalPort => $ssl_port,
Proto => 'tcp',
Listen => 5,
Reuse => 1,
# Timeout => 1,
);
if ( defined $sock ) {
dbg( "${sub}: (Re-)Started SSL Socket Process" );
}
else {
dbg( "${sub}: IO::Socket::INET->new: $!" );
}
$sock->timeout( 1 );
$sel = IO::Select->new( $sock );
$flags = fcntl( $from_parent_ssl, F_GETFL, 0 )
or die( "${sub}: Could not get flags for \$from_parent_ssl: $!\n" );
fcntl( $from_parent_ssl, F_SETFL, $flags | O_NONBLOCK )
or die( "${sub}: Could not set flags for \$from_parent_ssl: $!\n" );
if ( ! defined ( $pid = fork() ) ) { die( "${sub}: $@\n" ) }
return $pid if ( $pid );
tie( $peer_ref, 'IPC::Shareable', 'glue', \%shareable_opts );
####
sub launch_bgp_proc {
# Runs Net::BGP::Process in a separate process
#
my $pid;
my $sub = 'launch_bgp_proc()';
my $peer;
my $peer_ref;
#my %peers;
my $bgp;
if ( ! defined ( $pid = fork() ) ) { die( "${sub}: $@\n" ) }
return $pid if ( $pid );
tie( $peer_ref , 'IPC::Shareable', 'glue', \%shareable_opts);
$bgp = Net::BGP::Process->new();
if ( defined $bgp ) {
dbg( "${sub}: (Re-)Started BGP Process" );
}
else {
dbg( "${sub}: Net::BGP::Process: $!" );
}
$peer = Net::BGP::Peer->new(
Start => 1,
... [REMOVED TO HIDE IP ADRESSES]
ResetCallback => \&bgp_callback_reset
);
$peer_ref = $peer;
####
at /usr/lib/x86_64-linux-gnu/perl/5.22/Storable.pm line 341, at /usr/local/share/perl/5.22.1/IPC/Shareable.pm line 524.
####
sub launch_bgp_proc {
# Runs Net::BGP::Process in a separate process
#
my $pid;
my $sub = 'launch_bgp_proc()';
my $peer;
#my $peer_ref;
my %peers;
my $bgp;
if ( ! defined ( $pid = fork() ) ) { die( "${sub}: $@\n" ) }
return $pid if ( $pid );
tie( %peers , 'IPC::Shareable', 'glue', \%shareable_opts);
$bgp = Net::BGP::Process->new();
if ( defined $bgp ) {
dbg( "${sub}: (Re-)Started BGP Process" );
}
else {
dbg( "${sub}: Net::BGP::Process: $!" );
}
$peer = Net::BGP::Peer->new(
Start => 1,
... [REMOVED TO HIDE IP ADRESSES]
ResetCallback => \&bgp_callback_reset
);
$peers{ 'peer' } = $peer;
...