From: ian Date: Thu, 26 Dec 2002 15:54:07 +0000 (+0000) Subject: tuntap compiles X-Git-Tag: debian/1.1.1~136 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-tcl.git;a=commitdiff_plain;h=a41625aefb08ed5bf5f07951841bdfe30c4a72c7 tuntap compiles --- diff --git a/base/chiark-tcl.h b/base/chiark-tcl.h index 484f10d..afdae9a 100644 --- a/base/chiark-tcl.h +++ b/base/chiark-tcl.h @@ -83,6 +83,8 @@ * ULONG BITCOUNT UNDERRUN bitfields add up to less than 32 * ULONG VALUE NEGATIVE attempt convert -ve integers to ulong * ULONG VALUE OVERFLOW converted value does not fit in result + * TUNTAP IFNAME LENGTH tun/tap interface name too long + * TUNTAP MTU OVERRUN tun/tap mtu limited to 2^16 bytes * * Refs: HMAC: RFC2104 */ diff --git a/base/idtable.c b/base/idtable.c index c2f3aaa..d2f3e04 100644 --- a/base/idtable.c +++ b/base/idtable.c @@ -119,7 +119,7 @@ static void tabledataid_nt_ustr(Tcl_Obj *o) { (char*)0); } -Tcl_ObjType tabledataid_ntype = { +Tcl_ObjType tabledataid_nearlytype = { "tabledataid", tabledataid_nt_free, tabledataid_nt_dup, tabledataid_nt_ustr, tabledataid_nt_sfa diff --git a/base/parse.c b/base/parse.c index 44f00e2..539f074 100644 --- a/base/parse.c +++ b/base/parse.c @@ -30,6 +30,11 @@ int pat_long(Tcl_Interp *ip, Tcl_Obj *obj, long *val) { return Tcl_GetLongFromObj(ip, obj, val); } +int pat_string(Tcl_Interp *ip, Tcl_Obj *obj, const char **val) { + *val= Tcl_GetString(obj); + return TCL_OK; +} + int pat_hbv(Tcl_Interp *ip, Tcl_Obj *var, HBytes_Var *agg) { int rc; Tcl_Obj *val; @@ -89,6 +94,10 @@ Tcl_Obj *ret_long(Tcl_Interp *ip, long val) { return Tcl_NewLongObj(val); } +Tcl_Obj *ret_string(Tcl_Interp *ip, const char *val) { + return Tcl_NewStringObj(val,-1); +} + Tcl_Obj *ret_obj(Tcl_Interp *ip, Tcl_Obj *val) { return val; } diff --git a/base/tables-examples.tct b/base/tables-examples.tct index b98ba5f..1a02eb6 100644 --- a/base/tables-examples.tct +++ b/base/tables-examples.tct @@ -194,10 +194,10 @@ Table tuntap_socket TunSocket_SubCommand => string receive sock iddata(&tuntap_socks) - mtu long data hb on-transmit sock iddata(&tuntap_socks) + mtu long ?script obj Table blockcipherop BlockCipherOp diff --git a/base/troglodyte-Makefile b/base/troglodyte-Makefile index 24f1e13..9e5618a 100644 --- a/base/troglodyte-Makefile +++ b/base/troglodyte-Makefile @@ -6,6 +6,7 @@ OBJS= tables.o \ ulongs.o \ sockaddr.o \ dgram.o \ + tuntap.o \ chop.o \ hook.o \ bcmode.o \ diff --git a/hbytes/hbytes.h b/hbytes/hbytes.h index 484f10d..afdae9a 100644 --- a/hbytes/hbytes.h +++ b/hbytes/hbytes.h @@ -83,6 +83,8 @@ * ULONG BITCOUNT UNDERRUN bitfields add up to less than 32 * ULONG VALUE NEGATIVE attempt convert -ve integers to ulong * ULONG VALUE OVERFLOW converted value does not fit in result + * TUNTAP IFNAME LENGTH tun/tap interface name too long + * TUNTAP MTU OVERRUN tun/tap mtu limited to 2^16 bytes * * Refs: HMAC: RFC2104 */ diff --git a/hbytes/parse.c b/hbytes/parse.c index 44f00e2..539f074 100644 --- a/hbytes/parse.c +++ b/hbytes/parse.c @@ -30,6 +30,11 @@ int pat_long(Tcl_Interp *ip, Tcl_Obj *obj, long *val) { return Tcl_GetLongFromObj(ip, obj, val); } +int pat_string(Tcl_Interp *ip, Tcl_Obj *obj, const char **val) { + *val= Tcl_GetString(obj); + return TCL_OK; +} + int pat_hbv(Tcl_Interp *ip, Tcl_Obj *var, HBytes_Var *agg) { int rc; Tcl_Obj *val; @@ -89,6 +94,10 @@ Tcl_Obj *ret_long(Tcl_Interp *ip, long val) { return Tcl_NewLongObj(val); } +Tcl_Obj *ret_string(Tcl_Interp *ip, const char *val) { + return Tcl_NewStringObj(val,-1); +} + Tcl_Obj *ret_obj(Tcl_Interp *ip, Tcl_Obj *val) { return val; } diff --git a/tuntap/tuntap.c b/tuntap/tuntap.c index 5543302..ee8e99e 100644 --- a/tuntap/tuntap.c +++ b/tuntap/tuntap.c @@ -5,18 +5,23 @@ * tuntap-socket-rawlinux ifname => * tuntap-socket-rawlinux close * tuntap-socket-rawlinux receive - * tuntap-socket-rawlinux on-transmit [