1 |
cb7d18d5
|
Renato Botelho
|
#!/usr/local/bin/php-cgi -f
|
2 |
5b237745
|
Scott Ullrich
|
<?php
|
3 |
|
|
/*
|
4 |
ac24dc24
|
Renato Botelho
|
* rc.banner
|
5 |
|
|
*
|
6 |
|
|
* part of pfSense
|
7 |
c5d81585
|
Renato Botelho
|
* Copyright (c) 2005 Colin Smith
|
8 |
81299b5c
|
Renato Botelho
|
* Copyright (c) 2005-2016 Rubicon Communications, LLC (Netgate)
|
9 |
ac24dc24
|
Renato Botelho
|
* All rights reserved
|
10 |
|
|
*
|
11 |
b12ea3fb
|
Renato Botelho
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
12 |
|
|
* you may not use this file except in compliance with the License.
|
13 |
|
|
* You may obtain a copy of the License at
|
14 |
ac24dc24
|
Renato Botelho
|
*
|
15 |
b12ea3fb
|
Renato Botelho
|
* http://www.apache.org/licenses/LICENSE-2.0
|
16 |
ac24dc24
|
Renato Botelho
|
*
|
17 |
b12ea3fb
|
Renato Botelho
|
* Unless required by applicable law or agreed to in writing, software
|
18 |
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
19 |
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
20 |
|
|
* See the License for the specific language governing permissions and
|
21 |
|
|
* limitations under the License.
|
22 |
ac24dc24
|
Renato Botelho
|
*/
|
23 |
7b9ae57a
|
Scott Ullrich
|
|
24 |
ac24dc24
|
Renato Botelho
|
/* parse the configuration and include all functions used below */
|
25 |
|
|
require_once("config.inc");
|
26 |
|
|
require_once("gwlb.inc");
|
27 |
|
|
require_once("interfaces.inc");
|
28 |
7b9ae57a
|
Scott Ullrich
|
|
29 |
ac24dc24
|
Renato Botelho
|
$hostname = $config['system']['hostname'];
|
30 |
|
|
$product = $g['product_name'];
|
31 |
|
|
$machine = trim(`uname -m`);
|
32 |
7b9ae57a
|
Scott Ullrich
|
|
33 |
3f4a0df9
|
Renato Botelho
|
print "*** Welcome to {$product} {$g['product_version_string']} ({$machine}) on {$hostname} ***\n";
|
34 |
0afcc955
|
Scott Ullrich
|
|
35 |
ac24dc24
|
Renato Botelho
|
$iflist = get_configured_interface_with_descr(false, true);
|
36 |
|
|
foreach ($iflist as $ifname => $friendly) {
|
37 |
|
|
/* point to this interface's config */
|
38 |
|
|
$ifconf = $config['interfaces'][$ifname];
|
39 |
|
|
/* look for 'special cases' */
|
40 |
|
|
switch ($ifconf['ipaddr']) {
|
41 |
|
|
case "dhcp":
|
42 |
|
|
$class = "/DHCP4";
|
43 |
|
|
break;
|
44 |
|
|
case "pppoe":
|
45 |
|
|
$class = "/PPPoE";
|
46 |
|
|
break;
|
47 |
|
|
case "pptp":
|
48 |
|
|
$class = "/PPTP";
|
49 |
|
|
break;
|
50 |
|
|
case "l2tp":
|
51 |
|
|
$class = "/L2TP";
|
52 |
|
|
break;
|
53 |
|
|
default:
|
54 |
|
|
$class = "";
|
55 |
|
|
break;
|
56 |
|
|
}
|
57 |
|
|
switch ($ifconf['ipaddrv6']) {
|
58 |
|
|
case "dhcp6":
|
59 |
|
|
$class6 = "/DHCP6";
|
60 |
|
|
break;
|
61 |
|
|
case "slaac":
|
62 |
|
|
$class6 = "/SLAAC";
|
63 |
|
|
break;
|
64 |
|
|
case "6rd":
|
65 |
|
|
$class6 = "/6RD";
|
66 |
|
|
break;
|
67 |
|
|
case "6to4":
|
68 |
|
|
$class6 = "/6to4";
|
69 |
|
|
break;
|
70 |
|
|
case "track6":
|
71 |
|
|
$class6 = "/t6";
|
72 |
|
|
break;
|
73 |
|
|
default:
|
74 |
|
|
$class6 = "";
|
75 |
|
|
break;
|
76 |
|
|
}
|
77 |
|
|
$ipaddr = get_interface_ip($ifname);
|
78 |
|
|
$subnet = get_interface_subnet($ifname);
|
79 |
|
|
$ipaddr6 = get_interface_ipv6($ifname);
|
80 |
|
|
$subnet6 = get_interface_subnetv6($ifname);
|
81 |
|
|
$realif = get_real_interface($ifname);
|
82 |
|
|
$tobanner = "{$friendly} ({$ifname})";
|
83 |
e7693c09
|
Ermal Lu?i
|
|
84 |
ac24dc24
|
Renato Botelho
|
printf("\n %-15s -> %-10s -> ",
|
85 |
|
|
$tobanner,
|
86 |
|
|
$realif
|
87 |
|
|
);
|
88 |
|
|
$v6first = false;
|
89 |
|
|
if (!empty($ipaddr) && !empty($subnet)) {
|
90 |
|
|
printf("v4%s: %s/%s",
|
91 |
|
|
$class,
|
92 |
|
|
$ipaddr,
|
93 |
|
|
$subnet
|
94 |
e7693c09
|
Ermal Lu?i
|
);
|
95 |
ac24dc24
|
Renato Botelho
|
} else {
|
96 |
|
|
$v6first = true;
|
97 |
|
|
}
|
98 |
|
|
if (!empty($ipaddr6) && !empty($subnet6)) {
|
99 |
|
|
if (!$v6first) {
|
100 |
|
|
printf("\n%s", str_repeat(" ", 34));
|
101 |
29e566a1
|
jim-p
|
}
|
102 |
ac24dc24
|
Renato Botelho
|
printf("v6%s: %s/%s",
|
103 |
|
|
$class6,
|
104 |
|
|
$ipaddr6,
|
105 |
|
|
$subnet6
|
106 |
|
|
);
|
107 |
a438eb98
|
Scott Ullrich
|
}
|
108 |
ac24dc24
|
Renato Botelho
|
}
|
109 |
|
|
printf("\n");
|
110 |
41dfef33
|
Seth Mos
|
?>
|