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 Jan 27, 2025
1 parent 4dc40ca commit b425e83
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions misc/native/p4emu_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -2276,14 +2276,14 @@ void processDataPacket(struct packetContext *ctx, int bufS, int prt) {
}
doDropper;
case ETHERTYPE_PPPOE_DATA: // pppoe
if (port2vrf_res == NULL) doDropper;
ctx->stat->packPppoe++;
ctx->stat->bytePppoe += bufS;
pppoe_ntry.port = prt;
pppoe_ntry.session = get16msb(bufD, bufP + 2);
ctx->hash ^= pppoe_ntry.session;
index = table_find(&pppoe_table, &pppoe_ntry);
index = table_find(&port2vrf_res->pppoe, &pppoe_ntry);
if (index < 0) doDropper;
pppoe_res = table_get(&pppoe_table, index);
pppoe_res = table_get(&port2vrf_res->pppoe, index);
pppoe_res->pack++;
pppoe_res->byte += bufS;
bufP += 6;
Expand Down
19 changes: 10 additions & 9 deletions misc/native/p4emu_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1645,16 +1645,17 @@ int doOneCommand(struct packetContext *ctx, unsigned char* buf) {
return 0;
}
if (strcmp(arg[0], "pppoe") == 0) {
neigh_ntry.port = port2vrf_ntry.port = atoi(arg[3]);
port2vrf_res = port2vrf_init(&port2vrf_ntry);
neigh_ntry.aclport = pppoe_ntry.aclport = atoi(arg[2]);
neigh_ntry.port = pppoe_ntry.port = atoi(arg[3]);
neigh_ntry.tid = pppoe_ntry.session = atoi(arg[6]);
neigh_ntry.id = atoi(arg[4]);
neigh_ntry.vrf = atoi(arg[5]);
neigh_ntry.command = 2;
str2mac(&neigh_ntry.macs[0], arg[7]);
str2mac(&neigh_ntry.macs[6], arg[8]);
if (del == 0) table_del(&pppoe_table, &pppoe_ntry);
else table_add(&pppoe_table, &pppoe_ntry);
if (del == 0) table_del(&port2vrf_res->pppoe, &pppoe_ntry);
else table_add(&port2vrf_res->pppoe, &pppoe_ntry);
if (del == 0) table_del(&neigh_table, &neigh_ntry);
else table_add(&neigh_table, &neigh_ntry);
return 0;
Expand Down Expand Up @@ -3056,10 +3057,6 @@ void doStatLoop() {
struct bundle_entry *ntry = table_get(&bundle_table, i);
fprintf(commandTx, "counter %i 0 0 %li %li 0 0\r\n", ntry->id, ntry->pack, ntry->byte);
}
for (int i=0; i<pppoe_table.size; i++) {
struct pppoe_entry *ntry = table_get(&pppoe_table, i);
fprintf(commandTx, "counter %i %li %li 0 0 0 0\r\n", ntry->aclport, ntry->pack, ntry->byte);
}
for (int i=0; i<vlanout_table.size; i++) {
struct vlanout_entry *ontry = table_get(&vlanout_table, i);
struct vlanin_entry ival;
Expand Down Expand Up @@ -3107,13 +3104,17 @@ void doStatLoop() {
}
doStatRound_ipvX(&vrf2rib4_table, &doStatRound_rou4, &doStatRound_nat4, &doStatRound_tun4, &doStatRound_mcst4, 4);
doStatRound_ipvX(&vrf2rib6_table, &doStatRound_rou6, &doStatRound_nat6, &doStatRound_tun6, &doStatRound_mcst6, 6);
#ifndef HAVE_NOCRYPTO
for (int i=0; i<port2vrf_table.size; i++) {
struct port2vrf_entry *ntry = table_get(&port2vrf_table, i);
for (int o=0; o<ntry->pppoe.size; o++) {
struct pppoe_entry *ntry2 = table_get(&ntry->pppoe, o);
fprintf(commandTx, "counter %i %li %li 0 0 0 0\r\n", ntry2->aclport, ntry2->pack, ntry2->byte);
}
#ifndef HAVE_NOCRYPTO
if (ntry->mcscEthtyp == 0) continue;
fprintf(commandTx, "macsec_cnt %i %li %li %li %li %li %li\r\n", ntry->port, ntry->mcscPackRx, ntry->mcscByteRx, ntry->mcscPackTx, ntry->mcscByteTx, (ntry->mcscPackRx - ntry->mcscPackOk), (ntry->mcscByteRx - ntry->mcscByteOk));
}
#endif
}
for (int i=0; i<acls4_table.size; i++) {
struct acls_entry *ntry1 = table_get(&acls4_table, i);
doStatRound_acl(ntry1, 4);
Expand Down
23 changes: 11 additions & 12 deletions misc/native/p4emu_tab.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ struct port2vrf_entry {
int monPackets;
int sgtSet;
int sgtTag;
struct table_head pppoe;
#ifndef HAVE_NOCRYPTO
int mcscEthtyp;
int mcscCrTxKeyLen;
Expand Down Expand Up @@ -146,6 +147,14 @@ struct port2vrf_entry {
struct table_head port2vrf_table;


struct pppoe_entry {
int session;
int aclport;
long pack;
long byte;
};


struct port2vrf_entry* port2vrf_init(struct port2vrf_entry *ntry) {
int index = table_find(&port2vrf_table, ntry);
if (index >= 0) return table_get(&port2vrf_table, index);
Expand All @@ -154,6 +163,7 @@ struct port2vrf_entry* port2vrf_init(struct port2vrf_entry *ntry) {
ntry = table_get(&port2vrf_table, index);
ntry->monTarget = -1;
ntry->sgtSet = -1;
table_init(&ntry->pppoe, sizeof(struct pppoe_entry), 1);
return ntry;
}

Expand All @@ -162,6 +172,7 @@ void port2vrf_deinit(struct port2vrf_entry *ntry) {
int index = table_find(&port2vrf_table, ntry);
if (index < 0) return;
ntry = table_get(&port2vrf_table, index);
table_deinit(&ntry->pppoe);
table_del(&port2vrf_table, ntry);
}

Expand Down Expand Up @@ -602,17 +613,6 @@ struct bundle_entry {
struct table_head bundle_table;


struct pppoe_entry {
int port;
int session;
int aclport;
long pack;
long byte;
};

struct table_head pppoe_table;


struct tun4_entry {
int srcPort;
int trgPort;
Expand Down Expand Up @@ -754,7 +754,6 @@ int initTables() {
table_init(&acls4_table, sizeof(struct acls_entry), 2);
table_init(&acls6_table, sizeof(struct acls_entry), 2);
table_init(&bundle_table, sizeof(struct bundle_entry), 1);
table_init(&pppoe_table, sizeof(struct pppoe_entry), 2);
table_init(&policer_table, sizeof(struct policer_entry), 3);
#ifndef HAVE_NOCRYPTO
printf("openssl version: %s\n", OpenSSL_version(OPENSSL_VERSION));
Expand Down
4 changes: 2 additions & 2 deletions misc/native/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ void table_init(struct table_head *tab, int reclen, int cmplen) {

void table_resize(struct table_head *tab, int ned) {
int siz = -1;
if ((ned + 512) < tab->alloc) siz = ned + 128;
if (ned > tab->alloc) siz = ned + 512;
if ((ned + 512) < tab->alloc) siz = ned + 256;
if (ned > tab->alloc) siz = ned + 256;
if (siz < 0) return;
unsigned char *old = tab->buffer;
unsigned char *new = malloc((size_t)tab->reclen * siz);
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 v25.1.27-cur, done by sprscc13@mrn0b0dy.
-;-;-;2025-01-27 18:17:43, took 00:15:43, with 50 workers, on 3634 cases, 0 failed, 0 traces, 4 retries
-;-;-;2025-01-27 18:50:29, took 00:15:29, with 50 workers, on 3634 cases, 0 failed, 0 traces, 1 retries
-;-;-;./rtr.bin
http://sources.freertr.org/cfg/basic01.tst;basic01.tst;success;dummy test
http://sources.freertr.org/cfg/basic02.tst;basic02.tst;success;interface with slot
Expand Down
2 changes: 1 addition & 1 deletion src/rtr.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v25.1.27-cur, done by sprscc13@mrn0b0dy.<br/>
tested: 2025-01-27 18:17:43, took 00:15:43, with 50 workers, on 3634 cases, 0 failed, 0 traces, 4 retries<br/>
tested: 2025-01-27 18:50:29, took 00:15:29, with 50 workers, on 3634 cases, 0 failed, 0 traces, 1 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
2 changes: 1 addition & 1 deletion src/rtr8.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
url;file;result;test
-;-;-;freeRouter v25.1.27-cur, done by sprscc13@mrn0b0dy.
-;-;-;2025-01-27 17:56:32, took 00:12:30, with 50 workers, on 700 cases, 0 failed, 0 traces, 1 retries
-;-;-;2025-01-27 19:01:11, took 00:10:18, with 50 workers, on 700 cases, 0 failed, 0 traces, 0 retries
-;-;-;./rtr.bin
http://sources.freertr.org/cfg/p4lang-acl001.tst;p4lang-acl001.tst;success;p4lang: copp
http://sources.freertr.org/cfg/p4lang-acl002.tst;p4lang-acl002.tst;success;p4lang: ingress access list
Expand Down
2 changes: 1 addition & 1 deletion src/rtr8.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v25.1.27-cur, done by sprscc13@mrn0b0dy.<br/>
tested: 2025-01-27 17:56:32, took 00:12:30, with 50 workers, on 700 cases, 0 failed, 0 traces, 1 retries<br/>
tested: 2025-01-27 19:01:11, took 00:10:18, with 50 workers, on 700 cases, 0 failed, 0 traces, 0 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

0 comments on commit b425e83

Please sign in to comment.