packet.acid 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. sizeof_1_ = 8;
  2. aggr _1_
  3. {
  4. 'U' 0 lo;
  5. 'U' 4 hi;
  6. };
  7. defn
  8. _1_(addr) {
  9. complex _1_ addr;
  10. print(" lo ", addr.lo, "\n");
  11. print(" hi ", addr.hi, "\n");
  12. };
  13. sizeofFPdbleword = 8;
  14. aggr FPdbleword
  15. {
  16. 'F' 0 x;
  17. {
  18. 'U' 0 lo;
  19. 'U' 4 hi;
  20. };
  21. };
  22. defn
  23. FPdbleword(addr) {
  24. complex FPdbleword addr;
  25. print(" x ", addr.x, "\n");
  26. print("_1_ {\n");
  27. _1_(addr+0);
  28. print("}\n");
  29. };
  30. UTFmax = 3;
  31. Runesync = 128;
  32. Runeself = 128;
  33. Runeerror = 65533;
  34. sizeofFmt = 48;
  35. aggr Fmt
  36. {
  37. 'b' 0 runes;
  38. 'X' 4 start;
  39. 'X' 8 to;
  40. 'X' 12 stop;
  41. 'X' 16 flush;
  42. 'X' 20 farg;
  43. 'D' 24 nfmt;
  44. 'X' 28 args;
  45. 'D' 32 r;
  46. 'D' 36 width;
  47. 'D' 40 prec;
  48. 'U' 44 flags;
  49. };
  50. defn
  51. Fmt(addr) {
  52. complex Fmt addr;
  53. print(" runes ", addr.runes, "\n");
  54. print(" start ", addr.start\X, "\n");
  55. print(" to ", addr.to\X, "\n");
  56. print(" stop ", addr.stop\X, "\n");
  57. print(" flush ", addr.flush\X, "\n");
  58. print(" farg ", addr.farg\X, "\n");
  59. print(" nfmt ", addr.nfmt, "\n");
  60. print(" args ", addr.args\X, "\n");
  61. print(" r ", addr.r, "\n");
  62. print(" width ", addr.width, "\n");
  63. print(" prec ", addr.prec, "\n");
  64. print(" flags ", addr.flags, "\n");
  65. };
  66. FmtWidth = 1;
  67. FmtLeft = 2;
  68. FmtPrec = 4;
  69. FmtSharp = 8;
  70. FmtSpace = 16;
  71. FmtSign = 32;
  72. FmtZero = 64;
  73. FmtUnsigned = 128;
  74. FmtShort = 256;
  75. FmtLong = 512;
  76. FmtVLong = 1024;
  77. FmtComma = 2048;
  78. FmtByte = 4096;
  79. FmtFlag = 8192;
  80. sizeofTm = 40;
  81. aggr Tm
  82. {
  83. 'D' 0 sec;
  84. 'D' 4 min;
  85. 'D' 8 hour;
  86. 'D' 12 mday;
  87. 'D' 16 mon;
  88. 'D' 20 year;
  89. 'D' 24 wday;
  90. 'D' 28 yday;
  91. 'a' 32 zone;
  92. 'D' 36 tzoff;
  93. };
  94. defn
  95. Tm(addr) {
  96. complex Tm addr;
  97. print(" sec ", addr.sec, "\n");
  98. print(" min ", addr.min, "\n");
  99. print(" hour ", addr.hour, "\n");
  100. print(" mday ", addr.mday, "\n");
  101. print(" mon ", addr.mon, "\n");
  102. print(" year ", addr.year, "\n");
  103. print(" wday ", addr.wday, "\n");
  104. print(" yday ", addr.yday, "\n");
  105. print(" zone ", addr.zone, "\n");
  106. print(" tzoff ", addr.tzoff, "\n");
  107. };
  108. PNPROC = 1;
  109. PNGROUP = 2;
  110. Profoff = 0;
  111. Profuser = 1;
  112. Profkernel = 2;
  113. Proftime = 3;
  114. Profsample = 4;
  115. sizeofLock = 4;
  116. aggr Lock
  117. {
  118. 'D' 0 val;
  119. };
  120. defn
  121. Lock(addr) {
  122. complex Lock addr;
  123. print(" val ", addr.val, "\n");
  124. };
  125. sizeofQLp = 12;
  126. aggr QLp
  127. {
  128. 'D' 0 inuse;
  129. 'A' QLp 4 next;
  130. 'C' 8 state;
  131. };
  132. defn
  133. QLp(addr) {
  134. complex QLp addr;
  135. print(" inuse ", addr.inuse, "\n");
  136. print(" next ", addr.next\X, "\n");
  137. print(" state ", addr.state, "\n");
  138. };
  139. sizeofQLock = 16;
  140. aggr QLock
  141. {
  142. Lock 0 lock;
  143. 'D' 4 locked;
  144. 'A' QLp 8 $head;
  145. 'A' QLp 12 $tail;
  146. };
  147. defn
  148. QLock(addr) {
  149. complex QLock addr;
  150. print("Lock lock {\n");
  151. Lock(addr.lock);
  152. print("}\n");
  153. print(" locked ", addr.locked, "\n");
  154. print(" $head ", addr.$head\X, "\n");
  155. print(" $tail ", addr.$tail\X, "\n");
  156. };
  157. sizeofRWLock = 20;
  158. aggr RWLock
  159. {
  160. Lock 0 lock;
  161. 'D' 4 readers;
  162. 'D' 8 writer;
  163. 'A' QLp 12 $head;
  164. 'A' QLp 16 $tail;
  165. };
  166. defn
  167. RWLock(addr) {
  168. complex RWLock addr;
  169. print("Lock lock {\n");
  170. Lock(addr.lock);
  171. print("}\n");
  172. print(" readers ", addr.readers, "\n");
  173. print(" writer ", addr.writer, "\n");
  174. print(" $head ", addr.$head\X, "\n");
  175. print(" $tail ", addr.$tail\X, "\n");
  176. };
  177. sizeofRendez = 12;
  178. aggr Rendez
  179. {
  180. 'A' QLock 0 l;
  181. 'A' QLp 4 $head;
  182. 'A' QLp 8 $tail;
  183. };
  184. defn
  185. Rendez(addr) {
  186. complex Rendez addr;
  187. print(" l ", addr.l\X, "\n");
  188. print(" $head ", addr.$head\X, "\n");
  189. print(" $tail ", addr.$tail\X, "\n");
  190. };
  191. sizeofNetConnInfo = 36;
  192. aggr NetConnInfo
  193. {
  194. 'X' 0 dir;
  195. 'X' 4 root;
  196. 'X' 8 spec;
  197. 'X' 12 lsys;
  198. 'X' 16 lserv;
  199. 'X' 20 rsys;
  200. 'X' 24 rserv;
  201. 'X' 28 laddr;
  202. 'X' 32 raddr;
  203. };
  204. defn
  205. NetConnInfo(addr) {
  206. complex NetConnInfo addr;
  207. print(" dir ", addr.dir\X, "\n");
  208. print(" root ", addr.root\X, "\n");
  209. print(" spec ", addr.spec\X, "\n");
  210. print(" lsys ", addr.lsys\X, "\n");
  211. print(" lserv ", addr.lserv\X, "\n");
  212. print(" rsys ", addr.rsys\X, "\n");
  213. print(" rserv ", addr.rserv\X, "\n");
  214. print(" laddr ", addr.laddr\X, "\n");
  215. print(" raddr ", addr.raddr\X, "\n");
  216. };
  217. RFNAMEG = 1;
  218. RFENVG = 2;
  219. RFFDG = 4;
  220. RFNOTEG = 8;
  221. RFPROC = 16;
  222. RFMEM = 32;
  223. RFNOWAIT = 64;
  224. RFCNAMEG = 1024;
  225. RFCENVG = 2048;
  226. RFCFDG = 4096;
  227. RFREND = 8192;
  228. RFNOMNT = 16384;
  229. sizeofQid = 16;
  230. aggr Qid
  231. {
  232. 'W' 0 path;
  233. 'U' 8 vers;
  234. 'b' 12 type;
  235. };
  236. defn
  237. Qid(addr) {
  238. complex Qid addr;
  239. print(" path ", addr.path, "\n");
  240. print(" vers ", addr.vers, "\n");
  241. print(" type ", addr.type, "\n");
  242. };
  243. sizeofDir = 60;
  244. aggr Dir
  245. {
  246. 'u' 0 type;
  247. 'U' 4 dev;
  248. Qid 8 qid;
  249. 'U' 24 mode;
  250. 'U' 28 atime;
  251. 'U' 32 mtime;
  252. 'V' 36 length;
  253. 'X' 44 name;
  254. 'X' 48 uid;
  255. 'X' 52 gid;
  256. 'X' 56 muid;
  257. };
  258. defn
  259. Dir(addr) {
  260. complex Dir addr;
  261. print(" type ", addr.type, "\n");
  262. print(" dev ", addr.dev, "\n");
  263. print("Qid qid {\n");
  264. Qid(addr.qid);
  265. print("}\n");
  266. print(" mode ", addr.mode, "\n");
  267. print(" atime ", addr.atime, "\n");
  268. print(" mtime ", addr.mtime, "\n");
  269. print(" length ", addr.length, "\n");
  270. print(" name ", addr.name\X, "\n");
  271. print(" uid ", addr.uid\X, "\n");
  272. print(" gid ", addr.gid\X, "\n");
  273. print(" muid ", addr.muid\X, "\n");
  274. };
  275. sizeofWaitmsg = 20;
  276. aggr Waitmsg
  277. {
  278. 'D' 0 pid;
  279. 'a' 4 time;
  280. 'X' 16 msg;
  281. };
  282. defn
  283. Waitmsg(addr) {
  284. complex Waitmsg addr;
  285. print(" pid ", addr.pid, "\n");
  286. print(" time ", addr.time, "\n");
  287. print(" msg ", addr.msg\X, "\n");
  288. };
  289. sizeofIOchunk = 8;
  290. aggr IOchunk
  291. {
  292. 'X' 0 addr;
  293. 'U' 4 len;
  294. };
  295. defn
  296. IOchunk(addr) {
  297. complex IOchunk addr;
  298. print(" addr ", addr.addr\X, "\n");
  299. print(" len ", addr.len, "\n");
  300. };
  301. MaxFragSize = 9216;
  302. sizeofVtLog = 40;
  303. aggr VtLog
  304. {
  305. 'A' VtLog 0 next;
  306. 'X' 4 name;
  307. 'X' 8 chunk;
  308. 'U' 12 nchunk;
  309. 'X' 16 w;
  310. QLock 20 lk;
  311. 'D' 36 ref;
  312. };
  313. defn
  314. VtLog(addr) {
  315. complex VtLog addr;
  316. print(" next ", addr.next\X, "\n");
  317. print(" name ", addr.name\X, "\n");
  318. print(" chunk ", addr.chunk\X, "\n");
  319. print(" nchunk ", addr.nchunk, "\n");
  320. print(" w ", addr.w\X, "\n");
  321. print("QLock lk {\n");
  322. QLock(addr.lk);
  323. print("}\n");
  324. print(" ref ", addr.ref, "\n");
  325. };
  326. sizeofVtLogChunk = 12;
  327. aggr VtLogChunk
  328. {
  329. 'X' 0 p;
  330. 'X' 4 ep;
  331. 'X' 8 wp;
  332. };
  333. defn
  334. VtLogChunk(addr) {
  335. complex VtLogChunk addr;
  336. print(" p ", addr.p\X, "\n");
  337. print(" ep ", addr.ep\X, "\n");
  338. print(" wp ", addr.wp\X, "\n");
  339. };
  340. VtScoreSize = 20;
  341. VtMaxStringSize = 1024;
  342. VtMaxLumpSize = 57344;
  343. VtPointerDepth = 7;
  344. VtDataType = 0;
  345. VtDirType = 8;
  346. VtRootType = 16;
  347. VtMaxType = 17;
  348. VtCorruptType = 255;
  349. VtTypeDepthMask = 7;
  350. VtTypeBaseMask = -8;
  351. VtEntryActive = 1;
  352. _VtEntryDir = 2;
  353. _VtEntryDepthShift = 2;
  354. _VtEntryDepthMask = 28;
  355. VtEntryLocal = 32;
  356. VtEntrySize = 40;
  357. sizeofVtEntry = 40;
  358. aggr VtEntry
  359. {
  360. 'U' 0 gen;
  361. 'u' 4 psize;
  362. 'u' 6 dsize;
  363. 'b' 8 type;
  364. 'b' 9 flags;
  365. 'W' 12 size;
  366. 'a' 20 score;
  367. };
  368. defn
  369. VtEntry(addr) {
  370. complex VtEntry addr;
  371. print(" gen ", addr.gen, "\n");
  372. print(" psize ", addr.psize, "\n");
  373. print(" dsize ", addr.dsize, "\n");
  374. print(" type ", addr.type, "\n");
  375. print(" flags ", addr.flags, "\n");
  376. print(" size ", addr.size, "\n");
  377. print(" score ", addr.score, "\n");
  378. };
  379. sizeofVtRoot = 300;
  380. aggr VtRoot
  381. {
  382. 'a' 0 name;
  383. 'a' 128 type;
  384. 'a' 256 score;
  385. 'u' 276 blocksize;
  386. 'a' 278 prev;
  387. };
  388. defn
  389. VtRoot(addr) {
  390. complex VtRoot addr;
  391. print(" name ", addr.name, "\n");
  392. print(" type ", addr.type, "\n");
  393. print(" score ", addr.score, "\n");
  394. print(" blocksize ", addr.blocksize, "\n");
  395. print(" prev ", addr.prev, "\n");
  396. };
  397. VtRootSize = 300;
  398. VtRootVersion = 2;
  399. VtCryptoStrengthNone = 0;
  400. VtCryptoStrengthAuth = 1;
  401. VtCryptoStrengthWeak = 2;
  402. VtCryptoStrengthStrong = 3;
  403. VtCryptoNone = 0;
  404. VtCryptoSSL3 = 1;
  405. VtCryptoTLS1 = 2;
  406. VtCryptoMax = 3;
  407. VtCodecNone = 0;
  408. VtCodecDeflate = 1;
  409. VtCodecThwack = 2;
  410. VtCodecMax = 3;
  411. VtRerror = 1;
  412. VtTping = 2;
  413. VtRping = 3;
  414. VtThello = 4;
  415. VtRhello = 5;
  416. VtTgoodbye = 6;
  417. VtRgoodbye = 7;
  418. VtTauth0 = 8;
  419. VtRauth0 = 9;
  420. VtTauth1 = 10;
  421. VtRauth1 = 11;
  422. VtTread = 12;
  423. VtRread = 13;
  424. VtTwrite = 14;
  425. VtRwrite = 15;
  426. VtTsync = 16;
  427. VtRsync = 17;
  428. VtTmax = 18;
  429. sizeofVtFcall = 80;
  430. aggr VtFcall
  431. {
  432. 'b' 0 msgtype;
  433. 'b' 1 tag;
  434. 'X' 4 error;
  435. 'X' 8 version;
  436. 'X' 12 uid;
  437. 'b' 16 strength;
  438. 'X' 20 crypto;
  439. 'U' 24 ncrypto;
  440. 'X' 28 codec;
  441. 'U' 32 ncodec;
  442. 'X' 36 sid;
  443. 'b' 40 rcrypto;
  444. 'b' 41 rcodec;
  445. 'X' 44 auth;
  446. 'U' 48 nauth;
  447. 'a' 52 score;
  448. 'b' 72 blocktype;
  449. 'u' 74 count;
  450. 'X' 76 data;
  451. };
  452. defn
  453. VtFcall(addr) {
  454. complex VtFcall addr;
  455. print(" msgtype ", addr.msgtype, "\n");
  456. print(" tag ", addr.tag, "\n");
  457. print(" error ", addr.error\X, "\n");
  458. print(" version ", addr.version\X, "\n");
  459. print(" uid ", addr.uid\X, "\n");
  460. print(" strength ", addr.strength, "\n");
  461. print(" crypto ", addr.crypto\X, "\n");
  462. print(" ncrypto ", addr.ncrypto, "\n");
  463. print(" codec ", addr.codec\X, "\n");
  464. print(" ncodec ", addr.ncodec, "\n");
  465. print(" sid ", addr.sid\X, "\n");
  466. print(" rcrypto ", addr.rcrypto, "\n");
  467. print(" rcodec ", addr.rcodec, "\n");
  468. print(" auth ", addr.auth\X, "\n");
  469. print(" nauth ", addr.nauth, "\n");
  470. print(" score ", addr.score, "\n");
  471. print(" blocktype ", addr.blocktype, "\n");
  472. print(" count ", addr.count, "\n");
  473. print(" data ", addr.data\X, "\n");
  474. };
  475. VtStateAlloc = 0;
  476. VtStateConnected = 1;
  477. VtStateClosed = 2;
  478. sizeofVtConn = 1404;
  479. aggr VtConn
  480. {
  481. QLock 0 lk;
  482. QLock 16 inlk;
  483. QLock 32 outlk;
  484. 'D' 48 debug;
  485. 'D' 52 infd;
  486. 'D' 56 outfd;
  487. 'D' 60 muxer;
  488. 'X' 64 writeq;
  489. 'X' 68 readq;
  490. 'D' 72 state;
  491. 'a' 76 wait;
  492. 'U' 1100 ntag;
  493. 'U' 1104 nsleep;
  494. 'X' 1108 part;
  495. Rendez 1112 tagrend;
  496. Rendez 1124 rpcfork;
  497. 'X' 1136 version;
  498. 'X' 1140 uid;
  499. 'X' 1144 sid;
  500. 'a' 1148 addr;
  501. };
  502. defn
  503. VtConn(addr) {
  504. complex VtConn addr;
  505. print("QLock lk {\n");
  506. QLock(addr.lk);
  507. print("}\n");
  508. print("QLock inlk {\n");
  509. QLock(addr.inlk);
  510. print("}\n");
  511. print("QLock outlk {\n");
  512. QLock(addr.outlk);
  513. print("}\n");
  514. print(" debug ", addr.debug, "\n");
  515. print(" infd ", addr.infd, "\n");
  516. print(" outfd ", addr.outfd, "\n");
  517. print(" muxer ", addr.muxer, "\n");
  518. print(" writeq ", addr.writeq\X, "\n");
  519. print(" readq ", addr.readq\X, "\n");
  520. print(" state ", addr.state, "\n");
  521. print(" wait ", addr.wait, "\n");
  522. print(" ntag ", addr.ntag, "\n");
  523. print(" nsleep ", addr.nsleep, "\n");
  524. print(" part ", addr.part\X, "\n");
  525. print("Rendez tagrend {\n");
  526. Rendez(addr.tagrend);
  527. print("}\n");
  528. print("Rendez rpcfork {\n");
  529. Rendez(addr.rpcfork);
  530. print("}\n");
  531. print(" version ", addr.version\X, "\n");
  532. print(" uid ", addr.uid\X, "\n");
  533. print(" sid ", addr.sid\X, "\n");
  534. print(" addr ", addr.addr, "\n");
  535. };
  536. sizeofVtReq = 168;
  537. aggr VtReq
  538. {
  539. VtFcall 0 tx;
  540. VtFcall 80 rx;
  541. 'X' 160 srv;
  542. 'X' 164 sc;
  543. };
  544. defn
  545. VtReq(addr) {
  546. complex VtReq addr;
  547. print("VtFcall tx {\n");
  548. VtFcall(addr.tx);
  549. print("}\n");
  550. print("VtFcall rx {\n");
  551. VtFcall(addr.rx);
  552. print("}\n");
  553. print(" srv ", addr.srv\X, "\n");
  554. print(" sc ", addr.sc\X, "\n");
  555. };
  556. NilBlock = -1;
  557. sizeofVtBlock = 84;
  558. aggr VtBlock
  559. {
  560. 'X' 0 c;
  561. QLock 4 lk;
  562. 'X' 20 data;
  563. 'a' 24 score;
  564. 'b' 44 type;
  565. 'D' 48 nlock;
  566. 'D' 52 iostate;
  567. 'D' 56 ref;
  568. 'U' 60 heap;
  569. 'A' VtBlock 64 next;
  570. 'A' VtBlock 68 prev;
  571. 'U' 72 used;
  572. 'U' 76 used2;
  573. 'U' 80 addr;
  574. };
  575. defn
  576. VtBlock(addr) {
  577. complex VtBlock addr;
  578. print(" c ", addr.c\X, "\n");
  579. print("QLock lk {\n");
  580. QLock(addr.lk);
  581. print("}\n");
  582. print(" data ", addr.data\X, "\n");
  583. print(" score ", addr.score, "\n");
  584. print(" type ", addr.type, "\n");
  585. print(" nlock ", addr.nlock, "\n");
  586. print(" iostate ", addr.iostate, "\n");
  587. print(" ref ", addr.ref, "\n");
  588. print(" heap ", addr.heap, "\n");
  589. print(" next ", addr.next\X, "\n");
  590. print(" prev ", addr.prev\X, "\n");
  591. print(" used ", addr.used, "\n");
  592. print(" used2 ", addr.used2, "\n");
  593. print(" addr ", addr.addr, "\n");
  594. };
  595. sizeofVtFile = 84;
  596. aggr VtFile
  597. {
  598. QLock 0 lk;
  599. 'D' 16 ref;
  600. 'D' 20 $local;
  601. 'A' VtBlock 24 b;
  602. 'a' 28 score;
  603. 'X' 48 c;
  604. 'D' 52 mode;
  605. 'U' 56 gen;
  606. 'D' 60 dsize;
  607. 'D' 64 psize;
  608. 'D' 68 dir;
  609. 'A' VtFile 72 parent;
  610. 'D' 76 epb;
  611. 'U' 80 offset;
  612. };
  613. defn
  614. VtFile(addr) {
  615. complex VtFile addr;
  616. print("QLock lk {\n");
  617. QLock(addr.lk);
  618. print("}\n");
  619. print(" ref ", addr.ref, "\n");
  620. print(" $local ", addr.$local, "\n");
  621. print(" b ", addr.b\X, "\n");
  622. print(" score ", addr.score, "\n");
  623. print(" c ", addr.c\X, "\n");
  624. print(" mode ", addr.mode, "\n");
  625. print(" gen ", addr.gen, "\n");
  626. print(" dsize ", addr.dsize, "\n");
  627. print(" psize ", addr.psize, "\n");
  628. print(" dir ", addr.dir, "\n");
  629. print(" parent ", addr.parent\X, "\n");
  630. print(" epb ", addr.epb, "\n");
  631. print(" offset ", addr.offset, "\n");
  632. };
  633. VtOREAD = 0;
  634. VtOWRITE = 1;
  635. VtORDWR = 2;
  636. AESbsize = 16;
  637. AESmaxkey = 32;
  638. AESmaxrounds = 14;
  639. sizeofAESstate = 540;
  640. aggr AESstate
  641. {
  642. 'U' 0 setup;
  643. 'D' 4 rounds;
  644. 'D' 8 keybytes;
  645. 'a' 12 key;
  646. 'a' 44 ekey;
  647. 'a' 284 dkey;
  648. 'a' 524 ivec;
  649. };
  650. defn
  651. AESstate(addr) {
  652. complex AESstate addr;
  653. print(" setup ", addr.setup, "\n");
  654. print(" rounds ", addr.rounds, "\n");
  655. print(" keybytes ", addr.keybytes, "\n");
  656. print(" key ", addr.key, "\n");
  657. print(" ekey ", addr.ekey, "\n");
  658. print(" dkey ", addr.dkey, "\n");
  659. print(" ivec ", addr.ivec, "\n");
  660. };
  661. BFbsize = 8;
  662. BFrounds = 16;
  663. sizeofBFstate = 4236;
  664. aggr BFstate
  665. {
  666. 'U' 0 setup;
  667. 'a' 4 key;
  668. 'a' 60 ivec;
  669. 'a' 68 pbox;
  670. 'a' 140 sbox;
  671. };
  672. defn
  673. BFstate(addr) {
  674. complex BFstate addr;
  675. print(" setup ", addr.setup, "\n");
  676. print(" key ", addr.key, "\n");
  677. print(" ivec ", addr.ivec, "\n");
  678. print(" pbox ", addr.pbox, "\n");
  679. print(" sbox ", addr.sbox, "\n");
  680. };
  681. DESbsize = 8;
  682. sizeofDESstate = 148;
  683. aggr DESstate
  684. {
  685. 'U' 0 setup;
  686. 'a' 4 key;
  687. 'a' 12 expanded;
  688. 'a' 140 ivec;
  689. };
  690. defn
  691. DESstate(addr) {
  692. complex DESstate addr;
  693. print(" setup ", addr.setup, "\n");
  694. print(" key ", addr.key, "\n");
  695. print(" expanded ", addr.expanded, "\n");
  696. print(" ivec ", addr.ivec, "\n");
  697. };
  698. DES3E = 0;
  699. DES3D = 1;
  700. DES3EEE = 0;
  701. DES3EDE = 2;
  702. DES3DED = 5;
  703. DES3DDD = 7;
  704. sizeofDES3state = 420;
  705. aggr DES3state
  706. {
  707. 'U' 0 setup;
  708. 'a' 4 key;
  709. 'a' 28 expanded;
  710. 'a' 412 ivec;
  711. };
  712. defn
  713. DES3state(addr) {
  714. complex DES3state addr;
  715. print(" setup ", addr.setup, "\n");
  716. print(" key ", addr.key, "\n");
  717. print(" expanded ", addr.expanded, "\n");
  718. print(" ivec ", addr.ivec, "\n");
  719. };
  720. SHA1dlen = 20;
  721. MD4dlen = 16;
  722. MD5dlen = 16;
  723. sizeofDigestState = 164;
  724. aggr DigestState
  725. {
  726. 'W' 0 len;
  727. 'a' 8 state;
  728. 'a' 28 buf;
  729. 'D' 156 blen;
  730. 'C' 160 malloced;
  731. 'C' 161 seeded;
  732. };
  733. defn
  734. DigestState(addr) {
  735. complex DigestState addr;
  736. print(" len ", addr.len, "\n");
  737. print(" state ", addr.state, "\n");
  738. print(" buf ", addr.buf, "\n");
  739. print(" blen ", addr.blen, "\n");
  740. print(" malloced ", addr.malloced, "\n");
  741. print(" seeded ", addr.seeded, "\n");
  742. };
  743. sizeofRC4state = 260;
  744. aggr RC4state
  745. {
  746. 'a' 0 state;
  747. 'b' 256 x;
  748. 'b' 257 y;
  749. };
  750. defn
  751. RC4state(addr) {
  752. complex RC4state addr;
  753. print(" state ", addr.state, "\n");
  754. print(" x ", addr.x, "\n");
  755. print(" y ", addr.y, "\n");
  756. };
  757. sizeofRSApub = 8;
  758. aggr RSApub
  759. {
  760. 'X' 0 n;
  761. 'X' 4 ek;
  762. };
  763. defn
  764. RSApub(addr) {
  765. complex RSApub addr;
  766. print(" n ", addr.n\X, "\n");
  767. print(" ek ", addr.ek\X, "\n");
  768. };
  769. sizeofRSApriv = 32;
  770. aggr RSApriv
  771. {
  772. RSApub 0 pub;
  773. 'X' 8 dk;
  774. 'X' 12 p;
  775. 'X' 16 q;
  776. 'X' 20 kp;
  777. 'X' 24 kq;
  778. 'X' 28 c2;
  779. };
  780. defn
  781. RSApriv(addr) {
  782. complex RSApriv addr;
  783. print("RSApub pub {\n");
  784. RSApub(addr.pub);
  785. print("}\n");
  786. print(" dk ", addr.dk\X, "\n");
  787. print(" p ", addr.p\X, "\n");
  788. print(" q ", addr.q\X, "\n");
  789. print(" kp ", addr.kp\X, "\n");
  790. print(" kq ", addr.kq\X, "\n");
  791. print(" c2 ", addr.c2\X, "\n");
  792. };
  793. sizeofPEMChain = 12;
  794. aggr PEMChain
  795. {
  796. 'A' PEMChain 0 next;
  797. 'X' 4 pem;
  798. 'D' 8 pemlen;
  799. };
  800. defn
  801. PEMChain(addr) {
  802. complex PEMChain addr;
  803. print(" next ", addr.next\X, "\n");
  804. print(" pem ", addr.pem\X, "\n");
  805. print(" pemlen ", addr.pemlen, "\n");
  806. };
  807. sizeofEGpub = 12;
  808. aggr EGpub
  809. {
  810. 'X' 0 p;
  811. 'X' 4 alpha;
  812. 'X' 8 key;
  813. };
  814. defn
  815. EGpub(addr) {
  816. complex EGpub addr;
  817. print(" p ", addr.p\X, "\n");
  818. print(" alpha ", addr.alpha\X, "\n");
  819. print(" key ", addr.key\X, "\n");
  820. };
  821. sizeofEGpriv = 16;
  822. aggr EGpriv
  823. {
  824. EGpub 0 pub;
  825. 'X' 12 secret;
  826. };
  827. defn
  828. EGpriv(addr) {
  829. complex EGpriv addr;
  830. print("EGpub pub {\n");
  831. EGpub(addr.pub);
  832. print("}\n");
  833. print(" secret ", addr.secret\X, "\n");
  834. };
  835. sizeofEGsig = 8;
  836. aggr EGsig
  837. {
  838. 'X' 0 r;
  839. 'X' 4 s;
  840. };
  841. defn
  842. EGsig(addr) {
  843. complex EGsig addr;
  844. print(" r ", addr.r\X, "\n");
  845. print(" s ", addr.s\X, "\n");
  846. };
  847. sizeofDSApub = 16;
  848. aggr DSApub
  849. {
  850. 'X' 0 p;
  851. 'X' 4 q;
  852. 'X' 8 alpha;
  853. 'X' 12 key;
  854. };
  855. defn
  856. DSApub(addr) {
  857. complex DSApub addr;
  858. print(" p ", addr.p\X, "\n");
  859. print(" q ", addr.q\X, "\n");
  860. print(" alpha ", addr.alpha\X, "\n");
  861. print(" key ", addr.key\X, "\n");
  862. };
  863. sizeofDSApriv = 20;
  864. aggr DSApriv
  865. {
  866. DSApub 0 pub;
  867. 'X' 16 secret;
  868. };
  869. defn
  870. DSApriv(addr) {
  871. complex DSApriv addr;
  872. print("DSApub pub {\n");
  873. DSApub(addr.pub);
  874. print("}\n");
  875. print(" secret ", addr.secret\X, "\n");
  876. };
  877. sizeofDSAsig = 8;
  878. aggr DSAsig
  879. {
  880. 'X' 0 r;
  881. 'X' 4 s;
  882. };
  883. defn
  884. DSAsig(addr) {
  885. complex DSAsig addr;
  886. print(" r ", addr.r\X, "\n");
  887. print(" s ", addr.s\X, "\n");
  888. };
  889. sizeofThumbprint = 24;
  890. aggr Thumbprint
  891. {
  892. 'A' Thumbprint 0 next;
  893. 'a' 4 sha1;
  894. };
  895. defn
  896. Thumbprint(addr) {
  897. complex Thumbprint addr;
  898. print(" next ", addr.next\X, "\n");
  899. print(" sha1 ", addr.sha1, "\n");
  900. };
  901. sizeofTLSconn = 80;
  902. aggr TLSconn
  903. {
  904. 'a' 0 dir;
  905. 'X' 40 cert;
  906. 'X' 44 sessionID;
  907. 'D' 48 certlen;
  908. 'D' 52 sessionIDlen;
  909. 'X' 56 trace;
  910. 'A' PEMChain 60 chain;
  911. 'X' 64 sessionType;
  912. 'X' 68 sessionKey;
  913. 'D' 72 sessionKeylen;
  914. 'X' 76 sessionConst;
  915. };
  916. defn
  917. TLSconn(addr) {
  918. complex TLSconn addr;
  919. print(" dir ", addr.dir, "\n");
  920. print(" cert ", addr.cert\X, "\n");
  921. print(" sessionID ", addr.sessionID\X, "\n");
  922. print(" certlen ", addr.certlen, "\n");
  923. print(" sessionIDlen ", addr.sessionIDlen, "\n");
  924. print(" trace ", addr.trace\X, "\n");
  925. print(" chain ", addr.chain\X, "\n");
  926. print(" sessionType ", addr.sessionType\X, "\n");
  927. print(" sessionKey ", addr.sessionKey\X, "\n");
  928. print(" sessionKeylen ", addr.sessionKeylen, "\n");
  929. print(" sessionConst ", addr.sessionConst\X, "\n");
  930. };
  931. BigMemSize = 9216;
  932. SmallMemSize = 1152;
  933. NLocalFrag = 2;
  934. PFront = 0;
  935. PMiddle = 1;
  936. PEnd = 2;
  937. sizeofMem = 28;
  938. aggr Mem
  939. {
  940. Lock 0 lk;
  941. 'D' 4 ref;
  942. 'X' 8 bp;
  943. 'X' 12 ep;
  944. 'X' 16 rp;
  945. 'X' 20 wp;
  946. 'A' Mem 24 next;
  947. };
  948. defn
  949. Mem(addr) {
  950. complex Mem addr;
  951. print("Lock lk {\n");
  952. Lock(addr.lk);
  953. print("}\n");
  954. print(" ref ", addr.ref, "\n");
  955. print(" bp ", addr.bp\X, "\n");
  956. print(" ep ", addr.ep\X, "\n");
  957. print(" rp ", addr.rp\X, "\n");
  958. print(" wp ", addr.wp\X, "\n");
  959. print(" next ", addr.next\X, "\n");
  960. };
  961. FragLocalFree = 0;
  962. FragLocalAlloc = 1;
  963. FragGlobal = 2;
  964. sizeofFrag = 32;
  965. aggr Frag
  966. {
  967. 'D' 0 state;
  968. 'A' Mem 4 mem;
  969. 'X' 8 rp;
  970. 'X' 12 wp;
  971. 'A' Frag 16 next;
  972. 'X' 20 free;
  973. 'X' 24 a;
  974. 'X' 28 p;
  975. };
  976. defn
  977. Frag(addr) {
  978. complex Frag addr;
  979. print(" state ", addr.state, "\n");
  980. print(" mem ", addr.mem\X, "\n");
  981. print(" rp ", addr.rp\X, "\n");
  982. print(" wp ", addr.wp\X, "\n");
  983. print(" next ", addr.next\X, "\n");
  984. print(" free ", addr.free\X, "\n");
  985. print(" a ", addr.a\X, "\n");
  986. print(" p ", addr.p\X, "\n");
  987. };
  988. sizeofPacket = 88;
  989. aggr Packet
  990. {
  991. 'D' 0 size;
  992. 'D' 4 asize;
  993. 'U' 8 pc;
  994. 'A' Packet 12 next;
  995. 'A' Frag 16 first;
  996. 'A' Frag 20 last;
  997. 'a' 24 $local;
  998. };
  999. defn
  1000. Packet(addr) {
  1001. complex Packet addr;
  1002. print(" size ", addr.size, "\n");
  1003. print(" asize ", addr.asize, "\n");
  1004. print(" pc ", addr.pc, "\n");
  1005. print(" next ", addr.next\X, "\n");
  1006. print(" first ", addr.first\X, "\n");
  1007. print(" last ", addr.last\X, "\n");
  1008. print(" $local ", addr.$local, "\n");
  1009. };
  1010. sizeof_2_ = 36;
  1011. aggr _2_
  1012. {
  1013. Lock 0 lk;
  1014. 'A' Packet 4 packet;
  1015. 'D' 8 npacket;
  1016. 'A' Frag 12 frag;
  1017. 'D' 16 nfrag;
  1018. 'A' Mem 20 bigmem;
  1019. 'D' 24 nbigmem;
  1020. 'A' Mem 28 smallmem;
  1021. 'D' 32 nsmallmem;
  1022. };
  1023. defn
  1024. _2_(addr) {
  1025. complex _2_ addr;
  1026. print("Lock lk {\n");
  1027. Lock(addr.lk);
  1028. print("}\n");
  1029. print(" packet ", addr.packet\X, "\n");
  1030. print(" npacket ", addr.npacket, "\n");
  1031. print(" frag ", addr.frag\X, "\n");
  1032. print(" nfrag ", addr.nfrag, "\n");
  1033. print(" bigmem ", addr.bigmem\X, "\n");
  1034. print(" nbigmem ", addr.nbigmem, "\n");
  1035. print(" smallmem ", addr.smallmem\X, "\n");
  1036. print(" nsmallmem ", addr.nsmallmem, "\n");
  1037. };
  1038. complex _2_ freelist;
  1039. complex Packet packetalloc:p;
  1040. complex Packet packetfree:p;
  1041. complex Frag packetfree:f;
  1042. complex Frag packetfree:ff;
  1043. complex Packet packetdup:p;
  1044. complex Frag packetdup:f;
  1045. complex Frag packetdup:ff;
  1046. complex Packet packetdup:pp;
  1047. complex Packet packetsplit:p;
  1048. complex Packet packetsplit:pp;
  1049. complex Frag packetsplit:f;
  1050. complex Frag packetsplit:ff;
  1051. complex Packet packetconsume:p;
  1052. complex Packet packettrim:p;
  1053. complex Frag packettrim:f;
  1054. complex Frag packettrim:ff;
  1055. complex Packet packetheader:p;
  1056. complex Frag packetheader:f;
  1057. complex Mem packetheader:m;
  1058. complex Packet packettrailer:p;
  1059. complex Mem packettrailer:m;
  1060. complex Frag packettrailer:f;
  1061. complex Packet packetprefix:p;
  1062. complex Frag packetprefix:f;
  1063. complex Mem packetprefix:m;
  1064. complex Packet packetappend:p;
  1065. complex Frag packetappend:f;
  1066. complex Mem packetappend:m;
  1067. complex Packet packetconcat:p;
  1068. complex Packet packetconcat:pp;
  1069. complex Frag packetconcat:f;
  1070. complex Packet packetpeek:p;
  1071. complex Frag packetpeek:f;
  1072. complex Packet packetcopy:p;
  1073. complex Packet packetfragments:p;
  1074. complex IOchunk packetfragments:io;
  1075. complex Frag packetfragments:f;
  1076. complex IOchunk packetfragments:eio;
  1077. complex Packet packetstats:p;
  1078. complex Frag packetstats:f;
  1079. complex Mem packetstats:m;
  1080. complex Packet packetsize:p;
  1081. complex Frag packetsize:f;
  1082. complex Packet packetasize:p;
  1083. complex Frag packetasize:f;
  1084. complex Packet packetsha1:p;
  1085. complex DigestState packetsha1:ds;
  1086. complex Frag packetsha1:f;
  1087. complex Packet packetcmp:pkt0;
  1088. complex Packet packetcmp:pkt1;
  1089. complex Frag packetcmp:f0;
  1090. complex Frag packetcmp:f1;
  1091. complex Packet fragalloc:p;
  1092. complex Frag fragalloc:next;
  1093. complex Frag fragalloc:f;
  1094. complex Frag fragalloc:ef;
  1095. complex Mem fragalloc:m;
  1096. complex Packet packetforeign:p;
  1097. complex Frag packetforeign:f;
  1098. complex Packet fragdup:p;
  1099. complex Frag fragdup:f;
  1100. complex Frag fragdup:ff;
  1101. complex Mem fragdup:m;
  1102. complex Frag fragfree:f;
  1103. complex Mem memalloc:m;
  1104. complex Mem memfree:m;
  1105. complex Mem memhead:m;
  1106. complex Mem memtail:m;