Skip to content

Commit

Permalink
automatic commit at releng box
Browse files Browse the repository at this point in the history
no todo: aliases with sticky parameters
  • Loading branch information
mc36 committed Mar 30, 2022
1 parent b34a5fe commit 2915590
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13097,3 +13097,5 @@ todo: changelog converter with start point
no todo: lsrp pvrp forbid remote dynamic metric
---------------------------------- 2022-03-30 07:59:57 22.3.30
no todo: changelog converter with start point
---------------------------------- 2022-03-30 08:45:44 22.3.30
no todo: aliases with sticky parameters
20 changes: 20 additions & 0 deletions src/net/freertr/cfg/cfgAlias.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.freertr.user.userExec;
import net.freertr.user.userFilter;
import net.freertr.user.userHelping;
import net.freertr.user.userReader;
import net.freertr.util.cmds;

/**
Expand Down Expand Up @@ -48,6 +49,11 @@ public cfgAlias() {
*/
public boolean hidden = false;

/**
* sticky parameter
*/
public String sticky = "";

/**
* help description text
*/
Expand Down Expand Up @@ -248,6 +254,9 @@ public List<String> getShRun(int filter) {
if (parameter != paraMode.allow) {
l.add(a + " parameter " + param2string(parameter));
}
if (sticky.length() > 0) {
l.add(a + " sticky " + sticky);
}
if (description.length() > 0) {
l.add(a + " description " + description);
}
Expand Down Expand Up @@ -281,6 +290,14 @@ public void doCfgStr(cmds cmd) {
hidden = true;
return;
}
if (a.equals("sticky")) {
sticky = cmd.getRemaining();
userReader rdr = new userReader(cmd.pipe, null);
userExec exe = new userExec(cmd.pipe, rdr);
exe.privileged = true;
doCommands(exe, cmd);
return;
}
cmd.badCmd();
}

Expand Down Expand Up @@ -324,6 +341,9 @@ public void getLines(userHelping l, int lev) {
*/
public void doCommands(userExec exe, cmds par) {
cmds orig = par.copyBytes(false);
if (sticky.length() > 0) {
sticky = par.getRemaining();
}
String a = getCommand(orig);
a = exe.repairCommand(a);
exe.executeCommand(a);
Expand Down
2 changes: 2 additions & 0 deletions src/net/freertr/user/userConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,8 @@ private void getHelpGlobal(userHelping l) {
l.add(null, "5 5,. <cmd> command");
l.add(null, "4 5 description specify help description");
l.add(null, "5 5,. <text> help text");
l.add(null, "4 5 sticky specify sticky parameter");
l.add(null, "5 5,. <text> parameter text");
l.add(null, "4 5 parameter specify parameter existence");
l.add(null, "5 . forbidden no parameters");
l.add(null, "5 . required need parameters");
Expand Down
1 change: 1 addition & 0 deletions src/rtr-sw.txt
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ dial-peer 1
direction both
exit
!
alias test bash command attach shell1 /rtr/ptyRun.bin /bin/bash
!
server telnet tel
security authentication access
Expand Down
2 changes: 1 addition & 1 deletion src/rtr.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
url;file;result;test
-;-;-;freeRouter v22.3.30-cur, done by cs@nop.
-;-;-;2022-03-30 08:08:37, took 00:08:40, with 80 workers, on 2780 cases, 0 failed, 0 traces, 3 retries
-;-;-;2022-03-30 08:53:41, took 00:07:57, with 80 workers, on 2780 cases, 0 failed, 0 traces, 2 retries
-;-;-;./rtr.bin
http://sources.freertr.net/cfg/basic.tst;basic.tst;success;dummy test
http://sources.freertr.net/cfg/conn-amt01.tst;conn-amt01.tst;success;amt over ipv4
Expand Down
1 change: 0 additions & 1 deletion src/rtr.ftr
Original file line number Diff line number Diff line change
Expand Up @@ -2778,7 +2778,6 @@ qc pass: socks4 server
qc pass: socks5 server
qc pass: tacacs server
qc pass: udp forwarder server
todo: aliases with sticky parameters
todo: disableable door code in temper
todo: quic
todo: update gtp stack to the latest standards
Expand Down
2 changes: 1 addition & 1 deletion src/rtr.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v22.3.30-cur, done by cs@nop.<br/>
tested: 2022-03-30 08:08:37, took 00:08:40, with 80 workers, on 2780 cases, 0 failed, 0 traces, 3 retries<br/>
tested: 2022-03-30 08:53:41, took 00:07:57, with 80 workers, on 2780 cases, 0 failed, 0 traces, 2 retries<br/>
jvm: ./rtr.bin<br/>
<br/>
<table><thead><tr><td><b>file</b></td><td><b>result</b></td><td><b>test</b></td></tr></thead><tbody>
Expand Down
1 change: 0 additions & 1 deletion todo.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
aliases with sticky parameters
disableable door code in temper
quic
update gtp stack to the latest standards
Expand Down

0 comments on commit 2915590

Please sign in to comment.