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 Dec 22, 2024
1 parent d0521e0 commit 0f826cf
Show file tree
Hide file tree
Showing 15 changed files with 160 additions and 164 deletions.
2 changes: 1 addition & 1 deletion cfg/p4lang2.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dpdk pckout punting copp acl nat vlan bundle bridge pppoe hairpin gre l2tp l3tp tmux route mpls vpls evpn eompls gretap pppoetap l2tptap l3tptap tmuxtap vxlan ipip macsec ipsec pckoudp openvpn wireguard srv6 pbr qos flwspc mroute duplab bier amt nsh racl inspect sgt vrfysrc gtp loconn tcpmss pmtud etherip polka mpolka
dpdk pckout punting copp acl nat vlan bundle bridge pppoe hairpin gre l2tp l3tp tmux route mpls vpls evpn eompls gretap pppoetap l2tptap l3tptap tmuxtap vxlan ipip macsec ipsec pckoudp openvpn wireguard srv6 pbr qos flwspc mroute duplab bier amt nsh racl inspect sgt vrfysrc gtp loconn tcpmss pmtud etherip polka mpolka pwhe

qemu-img create -f qcow2 -o backing_file=../img/p4emu.img,backing_fmt=raw $fn$
qemu-system-x86_64 -monitor none -serial stdio -nographic -no-reboot -enable-kvm -cpu host -smp cores=2,threads=1,sockets=1 -drive file=$fn$,format=qcow2,cache=unsafe -m 1024 $nc$
Expand Down
2 changes: 1 addition & 1 deletion cfg/p4lang5.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
udp pckout punting copp acl nat vlan bundle bridge pppoe hairpin gre l2tp route mpls vpls evpn eompls gretap pppoetap l2tptap l3tptap tmuxtap vxlan ipip macsec ipsec pckoudp openvpn wireguard srv6 pbr qos flwspc mroute duplab bier amt nsh racl inspect sgt vrfysrc gtp loconn tcpmss pmtud l3tp tmux etherip polka mpolka
udp pckout punting copp acl nat vlan bundle bridge pppoe hairpin gre l2tp route mpls vpls evpn eompls gretap pppoetap l2tptap l3tptap tmuxtap vxlan ipip macsec ipsec pckoudp openvpn wireguard srv6 pbr qos flwspc mroute duplab bier amt nsh racl inspect sgt vrfysrc gtp loconn tcpmss pmtud l3tp tmux etherip polka mpolka pwhe


../binTmp/p4udp.bin 127.0.0.1 $cp$ 0 127.0.0.1 127.0.0.1 $nc$
Expand Down
2 changes: 1 addition & 1 deletion cfg/p4lang6.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
emudp pckout punting copp acl nat vlan bundle bridge pppoe hairpin gre l2tp route mpls vpls evpn eompls gretap pppoetap l2tptap l3tptap tmuxtap vxlan ipip macsec ipsec pckoudp openvpn wireguard srv6 pbr qos flwspc mroute duplab bier amt nsh racl inspect sgt vrfysrc gtp loconn tcpmss pmtud l3tp tmux etherip polka mpolka
emudp pckout punting copp acl nat vlan bundle bridge pppoe hairpin gre l2tp route mpls vpls evpn eompls gretap pppoetap l2tptap l3tptap tmuxtap vxlan ipip macsec ipsec pckoudp openvpn wireguard srv6 pbr qos flwspc mroute duplab bier amt nsh racl inspect sgt vrfysrc gtp loconn tcpmss pmtud l3tp tmux etherip polka mpolka pwhe


../binDsk/qemu-static -L ../binDsk/ ../binDsk/rtr/p4udp.bin 127.0.0.1 $cp$ 0 127.0.0.1 127.0.0.1 $nc$
Expand Down
2 changes: 1 addition & 1 deletion cfg/p4lang7.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
vgudp pckout punting copp acl nat vlan bundle bridge pppoe hairpin gre l2tp route mpls vpls evpn eompls gretap pppoetap l2tptap l3tptap tmuxtap vxlan ipip macsec ipsec pckoudp openvpn wireguard srv6 pbr qos flwspc mroute duplab bier amt nsh racl inspect sgt vrfysrc gtp loconn tcpmss pmtud l3tp tmux etherip polka mpolka
vgudp pckout punting copp acl nat vlan bundle bridge pppoe hairpin gre l2tp route mpls vpls evpn eompls gretap pppoetap l2tptap l3tptap tmuxtap vxlan ipip macsec ipsec pckoudp openvpn wireguard srv6 pbr qos flwspc mroute duplab bier amt nsh racl inspect sgt vrfysrc gtp loconn tcpmss pmtud l3tp tmux etherip polka mpolka pwhe


valgrind.bin --suppressions=../misc/valgrind.cfg --exit-on-first-error=yes ../binTmp/p4udp.bin 127.0.0.1 $cp$ 0 127.0.0.1 127.0.0.1 $nc$
Expand Down
20 changes: 20 additions & 0 deletions misc/native/p4emu_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,20 @@ void send2neigh(struct packetContext *ctx, struct neigh_entry *neigh_res, int bu
putTmuxHeader;
putIpv6header(IP_PROTOCOL_TMUX, neigh_res->sip1, neigh_res->sip2, neigh_res->sip3, neigh_res->sip4, neigh_res->dip1, neigh_res->dip2, neigh_res->dip3, neigh_res->dip4);
break;
case 23: // pwhe
bufP -= 12;
memcpy(&bufD[bufP], &bufH[0], 12);
bufP -= 4;
tmp = 0x1ff | (neigh_res->dprt << 12);
put32msb(bufD, bufP, tmp);
bufP -= 4;
tmp = 0xff | (neigh_res->sprt << 12);
put32msb(bufD, bufP, tmp);
ethtyp = ETHERTYPE_MPLS_UCAST;
bufP -= 2;
put16msb(bufD, bufP, ethtyp);
memcpy(&bufH[0], &neigh_res->mac2, 12);
break;
default:
doDropper;
}
Expand Down Expand Up @@ -1621,6 +1635,12 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
put32msb(bufD, bufP, label);
neigh_ntry.id = mpls_res->nexthop;
goto ethtyp_tx;
case 10: // pwhe
memcpy(&bufH[0], &bufD[bufP], 12);
memcpy(&bufD[preBuff], &bufH[0], 12);
bufP += 12;
prt = mpls_res->port;
goto ethtyp_rx;
}
doDropper;
case ETHERTYPE_VLAN: // dot1q
Expand Down
63 changes: 62 additions & 1 deletion misc/native/p4emu_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void readAcl6(struct acl6_entry *acl6_ntry, char**arg) {


char* getCapas() {
return "packout punting copp acl nat vlan bundle bridge pppoe hairpin gre l2tp l3tp tmux route mpls vpls evpn eompls gretap pppoetap l2tptap l3tptap tmuxtap vxlan etherip ipip pckoudp srv6 pbr qos flwspc mroute duplab bier amt nsh racl inspect sgt vrfysrc gtp loconn tcpmss pmtud mpolka polka"
return "packout punting copp acl nat vlan bundle bridge pppoe hairpin gre l2tp l3tp tmux route mpls vpls evpn eompls gretap pppoetap l2tptap l3tptap tmuxtap vxlan etherip ipip pckoudp srv6 pbr qos flwspc mroute duplab bier amt nsh racl inspect sgt vrfysrc gtp loconn tcpmss pmtud mpolka polka pwhe"

#ifndef HAVE_NOCRYPTO
" macsec ipsec openvpn wireguard"
Expand Down Expand Up @@ -369,6 +369,14 @@ int doOneCommand(struct packetContext *ctx, unsigned char* buf) {
else table_add(&mpls_table, &mpls_ntry);
return 0;
}
if (strcmp(arg[0], "pwhelab") == 0) {
mpls_ntry.label = atoi(arg[2]);
mpls_ntry.port = atoi(arg[3]);
mpls_ntry.command = 10;
if (del == 0) table_del(&mpls_table, &mpls_ntry);
else table_add(&mpls_table, &mpls_ntry);
return 0;
}
if (strcmp(arg[0], "cpulabel") == 0) {
mpls_ntry.label = atoi(arg[2]);
mpls_ntry.command = 6;
Expand Down Expand Up @@ -969,6 +977,31 @@ int doOneCommand(struct packetContext *ctx, unsigned char* buf) {
else table_add(&neigh_table, &neigh_ntry);
return 0;
}
if (strcmp(arg[0], "pwhenei4") == 0) {
route4_ntry.nexthop = atoi(arg[2]);
inet_pton(AF_INET, arg[3], buf2);
vrf2rib_ntry.vrf = atoi(arg[5]);
vrf2rib_res = vrf2rib_init4;
route4_ntry.addr[0] = get32msb(buf2, 0);
route4_ntry.mask = 32;
route4_ntry.command = 1;
neigh_ntry.id = route4_ntry.nexthop;
neigh_ntry.vrf = vrf2rib_ntry.vrf;
neigh_ntry.port = atoi(arg[7]);
neigh_ntry.aclport = atoi(arg[8]);
neigh_ntry.command = 23;
str2mac(&neigh_ntry.macs[0], arg[4]);
str2mac(&neigh_ntry.macs[6], arg[6]);
str2mac(&neigh_ntry.mac2[0], arg[9]);
str2mac(&neigh_ntry.mac2[6], arg[10]);
neigh_ntry.sprt = atoi(arg[11]);
neigh_ntry.dprt = atoi(arg[12]);
if (del == 0) tree_del(&vrf2rib_res->rou, &route4_ntry);
else tree_add(&vrf2rib_res->rou, &route4_ntry);
if (del == 0) table_del(&neigh_table, &neigh_ntry);
else table_add(&neigh_table, &neigh_ntry);
return 0;
}
if (strcmp(arg[0], "myaddr6") == 0) {
inet_pton(AF_INET6, arg[2], buf2);
vrf2rib_ntry.vrf = atoi(arg[5]);
Expand Down Expand Up @@ -1120,6 +1153,34 @@ int doOneCommand(struct packetContext *ctx, unsigned char* buf) {
else table_add(&neigh_table, &neigh_ntry);
return 0;
}
if (strcmp(arg[0], "pwhenei6") == 0) {
route6_ntry.nexthop = atoi(arg[2]);
inet_pton(AF_INET6, arg[3], buf2);
vrf2rib_ntry.vrf = atoi(arg[5]);
vrf2rib_res = vrf2rib_init6;
route6_ntry.addr[0] = get32msb(buf2, 0);
route6_ntry.addr[1] = get32msb(buf2, 4);
route6_ntry.addr[2] = get32msb(buf2, 8);
route6_ntry.addr[3] = get32msb(buf2, 12);
route6_ntry.mask = 128;
route6_ntry.command = 1;
neigh_ntry.id = route6_ntry.nexthop;
neigh_ntry.vrf = vrf2rib_ntry.vrf;
neigh_ntry.port = atoi(arg[7]);
neigh_ntry.aclport = atoi(arg[8]);
neigh_ntry.command = 23;
str2mac(&neigh_ntry.macs[0], arg[4]);
str2mac(&neigh_ntry.macs[6], arg[6]);
str2mac(&neigh_ntry.mac2[0], arg[9]);
str2mac(&neigh_ntry.mac2[6], arg[10]);
neigh_ntry.sprt = atoi(arg[11]);
neigh_ntry.dprt = atoi(arg[12]);
if (del == 0) tree_del(&vrf2rib_res->rou, &route6_ntry);
else tree_add(&vrf2rib_res->rou, &route6_ntry);
if (del == 0) table_del(&neigh_table, &neigh_ntry);
else table_add(&neigh_table, &neigh_ntry);
return 0;
}
if (strcmp(arg[0], "mysrv4") == 0) {
inet_pton(AF_INET6, arg[3], buf2);
vrf2rib_ntry.vrf = atoi(arg[2]);
Expand Down
5 changes: 3 additions & 2 deletions misc/native/p4emu_tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct table_head nsh_table;

struct mpls_entry {
int label;
int command; // 1=vrf, 2=pop, 3=swap, 4=xconn, 5=vpls, 6=punt, 7=dup, 8=bier, 9=push
int command; // 1=vrf, 2=pop, 3=swap, 4=xconn, 5=vpls, 6=punt, 7=dup, 8=bier, 9=push, 10=pwhe
long pack;
long byte;
int nexthop;
Expand Down Expand Up @@ -263,13 +263,14 @@ struct route6_entry {
struct neigh_entry {
int id;
int vrf;
int command; // 1=rawip, 2=pppoe, 3=gre4, 4=gre6, 5=l2tp4, 6=l2tp6, 7=ipip4, 8=ipip6, 9=esp4, 10=esp6, 11=ovpn4, 12=ovpn6, 13=wg4. 14=wg6, 15=amt4, 16=amt6, 17=gtp4, 18=gtp6, 19=l3tp4, 20=l3tp6, 21=tmux4, 22=tmux6
int command; // 1=rawip, 2=pppoe, 3=gre4, 4=gre6, 5=l2tp4, 6=l2tp6, 7=ipip4, 8=ipip6, 9=esp4, 10=esp6, 11=ovpn4, 12=ovpn6, 13=wg4. 14=wg6, 15=amt4, 16=amt6, 17=gtp4, 18=gtp6, 19=l3tp4, 20=l3tp6, 21=tmux4, 22=tmux6, 23=pwhe
long pack;
long byte;
int port;
int aclport;
int tid;
unsigned char macs[12];
unsigned char mac2[12];
int sip1;
int sip2;
int sip3;
Expand Down
150 changes: 0 additions & 150 deletions misc/native/p4emu_udp-new.c

This file was deleted.

2 changes: 1 addition & 1 deletion src/org/freertr/serv/servP4lang.java
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ public boolean srvCfgStr(cmds cmd) {
cmd.error("no need to export subinterface");
return false;
}
if ((ifc.type != tabRouteIface.ifaceType.sdn) && (ifc.type != tabRouteIface.ifaceType.bundle) && (ifc.type != tabRouteIface.ifaceType.bridge) && (ifc.type != tabRouteIface.ifaceType.dialer) && (ifc.type != tabRouteIface.ifaceType.hairpin) && (ifc.type != tabRouteIface.ifaceType.tunnel) && (ifc.type != tabRouteIface.ifaceType.virtppp) && (ifc.type != tabRouteIface.ifaceType.template)) {
if ((ifc.type != tabRouteIface.ifaceType.sdn) && (ifc.type != tabRouteIface.ifaceType.bundle) && (ifc.type != tabRouteIface.ifaceType.bridge) && (ifc.type != tabRouteIface.ifaceType.dialer) && (ifc.type != tabRouteIface.ifaceType.hairpin) && (ifc.type != tabRouteIface.ifaceType.tunnel) && (ifc.type != tabRouteIface.ifaceType.virtppp) && (ifc.type != tabRouteIface.ifaceType.pweth) && (ifc.type != tabRouteIface.ifaceType.template)) {
cmd.error("not p4lang interface");
return false;
}
Expand Down
Loading

0 comments on commit 0f826cf

Please sign in to comment.