Skip to content

Commit

Permalink
automatic commit at releng box
Browse files Browse the repository at this point in the history
  • Loading branch information
mc36 committed Feb 17, 2022
1 parent db0333b commit 4a1d188
Show file tree
Hide file tree
Showing 21 changed files with 1,383 additions and 37 deletions.
120 changes: 115 additions & 5 deletions src/net/freertr/cfg/cfgIfc.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.freertr.clnt.clntMplsTeP2p;
import net.freertr.clnt.clntMplsTrg;
import net.freertr.clnt.clntMplsUdp;
import net.freertr.clnt.clntMpolka;
import net.freertr.clnt.clntNvGre;
import net.freertr.clnt.clntOpenvpn;
import net.freertr.clnt.clntPckOudp;
Expand Down Expand Up @@ -71,6 +72,7 @@
import net.freertr.ifc.ifcLldp;
import net.freertr.ifc.ifcLossDet;
import net.freertr.ifc.ifcMacSec;
import net.freertr.ifc.ifcMpolka;
import net.freertr.ifc.ifcNhrp;
import net.freertr.ifc.ifcNshFwd;
import net.freertr.ifc.ifcNshXcn;
Expand Down Expand Up @@ -709,6 +711,11 @@ public class cfgIfc implements Comparator<cfgIfc>, cfgGeneric {
*/
public clntPolka tunPolka;

/**
* mpolka tunnel handler
*/
public clntMpolka tunMpolka;

/**
* sr over srh tunnel handler
*/
Expand Down Expand Up @@ -1039,6 +1046,11 @@ public class cfgIfc implements Comparator<cfgIfc>, cfgGeneric {
*/
public ifcPolka polkaPack;

/**
* mpolka packet processing
*/
public ifcMpolka mpolkaPack;

/**
* mpls ldp ipv4 discovery
*/
Expand Down Expand Up @@ -1225,6 +1237,10 @@ public enum tunnelType {
* polka tunnel interface
*/
polka,
/**
* mpolka tunnel interface
*/
mpolka,
/**
* exp bundle tunnel interface
*/
Expand Down Expand Up @@ -1404,6 +1420,7 @@ public enum tunnelType {
"interface .*! no nsh enable",
"interface .*! no nsh xconnect",
"interface .*! no polka enable",
"interface .*! no mpolka enable",
// mpls
"interface .*! no mpls enable",
"interface .*! no mpls access-group-in",
Expand Down Expand Up @@ -1798,6 +1815,8 @@ public enum tunnelType {
"interface .*! no ppp nshcp open",
"interface .*! no ppp polkacp close",
"interface .*! no ppp polkacp open",
"interface .*! no ppp mpolkacp close",
"interface .*! no ppp mpolkacp open",
"interface .*! no ppp authentication",
// hdlc
"interface .*! hdlc keepalive 5000",
Expand Down Expand Up @@ -2139,6 +2158,8 @@ public String tunnelMode(boolean badEmpty) {
return "pweompls";
case polka:
return "polka";
case mpolka:
return "mpolka";
case expBun:
return "expbun";
case srMpls:
Expand Down Expand Up @@ -2272,6 +2293,9 @@ public static tunnelType string2tunnelMode(String s) {
if (s.equals("polka")) {
return tunnelType.polka;
}
if (s.equals("mpolka")) {
return tunnelType.mpolka;
}
if (s.equals("expbun")) {
return tunnelType.expBun;
}
Expand Down Expand Up @@ -3671,6 +3695,10 @@ public synchronized void clear2tunnel(boolean justWorker) {
tunPolka.workStop();
tunPolka = null;
}
if (tunMpolka != null) {
tunMpolka.workStop();
tunMpolka = null;
}
if (tunExpBun != null) {
tunExpBun.workStop();
tunExpBun = null;
Expand Down Expand Up @@ -3943,7 +3971,7 @@ public synchronized boolean setup2tunnel() {
break;
case mplsudp:
tunMplsudp = new clntMplsUdp();
tunMplsudp.udp = tunVrf.getUdp(tunTrg);
tunMplsudp.udp = tunVrf.getUdp(tunTrg);
tunMplsudp.fwdIfc = tunSrc.getFwdIfc(tunTrg);
tunMplsudp.target = tunTrg.copyBytes();
tunMplsudp.prtR = tunKey;
Expand Down Expand Up @@ -4164,6 +4192,17 @@ public synchronized boolean setup2tunnel() {
tunPolka.workStart();
lower = tunPolka;
break;
case mpolka:
tunMpolka = new clntMpolka();
tunMpolka.fwdCor = tunVrf.getFwd(tunTrg);
tunMpolka.setTargets(tunFQDN);
tunFQDN = tunMpolka.getTargets();
tunMpolka.ttl = tunTTL;
tunMpolka.verify = tunSum;
tunMpolka.setUpper(ethtyp);
tunMpolka.workStart();
lower = tunMpolka;
break;
case pweOmpls:
tunPweOmpls = new clntMplsPwe();
tunPweOmpls.pwType = packLdpPwe.pwtIp;
Expand Down Expand Up @@ -4884,15 +4923,20 @@ public synchronized void clear2mpls() {
public synchronized void update2polka() {
if (ipIf4 != null) {
ipIf4.setPolka(polkaPack);
ipIf4.setMpolka(mpolkaPack);
}
if (ipIf6 != null) {
ipIf6.setPolka(polkaPack);
ipIf6.setMpolka(mpolkaPack);
}
if (polkaPack == null) {
return;
if (polkaPack != null) {
polkaPack.fwd4 = vrfFor.fwd4;
polkaPack.fwd6 = vrfFor.fwd6;
}
if (mpolkaPack != null) {
mpolkaPack.fwd4 = vrfFor.fwd4;
mpolkaPack.fwd6 = vrfFor.fwd6;
}
polkaPack.fwd4 = vrfFor.fwd4;
polkaPack.fwd6 = vrfFor.fwd6;
}

/**
Expand Down Expand Up @@ -4922,6 +4966,33 @@ public synchronized void clear2polka() {
update2polka();
}

/**
* setup interface mpolka packet
*
* @param id local id
* @param bas crc base
* @param max crc max
*/
public synchronized void setup2mpolka(int id, int bas, int max) {
if (vrfFor == null) {
return;
}
clear2mpolka();
mpolkaPack = new ifcMpolka(id, bas, max);
ethtyp.addET(ifcMpolka.type, "mpolka", mpolkaPack);
ethtyp.updateET(ifcMpolka.type, mpolkaPack);
update2polka();
}

/**
* clear interface polka packet
*/
public synchronized void clear2mpolka() {
mpolkaPack = null;
ethtyp.delET(ifcMpolka.type);
update2polka();
}

/**
* setup interface nsh packet
*/
Expand Down Expand Up @@ -5828,6 +5899,11 @@ public List<String> getShRun(int filter) {
a = polkaPack.localId + " " + polkaPack.crcBase + " " + polkaPack.crcMax;
}
cmds.cfgLine(l, polkaPack == null, cmds.tabulator, "polka enable", a);
a = "";
if (mpolkaPack != null) {
a = mpolkaPack.localId + " " + mpolkaPack.crcBase + " " + mpolkaPack.crcMax;
}
cmds.cfgLine(l, mpolkaPack == null, cmds.tabulator, "mpolka enable", a);
cmds.cfgLine(l, mplsPack == null, cmds.tabulator, "mpls enable", "");
if (mplsPack != null) {
cmds.cfgLine(l, !mplsPack.security, cmds.tabulator, "mpls label-security", "");
Expand Down Expand Up @@ -6173,6 +6249,7 @@ public void getHelp(userHelping l) {
l.add(null, "3 . expbun mpls exp bundle tunnel");
l.add(null, "3 . srmpls segment routing te over mpls tunnel");
l.add(null, "3 . polka polinomial key architecture tunnel");
l.add(null, "3 . mpolka multipath polinomial key architecture tunnel");
l.add(null, "3 . srext segment routing te over exthdr tunnel");
l.add(null, "3 . pcesr mpls sr tunnel from pcep");
l.add(null, "3 . pcete mpls te tunnel from pcep");
Expand Down Expand Up @@ -6267,6 +6344,11 @@ public void getHelp(userHelping l) {
l.add(null, "3 4 <num> local node id");
l.add(null, "4 5 <num> coefficient base");
l.add(null, "5 . <num> number of coefficients");
l.add(null, "1 2 mpolka multipath polynominal key architecture commands");
l.add(null, "2 3 enable enable/disable packet processing");
l.add(null, "3 4 <num> local node id");
l.add(null, "4 5 <num> coefficient base");
l.add(null, "5 . <num> number of coefficients");
l.add(null, "1 2 mpls multiprotocol label switching config commands");
l.add(null, "2 . enable enable/disable packet processing");
l.add(null, "2 . label-security enable/disable security checks");
Expand Down Expand Up @@ -7127,6 +7209,10 @@ public synchronized void doCfgStr(cmds cmd) {
doCfgPolka(cmd);
return;
}
if (a.equals("mpolka")) {
doCfgMpolka(cmd);
return;
}
if (a.equals("mpls")) {
doCfgMpls(cmd);
return;
Expand Down Expand Up @@ -7537,6 +7623,10 @@ public synchronized void doCfgStr(cmds cmd) {
doCfgNoPolka(cmd);
return;
}
if (a.equals("polka")) {
doCfgNoMpolka(cmd);
return;
}
if (a.equals("mpls")) {
doCfgNoMpls(cmd);
return;
Expand Down Expand Up @@ -8868,4 +8958,24 @@ private void doCfgNoPolka(cmds cmd) {
cmd.badCmd();
}

private void doCfgMpolka(cmds cmd) {
String s = cmd.word();
if (s.equals("enable")) {
int i = bits.str2num(cmd.word());
int o = bits.str2num(cmd.word());
setup2mpolka(i, o, bits.str2num(cmd.word()));
return;
}
cmd.badCmd();
}

private void doCfgNoMpolka(cmds cmd) {
String s = cmd.word();
if (s.equals("enable")) {
clear2mpolka();
return;
}
cmd.badCmd();
}

}

0 comments on commit 4a1d188

Please sign in to comment.