From dd62eab75d8e6a4844c78be9af69c67e561fb91c Mon Sep 17 00:00:00 2001 From: Izaya Date: Fri, 16 Feb 2018 22:33:08 +1100 Subject: [PATCH] added static route support to the OpenOS implementation --- OpenOS/etc/rc.d/minitel.lua | 9 ++++++++- README.md | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/OpenOS/etc/rc.d/minitel.lua b/OpenOS/etc/rc.d/minitel.lua index e1e2772..5e12d90 100644 --- a/OpenOS/etc/rc.d/minitel.lua +++ b/OpenOS/etc/rc.d/minitel.lua @@ -31,7 +31,8 @@ address { time last received } ]]-- -local rcache = {} +local sroutes = {} +local rcache = setmetatable({},{__index=sroutes}) local rctime = 30 --[[ @@ -211,3 +212,9 @@ function set_port(sn) port = tonumber(sn) or 4096 print("port = "..tostring(port)) end +function set_route(to,laddr,raddr) + sroutes[to] = {laddr,raddr,0} +end +function del_route(to) + sroutes[to] = nil +end diff --git a/README.md b/README.md index b44d557..bda8834 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Minitel -An easy-to-implement networking protocol for OpenComputers. Not to be confused with the French computer network of the same name. +An easy-to-implement networking protocol for OpenComputers. Not to be confused with the [French computer network of the same name](https://en.wikipedia.org/wiki/Minitel). ## Layers Minitel presently implements [layer 3](protocol-3.md) of the OSI model.