chiark / gitweb /
727591d1262b8bd3c4cecef70b168c1c67b43e70
[chiark-tcl.git] / hbytes / hbytes.tct
1 Type hb:                        HBytes_Value @
2 Init hb                         hbytes_sentinel(&@);
3
4 Type hbv:                       HBytes_Var @
5 Init hbv                        @.hb=0; init_somethingv(&@.sth);
6 Fini hbv                        fini_somethingv(ip, rc, &@.sth);
7
8 Type addrmapv:                  AddrMap_Var @
9 Init addrmapv                   @.am=0; init_somethingv(&@.sth);
10 Fini addrmapv                   fini_somethingv(ip, rc, &@.sth);
11
12 Type sockaddr:                  SockAddr_Value @
13 Init sockaddr                   sockaddr_clear(&@);
14
15 Table toplevel TopLevel_Command
16         hbytes
17                 subcmd  enum(HBytes_SubCommand, "hbytes subcommand")
18                 ...     obj
19         dgram-socket
20                 subcmd  enum(DgramSocket_SubCommand,"dgram-socket subcommand")
21                 ...     obj
22         tuntap-socket-raw
23             subcmd enum(TunSocket_SubCommand,"tuntap-socket-raw subcommand")
24             ... obj
25         ulong
26                 subcmd  enum(ULong_SubCommand,"ulong subcommand")
27                 ...     obj
28         adns
29                 subcmd  enum(Adns_SubCommand,"adns subcommand")
30                 ...     obj
31
32 Table ulong ULong_SubCommand
33         ul2int
34                 v       ulong
35                 =>      int
36         int2ul
37                 v       int
38                 =>      ulong
39         mask
40                 a       ulong
41                 b       ulong
42                 =>      ulong
43         add
44                 a       ulong
45                 b       ulong
46                 =>      ulong
47         multiply
48                 a       ulong
49                 b       ulong
50                 =>      ulong
51         subtract
52                 a       ulong
53                 b       ulong
54                 =>      ulong
55         compare
56                 a       ulong
57                 b       ulong
58                 =>      int
59         shift
60                 right   charfrom("lr", "shift direction")
61                 v       ulong
62                 bits    int
63                 =>      ulong
64         ul2bitfields
65                 value   ulong
66                 ...     obj
67                 =>      int
68         bitfields2ul
69                 base    ulong
70                 ...     obj
71                 =>      ulong
72
73 Table hbytes HBytes_SubCommand
74         raw2h
75                 binary  obj
76                 =>      hb
77         h2raw
78                 hex     hb
79                 =>      obj
80         ushort2h
81                 value   long
82                 =>      hb
83         h2ushort
84                 hex     hb
85                 =>      long
86         length
87                 v       hb
88                 =>      int
89         compare
90                 a       hb
91                 b       hb
92                 =>      int
93         range
94                 v       hb
95                 start   int
96                 size    int
97                 =>      hb
98         prepend
99                 v       hbv
100                 ...     str
101         append
102                 v       hbv
103                 ...     str
104         rep-info
105                 v       obj
106                 =>      obj
107         concat
108                 ...     str
109                 =>      hb
110         unprepend
111                 v       hbv
112                 length  int
113                 =>      hb
114         unappend
115                 v       hbv
116                 length  int
117                 =>      hb
118         chopto
119                 v       hbv
120                 length  int
121                 =>      hb
122         overwrite
123                 v       hbv
124                 start   int
125                 sub     hb
126         trimleft
127                 v       hbv
128         zeroes
129                 length  int
130                 =>      hb
131         repeat
132                 v       hb
133                 count   int
134                 =>      hb
135         xor
136                 v       hbv
137                 d       hb
138         random
139                 length  int
140                 =>      hb
141         pad
142                 op      enum(PadOp, "hbytes pad subcommand")
143                 v       hbv
144                 blocksz obj
145                 meth    enum(PadMethodInfo, "pad method")
146                 ...     methargs
147         blockcipher
148                 op      enum(BlockCipherOp, "op")
149                 ...     obj
150         hash
151                 alg     enum(HashAlgInfo, "hash alg")
152                 message hb
153                 =>      hb
154         hmac
155                 alg     enum(HashAlgInfo, "hash alg for hmac")
156                 message hb
157                 key     obj
158                 ?maclen obj
159                 =>      hb
160         hash-prop
161                 prop    enum(HashAlgPropInfo, "prop")
162                 alg     enum(HashAlgInfo, "alg")
163                 =>      int
164         addr-map
165                 subcmd  enum(AddrMap_SubCommand, "hbytes addr-map subcommand")
166                 ...     obj
167
168 Table padmethodinfo PadMethodInfo
169         pkcs5
170                 =>      int
171         rfc2406
172                 nxthdr  obj
173                 =>      int
174
175 Table dgram_socket DgramSocket_SubCommand
176         create
177                 local   sockaddr
178                 =>      iddata(&dgram_socks)
179         close
180                 sock    iddata(&dgram_socks)
181         transmit
182                 sock    iddata(&dgram_socks)
183                 data    hb
184                 remote  sockaddr
185         on-receive
186                 sock    iddata(&dgram_socks)
187                 ?script obj
188
189 Table tuntap_socket_raw TunSocket_SubCommand
190         create
191                 ?ifname string
192                 =>      iddata(&tuntap_socks)
193         close
194                 sock    iddata(&tuntap_socks)
195         ifname
196                 sock    iddata(&tuntap_socks)
197                 =>      string
198         receive
199                 sock    iddata(&tuntap_socks)
200                 data    hb
201         on-transmit
202                 sock    iddata(&tuntap_socks)
203                 mtu     long
204                 ?script obj
205
206 Table blockcipherop BlockCipherOp
207         e       1
208                 v       hbv
209                 alg     enum(BlockCipherAlgInfo, "alg")
210                 key     obj
211                 mode    enum(BlockCipherModeInfo, "mode")
212                 ?iv     hb
213                 =>      hb
214         d       0
215                 v       hbv
216                 alg     enum(BlockCipherAlgInfo, "alg")
217                 key     obj
218                 mode    enum(BlockCipherModeInfo, "mode")
219                 ?iv     hb
220                 =>      hb
221         mac     -1
222                 msg     hb
223                 alg     enum(BlockCipherAlgInfo, "alg")
224                 key     obj
225                 mode    enum(BlockCipherModeInfo, "mode")
226                 iv      hb
227                 =>      hb
228         prop    -1
229                 prop    enum(BlockCipherPropInfo, "prop")
230                 alg     enum(BlockCipherAlgInfo, "alg")
231                 =>      int
232
233 EntryExtra BlockCipherOp
234         int encrypt;