Example #1
0
function shift_entry($total, $base)
{
    while ($total > 0) {
        $f_idx = $total - 1;
        $to_idx = $total;
        del($base . "entry:" . $to_idx . "/date");
        del($base . "entry:" . $to_idx . "/time");
        del($base . "entry:" . $to_idx . "/domain");
        movc($base . "entry:" . $f_idx, $base . "entry:" . $to_idx);
        $total = $total - 1;
    }
}
Example #2
0
function dns4_setcfg($prefix, $inf)
{
    /* find interface path */
    $infp = XNODE_getpathbytarget("", "inf", "uid", $inf, 0);
    $profile = query($prefix . "/inf/dns4");
    set($infp . "/dns4", $profile);
    /* move the dns profile. */
    if ($profile != "") {
        $dst = XNODE_getpathbytarget("/dns4", "entry", "uid", $profile, 0);
        if ($dst == "") {
            $dst = XNODE_add_entry("/dns4", "DNS4");
        }
        $src = XNODE_getpathbytarget($prefix . "/dns4", "entry", "uid", $profile, 0);
        if ($src != "" || $dst != "") {
            movc($src, $dst);
        }
    }
}
Example #3
0
function filter_setcfg($prefix, $inf)
{
    $base = XNODE_getpathbytarget("", "inf", "uid", $inf, 0);
    $phyinf_name = query($base . "/phyinf");
    //TRACE_debug("1. base=".$base.", phyinf=".$phyinf_name);
    /* Check FILTER */
    $phyinf_base = XNODE_getpathbytarget("", "phyinf", "uid", $phyinf_name, 0);
    $filter_uid = query($phyinf_base . "/filter");
    //TRACE_debug("2. phyinf_base=".$phyinf_base.", filter_uid=".$filter_uid);
    //$filter_uid = query($prefix."/phyinf/filter");
    $filterp = XNODE_getpathbytarget($prefix . "/filter", "remote_mnt", "uid", $filter_uid, 0);
    //if ($filterp == "")
    //{
    /* internet error, no i18n(). */
    //	set_result("FAILED", $prefix."/inf/phyinf", "Invalid filter");
    //	return;
    //}
    /* set filter name from runtime node. */
    /*
    <phyinf>
    	<uid>ETH-1</uid>
    	<active>1</active>
    	<type>eth</type>
    	<filter>FILTER-1</filter>
    </phyinf>
    */
    $runtime_phyinf_base = XNODE_getpathbytarget($prefix, "phyinf", "uid", $phyinf_name, 0);
    $runtime_filter_uid = query($runtime_phyinf_base . "/filter");
    //TRACE_debug("2. runtime_phyinf_base=".$runtime_phyinf_base);
    //TRACE_debug("2. runtime_filter_uid=".$runtime_filter_uid);
    $dst_phyinfp = XNODE_getpathbytarget("", "phyinf", "uid", $phyinf_name, 0);
    set($dst_phyinfp . "/filter", $runtime_filter_uid);
    //TRACE_debug("3. dst_phyinfp=".$dst_phyinfp.", runtime_filter_uid=".$runtime_filter_uid);
    /* move the filter profile. */
    if ($filterp != "") {
        $dst = XNODE_getpathbytarget("/filter", "remote_mnt", "uid", $filter_uid, 0);
        $src = XNODE_getpathbytarget($prefix . "/filter", "remote_mnt", "uid", $filter_uid, 0);
        if ($src != "" || $dst != "") {
            movc($src, $dst);
        }
        //set($to."/entry:".$bwc_index."/enable",		query("enable"));
    }
}
Example #4
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
include "/htdocs/phplib/trace.php";
include "/htdocs/phplib/xnode.php";
/*
 * Internet Usage Meter.
 */
TRACE_debug("enable==============" . query($SETCFG_prefix . "/callmgr/mobile/flowmeter/enable"));
movc($SETCFG_prefix . "/callmgr/mobile/flowmeter", "/callmgr/mobile/flowmeter");
TRACE_debug("enable==============" . query("/callmgr/mobile/flowmeter/enable"));
Example #5
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
include "/htdocs/phplib/xnode.php";
movc($SETCFG_prefix . "/bwc/", "/bwc/");
/* because bwc use xml link, and movc() will destroy link attribute, so re-set link. */
/* For BWC, BWC-2's flag and enable will use BWC-1's config */
setattr("/bwc/entry:2/flag", "link", "/bwc/entry:1/flag");
setattr("/bwc/entry:2/enable", "link", "/bwc/entry:1/enable");
setattr("/bwc/entry:2/rules", "link", "/bwc/entry:1/rules");
Example #6
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix', will indicate the path of the session data. */
movc($SETCFG_prefix . "/route/destination", "/route/destination");
Example #7
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
include "/htdocs/phplib/trace.php";
include "/htdocs/phplib/xnode.php";
$infuid = query($SETCFG_prefix . "/inf/uid");
$ddnsuid = query($SETCFG_prefix . "/inf/ddns4");
$infp = XNODE_getpathbytarget("", "inf", "uid", $infuid, 0);
if ($infp != "") {
    if ($ddnsuid != "") {
        set($infp . "/ddns4", $ddnsuid);
    } else {
        set($infp . "/ddns4", "");
    }
    movc($SETCFG_prefix . "/ddns4", "/ddns4");
}
Example #8
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
/* Removed by Enos, 2010/09/29,
include "/htdocs/phplib/setcfg/libs/bwc.php";
bwc_setcfg($SETCFG_prefix); */
movc($SETCFG_prefix . "/bwc", "/bwc");
Example #9
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
movc($SETCFG_prefix . "/nat", "/nat");
Example #10
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
movc($SETCFG_prefix . "/acl/obfilter2", "/acl/obfilter2");
Example #11
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
movc($SETCFG_prefix . "/acl/firewall2", "/acl/firewall2");
Example #12
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
include "/htdocs/phplib/trace.php";
movc($SETCFG_prefix . "/route6/dynamic", "/route6/dynamic");
Example #13
0
<?php

if ($ACTION == "STARTTODOWNLOADFILE") {
    /* hendry,fix :I want a node that is very UNIQUE !! */
    set("/runtime/hendry_user_setting_tmp", "");
    set("/runtime/mydlink_user_setting_tmp", "");
    movc("/device/account", "/runtime/hendry_user_setting_tmp");
    mov("/mydlink", "/runtime/mydlink_user_setting_tmp");
} else {
    if ($ACTION == "ENDTODOWNLOADFILE") {
        movc("/runtime/hendry_user_setting_tmp/", "/device/account");
        del("/runtime/hendry_user_setting_tmp");
        mov("/runtime/mydlink_user_setting_tmp/mydlink", "/");
        del("/runtime/mydlink_user_setting_tmp");
    }
}
Example #14
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
set("/device/passthrough", "");
movc($SETCFG_prefix . "/device/passthrough", "/device/passthrough");
Example #15
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
movc($SETCFG_prefix . "/acl/macctrl", "/acl/macctrl");
Example #16
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
include "/htdocs/phplib/trace.php";
include "/htdocs/phplib/xnode.php";
$path_run_inf_wan1 = XNODE_getpathbytarget("/runtime", "inf", "uid", "WAN-1", 0);
set($path_run_inf_wan1 . "/ddns4", "");
movc($SETCFG_prefix . "/runtime/inf/ddns4", $path_run_inf_wan1 . "/ddns4");
Example #17
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
include "/htdocs/phplib/trace.php";
$level = query($SETCFG_prefix . "/device/log/level");
TRACE_debug("SETCFG/DEVICE.LOG: /device/log/level = " . $level);
set("/device/log/level", $level);
$subject = query($SETCFG_prefix . "/device/log/email/subject");
TRACE_debug("SETCFG/DEVICE.LOG: /device/log/emai/subject = " . $subject);
fwrite("w", "/var/log/subject", $subject);
set("/device/log/email", "");
movc($SETCFG_prefix . "/device/log/email", "/device/log/email");
//set("/device/log/remote", "");
//movc($SETCFG_prefix."/device/log/remote", "/device/log/remote");
Example #18
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
set("/webaccess/enable", query($SETCFG_prefix . "/webaccess/enable"));
set("/webaccess/httpenable", query($SETCFG_prefix . "/webaccess/httpenable"));
set("/webaccess/httpport", query($SETCFG_prefix . "/webaccess/httpport"));
set("/webaccess/httpsenable", query($SETCFG_prefix . "/webaccess/httpsenable"));
set("/webaccess/httpsport", query($SETCFG_prefix . "/webaccess/httpsport"));
set("/webaccess/remoteenable", query($SETCFG_prefix . "/webaccess/remoteenable"));
movc($SETCFG_prefix . "/webaccess/account", "/webaccess/account");
Example #19
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
movc($SETCFG_prefix . "/vlan", "/vlan");
Example #20
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
include "/htdocs/phplib/trace.php";
include "/htdocs/phplib/xnode.php";
/*
 * SMS.
 */
movc($SETCFG_prefix . "/runtime/callmgr/voice_service/mobile/sms", "/runtime/callmgr/voice_service/mobile/sms");
Example #21
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
include "/htdocs/phplib/xnode.php";
$infp = XNODE_getpathbytarget("", "inf", "uid", "LAN-1", 0);
if ($infp != "") {
    movc($SETCFG_prefix . "/inf/upnp", $infp . "/upnp");
}
Example #22
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
include "/htdocs/phplib/trace.php";
set("/runtime/fdisk", "");
movc($SETCFG_prefix . "/runtime/fdisk", "/runtime/fdisk");
Example #23
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
movc($SETCFG_prefix . "/route/static", "/route/static");
Example #24
0
            $type = "sysact";
            $max = 400;
        }
    }
}
$cnt = query($base . "/entry#");
if ($cnt == "") {
    $cnt = 0;
}
if ($cnt >= $max) {
    if ($archive != "") {
        set($archive . "/type", $type);
        $archive = $archive . "/" . $type;
        del($archive);
        set($archive, "");
        movc($base, $archive);
        event("LOGFULL");
    } else {
        while ($cnt >= $max) {
            $cnt--;
            del($base . "/entry:1");
        }
    }
}
$cnt = query($base . "/entry#");
if ($cnt == "") {
    $cnt = 0;
}
$cnt++;
$runtime_node = "/runtime/services/globals";
set($base . "/entry:" . $cnt . "/time", $TIME);
Example #25
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
movc($SETCFG_prefix . "/route/ipunnumbered", "/route/ipunnumbered");
Example #26
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
movc($SETCFG_prefix . "/acl/urlctrl", "/acl/urlctrl");
Example #27
0
<?php

/* setcfg is used to move the validated session data to the configuration database.
 * The variable, 'SETCFG_prefix',  will indicate the path of the session data. */
movc($SETCFG_prefix . "/vpn", "/vpn");