aboutsummaryrefslogtreecommitdiffstats
path: root/config/Fit123
diff options
context:
space:
mode:
Diffstat (limited to 'config/Fit123')
-rw-r--r--config/Fit123/bin/afc/reset_states.sh5
-rw-r--r--config/Fit123/bin/code-red/all.css1178
-rw-r--r--config/Fit123/bin/code-red/background.gifbin0 -> 112090 bytes
-rw-r--r--config/Fit123/bin/code-red/footer.pngbin0 -> 23360 bytes
-rw-r--r--config/Fit123/bin/code-red/header.pngbin0 -> 31124 bytes
-rw-r--r--config/Fit123/bin/date/index.abc275
-rwxr-xr-xconfig/Fit123/bin/dnssrv/system.abc347
-rw-r--r--config/Fit123/bin/ltsp/services.inc1316
-rw-r--r--config/Fit123/bin/ltsp/services_dhcp.abc642
-rw-r--r--config/Fit123/ddns.xml68
-rw-r--r--config/Fit123/fit123.inc298
-rw-r--r--config/Fit123/fit123.xml81
12 files changed, 4210 insertions, 0 deletions
diff --git a/config/Fit123/bin/afc/reset_states.sh b/config/Fit123/bin/afc/reset_states.sh
new file mode 100644
index 00000000..e0d0d48b
--- /dev/null
+++ b/config/Fit123/bin/afc/reset_states.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+sleep 60
+/sbin/pfctl -F state
+sleep 40
+/sbin/pfctl -F state
diff --git a/config/Fit123/bin/code-red/all.css b/config/Fit123/bin/code-red/all.css
new file mode 100644
index 00000000..e813ff4d
--- /dev/null
+++ b/config/Fit123/bin/code-red/all.css
@@ -0,0 +1,1178 @@
+/* Element CSS Definitions */
+html, body, td, th, input, select {
+ font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ font-size: 0.9em;
+
+}
+
+div.GraphLink {
+ position: relative;
+}
+
+span.GraphLinkLine {
+ position: absolute;
+ background-color: #990000;
+ width: 100%;
+}
+
+/* DOM Tooltip CSS definitions */
+div.niceTitle
+{
+ background-color: #333333;
+ color: #FFFFFF;
+ font-weight: bold;
+ font-size: 13px;
+ font-family: "Trebuchet MS", sans-serif;
+ width: 220px;
+ left: 0;
+ top: 0;
+ padding: 4px;
+ position: absolute;
+ text-align: left;
+ z-index: 20;
+ -moz-border-radius: 0 10px 10px 10px;
+ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=87);
+ -moz-opacity: .87;
+ -khtml-opacity: .87;
+ opacity: .87;
+}
+div.niceTitle h1
+{
+ background: #990000;
+ border-bottom: 1px dotted #FFFFFF;
+ font-weight: bold;
+ font-size: 13px;
+ font-family: "Trebuchet MS", sans-serif;
+ margin: 3px;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ padding-left: 3px;
+ text-align: left;
+ left: 0;
+ top: 0;
+ -moz-border-radius: 0 8px 0 0;
+ -moz-opacity: 1;
+}
+div.niceTitle .contents
+{
+ margin: 0;
+ padding: 0 3px;
+ filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);
+ -moz-opacity: 1;
+ -khtml-opacity: 1;
+ opacity: 1;
+}
+div.niceTitle p
+{
+ background: #FFFFFF;
+ border: 1px solid #990000;
+ color: #000000;
+ font-size: 11px;
+ font-family: "Trebuchet MS", sans-serif;
+ padding: 5px;
+ margin: 3px;
+ text-align: left;
+ -moz-opacity: 1;
+ -moz-border-radius: 0 0 8px 8px;
+}
+
+body {
+ margin: 0px auto;
+ background: url('images/background.gif') no-repeat;
+ background-position : center 0px;
+ background-color: #4a0203;
+}
+
+form {
+ margin: 0px;
+}
+a {
+ text-decoration: none;
+}
+form input {
+ font-size: 1.1em;
+}
+
+iframe {
+ z-index: 1;
+ border: 1px dashed #990000;
+}
+.iframe {
+ background-color: #FFFFFF;
+}
+
+/* ID Based CSS Definitions */
+#wrapper {
+ width: 810px;
+ margin: 0px auto;
+}
+
+#header {
+ background: url('images/header.png') no-repeat;
+ background-position: 0px;
+ height: 102px;
+ width: 810px;
+ margin-bottom: 5px;
+ z-index: 2;
+}
+#header-left {
+ position: relative;
+ /* background: url('images/logo.gif') no-repeat; */
+ background-position: center;
+ height: 65px;
+ width: 145px;
+ left: 10px;
+ float: left;
+}
+#header-left #status-link {
+ position: relative;
+ top: 10px;
+ left: 6px;
+}
+#header-right {
+ position: relative;
+ /* background: url('images/header.gif') no-repeat; */
+ height: 70px;
+ color: #fff;
+ left: 0px;
+ margin-left: 165px;
+}
+#header-right .alert {
+ position: relative;
+ /* background: url('images/alert.gif') no-repeat; */
+ background-position: 4px 2px;
+ color: #fff;
+ height: 17px;
+ width: 500px;
+ padding: 4px;
+ padding-left: 27px;
+ float: left;
+}
+#header-right .container {
+ position: relative;
+}
+#header-right .container .left {
+ position: relative;
+ float: left;
+ font-size: 1.3em;
+ font-weight: bold;
+ top: 15px;
+ left: 4px;
+ display: none;
+}
+#header-right .container .right {
+ position: relative;
+ float: right;
+ top: 22px;
+ padding-right: 4px;
+ z-index: 1;
+}
+
+#header-right .container .right #alerts {
+ position: relative;
+ background: url('images/alert_bgr.png') no-repeat;
+ height: 39px;
+ width: 431px;
+ z-index: 1;
+ padding-top: 20px;
+ padding-left: 5px;
+ margin: 0px;
+}
+#header-right .container .right #hostname {
+ position: relative;
+ height: 39px;
+ width: 431px;
+ z-index: 1;
+ padding-left: 5px;
+ margin: 0px;
+ top: 25px;
+ left: 230px;
+ font-size: 14px;
+ color: #990000;
+ font-weight: bold;
+}
+
+
+
+table#marquee {
+ position: relative;
+ top: -6px;
+ left: -5px;
+ border: 0;
+ padding: 0;
+ margin: 0;
+ width: 424px;
+ background-color: transparent;
+ padding: 2px;
+ border: 0px;
+}
+span#marquee-container {
+ position: absolute;
+ visibility: hidden;
+ top: -100px;
+ left: -10000px;
+}
+div#marquee-text {
+ font-size: 1.18em;
+ font-weight: normal;
+ font-family: Verdana;
+ color: #ffffff;
+}
+table#marquee div#container {
+ position: relative;
+ overflow: hidden;
+ width: 418px;
+ height: 20px;
+}
+table#marquee div#container div#scroller {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+}
+
+
+
+
+
+#content {
+ position: relative;
+ top: -5px;
+ left: 0px;
+ margin-top: 0px;
+ margin-left: 0px;
+ padding-top: 0px;
+ width: 810px;
+ background-color: #ffffff;
+}
+
+#left {
+ width: 810px;
+ height: 1px;
+}
+#right {
+ position: relative;
+ top: -10px;
+ width: 770px;
+ margin-top: 0px;
+ margin-left: 5px;
+ margin-right: 5px;
+ padding-top: 5px;
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-bottom: 20px;
+ min-height: 400px;
+}
+
+#footer {
+ position: relative;
+ background: url('images/footer.png') no-repeat;
+ top: -18px;
+ left: 0px;
+ width: 810px;
+ height: 75px;
+ color: #999999;
+ text-align: center;;
+ font-size: 0.9em;
+ padding-top: 17px;
+ margin-bottom: 20px;
+ clear: both;
+}
+#footer p {
+ padding: 0px;
+ margin: 0px;
+}
+
+/* Style the List */
+#navigation {
+ /* background: url('images/menu.gif') no-repeat; */
+ /* width: 693px; */
+ position: relative;
+ top: -35px;
+ left: 3px;
+ width: 810px;
+ padding: 0px;
+ height: 28px;
+ z-index: 3;
+}
+#navigation ul {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+ text-align: center;
+}
+#navigation ul#menu {
+ padding-top: 3px;
+ padding-left: 5px;
+}
+
+/* Style the List Elements */
+#navigation ul li {
+ float: left;
+ position: relative;
+ /* width: 7.5em; */
+ width: 8.77em;
+}
+#navigation ul li div {
+ font-size: 1em;
+ font-weight: bold;
+}
+/* Make the List inside the List Elements */
+/* initially hidden with absolute position */
+#navigation ul li ul {
+ display: none;
+ position: absolute;
+ top: 2em;
+ left: -2px;
+ width: 9em;
+ font-weight: normal;
+ background: transparent bottom left no-repeat; /* This is key to making the menu maintain visibility when not on a link */
+ /* background-color: #202020;
+ background: url("images/menu_footer.gif") no-repeat;
+ background-position: bottom;
+ */
+ padding: 0em 0 0.4em 0;
+ padding-top: 0.3em;
+}
+/* to override top and left in browsers other than IE */
+/* which will position to the top right of the containing */
+/* li, rather than bottom left */
+#navigation ul li > ul {
+ top: auto;
+ left: auto;
+ left: -1px !important;
+}
+/* Show initial drop down upon mouse over, but do not show */
+/* nested side drop menus within listed elements */
+#navigation ul li:hover ul {
+ display: block;
+ cursor: pointer;
+}
+#navigation ul li:hover {
+ cursor: pointer;
+ cursor: pointer;
+}
+#navigation ul li:hover div {
+ text-decoration: none;
+}
+
+#navigation ul li {
+ background-color: transparent;
+ color: #FFF;
+}
+#navigation ul li ul li {
+ border: 1px solid #990000;
+ width: 8.8em;
+ height: 1.6em;
+ line-height: 1.6em;
+ background-color: #990000;
+ color: #FFF;
+}
+#navigation ul li ul li:hover {
+ background-color: #666666;
+}
+
+#navigation li li a {
+ display: block;
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+#navigation ul li ul li a.navlnk:hover {
+ text-decoration: none;
+}
+#navigation ul li.first {
+ border-right: 0px;
+}
+#navigation ul li.middle {
+ border-right: 0px;
+}
+#navigation ul li.last {
+
+}
+
+#navigation ul li.dropfirst {
+ border-bottom: 0px;
+}
+#navigation ul li.dropmiddle {
+ border-bottom: 0px;
+}
+#navigation ul li.droplast {
+}
+
+#wzdtabcont {
+ float: left;
+ background-color: #FFFFFF;
+ color: #000000;
+ padding: 0;
+}
+
+ul#wzdnav {
+ font-size: 0.96em;
+ float: left;
+ width: 14.5em;
+ margin: 0;
+ padding-left: 18px;
+}
+
+ul#wzdnav li {
+ list-style: none;
+ margin: 0;
+ padding-bottom: 0.2em;
+ padding-left: 0;
+}
+
+ul#wzdnav a {
+ display: block;
+ padding: 0.3em;
+ font-weight: normal;
+}
+
+#wzdnavbold a {
+ display: block;
+ padding: 0.3em;
+ font-weight: bold ! important;
+}
+
+ul#wzdnav a:link {
+ color: black;
+ background-color: #eee;
+}
+
+ul#wzdnav a:visited {
+ color: #666;
+ background-color: #eee;
+}
+
+ul#wzdnav a:hover {
+ color: black;
+ background-color: white;
+}
+
+ul#wzdnav a:active {
+ color: white;
+ background-color: gray;
+}
+
+#graph {
+ position: relative;
+ z-index: 10;
+}
+
+#logoutbtn {
+ position: absolute;
+ left: 95%;
+ vertical-align: middle;
+}
+
+
+#graph {
+ position: relative;
+ z-index: 10;
+}
+
+
+
+/* Class Based CSS Definitions */
+.pgtitle {
+ font-size: 18px;
+ color: #777777;
+ font-weight: bold;
+}
+.tfrtitle {
+ font-size: 18px;
+ color: #ffffff;
+ font-weight: bold;
+}
+.vncell {
+ background-color: #DDDDDD;
+ padding-right: 20px;
+ padding-left: 8px;
+ border-bottom: 1px solid #999999;
+}
+.formfld {
+ font-size: small;
+}
+.formselect {
+ font-size: 1.0em;
+}
+.langopt {
+ padding-left: 34px;
+ padding-top: 2px;
+ padding-bottom: 2px;
+}
+.saved {
+ /* background: url('/themes/nione/images/icons/icon_wzd_saved.png') no-repeat 0 1px #FFFFFF; */
+ list-style-image: url('/themes/nervecenter/images/icons/icon_wzd_saved.png') ! important;
+}
+.notsaved {
+ /* background: url('/themes/nione/images/icons/icon_wzd_nsaved.png') no-repeat 0 1px #FFFFFF; */
+ list-style-image: url('/themes/nervecenter/images/icons/icon_wzd_nsaved.png') ! important;
+}
+.en {
+ background: url('/themes/nervecenter/images/icons/icon_flag_en.png') no-repeat 0 1px #FFFFFF;
+}
+.de {
+ background: url('/themes/nervecenter/images/icons/icon_flag_de.png') no-repeat 0 1px #FFFFFF;
+}
+.es {
+ background: url('/themes/nervecenter/images/icons/icon_flag_es.png') no-repeat 0 1px #FFFFFF;
+}
+.pt_BR {
+ background: url('/themes/nervecenter/images/icons/icon_flag_pt_BR.png') no-repeat 0 1px #FFFFFF;
+}
+.host {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_host.png') no-repeat 0 1px #FFFFFF;
+}
+.search {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_search.png') no-repeat 0 1px #FFFFFF;
+}
+.file {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_file.png') no-repeat 0 1px #FFFFFF;
+}
+.mail {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_mail.png') no-repeat 0 1px #FFFFFF;
+}
+.imp {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_imp.png') no-repeat 0 1px #FFFFFF;
+}
+.pwd {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_pwd.png') no-repeat 0 1px #FFFFFF;
+}
+.user {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_user.png') no-repeat 0 1px #FFFFFF ;
+}
+.group {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_group.png') no-repeat 0 1px #FFFFFF;
+}
+.url {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_url.png') no-repeat 0 1px #FFFFFF;
+}
+.time {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_time.png') no-repeat 0 1px #FFFFFF;
+}
+.unknown {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_unknown.png') no-repeat 0 1px #FFFFFF;
+}
+.formfld_cert {
+ background: url('/themes/nervecenter/images/icons/icon_frmfld_cert.png') no-repeat 0 1px #FFFFFF;
+ padding-left: 28px;
+ font-family: Courier New, Courier, monospaced;
+ font-size: 11px;
+}
+.formfldalias {
+ background-color: #990000;
+ color: #FFFFFF;
+}
+.formpre {
+ font-family: Courier New, Courier, monospaced;
+ font-size: 10px;
+}
+.formbtn {
+ font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ font-size: 13px;
+ font-weight: bold;
+}
+.formbtns {
+ font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ font-weight: bold;
+}
+.vvcell {
+ background-color: #FFFFC6;
+}
+.errmsg {
+ font-weight: bold;
+ color: #CC0000;
+}
+.red {
+ color: #CC0000;
+}
+.gray {
+ color: #A0A0A0;
+}
+.vexpl {
+ font-size: 11px;
+}
+.navlnk {
+ color: #FFFFFF;
+ text-decoration: none;
+ font-size: 13px;
+}
+.navlnks {
+ color: #FFFFFF;
+ text-decoration: none;
+ font-size: 11px;
+}
+.redlnk {
+ color: #990000;
+ text-decoration: none;
+}
+.tblnk {
+ color: #999999;
+ text-decoration: none;
+}
+.vncellreq {
+ background-color: #DDDDDD;
+ padding-right: 20px;
+ padding-left: 8px;
+ font-weight: bold;
+ border-bottom: 1px solid #999999;
+}
+.vncellt {
+ background-color: #DDDDDD;
+ padding-right: 20px;
+ padding-left: 8px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+ font-weight: bold;
+ border-bottom: 1px solid #999999;
+}
+.vtable {
+ border-bottom: 1px solid #999999;
+}
+.vnsepcell {
+ background-color: #BBBBBB;
+ padding-right: 20px;
+ padding-left: 8px;
+ font-weight: bold;
+ border-bottom: 1px solid #999999;
+ font-size: 11px;
+}
+.cpline {
+ font-size: 11px;
+ color: #FFFFFF;
+}
+.hostname {
+ font-size: 11px;
+ color: #990000;
+ font-weight: bold;
+}
+.vnsepcellr {
+ background-color: #BBBBBB;
+ padding-right: 20px;
+ padding-left: 8px;
+ font-weight: bold;
+ border-right: 1px solid #999999;
+ border-bottom: 1px solid #999999;
+ font-size: 11px;
+}
+.listr {
+ background-color: #FFFFFF;
+ border-right: 1px solid #999999;
+ border-bottom: 1px solid #999999;
+ font-size: 11px;
+ padding-right: 6px;
+ padding-left: 6px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+.listrpad {
+ border-right: 1px solid #999999;
+ border-bottom: 1px solid #999999;
+ font-size: 11px;
+ padding-right: 16px;
+ padding-left: 10px;
+ padding-top: 8px;
+ padding-bottom: 8px;
+}
+.listn {
+ font-size: 11px;
+ padding-right: 16px;
+ padding-left: 6px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+.listbg {
+ border-right: 1px solid #999999;
+ border-bottom: 1px solid #999999;
+ font-size: 11px;
+ background-color: #990000;
+ color: #FFFFFF;
+ padding-right: 16px;
+ padding-left: 6px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+.listbggrey {
+ border-right: 1px solid #999999;
+ border-bottom: 1px solid #999999;
+ font-size: 11px;
+ background-color: #999999;
+ padding-right: 16px;
+ padding-left: 6px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+.listhdr {
+ background-color: #BBBBBB;
+ padding-right: 16px;
+ padding-left: 6px;
+ font-weight: bold;
+ border-bottom: 1px solid #999999;
+ font-size: 11px;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+.listhdr a {
+ color: #000000;
+}
+.listhdrr {
+ background-color: #BBBBBB;
+ padding-right: 16px;
+ padding-left: 6px;
+ font-weight: bold;
+ border-right: 1px solid #999999;
+ border-bottom: 1px solid #999999;
+ font-size: 11px;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+.listhdrr a {
+ color: #000000;
+}
+.listlr {
+ background-color: #FFFFFF;
+ border-right: 1px solid #999999;
+ border-bottom: 1px solid #999999;
+ border-left: 1px solid #999999;
+ font-size: 11px;
+ padding-right: 6px;
+ padding-left: 6px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+.listlrns {
+ background-color: #FFFFFF;
+ border-right: 1px solid #999999;
+ border-bottom: 1px solid #999999;
+ border-left: 1px solid #999999;
+ font-size: 11px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+.list {
+ font-size: 11px;
+ padding-left: 6px;
+ padding-top: 2px;
+ padding-bottom: 2px;
+}
+.listt {
+ font-size: 11px;
+ padding-top: 5px;
+}
+.listhdrrns {
+ background-color: #BBBBBB;
+ padding-left: 6px;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ padding-right: 6px;
+ font-weight: bold;
+ border-right: 1px solid #999999;
+ border-bottom: 1px solid #999999;
+ font-size: 11px;
+}
+.listbgns {
+ border-right: 1px solid #999999;
+ border-bottom: 1px solid #999999;
+ font-size: 11px;
+ background-color: #D9DEE8;
+ padding-left: 6px;
+ padding-right: 4px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+.listtopic {
+ border-right: 1px solid #999999;
+ font-size: 11px;
+ background-color: #990000;
+ padding-right: 16px;
+ padding-left: 6px;
+ color: #FFFFFF;
+ font-weight: bold;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+.optsect_t {
+ border-right: 1px solid #999999;
+ background-color: #990000;
+ padding-right: 6px;
+ padding-left: 6px;
+ padding-top: 2px;
+ padding-bottom: 2px;
+}
+.optsect_s {
+ font-size: 11px;
+ color: #FFFFFF;
+ font-weight: bold;
+}
+.tabnavtbl {
+}
+
+
+/* MISC CSS Definitions */
+ul#tabnav {
+ font-size: 11px;
+ font-weight: bold;
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+}
+ul#tabnav li.tabinact1 {
+ float: left;
+ background-color: #777777;
+ color: #FFFFFF;
+ padding: 0;
+ white-space: nowrap;
+}
+ul#tabnav li.tabinact {
+ float: left;
+ border-left: 1px solid #999999;
+ background-color: #777777;
+ color: #FFFFFF;
+ padding: 0;
+ white-space: nowrap;
+}
+ul#tabnav li.tabinact a {
+ float: left;
+ display: block;
+ text-decoration: none;
+ padding: 5px 8px 5px 8px;
+ color: #FFFFFF;
+}
+ul#tabnav li.tabinact1 a {
+ float: left;
+ display: block;
+ text-decoration: none;
+ padding: 5px 8px 5px 8px;
+ color: #FFFFFF;
+}
+ul#tabnav li.tabact {
+ float: left;
+ background-color: #EEEEEE;
+ color: #000000;
+ padding: 5px 8px 5px 8px;
+ white-space: nowrap;
+}
+.tabcont {
+ background-color: #EEEEEE;
+ padding-right: 12px;
+ padding-left: 12px;
+ padding-top: 12px;
+ padding-bottom: 12px;
+}
+.tabact {
+ float: left;
+ background-color: #EEEEEE;
+ color: #000000;
+ padding: 5px 8px 5px 8px;
+ white-space: nowrap;
+}
+.tabinact {
+ font-weight: bold;
+ float: left;
+ border-left: 1px solid #999999;
+ background-color: #777777;
+ color: #FFFFFF;
+ padding: 0;
+ white-space: nowrap;
+}
+.menu {
+ background-color: #000000;
+ white-space: nowrap;
+ padding: 0px 5px 0px 5px;
+ width: 100%;
+ vertical-align: top;
+}
+
+
+/* Auto Complete Suggestions */
+div.suggestions {
+ -moz-box-sizing: border-box;
+ /* box-sizing: border-box; */
+ border: 1px solid black;
+ position: absolute;
+ background-color: #990000;
+ color: #FFF;
+}
+
+div.suggestions div {
+ cursor: default;
+ padding: 0px 3px;
+ background-color: #990000;
+ color: #FFF;
+}
+
+div.suggestions div.current {
+ background-color: #3366cc;
+ color: #FFF;
+}
+/* End Auto Complete Suggestions */
+
+
+/* Nifty Corners Crap */
+.rtop,.artop{display:block}
+.rtop *,.artop *{display:block;height:1px;overflow:hidden;font-size:1px}
+.artop *{border-style: solid;border-width:0 1px}
+.r1,.rl1,.re1,.rel1{margin-left:5px}
+.r1,.rr1,.re1,.rer1{margin-right:5px}
+.r2,.rl2,.re2,.rel2,.ra1,.ral1{margin-left:3px}
+.r2,.rr2,.re2,.rer2,.ra1,.rar1{margin-right:3px}
+.r3,.rl3,.re3,.rel3,.ra2,.ral2,.rs1,.rsl1,.res1,.resl1{margin-left:2px}
+.r3,.rr3,.re3,.rer3,.ra2,.rar2,.rs1,.rsr1,.res1,.resr1{margin-right:2px}
+.r4,.rl4,.rs2,.rsl2,.re4,.rel4,.ra3,.ral3,.ras1,.rasl1,.res2,.resl2{margin-left:1px}
+.r4,.rr4,.rs2,.rsr2,.re4,.rer4,.ra3,.rar3,.ras1,.rasr1,.res2,.resr2{margin-right:1px}
+.rx1,.rxl1{border-left-width:5px}
+.rx1,.rxr1{border-right-width:5px}
+.rx2,.rxl2{border-left-width:3px}
+.rx2,.rxr2{border-right-width:3px}
+.re2,.rel2,.ra1,.ral1,.rx3,.rxl3,.rxs1,.rxsl1{border-left-width:2px}
+.re2,.rer2,.ra1,.rar1,.rx3,.rxr3,.rxs1,.rxsr1{border-right-width:2px}
+.rxl1,.rxl2,.rxl3,.rxl4,.rxsl1,.rxsl2,.ral1,.ral2,.ral3,.ral4,.rasl1,.rasl2{border-right-width:0}
+.rxr1,.rxr2,.rxr3,.rxr4,.rxsr1,.rxsr2,.rar1,.rar2,.rar3,.rar4,.rasr1,.rasr2{border-left-width:0}
+.r4,.rl4,.rr4,.re4,.rel4,.rer4,.ra4,.rar4,.ral4,.rx4,.rxl4,.rxr4{height:2px}
+.rer1,.rel1,.re1,.res1,.resl1,.resr1{border-width:1px 0 0;height:0px !important;height /**/:1px}
+/* End Nifty Corners Crap */
+
+/* Widget CSS */
+.widgetsubheader {
+ border-right: 1px solid #999999;
+ font-size: 11px;
+ background-color: #999999;
+ padding-right: 6px;
+ padding-left: 6px;
+ color: #FFFFFF;
+ font-weight: bold;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+.widgetheader {
+ border-right: 1px solid #999999;
+ font-size: 11px;
+ background-color: #990000;
+ padding-right: 6px;
+ padding-left: 6px;
+ color: #FFFFFF;
+ font-weight: bold;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+.widgetdiv{
+ margin:5px;
+ padding: 5px;
+ background:#CCCCCC;
+}
+
+/* CSS for Dynamic Log Viewer */
+/* Author: Erik Kristensen */
+div#log div.log-entry {
+ clear: both;
+}
+
+div#log div.log-entry span,
+div#log div.log-header span {
+ padding: 3px 2px 3px 2px;
+ padding-left: 8px;
+}
+
+div#log div.log-entry span.log-action {
+ padding-bottom: 6px;
+ padding-left: 5px;
+ padding-right: 5px;
+}
+
+div#log div.log-header span {
+ border-top: 1px solid #999;
+ background-color: #bbb;
+ font-weight: bold;
+ text-align: left;
+}
+
+div#log span.log-action,
+div#log span.log-time,
+div#log span.log-interface,
+div#log span.log-source,
+div#log span.log-destination,
+div#log span.log-protocol {
+ float: left;
+ text-align: left;
+ border-left: 1px solid #999;
+ border-bottom: 1px solid #999;
+}
+
+div#log span.log-general {
+
+}
+
+div#log span.log-protocol {
+ border-right: 1px solid #999;
+}
+
+div#log span.log-action {
+ width: 2em;
+ text-align: center;
+}
+
+div#log span.log-time {
+ width: 12.5em;
+}
+
+div#log span.log-interface {
+ width: 5em;
+}
+
+div#log span.log-source,
+div#log span.log-destination {
+ width: 17.6em;
+}
+
+div#log span.log-protocol {
+ width: 5.5em;
+}
+/* END CSS FOR DYNAMIC LOG VIEWER */
+
+#login {
+ background: #cccccc;
+ border: 0px solid #666666;
+ margin: 5em auto;
+ padding: 0em;
+ width: 340px;
+}
+
+#login h1 {
+ background: url(images/misc/logon.png) no-repeat top left;
+ margin-top: 0;
+ display: block;
+ text-indent: -1000px;
+ height: 50px;
+ border-bottom: none;
+}
+
+#login p {
+ font-size: 1em;
+ font-weight: bold;
+ padding: 3px;
+ margin: 0em;
+ text-indent: 10px;
+}
+
+#login span {
+ font-size: 1em;
+ font-weight: bold;
+ width: 20%;
+ padding: 3px;
+ margin: 0em;
+ text-indent: 10px;
+}
+
+#login p#text {
+ font-size: 1em;
+ font-weight: normal;
+ padding: 3px;
+ margin: 0em;
+ text-indent: 10px;
+}
+
+#login #submit {
+ font-size: 1em;
+ font-weight: bold;
+ padding: 3px;
+ margin: 0em;
+ text-indent: 10px;
+}
+
+/* Widget CSS */
+.widgetsubheader {
+ border-right: 1px solid #999999;
+ font-size: 11px;
+ background-color: #B1B1B1;
+ padding-right: 6px;
+ padding-left: 6px;
+ color: #000000;
+ font-weight: bold;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+.widgetheader {
+ border-right: 1px solid #999999;
+ font-size: 11px;
+ background-color: #990000;
+ padding-right: 6px;
+ padding-left: 6px;
+ color: #FFFFFF;
+ font-weight: bold;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+.widgetdiv{
+ margin:5px;
+ padding: 5px;
+ background:#CCCCCC;
+}
+.widgetconfigdiv{
+ background:#BBBBBB;
+ font-size: 11px;
+ color: #000000;
+ padding-right: 5px;
+ padding-left: 5px;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+div#log div.log-entry-mini {
+ clear: both;
+}
+
+div#log div.log-entry-mini span {
+ padding: 2px 2px 2px 2px;
+ padding-left: 8px;
+}
+
+div#log span.log-action-mini-header,
+div#log span.log-interface-mini-header,
+div#log span.log-source-mini-header,
+div#log span.log-destination-mini-header,
+div#log span.log-protocol-mini-header {
+ float: left;
+ text-align: left;
+ background-color: #FFFFFF;
+ font-size: 12px;
+ border-left: 1px solid #999;
+ border-bottom: 1px solid #999;
+}
+
+div#log span.log-action-mini,
+div#log span.log-time-mini,
+div#log span.log-interface-mini,
+div#log span.log-source-mini,
+div#log span.log-destination-mini,
+div#log span.log-protocol-mini {
+ float: left;
+ text-align: left;
+ background-color: #FFFFFF;
+ font-size: 11px;
+ border-left: 1px solid #999;
+ border-bottom: 1px solid #999;
+}
+
+div#log span.log-action-mini,
+div#log span.log-action-mini-header {
+ width: 6%;
+}
+
+div#log span.log-interface-mini,
+div#log span.log-interface-mini-header {
+ width: 8%;
+}
+
+div#log span.log-source-mini,
+div#log span.log-destination-mini,
+div#log span.log-source-mini-header,
+div#log span.log-destination-mini-header {
+ width: 31%;
+}
+
+div#log span.log-protocol-mini,
+div#log span.log-protocol-mini-header {
+ width: 8%;
+ border-right: 1px solid #999;
+}
diff --git a/config/Fit123/bin/code-red/background.gif b/config/Fit123/bin/code-red/background.gif
new file mode 100644
index 00000000..3f0dc770
--- /dev/null
+++ b/config/Fit123/bin/code-red/background.gif
Binary files differ
diff --git a/config/Fit123/bin/code-red/footer.png b/config/Fit123/bin/code-red/footer.png
new file mode 100644
index 00000000..b668a615
--- /dev/null
+++ b/config/Fit123/bin/code-red/footer.png
Binary files differ
diff --git a/config/Fit123/bin/code-red/header.png b/config/Fit123/bin/code-red/header.png
new file mode 100644
index 00000000..06921877
--- /dev/null
+++ b/config/Fit123/bin/code-red/header.png
Binary files differ
diff --git a/config/Fit123/bin/date/index.abc b/config/Fit123/bin/date/index.abc
new file mode 100644
index 00000000..73a81fa1
--- /dev/null
+++ b/config/Fit123/bin/date/index.abc
@@ -0,0 +1,275 @@
+<?php
+/* $Id$ */
+/*
+ index.php
+ Copyright (C) 2004, 2005 Scott Ullrich
+ All rights reserved.
+
+ Originally part of m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ oR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+ ## Load Essential Includes
+ require_once('guiconfig.inc');
+ require_once('notices.inc');
+
+
+ ## Load Functions Files
+ require_once('includes/functions.inc.php');
+
+
+ ## Load AJAX, Initiate Class ###############################################
+ require_once('includes/sajax.class.php');
+
+ ## Initiate Class and Set location of ajax file containing
+ ## the information that we need for this page. Also set functions
+ ## that SAJAX will be using.
+ $oSajax = new sajax();
+ $oSajax->sajax_remote_uri = 'sajax/index.sajax.php';
+ $oSajax->sajax_request_type = 'POST';
+ $oSajax->sajax_export("get_stats");
+ $oSajax->sajax_handle_client_request();
+ ############################################################################
+
+
+ ## Check to see if we have a swap space,
+ ## if true, display, if false, hide it ...
+ if(file_exists("/usr/sbin/swapinfo")) {
+ $swapinfo = `/usr/sbin/swapinfo`;
+ if(stristr($swapinfo,'%') == true) $showswap=true;
+ }
+
+
+ ## User recently restored his config.
+ ## If packages are installed lets resync
+ if(file_exists('/conf/needs_package_sync')) {
+ if($config['installedpackages'] <> '') {
+ conf_mount_rw();
+ unlink('/conf/needs_package_sync');
+ header('Location: pkg_mgr_install.php?mode=reinstallall');
+ exit;
+ }
+ }
+
+
+ ## If it is the first time webGUI has been
+ ## accessed since initial install show this stuff.
+ if(file_exists('/conf/trigger_initial_wizard')) {
+
+ echo <<<EOF
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <title>{$g['product_name']}.local - {$g['product_name']} first time setup</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" type="text/css" href="/niftycssprintCode.css" media="print" />
+ <script type="text/javascript">var theme = "nervecenter"</script>
+ <script type="text/javascript" src="/themes/nervecenter/loader.js"></script>
+
+EOF;
+ echo "<body link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">\n";
+
+ if(file_exists("/usr/local/www/themes/{$g['theme']}/wizard.css"))
+ echo "<link rel=\"stylesheet\" href=\"/themes/{$g['theme']}/wizard.css\" media=\"all\" />\n";
+ else
+ echo "<link rel=\"stylesheet\" href=\"/themes/{$g['theme']}/all.css\" media=\"all\" />";
+
+ echo "<form>\n";
+ echo "<center>\n";
+ echo "<img src=\"/themes/{$g['theme']}/images/logo.gif\" border=\"0\"><p>\n";
+ echo "<div \" style=\"width:700px;background-color:#ffffff\" id=\"nifty\">\n";
+ echo "Welcome to {$g['product_name']}!<p>\n";
+ echo "One moment while we start the initial setup wizard.<p>\n";
+ echo "Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal GUI.<p>\n";
+ echo "To bypass the wizard, click on the {$g['product_name']} logo on the initial page.\n";
+ echo "</div>\n";
+ echo "<meta http-equiv=\"refresh\" content=\"1;url=wizard.php?xml=setup_wizard.xml\">\n";
+ echo "<script type=\"text/javascript\">\n";
+ echo "NiftyCheck();\n";
+ echo "Rounded(\"div#nifty\",\"all\",\"#AAA\",\"#FFFFFF\",\"smooth\");\n";
+ echo "</script>\n";
+ exit;
+ }
+
+
+ ## Find out whether there's hardware encryption or not
+ unset($hwcrypto);
+ $fd = @fopen("{$g['varlog_path']}/dmesg.boot", "r");
+ if ($fd) {
+ while (!feof($fd)) {
+ $dmesgl = fgets($fd);
+ if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches)) {
+ $hwcrypto = $matches[1];
+ break;
+ }
+ }
+ fclose($fd);
+ }
+
+
+ ## Set Page Title and Include Header
+ $pgtitle = "{$g['product_name']} webGUI";
+ include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<script language="javascript">
+var ajaxStarted = false;
+</script>
+<?php
+include("fbegin.inc");
+ if(!file_exists("/usr/local/www/themes/{$g['theme']}/no_big_logo"))
+ echo "<center><img src=\"./themes/".$g['theme']."/images/logobig.jpg\"></center><br>";
+?>
+<?
+exec("/bin/date", $dateOutput, $dateStatus);
+$currentDate = $dateOutput[0];
+?>
+<p class="pgtitle">System Overview</p>
+
+<div id="niftyOutter">
+<form action="index.php" method="post">
+<table bgcolor="#990000" width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr>
+ <td colspan="2" class="listtopic">System information</td>
+ </tr>
+ <tr>
+ <td width="25%" class="vncellt">Name</td>
+ <td width="75%" class="listr"><?php echo $config['system']['hostname'] . "." . $config['system']['domain']; ?></td>
+ </tr>
+ <tr>
+ <td width="25%" valign="top" class="vncellt">Version</td>
+ <td width="75%" class="listr">
+ <strong><?php readfile("/etc/version"); ?></strong>
+ <br />
+ built on <?php readfile("/etc/version.buildtime"); ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="25%" class="vncellt">Platform / Current Date </td>
+ <td width="75%" class="listr"><?=htmlspecialchars($g['platform']);?> / <?=$currentDate;?></td>
+ </tr>
+ <?php if ($hwcrypto): ?>
+ <tr>
+ <td width="25%" class="vncellt">Hardware crypto</td>
+ <td width="75%" class="listr"><?=htmlspecialchars($hwcrypto);?></td>
+ </tr>
+ <?php endif; ?>
+ <tr>
+ <td width="25%" class="vncellt">Uptime</td>
+ <td width="75%" class="listr"><input style="border: 0px solid white;" size="30" name="uptime" id="uptime" value="<?= htmlspecialchars(get_uptime()); ?>" /></td>
+ </tr>
+ <?php if ($config['lastchange']): ?>
+ <tr>
+ <td width="25%" class="vncellt">Last config change</td>
+ <td width="75%" class="listr"><?= htmlspecialchars(date("D M j G:i:s T Y", $config['revision']['time']));?></td>
+ </tr>
+ <?php endif; ?>
+ <tr>
+ <td width="25%" class="vncellt">State table size</td>
+ <td width="75%" class="listr">
+ <input style="border: 0px solid white;" size="30" name="pfstate" id="pfstate" value="<?= htmlspecialchars(get_pfstate()); ?>" />
+ <br />
+ <a href="diag_dump_states.php">Show states</a>
+ </td>
+ </tr>
+ <tr>
+ <td width="25%" class="vncellt">MBUF Usage</td>
+ <td width="75%" class="listr">
+ <?php
+ $mbufs_inuse=`netstat -mb | grep "mbufs in use" | awk '{ print $1 }' | cut -d"/" -f1`;
+ $mbufs_total=`netstat -mb | grep "mbufs in use" | awk '{ print $1 }' | cut -d"/" -f3`;
+ ?>
+ <?=$mbufs_inuse?>/<?=$mbufs_total?>
+ </td>
+ </tr>
+ <tr>
+ <td width="25%" class="vncellt">CPU usage</td>
+ <td width="75%" class="listr">
+ <?php $cpuUsage = "0"; ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" name="cpuwidtha" id="cpuwidtha" width="<?= $cpuUsage; ?>" border="0" align="middle" alt="red bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" name="cpuwidthb" id="cpuwidthb" width="<?= (100 - $cpuUsage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
+ &nbsp;
+ <input style="border: 0px solid white;" size="30" name="cpumeter" id="cpumeter" value="(Updating in 5 seconds)" />
+ </td>
+ </tr>
+ <tr>
+ <td width="25%" class="vncellt">Memory usage</td>
+ <td width="75%" class="listr">
+ <?php $memUsage = mem_usage(); ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" name="memwidtha" id="memwidtha" width="<?= $memUsage; ?>" border="0" align="middle" alt="red bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" name="memwidthb" id="memwidthb" width="<?= (100 - $memUsage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
+ &nbsp;
+ <input style="border: 0px solid white;" size="30" name="memusagemeter" id="memusagemeter" value="<?= $memUsage.'%'; ?>" />
+ </td>
+ </tr>
+ <?php if($showswap == true): ?>
+ <tr>
+ <td width="25%" class="vncellt">SWAP usage</td>
+ <td width="75%" class="listr">
+ <?php $swapusage = swap_usage(); ?>
+ <img src="./themes/<?= $g['theme']; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_blue.gif" height="15" width="<?= $swapUsage; ?>" border="0" align="middle" alt="red bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_gray.gif" height="15" width="<?= (100 - $swapUsage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g['theme']; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
+ &nbsp;
+ <input style="border: 0px solid white;" size="30" name="swapusagemeter" id="swapusagemeter" value="<?= $swapusage.'%'; ?>" />
+ </td>
+ </tr>
+ <?php endif; ?>
+<?php
+ if(has_temp()):
+?>
+ <tr>
+ <td width='25%' class='vncellt'>Temperature</td>
+ <td width='75%' class='listr'>
+ <?php $temp = get_temp(); ?>
+ <img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_blue.gif" height="15" name="tempwidtha" id="tempwidtha" width="<?= $temp; ?>" border="0" align="middle" alt="red bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_gray.gif" height="15" name="tempwidthb" id="tempwidthb" width="<?= (100 - $temp); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
+ &nbsp;
+ <input style="border: 0px solid white;" size="30" name="tempmeter" id="tempmeter" value="<?= $temp."C"; ?>" />
+ </td>
+ </tr>
+ <?php endif; ?>
+ <tr>
+ <td width="25%" class="vncellt">Disk usage</td>
+ <td width="75%" class="listr">
+ <?php $diskusage = disk_usage(); ?>
+ <img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_left.gif" height="15" width="4" border="0" align="middle" alt="left bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_blue.gif" height="15" width="<?= $diskusage; ?>" border="0" align="middle" alt="red bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_gray.gif" height="15" width="<?= (100 - $diskusage); ?>" border="0" align="middle" alt="gray bar" /><img src="./themes/<?= $g["theme"]; ?>/images/misc/bar_right.gif" height="15" width="5" border="0" align="middle" alt="right bar" />
+ &nbsp;
+ <input style="border: 0px solid white;" size="30" name="diskusagemeter" id="diskusagemeter" value="<?= $diskusage.'%'; ?>" />
+ </td>
+ </tr>
+ </tbody>
+</table>
+</form>
+</div>
+
+<?php include("fend.inc"); ?>
+
+<script type="text/javascript">
+ NiftyCheck();
+ Rounded("div#nifty","top","#FFF","#EEEEEE","smooth");
+</script>
+
+</body>
+</html>
diff --git a/config/Fit123/bin/dnssrv/system.abc b/config/Fit123/bin/dnssrv/system.abc
new file mode 100755
index 00000000..24021aab
--- /dev/null
+++ b/config/Fit123/bin/dnssrv/system.abc
@@ -0,0 +1,347 @@
+<?php
+/* $Id$ */
+/*
+ system.php
+ part of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require("guiconfig.inc");
+
+$pconfig['hostname'] = $config['system']['hostname'];
+$pconfig['domain'] = $config['system']['domain'];
+list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $config['system']['dnsserver'];
+
+$pconfig['dnsallowoverride'] = isset($config['system']['dnsallowoverride']);
+$pconfig['username'] = $config['system']['username'];
+if (!$pconfig['username'])
+ $pconfig['username'] = "admin";
+$pconfig['webguiproto'] = $config['system']['webgui']['protocol'];
+if (!$pconfig['webguiproto'])
+ $pconfig['webguiproto'] = "http";
+$pconfig['webguiport'] = $config['system']['webgui']['port'];
+$pconfig['timezone'] = $config['system']['timezone'];
+$pconfig['timeupdateinterval'] = $config['system']['time-update-interval'];
+$pconfig['timeservers'] = $config['system']['timeservers'];
+$pconfig['theme'] = $config['system']['theme'];
+
+if (!isset($pconfig['timeupdateinterval']))
+ $pconfig['timeupdateinterval'] = 300;
+if (!$pconfig['timezone'])
+ $pconfig['timezone'] = "Etc/UTC";
+if (!$pconfig['timeservers'])
+ $pconfig['timeservers'] = "pool.ntp.org";
+
+$changedesc = "System: ";
+$changecount = 0;
+
+function is_timezone($elt) {
+ return !preg_match("/\/$/", $elt);
+}
+
+if($pconfig['timezone'] <> $_POST['timezone']) {
+ /* restart firewall log dumper helper */
+ require_once("functions.inc");
+ $pid = `ps awwwux | grep -v "grep" | grep "tcpdump -v -l -n -e -ttt -i pflog0" | awk '{ print $2 }'`;
+ if($pid) {
+ mwexec("kill $pid");
+ usleep(1000);
+ }
+ filter_pflog_start();
+}
+
+exec('/usr/bin/tar -tzf /usr/share/zoneinfo.tgz', $timezonelist);
+$timezonelist = array_filter($timezonelist, 'is_timezone');
+sort($timezonelist);
+
+if ($_POST) {
+
+ $changecount++;
+
+ unset($input_errors);
+ $pconfig = $_POST;
+
+ /* input validation */
+ $reqdfields = split(" ", "hostname domain username");
+ $reqdfieldsn = split(",", "Hostname,Domain,Username");
+
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+
+ if ($_POST['hostname'] && !is_hostname($_POST['hostname'])) {
+ $input_errors[] = "The hostname may only contain the characters a-z, 0-9 and '-'.";
+ }
+ if ($_POST['domain'] && !is_domain($_POST['domain'])) {
+ $input_errors[] = "The domain may only contain the characters a-z, 0-9, '-' and '.'.";
+ }
+ if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2'])) || ($_POST['dns3'] && !is_ipaddr($_POST['dns3'])) || ($_POST['dns4'] && !is_ipaddr($_POST['dns4']))) {
+ $input_errors[] = "A valid IP address must be specified for the primary/secondary DNS server.";
+ }
+ if ($_POST['username'] && !preg_match("/^[a-zA-Z0-9]*$/", $_POST['username'])) {
+ $input_errors[] = "The username may only contain the characters a-z, A-Z and 0-9.";
+ }
+ if ($_POST['webguiport'] && (!is_numericint($_POST['webguiport']) ||
+ ($_POST['webguiport'] < 1) || ($_POST['webguiport'] > 65535))) {
+ $input_errors[] = "A valid TCP/IP port must be specified for the webGUI port.";
+ }
+ if (($_POST['password']) && ($_POST['password'] != $_POST['password2'])) {
+ $input_errors[] = "The passwords do not match.";
+ }
+
+ $t = (int)$_POST['timeupdateinterval'];
+ if (($t < 0) || (($t > 0) && ($t < 6)) || ($t > 1440)) {
+ $input_errors[] = "The time update interval must be either 0 (disabled) or between 6 and 1440.";
+ }
+ foreach (explode(' ', $_POST['timeservers']) as $ts) {
+ if (!is_domain($ts)) {
+ $input_errors[] = "A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'.";
+ }
+ }
+
+ if (!$input_errors) {
+ update_if_changed("hostname", $config['system']['hostname'], strtolower($_POST['hostname']));
+ update_if_changed("domain", $config['system']['domain'], strtolower($_POST['domain']));
+ update_if_changed("username", $config['system']['username'], $_POST['username']);
+
+ if (update_if_changed("webgui protocol", $config['system']['webgui']['protocol'], $_POST['webguiproto']))
+ $restart_webgui = true;
+ if (update_if_changed("webgui port", $config['system']['webgui']['port'], $_POST['webguiport']))
+ $restart_webgui = true;
+
+ update_if_changed("timezone", $config['system']['timezone'], $_POST['timezone']);
+ update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
+ update_if_changed("NTP update interval", $config['system']['time-update-interval'], $_POST['timeupdateinterval']);
+
+ /* pfSense themes */
+ update_if_changed("System Theme", $config['theme'], $_POST['theme']);
+
+ /* XXX - billm: these still need updating after figuring out how to check if they actually changed */
+ unset($config['system']['dnsserver']);
+ if ($_POST['dns1'])
+ $config['system']['dnsserver'][] = $_POST['dns1'];
+ if ($_POST['dns2'])
+ $config['system']['dnsserver'][] = $_POST['dns2'];
+ if ($_POST['dns3'])
+ $config['system']['dnsserver'][] = $_POST['dns3'];
+ if ($_POST['dns4'])
+ $config['system']['dnsserver'][] = $_POST['dns4'];
+
+ $olddnsallowoverride = $config['system']['dnsallowoverride'];
+
+ unset($config['system']['dnsallowoverride']);
+ $config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false;
+ if ($_POST['password']) {
+ $config['system']['password'] = crypt($_POST['password']);
+ update_changedesc("password changed via webConfigurator");
+ sync_webgui_passwords();
+ }
+
+ if ($changecount > 0)
+ write_config($changedesc);
+
+ if ($restart_webgui) {
+ global $_SERVER;
+ list($host) = explode(":", $_SERVER['HTTP_HOST']);
+ if ($config['system']['webgui']['port']) {
+ $url="{$config['system']['webgui']['protocol']}://{$host}:{$config['system']['webgui']['port']}/system.php";
+ } else {
+ $url = "{$config['system']['webgui']['protocol']}://{$host}/system.php";
+ }
+ }
+
+ $retval = 0;
+ config_lock();
+ $retval = system_hostname_configure();
+ $retval |= system_hosts_generate();
+ $retval |= system_resolvconf_generate();
+ $retval |= system_password_configure();
+ $retval |= services_dnsmasq_configure();
+ $retval |= system_timezone_configure();
+ $retval |= system_ntp_configure();
+
+ if ($olddnsallowoverride != $config['system']['dnsallowoverride'])
+ $retval |= interfaces_wan_configure();
+
+ config_unlock();
+
+ // Reload filter -- plugins might need to run
+ filter_configure();
+
+ $savemsg = get_std_save_message($retval);
+ if ($restart_webgui)
+ $savemsg .= "<br />One moment...redirecting to {$url} in 10 seconds.";
+ }
+}
+
+$pgtitle = "System: General Setup";
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle"><?=$pgtitle?></p>
+<?php if ($input_errors) print_input_errors($input_errors); ?>
+<?php if ($savemsg) print_info_box($savemsg); ?>
+<form action="system.php" method="post">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Hostname</td>
+ <td width="78%" class="vtable"> <input name="hostname" type="text" class="formfld" id="hostname" size="40" value="<?=htmlspecialchars($pconfig['hostname']);?>">
+ <br> <span class="vexpl">name of the firewall host, without
+ domain part<br>
+ e.g. <em>firewall</em></span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Domain</td>
+ <td width="78%" class="vtable"> <input name="domain" type="text" class="formfld" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>">
+ <br> <span class="vexpl">e.g. <em>mycorp.com</em> </span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">DNS servers</td>
+ <td width="78%" class="vtable"> <p>
+ <input name="dns1" type="text" class="formfld" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>">
+ <br>
+ <input name="dns2" type="text" class="formfld" id="dns22" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>">
+ <br>
+ <input name="dns3" type="text" class="formfld" id="dns3" size="20" value="<?=htmlspecialchars($pconfig['dns3']);?>">
+ <br>
+ <input name="dns4" type="text" class="formfld" id="dns4" size="20" value="<?=htmlspecialchars($pconfig['dns4']);?>">
+ <br>
+ <span class="vexpl">IP addresses; these are also used for
+ the DHCP service, DNS forwarder and for PPTP VPN clients<br>
+ <br>
+ <input name="dnsallowoverride" type="checkbox" id="dnsallowoverride" value="yes" <?php if ($pconfig['dnsallowoverride']) echo "checked"; ?>>
+ <strong>Allow DNS server list to be overridden by DHCP/PPP
+ on WAN</strong><br>
+ If this option is set, <?=$g['product_name']?> will use DNS servers assigned
+ by a DHCP/PPP server on WAN for its own purposes (including
+ the DNS forwarder). They will not be assigned to DHCP and
+ PPTP VPN clients, though.</span></p></td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Username</td>
+ <td class="vtable"> <input name="username" type="text" class="formfld" id="username" size="20" value="<?=$pconfig['username'];?>">
+ <br>
+ <span class="vexpl">If you want
+ to change the username for accessing the webGUI, enter it
+ here.</span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Password</td>
+ <td width="78%" class="vtable"> <input name="password" type="password" class="formfld" id="password" size="20">
+ <br> <input name="password2" type="password" class="formfld" id="password2" size="20">
+ &nbsp;(confirmation) <br> <span class="vexpl">If you want
+ to change the password for accessing the webGUI, enter it
+ here twice.</span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">webGUI protocol</td>
+ <td width="78%" class="vtable"> <input name="webguiproto" type="radio" value="http" <?php if ($pconfig['webguiproto'] == "http") echo "checked"; ?>>
+ HTTP &nbsp;&nbsp;&nbsp; <input type="radio" name="webguiproto" value="https" <?php if ($pconfig['webguiproto'] == "https") echo "checked"; ?>>
+ HTTPS</td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">webGUI port</td>
+ <td class="vtable"> <input name="webguiport" type="text" class="formfld" id="webguiport" "size="5" value="<?=htmlspecialchars($config['system']['webgui']['port']);?>">
+ <br>
+ <span class="vexpl">Enter a custom port number for the webGUI
+ above if you want to override the default (80 for HTTP, 443
+ for HTTPS). Changes will take effect immediately after save.</span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Time zone</td>
+ <td width="78%" class="vtable"> <select name="timezone" id="timezone">
+ <?php foreach ($timezonelist as $value): ?>
+ <option value="<?=htmlspecialchars($value);?>" <?php if ($value == $pconfig['timezone']) echo "selected"; ?>>
+ <?=htmlspecialchars($value);?>
+ </option>
+ <?php endforeach; ?>
+ </select> <br> <span class="vexpl">Select the location closest
+ to you</span></td>
+ </tr>
+ <!--
+ <tr>
+ <td width="22%" valign="top" class="vncell">Time update interval</td>
+ <td width="78%" class="vtable"> <input name="timeupdateinterval" type="text" class="formfld" id="timeupdateinterval" size="4" value="<?=htmlspecialchars($pconfig['timeupdateinterval']);?>">
+ <br> <span class="vexpl">Minutes between network time sync.;
+ 300 recommended, or 0 to disable </span></td>
+ </tr>
+ -->
+ <tr>
+ <td width="22%" valign="top" class="vncell">NTP time server</td>
+ <td width="78%" class="vtable"> <input name="timeservers" type="text" class="formfld" id="timeservers" size="40" value="<?=htmlspecialchars($pconfig['timeservers']);?>">
+ <br> <span class="vexpl">Use a space to separate multiple
+ hosts (only one required). Remember to set up at least one
+ DNS server if you enter a host name here!</span></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="list" height="12">&nbsp;</td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Theme</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">&nbsp;</td>
+ <td width="78%" class="vtable">
+ <select name="theme">
+<?php
+ $files = return_dir_as_array("/usr/local/www/themes/");
+ foreach($files as $f) {
+ if ( (substr($f, 0, 1) == "_") && !isset($config['system']['developer']) ) continue;
+ if($f == "CVS") continue;
+ $selected = "";
+ if($f == $config['theme'])
+ $selected = " SELECTED";
+ if($config['theme'] == "" and $f == "pfsense")
+ $selceted = " SELECTED";
+ echo "\t\t\t\t\t"."<option{$selected}>{$f}</option>\n";
+ }
+?>
+ </select>
+ <strong>This will change the look and feel of <?=$g['product_name']?></strong>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%"> <input name="Submit" type="submit" class="formbtn" value="Save">
+ </td>
+ </tr>
+ </table>
+</form>
+<?php include("fend.inc"); ?>
+<?php
+ // restart webgui if proto or port changed
+ if ($restart_webgui) {
+ echo "<meta http-equiv=\"refresh\" content=\"10;url={$url}\">";
+ }
+?>
+</body>
+</html>
+<?php
+if ($restart_webgui) {
+ touch("/tmp/restart_webgui");
+}
+?>
diff --git a/config/Fit123/bin/ltsp/services.inc b/config/Fit123/bin/ltsp/services.inc
new file mode 100644
index 00000000..a788a2b3
--- /dev/null
+++ b/config/Fit123/bin/ltsp/services.inc
@@ -0,0 +1,1316 @@
+<?php
+/* $Id$ */
+/*
+ services.inc
+ part of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/* include all configuration functions */
+require_once("functions.inc");
+
+function load_balancer_use_sticky() {
+ global $config, $g;
+ if (isset ($config['system']['lb_use_sticky']))
+ touch("/var/etc/use_pf_pool__stickyaddr");
+ else
+ unlink_if_exists("/var/etc/use_pf_pool__stickyaddr");
+}
+
+function services_dhcpd_configure() {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "services_dhcpd_configure($if) being called $mt\n";
+ }
+
+ /* if OLSRD is enabled, allow WAN to house DHCP. */
+ if($config['installedpackages']['olsrd'])
+ foreach($config['installedpackages']['olsrd']['config'] as $olsrd)
+ if($olsrd['enable'])
+ $is_olsr_enabled = true;
+
+ /* configure DHCPD chroot */
+ $fd = fopen("/tmp/dhcpd.sh","w");
+ $status = `mount | grep "{$g['dhcpd_chroot_path']}/dev"`;
+ fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}\n");
+ fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/dev\n");
+ fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/etc\n");
+ fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr/local/sbin\n");
+ fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/var/db\n");
+ fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr\n");
+ fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/lib\n");
+ fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/run\n");
+ fwrite($fd, "chown -R dhcpd:_dhcp {$g['dhcpd_chroot_path']}/*\n");
+ fwrite($fd, "cp /lib/libc.so.* {$g['dhcpd_chroot_path']}/lib/\n");
+ fwrite($fd, "cp /usr/local/sbin/dhcpd {$g['dhcpd_chroot_path']}/usr/local/sbin/\n");
+ fwrite($fd, "chmod a+rx {$g['dhcpd_chroot_path']}/usr/local/sbin/dhcpd\n");
+ if(!trim($status))
+ fwrite($fd, "mount -t devfs devfs {$g['dhcpd_chroot_path']}/dev\n");
+ fclose($fd);
+ mwexec("/bin/sh /tmp/dhcpd.sh");
+
+ /* kill any running dhcpd */
+ if(is_process_running("dhcpd"))
+ mwexec("killall dhcpd", true);
+
+ $syscfg = $config['system'];
+ $dhcpdcfg = $config['dhcpd'];
+
+ /* DHCP enabled on any interfaces? */
+ $dhcpdenable = false;
+ if(is_array($dhcpdcfg))
+ foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
+ if (isset($dhcpifconf['enable']) &&
+ (($dhcpif == "lan") ||
+ (isset($config['interfaces'][$dhcpif]['enable']) &&
+ $config['interfaces'][$dhcpif]['if'] && (!$config['interfaces'][$dhcpif]['bridge']))))
+ $dhcpdenable = true;
+ if (isset($dhcpifconf['enable']) &&
+ (($dhcpif == "wan") || (isset($config['interfaces'][$dhcpif]['enable']) &&
+ $config['interfaces'][$dhcpif]['if'] && (!$config['interfaces'][$dhcpif]['bridge']))))
+ $dhcpdenable = true;
+ }
+
+ if (!$dhcpdenable)
+ return 0;
+
+ if ($g['booting'])
+ echo "Starting DHCP service...";
+ else
+ sleep(1);
+
+ /* write dhcpd.conf */
+ $fd = fopen("{$g['dhcpd_chroot_path']}/etc/dhcpd.conf", "w");
+ if (!$fd) {
+ printf("Error: cannot open dhcpd.conf in services_dhcpd_configure().\n");
+ return 1;
+ }
+
+
+
+ $dhcpdconf = <<<EOD
+option domain-name "{$syscfg['domain']}";
+default-lease-time 7200;
+max-lease-time 86400;
+authoritative;
+log-facility local7;
+ddns-update-style none;
+one-lease-per-client true;
+deny duplicates;
+
+EOD;
+
+ $dhcpdifs = array();
+
+ /* loop through and deterimine if we need to setup
+ * failover peer "bleh" entries
+ */
+ $dhcpnum = 0;
+ foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
+ if($dhcpifconf['failover_peerip'] <> "") {
+ /*
+ * yep, failover peer is defined.
+ * does it match up to a defined vip?
+ */
+ $skew = 110;
+ $a_vip = &$config['virtualip']['vip'];
+ if(is_array($a_vip)) {
+ foreach ($a_vip as $vipent) {
+ $int = guess_interface_from_ip($dhcpifconf['failover_peerip']);
+ $intip = find_interface_ip($int);
+ $real_dhcpif = convert_friendly_interface_to_real_interface_name($dhcpif);
+ if($int == $real_dhcpif) {
+ /* this is the interface! */
+ if($vipent['advskew'] < "20")
+ $skew = 0;
+ }
+ }
+ } else {
+ log_error("Warning! DHCP Failover setup and no CARP virtual IP's defined!");
+ }
+ if($skew > 10) {
+ $type = "secondary";
+ $dhcpdconf_pri = "mclt 600;\n";
+ $my_port = "520";
+ $peer_port = "519";
+ } else {
+ $my_port = "519";
+ $peer_port = "520";
+ $type = "primary";
+ $dhcpdconf_pri = "split 128;\n";
+ $dhcpdconf_pri .= " mclt 600;\n";
+ }
+ $dhcpdconf .= <<<EOPP
+failover peer "dhcp{$dhcpnum}" {
+ {$type};
+ address {$intip};
+ port {$my_port};
+ peer address {$dhcpifconf['failover_peerip']};
+ peer port {$peer_port};
+ max-response-delay 10;
+ max-unacked-updates 10;
+ {$dhcpdconf_pri}
+ load balance max seconds 3;
+}
+
+EOPP;
+ $dhcpnum++;
+ }
+ }
+
+ $dhcpnum = 0;
+
+ foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
+
+ $ifcfg = $config['interfaces'][$dhcpif];
+
+ if (!isset($dhcpifconf['enable']) ||
+ ($ifcfg['ipaddr'] == "dhcp") ||
+ (($dhcpif != "lan") &&
+ (!isset($ifcfg['enable']) || !$ifcfg['if'] || $ifcfg['bridge'])))
+ continue;
+
+ if($dhcpif == "lan" && $ifcfg['bridge'])
+ log_error("NOTE: DHCP Server on LAN is enabled.");
+
+ $subnet = gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);
+ $subnetmask = gen_subnet_mask($ifcfg['subnet']);
+
+ if($is_olsr_enabled == true)
+ if($dhcpifconf['netmask'])
+ $subnetmask = gen_subnet_mask($dhcpifconf['netmask']);
+
+ $dnscfg = "";
+
+ if ($dhcpifconf['domain']) {
+ $dnscfg .= " option domain-name \"{$dhcpifconf['domain']}\";\n";
+ }
+ if (isset($dhcpifconf['ddnsupdate'])) {
+ if($dhcpifconf['ddnsdomain'] <> "") {
+ $dnscfg .= " ddns-domainname \"{$dhcpifconf['ddnsdomain']}\";\n";
+ }
+ $dnscfg .= " ddns-update-style interim;\n";
+ }
+
+
+ if (is_array($dhcpifconf['dnsserver']) && ($dhcpifconf['dnsserver'][0])) {
+ $dnscfg .= " option domain-name-servers " . join(",", $dhcpifconf['dnsserver']) . ";";
+ } else if (isset($config['dnsmasq']['enable'])) {
+ $dnscfg .= " option domain-name-servers " . $ifcfg['ipaddr'] . ";";
+ } else if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
+ $dnscfg .= " option domain-name-servers " . join(",", $syscfg['dnsserver']) . ";";
+ }
+
+ $dhcpdconf .= "subnet $subnet netmask $subnetmask {\n";
+ $dhcpdconf .= " pool {\n";
+
+ /* is failover dns setup? */
+ if (is_array($dhcpifconf['dnsserver']) && $dhcpifconf['dnsserver'][0] <> "") {
+ $dhcpdconf .= " option domain-name-servers {$dhcpifconf['dnsserver'][0]}";
+ if($dhcpifconf['dnsserver'][1] <> "")
+ $dhcpdconf .= ",{$dhcpifconf['dnsserver'][1]}";
+ $dhcpdconf .= ";\n";
+ }
+
+ if($dhcpifconf['failover_peerip'] <> "")
+ $dhcpdconf .= " deny dynamic bootp clients;\n";
+
+ if (isset($dhcpifconf['denyunknown']))
+ $dhcpdconf .= " deny unknown clients;\n";
+
+ if ($dhcpifconf['gateway'])
+ $routers = $dhcpifconf['gateway'];
+ else
+ $routers = $ifcfg['ipaddr'];
+
+ if($dhcpifconf['failover_peerip'] <> "") {
+ $dhcpdconf .= " failover peer \"dhcp{$dhcpnum}\";\n";
+ $dhcpnum++;
+ }
+
+ $dhcpdconf .= <<<EOD
+ range {$dhcpifconf['range']['from']} {$dhcpifconf['range']['to']};
+ }
+ option routers {$routers};
+$dnscfg
+
+EOD;
+
+ if ($dhcpifconf['defaultleasetime'])
+ $dhcpdconf .= " default-lease-time {$dhcpifconf['defaultleasetime']};\n";
+ if ($dhcpifconf['maxleasetime'])
+ $dhcpdconf .= " max-lease-time {$dhcpifconf['maxleasetime']};\n";
+
+ if (is_array($dhcpifconf['winsserver']) && $dhcpifconf['winsserver'][0]) {
+ $dhcpdconf .= " option netbios-name-servers " . join(",", $dhcpifconf['winsserver']) . ";\n";
+ $dhcpdconf .= " option netbios-node-type 8;\n";
+ }
+
+ if (is_array($dhcpifconf['ntpserver']) && $dhcpifconf['ntpserver'][0])
+ $dhcpdconf .= " option ntp-servers " . join(",", $dhcpifconf['ntpserver']) . ";\n";
+
+ if(isset($dhcpifconf['netboot'])) {
+ if (($dhcpifconf['next-server'] <> "") && ($dhcpifconf['filename'] <> "")) {
+ $dhcpdconf .= " next-server {$dhcpifconf['next-server']};\n";
+ $dhcpdconf .= " filename \"{$dhcpifconf['filename']}\";\n";
+ }
+ if ($dhcpifconf['rootpath'] <> "") {
+ $dhcpdconf .= " option root-path \"{$dhcpifconf['rootpath']}\";\n";
+ }
+ }
+ $dhcpdconf .= <<<EOD
+}
+
+EOD;
+
+ /* add static mappings */
+ if (is_array($dhcpifconf['staticmap'])) {
+
+ $i = 0;
+ foreach ($dhcpifconf['staticmap'] as $sm) {
+ $dhcpdconf .= <<<EOD
+host s_{$dhcpif}_{$i} {
+ hardware ethernet {$sm['mac']};
+
+EOD;
+ if ($sm['ipaddr'])
+ $dhcpdconf .= " fixed-address {$sm['ipaddr']};\n";
+
+ $dhcpdconf .= "}\n";
+ $i++;
+ }
+ }
+
+ $dhcpdifs[] = $ifcfg['if'];
+ }
+
+ fwrite($fd, $dhcpdconf);
+ fclose($fd);
+
+ /* create an empty leases database */
+ touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases");
+
+ /* fire up dhcpd in a chroot */
+ mwexec("/usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot {$g['dhcpd_chroot_path']} -cf {$g['dhcpd_chroot_path']}/etc/dhcpd.conf " .
+ join(" ", $dhcpdifs));
+
+ if ($g['booting']) {
+ print "done.\n";
+ }
+
+ return 0;
+}
+
+function interfaces_staticarp_configure($if) {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "interfaces_staticarp_configure($if) being called $mt\n";
+ }
+
+ $ifcfg = $config['interfaces'][$if];
+
+ /* Enable staticarp, if enabled */
+ if(isset($config['dhcpd'][$if]['staticarp'])) {
+ mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " staticarp " );
+ mwexec("/usr/sbin/arp -ad > /dev/null 2>&1 ");
+ if (is_array($config['dhcpd'][$if]['staticmap'])) {
+
+ foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
+ mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
+ log_error("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
+ }
+
+ }
+ } else {
+ mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " -staticarp " );
+ mwexec("/usr/sbin/arp -da > /dev/null 2>&1 ");
+ }
+
+ return 0;
+}
+
+function services_dhcrelay_configure() {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "services_dhcrelay_configure() being called $mt\n";
+ }
+
+ /* kill any running dhcrelay */
+ killbypid("{$g['varrun_path']}/dhcrelay.pid");
+
+ $dhcrelaycfg = $config['dhcrelay'];
+
+ /* DHCPRelay enabled on any interfaces? */
+ $dhcrelayenable = false;
+ if(is_array($dhcrelaycfg)) {
+ foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) {
+ if (isset($dhcrelayifconf['enable']) &&
+ (($dhcrelayif == "lan") ||
+ (isset($config['interfaces'][$dhcrelayif]['enable']) &&
+ $config['interfaces'][$dhcrelayif]['if'] && (!$config['interfaces'][$dhcrelayif]['bridge']))))
+ $dhcrelayenable = true;
+ }
+ }
+
+ if (!$dhcrelayenable)
+ return 0;
+
+ if ($g['booting'])
+ echo "Starting DHCP relay service...";
+ else
+ sleep(1);
+
+ $dhcrelayifs = array();
+ foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) {
+
+ $ifcfg = $config['interfaces'][$dhcrelayif];
+
+ if (!isset($dhcrelayifconf['enable']) ||
+ (($dhcrelayif != "lan") &&
+ (!isset($ifcfg['enable']) || !$ifcfg['if'] || $ifcfg['bridge'])))
+ continue;
+
+ $dhcrelayifs[] = $ifcfg['if'];
+ }
+
+ /* In order for the relay to work, it needs to be active on the
+ interface in which the destination server sits */
+ foreach ($config['interfaces'] as $ifname) {
+ $subnet = $ifname['ipaddr'] . "/" . $ifname['subnet'];
+ if (ip_in_subnet($dhcrelaycfg['server'],$subnet))
+ $destif = $ifname['if'];
+ }
+
+ if (!isset($destif))
+ $destif = $config['interfaces']['wan']['if'];
+
+ $dhcrelayifs[] = $destif;
+ $dhcrelayifs = array_unique($dhcrelayifs);
+
+ /* fire up dhcrelay */
+ $cmd = "/usr/local/sbin/dhcrelay -i " . join(" -i ", $dhcrelayifs);
+
+ if (isset($dhcrelaycfg['agentoption']))
+ $cmd .= " -a -m replace";
+
+ $cmd .= " {$dhcrelaycfg['server']}";
+ mwexec($cmd);
+
+ if (!$g['booting']) {
+ /* set the reload filter dity flag */
+ touch("{$g['tmp_path']}/filter_dirty");
+ }
+
+ return 0;
+}
+
+function services_dyndns_reset() {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "services_dyndns_reset() being called $mt\n";
+ }
+
+ if (file_exists("{$g['vardb_path']}/ez-ipupdate.cache")) {
+ conf_mount_rw();
+ unlink("{$g['vardb_path']}/ez-ipupdate.cache");
+ conf_mount_ro();
+ }
+
+ if (file_exists("{$g['conf_path']}/ez-ipupdate.cache")) {
+ conf_mount_rw();
+ unlink("{$g['conf_path']}/ez-ipupdate.cache");
+ conf_mount_ro();
+ }
+
+ if (file_exists("{$g['conf_path']}/dyndns.cache")) {
+ conf_mount_rw();
+ unlink("{$g['conf_path']}/dyndns.cache");
+ conf_mount_ro();
+ }
+
+ return 0;
+}
+
+function services_dyndns_configure() {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "services_dyndns_configure() being called $mt\n";
+ }
+
+ $dyndnscfg = $config['dyndns'];
+ $wancfg = $config['interfaces']['wan'];
+
+ if (isset($dyndnscfg['enable'])) {
+
+ if ($g['booting']) {
+ echo "Starting DynDNS client...";
+ if(isset($config['system']['use_old_dyndns'])) {
+ echo " [Using ez-ipupdate] ";
+ services_dyndns_configure_old();
+ return;
+ }
+ } else {
+ sleep(1);
+ if(isset($config['system']['use_old_dyndns'])) {
+ services_dyndns_configure_old();
+ return;
+ }
+ }
+
+ /* load up the dyndns.class */
+ require_once("dyndns.class");
+
+ log_error("DynDns: Running updatedns()");
+
+ /* determine WAN interface name */
+ $wanif = get_real_wan_interface();
+ /* get ip */
+ $ip = find_interface_ip($wanif);
+
+ $dns = new updatedns($dnsService = $config['dyndns']['type'],
+ $dnsHost = $config['dyndns']['host'],
+ $dnsUser = $config['dyndns']['username'],
+ $dnsPass = $config['dyndns']['password'],
+ $dnsWilcard = $config['dyndns']['wildcard'],
+ $dnsMX = $config['dyndns']['mx']);
+
+ if ($g['booting'])
+ echo "done.\n";
+ }
+
+ return 0;
+}
+
+function services_dyndns_configure_old() {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "services_dyndns_configure_old() being called $mt\n";
+ }
+
+ /* kill any running ez-ipupdate */
+ /* ez-ipupdate needs SIGQUIT instead of SIGTERM */
+ sigkillbypid("{$g['varrun_path']}/ez-ipupdate.pid", "QUIT");
+
+ $dyndnscfg = $config['dyndns'];
+ $wancfg = $config['interfaces']['wan'];
+
+ if (isset($dyndnscfg['enable'])) {
+
+ if ($g['booting'])
+ echo "Starting DynDNS client...";
+ else
+ sleep(1);
+
+ /* determine WAN interface name */
+ $wanif = get_real_wan_interface();
+
+ /* write ez-ipupdate.conf */
+ $fd = fopen("{$g['varetc_path']}/ez-ipupdate.conf", "w");
+ if (!$fd) {
+ printf("Error: cannot open ez-ipupdate.conf in services_dyndns_configure().\n");
+ return 1;
+ }
+
+ $ezipupdateconf = <<<EOD
+service-type={$dyndnscfg['type']}
+user={$dyndnscfg['username']}:{$dyndnscfg['password']}
+host={$dyndnscfg['host']}
+interface={$wanif}
+max-interval=2073600
+pid-file={$g['varrun_path']}/ez-ipupdate.pid
+cache-file={$g['vardb_path']}/ez-ipupdate.cache
+execute=/etc/rc.dyndns.storecache
+daemon
+
+EOD;
+
+ /* enable server[:port]? */
+ if ($dyndnscfg['server']) {
+ if ($dyndnscfg['port'])
+ $ezipupdateconf .= "server={$dyndnscfg['server']}:{$dyndnscfg['port']}\n";
+ else
+ $ezipupdateconf .= "server={$dyndnscfg['server']}\n";
+ }
+
+ /* enable MX? */
+ if ($dyndnscfg['mx']) {
+ $ezipupdateconf .= "mx={$dyndnscfg['mx']}\n";
+ }
+
+ /* enable wildcards? */
+ if (isset($dyndnscfg['wildcard'])) {
+ $ezipupdateconf .= "wildcard\n";
+ }
+
+ fwrite($fd, $ezipupdateconf);
+ fclose($fd);
+
+ /* if we're booting, copy the cache file from /conf */
+ if ($g['booting']) {
+ if (file_exists("{$g['conf_path']}/ez-ipupdate.cache")) {
+ copy("{$g['conf_path']}/ez-ipupdate.cache", "{$g['vardb_path']}/ez-ipupdate.cache");
+ }
+ }
+
+ /* run ez-ipupdate */
+ mwexec("/usr/local/bin/ez-ipupdate -c {$g['varetc_path']}/ez-ipupdate.conf");
+
+ if ($g['booting'])
+ echo "done\n";
+ }
+
+ return 0;
+}
+
+function services_dnsmasq_configure() {
+ global $config, $g;
+ $return = 0;
+
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "services_dnsmasq_configure() being called $mt\n";
+ }
+
+ /* kill any running dnsmasq */
+ sigkillbypid("{$g['varrun_path']}/dnsmasq.pid", "TERM");
+
+ if (isset($config['dnsmasq']['enable'])) {
+
+ if ($g['booting'])
+ echo "Starting DNS forwarder...";
+ else
+ sleep(1);
+
+ /* generate hosts file */
+ if(system_hosts_generate()!=0)
+ $return = 1;
+
+ $args = "";
+
+ if (isset($config['dnsmasq']['regdhcp'])) {
+
+ $args .= " -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases" .
+ " -s {$config['system']['domain']}";
+ }
+
+ if (isset($config['dnsmasq']['domainoverrides']) && is_array($config['dnsmasq']['domainoverrides'])) {
+ foreach($config['dnsmasq']['domainoverrides'] as $override) {
+ $args .= ' --server=/' . $override['domain'] . '/' . $override['ip'];
+ }
+ }
+
+ /* suppose that dnsmasq handles our domain and don't send
+ requests for our local domain to upstream servers */
+ //if (!empty($config['system']['domain'])) {
+ // $args .= sprintf(' --local=/%s/', $config['system']['domain']);
+ //}
+
+ /* run dnsmasq */
+ mwexec("/usr/local/sbin/dnsmasq {$args}");
+
+ if ($g['booting'])
+ echo "done.\n";
+ }
+
+ if (!$g['booting']) {
+ if(services_dhcpd_configure()!=0)
+ $return = 1;
+ }
+
+ return $return;
+}
+
+function services_snmpd_configure() {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "services_snmpd_configure() being called $mt\n";
+ }
+
+ /* kill any running snmpd */
+ sigkillbypid("{$g['varrun_path']}/snmpd.pid", "TERM");
+ if(is_process_running("bsnmpd"))
+ mwexec("/usr/bin/killall bsnmpd", true);
+
+ if (isset($config['snmpd']['enable'])) {
+
+ if ($g['booting'])
+ echo "Starting SNMP daemon... ";
+
+ /* generate snmpd.conf */
+ $fd = fopen("{$g['varetc_path']}/snmpd.conf", "w");
+ if (!$fd) {
+ printf("Error: cannot open snmpd.conf in services_snmpd_configure().\n");
+ return 1;
+ }
+
+
+ $snmpdconf = <<<EOD
+location := "{$config['snmpd']['syslocation']}"
+contact := "{$config['snmpd']['syscontact']}"
+read := "{$config['snmpd']['rocommunity']}"
+
+EOD;
+
+/* No docs on what write strings do there for disable for now.
+ if(isset($config['snmpd']['rwenable']) && preg_match('/^\S+$/', $config['snmpd']['rwcommunity'])){
+ $snmpdconf .= <<<EOD
+# write string
+write := "{$config['snmpd']['rwcommunity']}"
+
+EOD;
+ }
+*/
+
+
+ if(isset($config['snmpd']['trapenable']) && preg_match('/^\S+$/', $config['snmpd']['trapserver'])){
+ $snmpdconf .= <<<EOD
+# SNMP Trap support.
+traphost := {$config['snmpd']['trapserver']}
+trapport := {$config['snmpd']['trapserverport']}
+trap := "{$config['snmpd']['trapstring']}"
+
+
+EOD;
+ }
+
+
+ $snmpdconf .= <<<EOD
+system := 1 # pfSense
+%snmpd
+begemotSnmpdDebugDumpPdus = 2
+begemotSnmpdDebugSyslogPri = 7
+begemotSnmpdCommunityString.0.1 = $(read)
+
+EOD;
+
+/* No docs on what write strings do there for disable for now.
+ if(isset($config['snmpd']['rwcommunity']) && preg_match('/^\S+$/', $config['snmpd']['rwcommunity'])){
+ $snmpdconf .= <<<EOD
+begemotSnmpdCommunityString.0.2 = $(write)
+
+EOD;
+ }
+*/
+
+
+ if(isset($config['snmpd']['trapenable']) && preg_match('/^\S+$/', $config['snmpd']['trapserver'])){
+ $snmpdconf .= <<<EOD
+begemotTrapSinkStatus.[$(traphost)].$(trapport) = 4
+begemotTrapSinkVersion.[$(traphost)].$(trapport) = 2
+begemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap)
+
+EOD;
+ }
+
+
+ $snmpdconf .= <<<EOD
+begemotSnmpdCommunityDisable = 1
+
+EOD;
+
+ if(isset($config['snmpd']['bindlan'])) {
+ $bind_to_ip = $config['interfaces']['lan']['ipaddr'];
+ } else {
+ $bind_to_ip = "0.0.0.0";
+ }
+
+ if(is_port( $config['snmpd']['pollport'] )) {
+ $snmpdconf .= <<<EOD
+begemotSnmpdPortStatus.{$bind_to_ip}.{$config['snmpd']['pollport']} = 1
+
+EOD;
+
+ }
+
+ $snmpdconf .= <<<EOD
+begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1
+begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4
+
+# These are bsnmp macros not php vars.
+sysContact = $(contact)
+sysLocation = $(location)
+sysObjectId = 1.3.6.1.4.1.12325.1.1.2.1.$(system)
+
+snmpEnableAuthenTraps = 2
+
+EOD;
+
+ if (is_array( $config['snmpd']['modules'] )) {
+ if(isset($config['snmpd']['modules']['mibii'])) {
+ $snmpdconf .= <<<EOD
+begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"
+
+EOD;
+ }
+
+ if(isset($config['snmpd']['modules']['netgraph'])) {
+ $snmpdconf .= <<<EOD
+begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so"
+%netgraph
+begemotNgControlNodeName = "snmpd"
+
+EOD;
+ }
+
+ if(isset($config['snmpd']['modules']['pf'])) {
+ $snmpdconf .= <<<EOD
+begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so"
+
+EOD;
+ }
+
+ if(isset($config['snmpd']['modules']['hostres'])) {
+ $snmpdconf .= <<<EOD
+begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so"
+
+EOD;
+ }
+ if(isset($config['snmpd']['modules']['bridge'])) {
+ $snmpdconf .= <<<EOD
+begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so"
+# config must end with blank line
+
+
+EOD;
+ }
+ }
+
+ fwrite($fd, $snmpdconf);
+ fclose($fd);
+
+ if (isset($config['snmpd']['bindlan'])) {
+ $bindlan = "";
+ }
+
+ /* run bsnmpd */
+ mwexec("/usr/sbin/bsnmpd -c {$g['varetc_path']}/snmpd.conf" .
+ "{$bindlan} -p {$g['varrun_path']}/snmpd.pid");
+
+ if ($g['booting'])
+ echo "done.\n";
+ }
+
+ return 0;
+}
+
+function services_proxyarp_configure() {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "services_proxyarp_configure() being called $mt\n";
+ }
+
+ /* kill any running choparp */
+ killbyname("choparp");
+
+ if (isset($config['virtualip']) && is_array($config['virtualip']['vip'])) {
+ $paa = array();
+
+ /* group by interface */
+ foreach ($config['virtualip']['vip'] as $vipent) {
+ if ($vipent['mode'] === "proxyarp") {
+ if ($vipent['interface'])
+ $if = $vipent['interface'];
+ else
+ $if = "wan";
+
+ if (!is_array($paa[$if]))
+ $paa[$if] = array();
+
+ $paa[$if][] = $vipent;
+ }
+ }
+
+ if (count($paa))
+ foreach ($paa as $paif => $paents) {
+ if ($paif == "wan" && !(is_ipaddr($config['interfaces']['wan']['ipaddr']) ||
+ ($config['interfaces']['wan']['ipaddr'] == "dhcp") ||
+ ($config['interfaces']['wan']['ipaddr'] == "bigpond")))
+ continue;
+
+ $args = $config['interfaces'][$paif]['if'] . " auto";
+
+ foreach ($paents as $paent) {
+
+ if (isset($paent['subnet']))
+ $args .= " " . escapeshellarg("{$paent['subnet']}/{$paent['subnet_bits']}");
+ else if (isset($paent['range']))
+ $args .= " " . escapeshellarg($paent['range']['from'] . "-" .
+ $paent['range']['to']);
+ }
+
+ mwexec_bg("/usr/local/sbin/choparp " . $args);
+ }
+ }
+}
+
+function services_dnsupdate_process() {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "services_dnsupdate_process() being called $mt\n";
+ }
+
+ /* Dynamic DNS updating active? */
+ if (isset($config['dnsupdate']['enable'])) {
+
+ $wanip = get_current_wan_address();
+ if ($wanip) {
+
+ $keyname = $config['dnsupdate']['keyname'];
+ /* trailing dot */
+ if (substr($keyname, -1) != ".")
+ $keyname .= ".";
+
+ $hostname = $config['dnsupdate']['host'];
+ /* trailing dot */
+ if (substr($hostname, -1) != ".")
+ $hostname .= ".";
+
+ /* write private key file
+ this is dumb - public and private keys are the same for HMAC-MD5,
+ but nsupdate insists on having both */
+ $fd = fopen("{$g['varetc_path']}/K{$keyname}+157+00000.private", "w");
+ $privkey .= <<<EOD
+Private-key-format: v1.2
+Algorithm: 157 (HMAC)
+Key: {$config['dnsupdate']['keydata']}
+
+EOD;
+ fwrite($fd, $privkey);
+ fclose($fd);
+
+ /* write public key file */
+ if ($config['dnsupdate']['keytype'] == "zone") {
+ $flags = 257;
+ $proto = 3;
+ } else if ($config['dnsupdate']['keytype'] == "host") {
+ $flags = 513;
+ $proto = 3;
+ } else if ($config['dnsupdate']['keytype'] == "user") {
+ $flags = 0;
+ $proto = 2;
+ }
+
+ $fd = fopen("{$g['varetc_path']}/K{$keyname}+157+00000.key", "w");
+ fwrite($fd, "{$keyname} IN KEY {$flags} {$proto} 157 {$config['dnsupdate']['keydata']}\n");
+ fclose($fd);
+
+ /* generate update instructions */
+ $upinst = "update delete {$config['dnsupdate']['host']} A\n";
+ $upinst .= "update add {$config['dnsupdate']['host']} {$config['dnsupdate']['ttl']} A {$wanip}\n";
+ $upinst .= "\n"; /* mind that trailing newline! */
+
+ $fd = fopen("{$g['varetc_path']}/nsupdatecmds", "w");
+ fwrite($fd, $upinst);
+ fclose($fd);
+
+ /* invoke nsupdate */
+ $cmd = "/usr/sbin/nsupdate -k {$g['varetc_path']}/K{$keyname}+157+00000.key";
+ if (isset($config['dnsupdate']['usetcp']))
+ $cmd .= " -v";
+ $cmd .= " {$g['varetc_path']}/nsupdatecmds";
+
+ mwexec_bg($cmd);
+ }
+ }
+
+ return 0;
+}
+
+function setup_wireless_olsr() {
+ global $config, $g;
+ if(!$config['installedpackages']['olsrd'] || !$config['installedpackages'])
+ return;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "setup_wireless_olsr($interface) being called $mt\n";
+ }
+ conf_mount_rw();
+ foreach($config['installedpackages']['olsrd']['config'] as $olsrd) {
+ $olsr_enable = $olsrd['enable'];
+ if($olsr_enable <> "on")
+ return;
+ $fd = fopen("{$g['varetc_path']}/olsr.conf", "w");
+
+ if($olsrd['announcedynamicroute'] or $olsrd['enableannounce'] == "on") {
+ $enableannounce .= "\nHna4\n";
+ $enableannounce .= "{\n";
+ if($olsrd['announcedynamicroute'])
+ $enableannounce .= "\t{$olsrd['announcedynamicroute']}\n";
+ if($olsrd['enableannounce'] == "on")
+ $enableannounce .= "0.0.0.0 0.0.0.0";
+ $enableannounce .= "\n}\n";
+ } else {
+ $enableannounce = "";
+ }
+
+ $olsr .= <<<EODA
+#
+# olsr.org OLSR daemon config file
+#
+# Lines starting with a # are discarded
+#
+# This file was generated by setup_wireless_olsr() in services.inc
+#
+
+# This file is an example of a typical
+# configuration for a mostly static
+# network(regarding mobility) using
+# the LQ extention
+
+# Debug level(0-9)
+# If set to 0 the daemon runs in the background
+
+DebugLevel 2
+
+# IP version to use (4 or 6)
+
+IpVersion 4
+
+# Clear the screen each time the internal state changes
+
+ClearScreen yes
+
+{$enableannounce}
+
+# Should olsrd keep on running even if there are
+# no interfaces available? This is a good idea
+# for a PCMCIA/USB hotswap environment.
+# "yes" OR "no"
+
+AllowNoInt yes
+
+# TOS(type of service) value for
+# the IP header of control traffic.
+# If not set it will default to 16
+
+#TosValue 16
+
+# The fixed willingness to use(0-7)
+# If not set willingness will be calculated
+# dynamically based on battery/power status
+# if such information is available
+
+#Willingness 4
+
+# Allow processes like the GUI front-end
+# to connect to the daemon.
+
+IpcConnect
+{
+ # Determines how many simultaneously
+ # IPC connections that will be allowed
+ # Setting this to 0 disables IPC
+
+ MaxConnections 0
+
+ # By default only 127.0.0.1 is allowed
+ # to connect. Here allowed hosts can
+ # be added
+
+ Host 127.0.0.1
+ #Host 10.0.0.5
+
+ # You can also specify entire net-ranges
+ # that are allowed to connect. Multiple
+ # entries are allowed
+
+ #Net 192.168.1.0 255.255.255.0
+}
+
+# Wether to use hysteresis or not
+# Hysteresis adds more robustness to the
+# link sensing but delays neighbor registration.
+# Used by default. 'yes' or 'no'
+
+UseHysteresis no
+
+# Hysteresis parameters
+# Do not alter these unless you know
+# what you are doing!
+# Set to auto by default. Allowed
+# values are floating point values
+# in the interval 0,1
+# THR_LOW must always be lower than
+# THR_HIGH.
+
+#HystScaling 0.50
+#HystThrHigh 0.80
+#HystThrLow 0.30
+
+
+# Link quality level
+# 0 = do not use link quality
+# 1 = use link quality for MPR selection
+# 2 = use link quality for MPR selection and routing
+# Defaults to 0
+
+LinkQualityLevel {$olsrd['enablelqe']}
+
+# Link quality window size
+# Defaults to 10
+
+LinkQualityWinSize 10
+
+# Polling rate in seconds(float).
+# Default value 0.05 sec
+
+Pollrate 0.05
+
+
+# TC redundancy
+# Specifies how much neighbor info should
+# be sent in TC messages
+# Possible values are:
+# 0 - only send MPR selectors
+# 1 - send MPR selectors and MPRs
+# 2 - send all neighbors
+#
+# defaults to 0
+
+TcRedundancy 2
+
+#
+# MPR coverage
+# Specifies how many MPRs a node should
+# try select to reach every 2 hop neighbor
+#
+# Can be set to any integer >0
+#
+# defaults to 1
+
+MprCoverage 3
+
+# Example plugin entry with parameters:
+
+EODA;
+
+if($olsrd['enablehttpinfo'] == "on") {
+ $olsr .= <<<EODB
+
+LoadPlugin "/usr/local/lib/olsrd_httpinfo.so.0.1"
+{
+ PlParam "port" "{$olsrd['port']}"
+ PlParam "Net" "{$olsrd['allowedhttpinfohost']} {$olsrd['allowedhttpinfosubnet']}"
+}
+
+EODB;
+
+}
+
+if($olsrd['enabledsecure'] == "on") {
+ $olsr .= <<<EODC
+
+LoadPlugin "/usr/local/lib/olsrd_secure.so.0.5"
+{
+ PlParam "Keyfile" "/usr/local/etc/olsrkey.txt"
+}
+
+EODC;
+
+}
+
+if($olsrd['enabledyngw'] == "on") {
+
+ /* unset default route, olsr auto negotiates */
+ mwexec("/sbin/route delete default");
+
+ $olsr .= <<<EODE
+
+LoadPlugin "/usr/local/lib/olsrd_dyn_gw.so.0.4"
+{
+ # how often to look for a inet gw, in seconds
+ # defaults to 5 secs, if commented out
+ PlParam "Interval" "{$olsrd['polling']}"
+
+ # if one or more IPv4 addresses are given, do a ping on these in
+ # descending order to validate that there is not only an entry in
+ # routing table, but also a real internet connection. If any of
+ # these addresses could be pinged successfully, the test was
+ # succesful, i.e. if the ping on the 1st address was successful,the
+ # 2nd won't be pinged
+ PlParam "Ping" "{$olsrd['ping']}"
+ #PlParam "HNA" "192.168.81.0 255.255.255.0"
+}
+
+EODE;
+
+}
+
+foreach($config['installedpackages']['olsrd']['config'] as $conf) {
+ $interfaces = explode(',', $conf['iface_array']);
+ foreach($interfaces as $interface) {
+ $realinterface = convert_friendly_interface_to_real_interface_name($interface);
+$olsr .= <<<EODAD
+Interface "{$realinterface}"
+{
+
+ # Hello interval in seconds(float)
+ HelloInterval 2.0
+
+ # HELLO validity time
+ HelloValidityTime 20.0
+
+ # TC interval in seconds(float)
+ TcInterval 5.0
+
+ # TC validity time
+ TcValidityTime 30.0
+
+ # MID interval in seconds(float)
+ MidInterval 5.0
+
+ # MID validity time
+ MidValidityTime 30.0
+
+ # HNA interval in seconds(float)
+ HnaInterval 5.0
+
+ # HNA validity time
+ HnaValidityTime 30.0
+
+ # When multiple links exist between hosts
+ # the weight of interface is used to determine
+ # the link to use. Normally the weight is
+ # automatically calculated by olsrd based
+ # on the characteristics of the interface,
+ # but here you can specify a fixed value.
+ # Olsrd will choose links with the lowest value.
+
+ # Weight 0
+
+
+}
+
+EODAD;
+
+ }
+ break;
+}
+ fwrite($fd, $olsr);
+ fclose($fd);
+ }
+
+ if(is_process_running("olsrd"))
+ mwexec("/usr/bin/killall olsrd", true);
+
+ sleep(2);
+
+ mwexec_bg("/usr/local/sbin/olsrd -f {$g['varetc_path']}/olsr.conf");
+
+ conf_mount_ro();
+}
+
+/* configure cron service */
+function configure_cron() {
+ global $g, $config;
+ conf_mount_rw();
+ /* preserve existing crontab entries */
+ $crontab_contents = file_get_contents("/etc/crontab");
+ $crontab_contents_a = split("\n", $crontab_contents);
+
+ for ($i = 0; $i < count($crontab_contents_a); $i++) {
+ $item =& $crontab_contents_a[$i];
+ if (strpos($item, "# pfSense specific crontab entries") !== false) {
+ array_splice($crontab_contents_a, $i - 1);
+ break;
+ }
+ }
+ $crontab_contents = implode("\n", $crontab_contents_a) . "\n";
+
+
+ if (is_array($config['cron']['item'])) {
+ $crontab_contents .= "#\n";
+ $crontab_contents .= "# pfSense specific crontab entries\n";
+ $crontab_contents .= "# Created: " . date("F j, Y, g:i a") . "\n";
+ $crontab_contents .= "#\n";
+
+ foreach ($config['cron']['item'] as $item) {
+ $crontab_contents .= "\n{$item['minute']}\t";
+ $crontab_contents .= "{$item['hour']}\t";
+ $crontab_contents .= "{$item['mday']}\t";
+ $crontab_contents .= "{$item['month']}\t";
+ $crontab_contents .= "{$item['wday']}\t";
+ $crontab_contents .= "{$item['who']}\t";
+ $crontab_contents .= "{$item['command']}";
+ }
+
+ $crontab_contents .= "\n#\n";
+ $crontab_contents .= "# If possible do not add items to this file manually.\n";
+ $crontab_contents .= "# If you do so, this file must be terminated with a blank line (e.g. new line)\n";
+ $crontab_contents .= "#\n\n";
+ }
+
+ /* please maintain the newline at the end of file */
+ file_put_contents("/etc/crontab", $crontab_contents);
+
+ if (!$g['booting'])
+ conf_mount_ro();
+}
+
+function upnp_action ($action) {
+ switch($action) {
+ case "start":
+ if(file_exists('/var/etc/miniupnpd.conf'))
+ mwexec_bg('/usr/local/sbin/miniupnpd -f /var/etc/miniupnpd.conf');
+ break;
+ case "stop":
+ while((int)exec("pgrep miniupnpd | wc -l") > 0)
+ mwexec('killall miniupnpd 2>/dev/null', true);
+ mwexec('/sbin/pfctl -aminiupnpd -Fr 2>&1 >/dev/null');
+ mwexec('/sbin/pfctl -aminiupnpd -Fn 2>&1 >/dev/null');
+ break;
+ case "restart":
+ upnp_action('stop');
+ upnp_action('start');
+ break;
+ }
+}
+
+function upnp_start() {
+ global $config, $g;
+ if($config['installedpackages']['miniupnpd']['config'][0]['enable']) {
+ if($g['booting']) {
+ echo "Starting UPnP service...";
+ include('/usr/local/pkg/miniupnpd.inc');
+ sync_package_miniupnpd();
+ echo "done.\n";
+ }
+ else {
+ upnp_action('start');
+ }
+ }
+}
+
+?>
diff --git a/config/Fit123/bin/ltsp/services_dhcp.abc b/config/Fit123/bin/ltsp/services_dhcp.abc
new file mode 100644
index 00000000..89548502
--- /dev/null
+++ b/config/Fit123/bin/ltsp/services_dhcp.abc
@@ -0,0 +1,642 @@
+<?php
+/* $Id$ */
+/*
+ services_dhcp.php
+ part of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require("guiconfig.inc");
+
+$if = $_GET['if'];
+if ($_POST['if'])
+ $if = $_POST['if'];
+
+/* if OLSRD is enabled, allow WAN to house DHCP. */
+if($config['installedpackages']['olsrd']) {
+ foreach($config['installedpackages']['olsrd']['config'] as $olsrd) {
+ if($olsrd['enable']) {
+ $iflist = array("lan" => "LAN", "wan" => "WAN");
+ $is_olsr_enabled = true;
+ break;
+ }
+ }
+}
+
+if(!$iflist)
+ $iflist = array("lan" => "LAN");
+
+for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
+ $oc = $config['interfaces']['opt' . $i];
+
+ if (isset($oc['enable']) && $oc['if'] && (!$oc['bridge'])) {
+ $iflist['opt' . $i] = $oc['descr'];
+ }
+}
+
+if (!$if || !isset($iflist[$if]))
+ $if = "lan";
+
+$pconfig['range_from'] = $config['dhcpd'][$if]['range']['from'];
+$pconfig['range_to'] = $config['dhcpd'][$if]['range']['to'];
+$pconfig['deftime'] = $config['dhcpd'][$if]['defaultleasetime'];
+$pconfig['maxtime'] = $config['dhcpd'][$if]['maxleasetime'];
+$pconfig['gateway'] = $config['dhcpd'][$if]['gateway'];
+list($pconfig['wins1'],$pconfig['wins2']) = $config['dhcpd'][$if]['winsserver'];
+list($pconfig['dns1'],$pconfig['dns2']) = $config['dhcpd'][$if]['dnsserver'];
+$pconfig['enable'] = isset($config['dhcpd'][$if]['enable']);
+$pconfig['denyunknown'] = isset($config['dhcpd'][$if]['denyunknown']);
+$pconfig['staticarp'] = isset($config['dhcpd'][$if]['staticarp']);
+$pconfig['ddnsdomain'] = $config['dhcpd'][$if]['ddnsdomain'];
+$pconfig['ddnsupdate'] = isset($config['dhcpd'][$if]['ddnsupdate']);
+list($pconfig['ntp1'],$pconfig['ntp2']) = $config['dhcpd'][$if]['ntpserver'];
+$pconfig['netboot'] = isset($config['dhcpd'][$if]['netboot']);
+$pconfig['nextserver'] = $config['dhcpd'][$if]['next-server'];
+$pconfig['filename'] = $config['dhcpd'][$if]['filename'];
+$pconfig['rootpath'] = $config['dhcpd'][$if]['rootpath'];
+$pconfig['failover_peerip'] = $config['dhcpd'][$if]['failover_peerip'];
+$pconfig['netmask'] = $config['dhcpd'][$if]['netmask'];
+
+$ifcfg = $config['interfaces'][$if];
+
+/* set the enabled flag which will tell us if DHCP relay is enabled
+ * on any interface. We will use this to disable DHCP server since
+ * the two are not compatible with each other.
+ */
+
+$dhcrelay_enabled = false;
+$dhcrelaycfg = $config['dhcrelay'];
+
+if(is_array($dhcrelaycfg)) {
+ foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) {
+ if (isset($dhcrelayifconf['enable']) &&
+ (($dhcrelayif == "lan") ||
+ (isset($config['interfaces'][$dhcrelayif]['enable']) &&
+ $config['interfaces'][$dhcrelayif]['if'] && (!$config['interfaces'][$dhcrelayif]['bridge']))))
+ $dhcrelay_enabled = true;
+ }
+}
+
+
+if (!is_array($config['dhcpd'][$if]['staticmap'])) {
+ $config['dhcpd'][$if]['staticmap'] = array();
+}
+staticmaps_sort($if);
+$a_maps = &$config['dhcpd'][$if]['staticmap'];
+
+function is_inrange($test, $start, $end) {
+ if ( (ip2long($test) < ip2long($end)) && (ip2long($test) > ip2long($start)) )
+ return true;
+ else
+ return false;
+}
+
+if ($_POST) {
+
+ unset($input_errors);
+
+ $pconfig = $_POST;
+
+ /* input validation */
+ if ($_POST['enable']) {
+ $reqdfields = explode(" ", "range_from range_to");
+ $reqdfieldsn = explode(",", "Range begin,Range end");
+
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+
+ foreach($a_maps as $mapent) {
+ if(is_inrange($mapent['ipaddr'], $_POST['range_from'], $_POST['range_to'])) {
+ $input_errors[] = "{$mapent['ipaddr']} is inside the range you specified.";
+ }
+
+ }
+
+ if (($_POST['range_from'] && !is_ipaddr($_POST['range_from']))) {
+ $input_errors[] = "A valid range must be specified.";
+ }
+ if (($_POST['range_to'] && !is_ipaddr($_POST['range_to']))) {
+ $input_errors[] = "A valid range must be specified.";
+ }
+ if (($_POST['gateway'] && !is_ipaddr($_POST['gateway']))) {
+ $input_errors[] = "A valid IP address must be specified for the gateway.";
+ }
+ if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) {
+ $input_errors[] = "A valid IP address must be specified for the primary/secondary WINS servers.";
+ }
+ if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) {
+ $input_errors[] = "A valid IP address must be specified for the primary/secondary DNS servers.";
+ }
+ if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60))) {
+ $input_errors[] = "The default lease time must be at least 60 seconds.";
+ }
+ if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime']))) {
+ $input_errors[] = "The maximum lease time must be at least 60 seconds and higher than the default lease time.";
+ }
+ if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain']))) {
+ $input_errors[] = "A valid domain name must be specified for the dynamic DNS registration.";
+ }
+ if (($_POST['ntp1'] && !is_ipaddr($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddr($_POST['ntp2']))) {
+ $input_errors[] = "A valid IP address must be specified for the primary/secondary NTP servers.";
+ }
+ if (($_POST['nextserver'] && !is_ipaddr($_POST['nextserver']))) {
+ $input_errors[] = "A valid IP address must be specified for the network boot server.";
+ }
+
+
+ if (!$input_errors) {
+ /* make sure the range lies within the current subnet */
+ $subnet_start = (ip2long($ifcfg['ipaddr']) & gen_subnet_mask_long($ifcfg['subnet']));
+ $subnet_end = (ip2long($ifcfg['ipaddr']) | (~gen_subnet_mask_long($ifcfg['subnet'])));
+
+ if ((ip2long($_POST['range_from']) < $subnet_start) || (ip2long($_POST['range_from']) > $subnet_end) ||
+ (ip2long($_POST['range_to']) < $subnet_start) || (ip2long($_POST['range_to']) > $subnet_end)) {
+ $input_errors[] = "The specified range lies outside of the current subnet.";
+ }
+
+ if (ip2long($_POST['range_from']) > ip2long($_POST['range_to']))
+ $input_errors[] = "The range is invalid (first element higher than second element).";
+
+ /* make sure that the DHCP Relay isn't enabled on this interface */
+ if (isset($config['dhcrelay'][$if]['enable']))
+ $input_errors[] = "You must disable the DHCP relay on the {$iflist[$if]} interface before enabling the DHCP server.";
+ }
+ }
+
+ if (!$input_errors) {
+ $config['dhcpd'][$if]['range']['from'] = $_POST['range_from'];
+ $config['dhcpd'][$if]['range']['to'] = $_POST['range_to'];
+ $config['dhcpd'][$if]['defaultleasetime'] = $_POST['deftime'];
+ $config['dhcpd'][$if]['maxleasetime'] = $_POST['maxtime'];
+ $config['dhcpd'][$if]['netmask'] = $_POST['netmask'];
+ $previous = $config['dhcpd'][$if]['failover_peerip'];
+ if($previous <> $_POST['failover_peerip']) {
+ mwexec("rm -rf /var/dhcpd/var/db/*");
+ }
+ $config['dhcpd'][$if]['failover_peerip'] = $_POST['failover_peerip'];
+
+ unset($config['dhcpd'][$if]['winsserver']);
+ if ($_POST['wins1'])
+ $config['dhcpd'][$if]['winsserver'][] = $_POST['wins1'];
+ if ($_POST['wins2'])
+ $config['dhcpd'][$if]['winsserver'][] = $_POST['wins2'];
+
+ unset($config['dhcpd'][$if]['dnsserver']);
+ if ($_POST['dns1'])
+ $config['dhcpd'][$if]['dnsserver'][] = $_POST['dns1'];
+ if ($_POST['dns2'])
+ $config['dhcpd'][$if]['dnsserver'][] = $_POST['dns2'];
+
+ $config['dhcpd'][$if]['gateway'] = $_POST['gateway'];
+ $config['dhcpd'][$if]['denyunknown'] = ($_POST['denyunknown']) ? true : false;
+ $config['dhcpd'][$if]['enable'] = ($_POST['enable']) ? true : false;
+ $config['dhcpd'][$if]['staticarp'] = ($_POST['staticarp']) ? true : false;
+ $config['dhcpd'][$if]['ddnsdomain'] = $_POST['ddnsdomain'];
+ $config['dhcpd'][$if]['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
+
+ unset($config['dhcpd'][$if]['ntpserver']);
+ if ($_POST['ntp1'])
+ $config['dhcpd'][$if]['ntpserver'][] = $_POST['ntp1'];
+ if ($_POST['ntp2'])
+ $config['dhcpd'][$if]['ntpserver'][] = $_POST['ntp2'];
+
+ $config['dhcpd'][$if]['netboot'] = ($_POST['netboot']) ? true : false;
+ $config['dhcpd'][$if]['next-server'] = $_POST['nextserver'];
+ $config['dhcpd'][$if]['filename'] = $_POST['filename'];
+ $config['dhcpd'][$if]['rootpath'] = $_POST['rootpath'];
+
+ write_config();
+
+ /* static arp configuration */
+ interfaces_staticarp_configure($if);
+
+ $retval = 0;
+ $retvaldhcp = 0;
+ $retvaldns = 0;
+ config_lock();
+ /* dnsmasq_configure calls dhcpd_configure */
+ /* no need to restart dhcpd twice */
+ if (isset($config['dnsmasq']['regdhcpstatic'])) {
+ $retvaldns = services_dnsmasq_configure();
+ if ($retvaldns == 0) {
+ if (file_exists($d_hostsdirty_path))
+ unlink($d_hostsdirty_path);
+ if (file_exists($d_staticmapsdirty_path))
+ unlink($d_staticmapsdirty_path);
+ }
+ } else {
+ $retvaldhcp = services_dhcpd_configure();
+ if ($retvaldhcp == 0) {
+ if (file_exists($d_staticmapsdirty_path))
+ unlink($d_staticmapsdirty_path);
+ }
+ }
+ config_unlock();
+ if($retvaldhcp == 1 || $retvaldns == 1)
+ $retval = 1;
+ $savemsg = get_std_save_message($retval);
+ }
+}
+
+if ($_GET['act'] == "del") {
+ if ($a_maps[$_GET['id']]) {
+ unset($a_maps[$_GET['id']]);
+ write_config();
+ if(isset($config['dhcpd'][$if]['enable'])) {
+ touch($d_staticmapsdirty_path);
+ if (isset($config['dnsmasq']['regdhcpstatic']))
+ touch($d_hostsdirty_path);
+ }
+ header("Location: services_dhcp.php?if={$if}");
+ exit;
+ }
+}
+
+$pgtitle = "Services: DHCP server";
+include("head.inc");
+
+?>
+
+<script type="text/javascript" language="JavaScript">
+
+function enable_change(enable_over) {
+ var endis;
+ endis = !(document.iform.enable.checked || enable_over);
+ document.iform.range_from.disabled = endis;
+ document.iform.range_to.disabled = endis;
+ document.iform.wins1.disabled = endis;
+ document.iform.wins2.disabled = endis;
+ document.iform.dns1.disabled = endis;
+ document.iform.dns2.disabled = endis;
+ document.iform.deftime.disabled = endis;
+ document.iform.maxtime.disabled = endis;
+ document.iform.gateway.disabled = endis;
+ document.iform.failover_peerip.disabled = endis;
+ document.iform.staticarp.disabled = endis;
+ document.iform.ddnsdomain.disabled = endis;
+ document.iform.ddnsupdate.disabled = endis;
+ document.iform.ntp1.disabled = endis;
+ document.iform.ntp2.disabled = endis;
+ document.iform.netboot.disabled = endis;
+ document.iform.nextserver.disabled = endis;
+ document.iform.filename.disabled = endis;
+ document.iform.rootpath.disabled = endis;
+ document.iform.denyunknown.disabled = endis;
+}
+
+function show_ddns_config() {
+ document.getElementById("showddnsbox").innerHTML='';
+ aodiv = document.getElementById('showddns');
+ aodiv.style.display = "block";
+}
+
+function show_ntp_config() {
+ document.getElementById("showntpbox").innerHTML='';
+ aodiv = document.getElementById('showntp');
+ aodiv.style.display = "block";
+}
+
+function show_netboot_config() {
+ document.getElementById("shownetbootbox").innerHTML='';
+ aodiv = document.getElementById('shownetboot');
+ aodiv.style.display = "block";
+}
+
+</script>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle"><?=$pgtitle?></p>
+<form action="services_dhcp.php" method="post" name="iform" id="iform">
+<?php if ($input_errors) print_input_errors($input_errors); ?>
+<?php if ($savemsg) print_info_box($savemsg); ?>
+<?php
+ if ($dhcrelay_enabled) {
+ echo "DHCP Relay is currently enabled. Cannot enable the DHCP Server service while the DHCP Relay is enabled on any interface.";
+ include("fend.inc");
+ echo "</body>";
+ echo "</html>";
+ exit;
+ }
+?>
+<?php if (file_exists($d_staticmapsdirty_path)): ?><p>
+<?php print_info_box_np("The static mapping configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
+<?php endif; ?>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td>
+ <?php
+ /* active tabs */
+ $tab_array = array();
+ $tabscounter = 0;
+ $i = 0;
+ foreach ($iflist as $ifent => $ifname) {
+ if ($ifent == $if)
+ $active = true;
+ else
+ $active = false;
+ $tab_array[] = array($ifname, $active, "services_dhcp.php?if={$ifent}");
+ }
+ display_top_tabs($tab_array);
+ ?>
+ </td></tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top" class="vtable">&nbsp;</td>
+ <td width="78%" class="vtable">
+ <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
+ <strong>Enable DHCP server on
+ <?=htmlspecialchars($iflist[$if]);?>
+ interface</strong></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vtable">&nbsp;</td>
+ <td width="78%" class="vtable">
+ <input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
+ <strong>Deny unknown clients</strong><br>
+ If this is checked, only the clients defined below will get DHCP leases from this server. </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Subnet</td>
+ <td width="78%" class="vtable">
+ <?=gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Subnet
+ mask</td>
+ <td width="78%" class="vtable">
+ <?=gen_subnet_mask($ifcfg['subnet']);?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Available
+ range</td>
+ <td width="78%" class="vtable">
+ <?=long2ip(ip2long($ifcfg['ipaddr']) & gen_subnet_mask_long($ifcfg['subnet']));?>
+ -
+ <?=long2ip(ip2long($ifcfg['ipaddr']) | (~gen_subnet_mask_long($ifcfg['subnet']))); ?>
+ </td>
+ </tr>
+ <?php if($is_olsr_enabled): ?>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Subnet Mask</td>
+ <td width="78%" class="vtable">
+ <select name="netmask" class="formfld" id="netmask">
+ <?php
+ for ($i = 32; $i > 0; $i--) {
+ if($i <> 31) {
+ echo "<option value=\"{$i}\" ";
+ if ($i == $pconfig['netmask']) echo "selected";
+ echo ">" . $i . "</option>";
+ }
+ }
+ ?>
+ </select>
+ </td>
+ </tr>
+ <?php endif; ?>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Range</td>
+ <td width="78%" class="vtable">
+ <input name="range_from" type="text" class="formfld" id="range_from" size="20" value="<?=htmlspecialchars($pconfig['range_from']);?>">
+ &nbsp;to&nbsp; <input name="range_to" type="text" class="formfld" id="range_to" size="20" value="<?=htmlspecialchars($pconfig['range_to']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">WINS servers</td>
+ <td width="78%" class="vtable">
+ <input name="wins1" type="text" class="formfld" id="wins1" size="20" value="<?=htmlspecialchars($pconfig['wins1']);?>"><br>
+ <input name="wins2" type="text" class="formfld" id="wins2" size="20" value="<?=htmlspecialchars($pconfig['wins2']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">DNS servers</td>
+ <td width="78%" class="vtable">
+ <input name="dns1" type="text" class="formfld" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>"><br>
+ <input name="dns2" type="text" class="formfld" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>"><br>
+ NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Gateway</td>
+ <td width="78%" class="vtable">
+ <input name="gateway" type="text" class="formfld" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>"><br>
+ The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Default lease
+ time</td>
+ <td width="78%" class="vtable">
+ <input name="deftime" type="text" class="formfld" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>">
+ seconds<br>
+ This is used for clients that do not ask for a specific
+ expiration time.<br>
+ The default is 7200 seconds.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Maximum lease
+ time</td>
+ <td width="78%" class="vtable">
+ <input name="maxtime" type="text" class="formfld" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>">
+ seconds<br>
+ This is the maximum lease time for clients that ask
+ for a specific expiration time.<br>
+ The default is 86400 seconds.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Failover peer IP:</td>
+ <td width="78%" class="vtable">
+ <input name="failover_peerip" type="text" class="formfld" id="failover_peerip" size="20" value="<?=htmlspecialchars($pconfig['failover_peerip']);?>"><br>
+ Leave blank to disable. Enter the REAL address of the other machine. Machines must be using CARP.
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Static ARP</td>
+ <td width="78%" class="vtable">
+ <table>
+ <tr>
+ <td>
+ <input valign="middle" type="checkbox" value="yes" name="staticarp" id="staticarp" <?php if($pconfig['staticarp']) echo " checked"; ?>>&nbsp;
+ </td>
+ <td>
+ <b>Enable Static ARP entries</b>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+ <span class="red"><strong>Note:</strong></span> Only the machines listed below will be able to communicate with the firewall on this NIC.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Dynamic DNS</td>
+ <td width="78%" class="vtable">
+ <div id="showddnsbox">
+ <input type="button" onClick="show_ddns_config()" value="Advanced"></input> - Show Dynamic DNS</a>
+ </div>
+ <div id="showddns" style="display:none">
+ <input valign="middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if($pconfig['ddnsupdate']) echo " checked"; ?>>&nbsp;
+ <b>Enable registration of DHCP client names in DNS.</b><br />
+ <p>
+ <input name="ddnsdomain" type="text" class="formfld" id="ddnsdomain" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomain']);?>"><br />
+ Note: Leave blank to disable dynamic DNS registration.<br />
+ Enter the dynamic DNS domain which will be used to register client names in the DNS server.
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">NTP servers</td>
+ <td width="78%" class="vtable">
+ <div id="showntpbox">
+ <input type="button" onClick="show_ntp_config()" value="Advanced"></input> - Show NTP configuration</a>
+ </div>
+ <div id="showntp" style="display:none">
+ <input name="ntp1" type="text" class="formfld" id="ntp1" size="20" value="<?=htmlspecialchars($pconfig['ntp1']);?>"><br>
+ <input name="ntp2" type="text" class="formfld" id="ntp2" size="20" value="<?=htmlspecialchars($pconfig['ntp2']);?>">
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Enable Network booting</td>
+ <td width="78%" class="vtable">
+ <div id="shownetbootbox">
+ <input type="button" onClick="show_netboot_config()" value="Advanced"></input> - Show Network booting</a>
+ </div>
+ <div id="shownetboot" style="display:none">
+ <input valign="middle" type="checkbox" value="yes" name="netboot" id="netboot" <?php if($pconfig['netboot']) echo " checked"; ?>>&nbsp;
+ <b>Enables network booting.</b>
+ <p>
+ <input name="nextserver" type="text" class="formfld" id="nextserver" size="20" value="<?=htmlspecialchars($pconfig['nextserver']);?>"><br>
+ Enter the IP address from the network boot server.
+ <p>
+ <input name="filename" type="text" class="formfld" id="filename" size="20" value="<?=htmlspecialchars($pconfig['filename']);?>"><br>
+ Enter the filename used for network booting.<br />
+ Note: You need both a filename and a boot server configured for this to work!<br />
+ <p>
+ <input name="rootpath" type="text" class="formfld" id="rootpath" size="20" value="<?=htmlspecialchars($pconfig['rootpath']);?>"><br>
+ Enter option root-path.
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="if" type="hidden" value="<?=$if;?>">
+ <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%"> <p><span class="vexpl"><span class="red"><strong>Note:<br>
+ </strong></span>The DNS servers entered in <a href="system.php">System:
+ General setup</a> (or the <a href="services_dnsmasq.php">DNS
+ forwarder</a>, if enabled) </span><span class="vexpl">will
+ be assigned to clients by the DHCP server.<br>
+ <br>
+ The DHCP lease table can be viewed on the <a href="diag_dhcp_leases.php">Status:
+ DHCP leases</a> page.<br>
+ </span></p>
+ </td>
+ </tr>
+ </table>
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="25%" class="listhdrr">MAC address</td>
+ <td width="15%" class="listhdrr">IP address</td>
+ <td width="20%" class="listhdrr">Hostname</td>
+ <td width="30%" class="listhdr">Description</td>
+ <td width="10%" class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
+ <td valign="middle" width="17"></td>
+ <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <?php if(is_array($a_maps)): ?>
+ <?php $i = 0; foreach ($a_maps as $mapent): ?>
+ <?php if($mapent['mac'] <> "" or $mapent['ipaddr'] <> ""): ?>
+ <tr>
+ <td class="listlr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
+ <?=htmlspecialchars($mapent['mac']);?>
+ </td>
+ <td class="listr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
+ <?=htmlspecialchars($mapent['ipaddr']);?>&nbsp;
+ </td>
+ <td class="listr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
+ <?=htmlspecialchars($mapent['hostname']);?>&nbsp;
+ </td>
+ <td class="listbg" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
+ <font color="#FFFFFF"><?=htmlspecialchars($mapent['descr']);?>&nbsp;</font>
+ </td>
+ <td valign="middle" nowrap class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
+ <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
+ <td valign="middle"><a href="services_dhcp.php?if=<?=$if;?>&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this mapping?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <?php endif; ?>
+ <?php $i++; endforeach; ?>
+ <?php endif; ?>
+ <tr>
+ <td class="list" colspan="4"></td>
+ <td class="list">
+ <table border="0" cellspacing="0" cellpadding="1">
+ <tr>
+ <td valign="middle" width="17"></td>
+ <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
+</table>
+</form>
+<script language="JavaScript">
+<!--
+enable_change(false);
+//-->
+</script>
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/config/Fit123/ddns.xml b/config/Fit123/ddns.xml
new file mode 100644
index 00000000..ea461254
--- /dev/null
+++ b/config/Fit123/ddns.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<packagegui>
+ <copyright></copyright>
+ <description>Describe your package here</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>ddns</name>
+ <title>DDNS</title>
+ <include_file>/usr/local/pkg/fit123.inc</include_file>
+ <tabs>
+ <tab>
+ <text>Fit123</text>
+ <url>/pkg_edit.php?xml=fit123.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>DDNS</text>
+ <url>/pkg_edit.php?xml=ddns.xml&amp;id=0</url>
+ </tab>
+ </tabs>
+ <fields>
+ <field>
+ <fielddescr>Dynamic DNS</fielddescr>
+ <fieldname>enable</fieldname>
+ <description>
+ A more customize way to update dynamic dns and mainly for IP's that doesn't change very often.&lt;br&gt;
+ Will check for ip change every 5 min via local shell script and will only contact provider on change.&lt;br&gt;
+ </description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Enter string that should be phrased</fielddescr>
+ <fieldname>line1</fieldname>
+ <description>
+ String for OpenDNS should look like:&lt;br&gt;
+ https://username:password@updates.opendns.com/nic/update?hostname=
+ </description>
+ <type>textarea</type>
+ <cols>80</cols>
+ <rows>1</rows>
+ </field>
+ <field>
+ <fielddescr>Enter 2th string that should be phrased</fielddescr>
+ <fieldname>line2</fieldname>
+ <description>Leave empty if not used</description>
+ <type>textarea</type>
+ <cols>80</cols>
+ <rows>1</rows>
+ </field>
+ <field>
+ <fielddescr>Enter 3th string that should be phrased</fielddescr>
+ <fieldname>line3</fieldname>
+ <description>Leave empty if not used</description>
+ <type>textarea</type>
+ <cols>80</cols>
+ <rows>1</rows>
+ </field>
+ </fields>
+ <custom_add_php_command></custom_add_php_command>
+ <custom_php_command_before_form>ddns_config();</custom_php_command_before_form>
+ <custom_php_after_form_command></custom_php_after_form_command>
+ <custom_php_validation_command></custom_php_validation_command>
+ <custom_php_resync_config_command></custom_php_resync_config_command>
+ <custom_php_install_command>Fit123_install_config();</custom_php_install_command>
+ <custom_php_deinstall_command>Fit123_install_deinstall();</custom_php_deinstall_command>
+</packagegui>
diff --git a/config/Fit123/fit123.inc b/config/Fit123/fit123.inc
new file mode 100644
index 00000000..646ab65f
--- /dev/null
+++ b/config/Fit123/fit123.inc
@@ -0,0 +1,298 @@
+<?php
+
+function Fit123_install_deinstall() {
+ conf_mount_rw();
+ config_lock();
+ exec("cd ..");
+ exec("rm -d -R /usr/local/pkg/Fit123");
+ conf_mount_ro();
+ config_unlock();
+}
+
+function Fit123_install_config() {
+ conf_mount_rw();
+ config_lock();
+ exec("cd ..");
+//Creating backup directory
+ exec("mkdir /usr/local/pkg/Fit123");
+ exec("mkdir /usr/local/pkg/Fit123/backup");
+//Copy orignal files to backup dir
+ //Date
+ exec("cp /usr/local/www/index.php /usr/local/pkg/Fit123/backup/");
+ //Code-Red Nervecenter Theme
+ exec("cp /usr/local/www/themes/nervecenter/all.css /usr/local/pkg/Fit123/backup/");
+ exec("cp /usr/local/www/themes/nervecenter/images/background.gif /usr/local/pkg/Fit123/backup/");
+ exec("cp /usr/local/www/themes/nervecenter/images/footer.png /usr/local/pkg/Fit123/backup/");
+ exec("cp /usr/local/www/themes/nervecenter/images/header.png /usr/local/pkg/Fit123/backup/");
+ //LTSP network boot Option
+ exec("cp /etc/inc/services.inc /usr/local/pkg/Fit123/backup/");
+ exec("cp /usr/local/www/services_dhcp.php /usr/local/pkg/Fit123/backup/");
+ //DNS Server adds option for a 3th and 4th DNS Server
+ exec("cp /usr/local/www/system.php /usr/local/pkg/Fit123/backup/");
+//Greate directories and downloading files to them
+ //Date
+ exec("mkdir /usr/local/pkg/Fit123/date");
+ exec("fetch -o /usr/local/pkg/Fit123/date/index.php http://www.pfsense.com/packages/config/Fit123/bin/date/index.abc");
+ //Code-Red Nervecenter Theme
+ exec("mkdir /usr/local/pkg/Fit123/code-red");
+ exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://www.pfsense.com/packages/config/Fit123/bin/code-red/all.css");
+ exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://www.pfsense.com/packages/config/Fit123/bin/code-red/background.gif");
+ exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://www.pfsense.com/packages/config/Fit123/bin/code-red/footer.png");
+ exec("fetch -o /usr/local/pkg/Fit123/code-red/ http://www.pfsense.com/packages/config/Fit123/bin/code-red/header.png");
+ //LTSP 3th network boot Option
+ exec("mkdir /usr/local/pkg/Fit123/LTSP");
+ exec("fetch -o /usr/local/pkg/Fit123/LTSP/ http://www.pfsense.com/packages/config/Fit123/bin/ltsp/services.inc");
+ exec("fetch -o /usr/local/pkg/Fit123/LTSP/services_dhcp.php http://www.pfsense.com/packages/config/Fit123/bin/ltsp/services_dhcp.abc");
+ //AFC Reset's states after filter change
+ exec("mkdir /usr/local/pkg/Fit123/afc");
+ exec("fetch -o /usr/local/pkg/Fit123/afc/reset_states.sh http://www.pfsense.com/packages/config/Fit123/bin/afc/reset_states.sh");
+ exec("chmod 744 /usr/local/pkg/Fit123/afc/reset_states.sh");
+ //DDNS
+ exec("mkdir /usr/local/pkg/Fit123/ddns");
+ //DNS Server adds option for a 3th and 4th DNS Server
+ exec("mkdir /usr/local/pkg/Fit123/dnssrv");
+ exec("fetch -o /usr/local/pkg/Fit123/dnssrv/system.php http://www.pfsense.com/packages/config/Fit123/bin/dnssrv/system.abc");
+ conf_mount_ro();
+ config_unlock();
+}
+
+function Fit123_config() {
+global $config;
+
+ $adddate = $config['installedpackages']['fit123']['config'][0]['adddate'];
+ if($adddate)
+ exec("cp /usr/local/pkg/Fit123/date/index.php /usr/local/www/index.php");
+ else
+ exec("cp /usr/local/pkg/Fit123/backup/index.php /usr/local/www/index.php");
+
+ $codered = $config['installedpackages']['fit123']['config'][0]['codered'];
+ if($codered){
+ exec("cp /usr/local/pkg/Fit123/code-red/all.css /usr/local/www/themes/nervecenter/all.css");
+ exec("cp /usr/local/pkg/Fit123/code-red/background.gif /usr/local/www/themes/nervecenter/images/background.gif");
+ exec("cp /usr/local/pkg/Fit123/code-red/footer.png /usr/local/www/themes/nervecenter/images/footer.png");
+ exec("cp /usr/local/pkg/Fit123/code-red/header.png /usr/local/www/themes/nervecenter/images/header.png");
+ }
+ else
+ {
+ exec("cp /usr/local/pkg/Fit123/backup/all.css /usr/local/www/themes/nervecenter/all.css");
+ exec("cp /usr/local/pkg/Fit123/backup/background.gif /usr/local/www/themes/nervecenter/images/background.gif");
+ exec("cp /usr/local/pkg/Fit123/backup/footer.png /usr/local/www/themes/nervecenter/images/footer.png");
+ exec("cp /usr/local/pkg/Fit123/backup/header.png /usr/local/www/themes/nervecenter/images/header.png");
+ }
+
+ $ltsp = $config['installedpackages']['fit123']['config'][0]['ltsp'];
+ if($ltsp){
+ exec("cp /usr/local/pkg/Fit123/LTSP/services.inc /etc/inc/services.inc");
+ exec("cp /usr/local/pkg/Fit123/LTSP/services_dhcp.php /usr/local/www/services_dhcp.php");
+ }
+ else
+ {
+ exec("cp /usr/local/pkg/Fit123/backup/services.inc /etc/inc/services.inc");
+ exec("cp /usr/local/pkg/Fit123/backup/services_dhcp.php /usr/local/www/services_dhcp.php");
+ }
+
+ $afc = $config['installedpackages']['fit123']['config'][0]['afc'];
+ if($afc)
+ $config['system']['afterfilterchangeshellcmd'] = "/usr/local/bin/reset_states.sh";
+ else
+ $config['system']['afterfilterchangeshellcmd'] = "";
+
+ $dnssrv = $config['installedpackages']['fit123']['config'][0]['dnssrv'];
+ if($dnssrv)
+ exec("cp /usr/local/pkg/Fit123/dnssrv/system.php /usr/local/www/system.php");
+ else
+ exec("cp /usr/local/pkg/Fit123/backup/system.php /usr/local/www/system.php");
+}
+
+function ddns_config(){
+global $config;
+
+// Is DDNS enable or not
+ $hoba = $config['installedpackages']['ddns']['config'][0]['enable'];
+ if($hoba){
+ // Is DDNS.sh already added as a conjob
+ $task_key = '/usr/local/pkg/Fit123/ddns/DDNS.sh';
+ $x_name='';
+ $x=0;
+ foreach($config['cron']['item'] as $item) {
+ if($item['command']==$task_key) {
+ $x_name = $x;
+ }
+ $x++;
+ }
+ unset($x);
+ if(!$x_name > 0)
+ {
+ // Add cron job DDNS.sh to config.xml
+ $cron_item = array();
+ $cron_item['minute'] = "*/5";
+ $cron_item['hour'] = "*";
+ $cron_item['mday'] = "*";
+ $cron_item['month'] = "*";
+ $cron_item['wday'] = "*";
+ $cron_item['who'] = "root";
+ $cron_item['command'] = "/usr/local/pkg/Fit123/ddns/DDNS.sh";
+ $config['cron']['item'][] = $cron_item;
+ write_config();
+ configure_cron();
+ }
+ }
+ else
+ {
+ // Remove DDNS.sh cron entry from config.xml
+ $task_key = '/usr/local/pkg/Fit123/ddns/DDNS.sh';
+ $x_name='';
+ $x=0;
+ foreach($config['cron']['item'] as $item) {
+ if($item['command']==$task_key) {
+ $x_name = $x;
+ }
+ $x++;
+ }
+ unset($x);
+ if($x_name > 0)
+ {
+ unset($config['cron']['item'][$x_name]);
+ write_config();
+ }
+ configure_cron();
+ }
+
+// Created DDNS updater file ddns.php
+
+ //Get user entry from config.xml
+ $line1text = $config['installedpackages']['ddns']['config'][0]['line1'];
+ $line2text = $config['installedpackages']['ddns']['config'][0]['line2'];
+ $line3text = $config['installedpackages']['ddns']['config'][0]['line3'];
+
+ // Open ddns.php for writing
+ $hf = fopen("/usr/local/pkg/Fit123/ddns/ddns.php","w");
+ if(!$hf) {
+ log_error("could not open /usr/local/pkg/Fit123/ddns/ddns.php for writing");
+ exit;
+ }
+
+ // The start of the config file
+ fwrite($hf, '<?php');
+ fwrite($hf, "\n");
+ fwrite($hf, '$ch = curl_init();');
+ fwrite($hf, "\n");
+ fwrite($hf, 'curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);');
+ fwrite($hf, "\n");
+ // add to config file
+ if ($line1text != ""){
+ fwrite($hf, 'curl_setopt($ch, CURLOPT_URL, "');
+ fwrite($hf, $line1text);
+ fwrite($hf, '");');
+ fwrite($hf, "\n");
+ fwrite($hf, '$result = curl_exec($ch);');
+ fwrite($hf, "\n");
+ }
+ if ($line2text != ""){
+ fwrite($hf, 'curl_setopt($ch, CURLOPT_URL, "');
+ fwrite($hf, $line2text);
+ fwrite($hf, '");');
+ fwrite($hf, "\n");
+ fwrite($hf, '$result = curl_exec($ch);');
+ fwrite($hf, "\n");
+ }
+ if ($line3text != ""){
+ fwrite($hf, 'curl_setopt($ch, CURLOPT_URL, "');
+ fwrite($hf, $line3text);
+ fwrite($hf, '");');
+ fwrite($hf, "\n");
+ fwrite($hf, '$result = curl_exec($ch);');
+ fwrite($hf, "\n");
+ }
+ // The end of the config file
+ fwrite($hf, 'curl_close ($ch);');
+ fwrite($hf, "\n");
+ fwrite($hf, '?>');
+ fwrite($hf, "\n");
+ fclose($hf);
+
+// Create local shell script to watch for wan ip change
+
+ // Get WAN nic name from config.xml
+ $wannic = $config['interfaces']['wan']['if'];
+
+ //Open DDNS.sh for writing
+ $hfd = fopen("/usr/local/pkg/Fit123/ddns/DDNS.sh","w");
+ if(!$hfd) {
+ log_error("could not open /usr/local/pkg/Fit123/ddns/DDNS.sh for writing");
+ exit;
+ }
+ // The start of the config file
+ fwrite($hfd, '#!/bin/sh');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'ext_if="');
+ fwrite($hfd, $wannic);
+ fwrite($hfd, '"');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'dns_file="/usr/local/pkg/Fit123/ddns/DDNS.ip"');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'update_file="/usr/local/bin/php /usr/local/pkg/Fit123/ddns/ddns.php"');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'EXIT_SUCCESS=0');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'EXIT_FAILURE=1');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'if [ `id -u` -ne 0 ]');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'then');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' echo "Only root may run this program."');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' exit $EXIT_FAILURE');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'fi');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'get_ip(){');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' if [ -f $dns_file ]');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' then');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' registered_ip=`cat ${dns_file}`');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' else');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' registered_ip=""');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' fi');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' current_ip=`ifconfig ${ext_if} | awk ');
+ fwrite($hfd, "'");
+ fwrite($hfd, '/inet / { print $2 }');
+ fwrite($hfd, "'");
+ fwrite($hfd, '`');
+ fwrite($hfd, "\n");
+ fwrite($hfd, '}');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'update_hosts(){');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' if [ "$registered_ip" != "$current_ip" ]');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' then');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' $update_file');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' echo $current_ip > $dns_file');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' echo "Your DDNS records have been updated" | logger');
+ fwrite($hfd, "\n");
+ fwrite($hfd, ' fi');
+ fwrite($hfd, "\n");
+ fwrite($hfd, '}');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'get_ip');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'update_hosts');
+ fwrite($hfd, "\n");
+ fwrite($hfd, 'exit $EXIT_SUCCESS');
+ fwrite($hfd, "\n");
+ fclose($hfd);
+
+ exec("chmod 744 /usr/local/pkg/Fit123/ddns/DDNS.sh");
+}
+?>
diff --git a/config/Fit123/fit123.xml b/config/Fit123/fit123.xml
new file mode 100644
index 00000000..04274234
--- /dev/null
+++ b/config/Fit123/fit123.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<packagegui>
+ <copyright></copyright>
+ <description>Describe your package here</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>Fit123</name>
+ <version>0.0.0.1</version>
+ <title>Fit123</title>
+ <include_file>/usr/local/pkg/fit123.inc</include_file>
+ <menu>
+ <name>Fit123</name>
+ <tooltiptext></tooltiptext>
+ <section>Status</section>
+ <url>/pkg_edit.php?xml=fit123.xml&amp;id=0</url>
+ </menu>
+ <tabs>
+ <tab>
+ <text>Fit123</text>
+ <url>/pkg_edit.php?xml=fit123.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>DDNS</text>
+ <url>/pkg_edit.php?xml=ddns.xml&amp;id=0</url>
+ </tab>
+ </tabs>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0644</chmod>
+ <item>http://www.pfsense.com/packages/config/Fit123/fit123.inc</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0644</chmod>
+ <item>http://www.pfsense.com/packages/config/Fit123/ddns.xml</item>
+ </additional_files_needed>
+ <fields>
+ <field>
+ <fielddescr>Date</fielddescr>
+ <fieldname>adddate</fieldname>
+ <description>Adds current date to front page</description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Code-red</fielddescr>
+ <fieldname>codered</fieldname>
+ <description>Change nervecenter Theme to Code-red</description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>LTSP</fielddescr>
+ <fieldname>ltsp</fieldname>
+ <description>Adds 3th network boot option</description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>After Filter Change</fielddescr>
+ <fieldname>afc</fieldname>
+ <description>
+ When using voip behind a multiwan failover setup, states needs to be cleared.&lt;br&gt;
+ (Press save twice to activate and deactivate)
+ </description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>DNS Servers</fielddescr>
+ <fieldname>dnssrv</fieldname>
+ <description>Adds option for a 3th and 4th DNS Server</description>
+ <type>checkbox</type>
+ </field>
+ </fields>
+ <custom_php_command_before_form>Fit123_config();</custom_php_command_before_form>
+ <custom_php_after_form_command></custom_php_after_form_command>
+ <custom_php_validation_command></custom_php_validation_command>
+ <custom_php_resync_config_command></custom_php_resync_config_command>
+ <custom_php_install_command>Fit123_install_config();</custom_php_install_command>
+ <custom_php_deinstall_command>Fit123_install_deinstall();</custom_php_deinstall_command>
+</packagegui>