/* * wip, a small TCP/IP stack. * Copyright (C) 2025 Xavier Del Campo Romero * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #include #include int wip_run(struct wip *const w) { enum wip_state n; again: switch ((n = w->rx.next(w))) { case WIP_OK: goto again; case WIP_AGAIN: break; case WIP_FATAL: return -1; case WIP_INVALID: wip_rx(w); break; } #if 0 switch (w->tx.next(w)) { case WIP_OK: case WIP_AGAIN: break; case WIP_INVALID: case WIP_FATAL: return -1; } #endif return 0; }