summaryrefslogtreecommitdiff
path: root/scripts/vyatta-op-vpnprof.pl
blob: 2f173fbb89393b48d801587b5ee668f8f3b38149 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/perl
#
# Module: vyatta-op-vpnprof.pl
#
use Getopt::Long;
use Data::Dumper;
use lib "/opt/vyatta/share/perl5/";
use Vyatta::vpnprof::OPMode;

use strict;

my ($get_profiles_for_cli, $get_conn_for_cli, $show_ipsec_sa, $show_ipsec_sa_detail,
    $show_ipsec_sa_profile, $show_ipsec_sa_profile_detail,  
    $show_ipsec_sa_stats, $show_ipsec_sa_stats_profile);
my @show_ipsec_sa_stats_conn;
my @show_ipsec_sa_conn_detail;
my @show_ipsec_sa_conn;

GetOptions("show-ipsec-sa!"                 => \$show_ipsec_sa,
           "show-ipsec-sa-detail!"          => \$show_ipsec_sa_detail,
           "get-profiles-for-cli!"          => \$get_profiles_for_cli,
           "get-conn-for-cli=s"             => \$get_conn_for_cli,
           "show-ipsec-sa-profile=s"        => \$show_ipsec_sa_profile,
           "show-ipsec-sa-profile-detail=s" => \$show_ipsec_sa_profile_detail,
           "show-ipsec-sa-stats!"           => \$show_ipsec_sa_stats,
           "show-ipsec-sa-stats-profile=s"  => \$show_ipsec_sa_stats_profile,
           "show-ipsec-sa-conn-detail=s{2}" => \@show_ipsec_sa_conn_detail,
           "show-ipsec-sa-conn=s{2}"        => \@show_ipsec_sa_conn);

if (defined $get_profiles_for_cli) {
  Vyatta::vpnprof::OPMode::get_profiles_for_cli();
}
if (defined $get_conn_for_cli) {
  Vyatta::vpnprof::OPMode::get_conn_for_cli($get_conn_for_cli);
}
if (defined $show_ipsec_sa) {
  Vyatta::vpnprof::OPMode::show_ipsec_sa();
}
if (defined $show_ipsec_sa_detail) {
  Vyatta::vpnprof::OPMode::show_ipsec_sa_detail();
}
if (defined $show_ipsec_sa_profile) {
  Vyatta::vpnprof::OPMode::show_ipsec_sa_profile($show_ipsec_sa_profile);
}
if (defined $show_ipsec_sa_profile_detail) {
  Vyatta::vpnprof::OPMode::show_ipsec_sa_profile_detail($show_ipsec_sa_profile_detail);
}
if (defined @show_ipsec_sa_conn_detail) {
  Vyatta::vpnprof::OPMode::show_ipsec_sa_conn_detail(@show_ipsec_sa_conn_detail);
}
if (defined @show_ipsec_sa_conn) {
  Vyatta::vpnprof::OPMode::show_ipsec_sa_conn(@show_ipsec_sa_conn);
}
if (defined $show_ipsec_sa_stats) {
  Vyatta::vpnprof::OPMode::show_ipsec_sa_stats();
}
if (defined $show_ipsec_sa_stats_profile) {
  Vyatta::vpnprof::OPMode::show_ipsec_sa_stats_profile($show_ipsec_sa_stats_profile);
}