Porting PicoTCP WIP

This commit is contained in:
2025-10-29 14:29:06 +01:00
parent 6722f42e68
commit 815c2239fe
464 changed files with 235009 additions and 24 deletions

View File

@ -1,5 +1,6 @@
#include <ulib.h>
#include "block.h"
#include "tcptest.h"
void main(void) {
if (argslen() == 0) {
@ -11,6 +12,8 @@ void main(void) {
if (string_strcmp(cmd, "block") == 0) {
diagdummy_block();
} else if (string_strcmp(cmd, "tcp-test") == 0) {
diagdummy_tcptest();
} else {
uprintf("diagdummy: unknown cmd %s\n", cmd);
}

19
user/diagdummy/tcptest.c Normal file
View File

@ -0,0 +1,19 @@
#include <stdint.h>
#include <stddef.h>
#include <ulib.h>
#define MAX_CONNS 10
void diagdummy_tcptest(void) {
netsock_t netsock = ipc_netsockmake(NETSOCK_IPV4, NETSOCK_TCP, 1);
ipc_netsocklisten(netsock, MAX_CONNS);
for (;;) {
netsockev_t ev = ipc_netsockpollev(netsock);
if (!IS_NETSOCKEV_READY(ev)) {
schedrelease();
} else {
}
}
}

6
user/diagdummy/tcptest.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef DIAGDUMMY_TCPTEST_H_
#define DIAGDUMMY_TCPTEST_H_
void diagdummy_tcptest(void);
#endif // DIAGDUMMY_TCPTEST_H_