xref: /openbsd/regress/usr.sbin/ospfd/Default.pm (revision 8529ddd3)
1#	$OpenBSD: Default.pm,v 1.2 2014/07/11 22:28:51 bluhm Exp $
2
3# Copyright (c) 2010-2014 Alexander Bluhm <bluhm@openbsd.org>
4# Copyright (c) 2014 Florian Riehm <mail@friehm.de>
5#
6# Permission to use, copy, modify, and distribute this software for any
7# purpose with or without fee is hereby granted, provided that the above
8# copyright notice and this permission notice appear in all copies.
9#
10# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
18use strict;
19use warnings;
20
21package Default;
22use parent qw( Exporter );
23our @ISA = qw( Exporter );
24
25our @EXPORT = qw(
26    $area
27    $tun_number
28    $ospfd_ip
29    $ospfd_rtrid
30    %default_args
31);
32
33our $area = "10.188.0.0";
34our $tun_number = $ENV{TUNNUM};
35our $ospfd_ip = $ENV{TUNIP};
36our $ospfd_rtrid = $ENV{RTRID};
37
38my $hello_interval = 2;
39our %default_args = (
40    ospfd => {
41	configtest => 0,
42	conf => {
43	    global => {
44		'router-id' => $ospfd_rtrid,
45	    },
46	    areas => {
47		$area => {
48		    "tun$tun_number:$ospfd_ip" => {
49			'metric' => '15',
50			'hello-interval' => $hello_interval,
51			'router-dead-time' => 4 * $hello_interval,
52			'router-priority' => '15',
53		    },
54		},
55	    },
56	},
57    },
58    client => {
59	mac_address => "2:3:4:5:6:7",
60	ospf_address => "10.188.6.18",
61	router_id => "10.188.0.18",
62	area => $area,
63	hello_intervall => $hello_interval,
64	tun_number => $tun_number,
65	ospfd_ip => $ospfd_ip,
66	ospfd_rtrid => $ospfd_rtrid,
67    },
68);
69
701;
71