structs.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Nfsv4SecInfoFlavor = exports.Nfsv4RpcSecGssInfo = exports.Nfsv4CreateType = exports.Nfsv4CreateTypeVoid = exports.Nfsv4CreateTypeDevice = exports.Nfsv4CreateTypeLink = exports.Nfsv4LockOwnerInfo = exports.Nfsv4LockExistingOwner = exports.Nfsv4LockNewOwner = exports.Nfsv4Entry = exports.Nfsv4OpenDelegation = exports.Nfsv4OpenWriteDelegation = exports.Nfsv4OpenReadDelegation = exports.Nfsv4OpenClaim = exports.Nfsv4OpenClaimDelegatePrev = exports.Nfsv4OpenClaimDelegateCur = exports.Nfsv4OpenClaimPrevious = exports.Nfsv4OpenClaimNull = exports.Nfsv4OpenHow = exports.Nfsv4CreateHow = exports.Nfsv4CreateVerf = exports.Nfsv4CreateAttrs = exports.Nfsv4SecInfo = exports.Nfsv4Acl = exports.Nfsv4Ace = exports.Nfsv4FsLocations = exports.Nfsv4FsLocation = exports.Nfsv4OpenToLockOwner = exports.Nfsv4LockOwner = exports.Nfsv4OpenOwner = exports.Nfsv4ClientId = exports.Nfsv4CbClient = exports.Nfsv4ClientAddr = exports.Nfsv4Fattr = exports.Nfsv4Bitmap = exports.Nfsv4SetTime = exports.Nfsv4ChangeInfo = exports.Nfsv4Stateid = exports.Nfsv4Fsid = exports.Nfsv4Verifier = exports.Nfsv4Fh = exports.Nfsv4SpecData = exports.Nfsv4Time = void 0;
  4. class Nfsv4Time {
  5. constructor(seconds, nseconds) {
  6. this.seconds = seconds;
  7. this.nseconds = nseconds;
  8. }
  9. encode(xdr) {
  10. xdr.writeHyper(this.seconds);
  11. xdr.writeUnsignedInt(this.nseconds);
  12. }
  13. }
  14. exports.Nfsv4Time = Nfsv4Time;
  15. class Nfsv4SpecData {
  16. constructor(specdata1, specdata2) {
  17. this.specdata1 = specdata1;
  18. this.specdata2 = specdata2;
  19. }
  20. encode(xdr) {
  21. xdr.writeUnsignedInt(this.specdata1);
  22. xdr.writeUnsignedInt(this.specdata2);
  23. }
  24. }
  25. exports.Nfsv4SpecData = Nfsv4SpecData;
  26. class Nfsv4Fh {
  27. constructor(data) {
  28. this.data = data;
  29. }
  30. encode(xdr) {
  31. xdr.writeVarlenOpaque(this.data);
  32. }
  33. }
  34. exports.Nfsv4Fh = Nfsv4Fh;
  35. class Nfsv4Verifier {
  36. constructor(data) {
  37. this.data = data;
  38. }
  39. encode(xdr) {
  40. xdr.writeOpaque(this.data);
  41. }
  42. }
  43. exports.Nfsv4Verifier = Nfsv4Verifier;
  44. class Nfsv4Fsid {
  45. constructor(major, minor) {
  46. this.major = major;
  47. this.minor = minor;
  48. }
  49. encode(xdr) {
  50. xdr.writeUnsignedHyper(this.major);
  51. xdr.writeUnsignedHyper(this.minor);
  52. }
  53. }
  54. exports.Nfsv4Fsid = Nfsv4Fsid;
  55. class Nfsv4Stateid {
  56. static decode(xdr) {
  57. const seqid = xdr.readUnsignedInt();
  58. const other = xdr.readOpaque(12);
  59. return new Nfsv4Stateid(seqid, other);
  60. }
  61. constructor(seqid, other) {
  62. this.seqid = seqid;
  63. this.other = other;
  64. }
  65. encode(xdr) {
  66. xdr.writeUnsignedInt(this.seqid);
  67. xdr.writeOpaque(this.other);
  68. }
  69. }
  70. exports.Nfsv4Stateid = Nfsv4Stateid;
  71. class Nfsv4ChangeInfo {
  72. constructor(atomic, before, after) {
  73. this.atomic = atomic;
  74. this.before = before;
  75. this.after = after;
  76. }
  77. encode(xdr) {
  78. xdr.writeBoolean(this.atomic);
  79. xdr.writeUnsignedHyper(this.before);
  80. xdr.writeUnsignedHyper(this.after);
  81. }
  82. }
  83. exports.Nfsv4ChangeInfo = Nfsv4ChangeInfo;
  84. class Nfsv4SetTime {
  85. constructor(how, time) {
  86. this.how = how;
  87. this.time = time;
  88. }
  89. encode(xdr) {
  90. xdr.writeUnsignedInt(this.how);
  91. if (this.time) {
  92. this.time.encode(xdr);
  93. }
  94. }
  95. }
  96. exports.Nfsv4SetTime = Nfsv4SetTime;
  97. class Nfsv4Bitmap {
  98. constructor(mask) {
  99. this.mask = mask;
  100. }
  101. encode(xdr) {
  102. const mask = this.mask;
  103. const length = mask.length;
  104. xdr.writeUnsignedInt(length);
  105. for (let i = 0; i < length; i++)
  106. xdr.writeUnsignedInt(mask[i]);
  107. }
  108. }
  109. exports.Nfsv4Bitmap = Nfsv4Bitmap;
  110. class Nfsv4Fattr {
  111. constructor(attrmask, attrVals) {
  112. this.attrmask = attrmask;
  113. this.attrVals = attrVals;
  114. }
  115. encode(xdr) {
  116. this.attrmask.encode(xdr);
  117. xdr.writeVarlenOpaque(this.attrVals);
  118. }
  119. }
  120. exports.Nfsv4Fattr = Nfsv4Fattr;
  121. class Nfsv4ClientAddr {
  122. constructor(rNetid, rAddr) {
  123. this.rNetid = rNetid;
  124. this.rAddr = rAddr;
  125. }
  126. encode(xdr) {
  127. xdr.writeStr(this.rNetid);
  128. xdr.writeStr(this.rAddr);
  129. }
  130. }
  131. exports.Nfsv4ClientAddr = Nfsv4ClientAddr;
  132. class Nfsv4CbClient {
  133. constructor(cbProgram, cbLocation) {
  134. this.cbProgram = cbProgram;
  135. this.cbLocation = cbLocation;
  136. }
  137. encode(xdr) {
  138. xdr.writeUnsignedInt(this.cbProgram);
  139. this.cbLocation.encode(xdr);
  140. }
  141. }
  142. exports.Nfsv4CbClient = Nfsv4CbClient;
  143. class Nfsv4ClientId {
  144. constructor(verifier, id) {
  145. this.verifier = verifier;
  146. this.id = id;
  147. }
  148. encode(xdr) {
  149. this.verifier.encode(xdr);
  150. xdr.writeVarlenOpaque(this.id);
  151. }
  152. }
  153. exports.Nfsv4ClientId = Nfsv4ClientId;
  154. class Nfsv4OpenOwner {
  155. constructor(clientid, owner) {
  156. this.clientid = clientid;
  157. this.owner = owner;
  158. }
  159. encode(xdr) {
  160. xdr.writeUnsignedHyper(this.clientid);
  161. xdr.writeVarlenOpaque(this.owner);
  162. }
  163. }
  164. exports.Nfsv4OpenOwner = Nfsv4OpenOwner;
  165. class Nfsv4LockOwner {
  166. constructor(clientid, owner) {
  167. this.clientid = clientid;
  168. this.owner = owner;
  169. }
  170. encode(xdr) {
  171. xdr.writeUnsignedHyper(this.clientid);
  172. xdr.writeVarlenOpaque(this.owner);
  173. }
  174. }
  175. exports.Nfsv4LockOwner = Nfsv4LockOwner;
  176. class Nfsv4OpenToLockOwner {
  177. constructor(openSeqid, openStateid, lockSeqid, lockOwner) {
  178. this.openSeqid = openSeqid;
  179. this.openStateid = openStateid;
  180. this.lockSeqid = lockSeqid;
  181. this.lockOwner = lockOwner;
  182. }
  183. encode(xdr) {
  184. xdr.writeUnsignedInt(this.openSeqid);
  185. this.openStateid.encode(xdr);
  186. xdr.writeUnsignedInt(this.lockSeqid);
  187. this.lockOwner.encode(xdr);
  188. }
  189. }
  190. exports.Nfsv4OpenToLockOwner = Nfsv4OpenToLockOwner;
  191. class Nfsv4FsLocation {
  192. constructor(server, rootpath) {
  193. this.server = server;
  194. this.rootpath = rootpath;
  195. }
  196. encode(xdr) {
  197. const { server, rootpath } = this;
  198. const serverLen = server.length;
  199. xdr.writeUnsignedInt(serverLen);
  200. for (let i = 0; i < serverLen; i++)
  201. xdr.writeStr(server[i]);
  202. const rootpathLen = rootpath.length;
  203. xdr.writeUnsignedInt(rootpathLen);
  204. for (let i = 0; i < rootpathLen; i++)
  205. xdr.writeStr(rootpath[i]);
  206. }
  207. }
  208. exports.Nfsv4FsLocation = Nfsv4FsLocation;
  209. class Nfsv4FsLocations {
  210. constructor(fsRoot, locations) {
  211. this.fsRoot = fsRoot;
  212. this.locations = locations;
  213. }
  214. encode(xdr) {
  215. xdr.writeUnsignedInt(this.fsRoot.length);
  216. const { fsRoot, locations } = this;
  217. const fsRootLen = fsRoot.length;
  218. for (let i = 0; i < fsRootLen; i++)
  219. xdr.writeStr(fsRoot[i]);
  220. const locationsLen = locations.length;
  221. xdr.writeUnsignedInt(locationsLen);
  222. for (let i = 0; i < locationsLen; i++)
  223. locations[i].encode(xdr);
  224. }
  225. }
  226. exports.Nfsv4FsLocations = Nfsv4FsLocations;
  227. class Nfsv4Ace {
  228. constructor(type, flag, accessMask, who) {
  229. this.type = type;
  230. this.flag = flag;
  231. this.accessMask = accessMask;
  232. this.who = who;
  233. }
  234. encode(xdr) {
  235. xdr.writeUnsignedInt(this.type);
  236. xdr.writeUnsignedInt(this.flag);
  237. xdr.writeUnsignedInt(this.accessMask);
  238. xdr.writeStr(this.who);
  239. }
  240. }
  241. exports.Nfsv4Ace = Nfsv4Ace;
  242. class Nfsv4Acl {
  243. constructor(aces) {
  244. this.aces = aces;
  245. }
  246. encode(xdr) {
  247. const aces = this.aces;
  248. const length = aces.length;
  249. xdr.writeUnsignedInt(length);
  250. for (let i = 0; i < length; i++)
  251. aces[i].encode(xdr);
  252. }
  253. }
  254. exports.Nfsv4Acl = Nfsv4Acl;
  255. class Nfsv4SecInfo {
  256. constructor(flavor, flavorInfo) {
  257. this.flavor = flavor;
  258. this.flavorInfo = flavorInfo;
  259. }
  260. encode(xdr) {
  261. xdr.writeUnsignedInt(this.flavor);
  262. const flavorInfo = this.flavorInfo;
  263. if (flavorInfo)
  264. xdr.writeVarlenOpaque(flavorInfo);
  265. }
  266. }
  267. exports.Nfsv4SecInfo = Nfsv4SecInfo;
  268. class Nfsv4CreateAttrs {
  269. constructor(createattrs) {
  270. this.createattrs = createattrs;
  271. }
  272. encode(xdr) {
  273. this.createattrs.encode(xdr);
  274. }
  275. }
  276. exports.Nfsv4CreateAttrs = Nfsv4CreateAttrs;
  277. class Nfsv4CreateVerf {
  278. constructor(createverf) {
  279. this.createverf = createverf;
  280. }
  281. encode(xdr) {
  282. this.createverf.encode(xdr);
  283. }
  284. }
  285. exports.Nfsv4CreateVerf = Nfsv4CreateVerf;
  286. class Nfsv4CreateHow {
  287. constructor(mode, how) {
  288. this.mode = mode;
  289. this.how = how;
  290. }
  291. encode(xdr) {
  292. xdr.writeUnsignedInt(this.mode);
  293. this.how?.encode(xdr);
  294. }
  295. }
  296. exports.Nfsv4CreateHow = Nfsv4CreateHow;
  297. class Nfsv4OpenHow {
  298. constructor(opentype, how) {
  299. this.opentype = opentype;
  300. this.how = how;
  301. }
  302. encode(xdr) {
  303. xdr.writeUnsignedInt(this.opentype);
  304. this.how?.encode(xdr);
  305. }
  306. }
  307. exports.Nfsv4OpenHow = Nfsv4OpenHow;
  308. class Nfsv4OpenClaimNull {
  309. constructor(file) {
  310. this.file = file;
  311. }
  312. encode(xdr) {
  313. xdr.writeStr(this.file);
  314. }
  315. }
  316. exports.Nfsv4OpenClaimNull = Nfsv4OpenClaimNull;
  317. class Nfsv4OpenClaimPrevious {
  318. constructor(delegateType) {
  319. this.delegateType = delegateType;
  320. }
  321. encode(xdr) {
  322. xdr.writeUnsignedInt(this.delegateType);
  323. }
  324. }
  325. exports.Nfsv4OpenClaimPrevious = Nfsv4OpenClaimPrevious;
  326. class Nfsv4OpenClaimDelegateCur {
  327. constructor(delegateStateid, file) {
  328. this.delegateStateid = delegateStateid;
  329. this.file = file;
  330. }
  331. encode(xdr) {
  332. this.delegateStateid.encode(xdr);
  333. xdr.writeStr(this.file);
  334. }
  335. }
  336. exports.Nfsv4OpenClaimDelegateCur = Nfsv4OpenClaimDelegateCur;
  337. class Nfsv4OpenClaimDelegatePrev {
  338. constructor(file) {
  339. this.file = file;
  340. }
  341. encode(xdr) {
  342. xdr.writeStr(this.file);
  343. }
  344. }
  345. exports.Nfsv4OpenClaimDelegatePrev = Nfsv4OpenClaimDelegatePrev;
  346. class Nfsv4OpenClaim {
  347. constructor(claimType, claim) {
  348. this.claimType = claimType;
  349. this.claim = claim;
  350. }
  351. encode(xdr) {
  352. xdr.writeUnsignedInt(this.claimType);
  353. this.claim.encode(xdr);
  354. }
  355. }
  356. exports.Nfsv4OpenClaim = Nfsv4OpenClaim;
  357. class Nfsv4OpenReadDelegation {
  358. constructor(stateid, recall, permissions) {
  359. this.stateid = stateid;
  360. this.recall = recall;
  361. this.permissions = permissions;
  362. }
  363. encode(xdr) {
  364. this.stateid.encode(xdr);
  365. xdr.writeBoolean(this.recall);
  366. const permissions = this.permissions;
  367. const length = permissions.length;
  368. xdr.writeUnsignedInt(length);
  369. for (let i = 0; i < length; i++)
  370. permissions[i].encode(xdr);
  371. }
  372. }
  373. exports.Nfsv4OpenReadDelegation = Nfsv4OpenReadDelegation;
  374. class Nfsv4OpenWriteDelegation {
  375. constructor(stateid, recall, spaceLimit, permissions) {
  376. this.stateid = stateid;
  377. this.recall = recall;
  378. this.spaceLimit = spaceLimit;
  379. this.permissions = permissions;
  380. }
  381. encode(xdr) {
  382. this.stateid.encode(xdr);
  383. xdr.writeBoolean(this.recall);
  384. xdr.writeUnsignedHyper(this.spaceLimit);
  385. const permissions = this.permissions;
  386. const length = permissions.length;
  387. xdr.writeUnsignedInt(length);
  388. for (let i = 0; i < length; i++)
  389. permissions[i].encode(xdr);
  390. }
  391. }
  392. exports.Nfsv4OpenWriteDelegation = Nfsv4OpenWriteDelegation;
  393. class Nfsv4OpenDelegation {
  394. constructor(delegationType, delegation) {
  395. this.delegationType = delegationType;
  396. this.delegation = delegation;
  397. }
  398. encode(xdr) {
  399. xdr.writeUnsignedInt(this.delegationType);
  400. this.delegation?.encode(xdr);
  401. }
  402. }
  403. exports.Nfsv4OpenDelegation = Nfsv4OpenDelegation;
  404. class Nfsv4Entry {
  405. constructor(cookie, name, attrs, nextEntry) {
  406. this.cookie = cookie;
  407. this.name = name;
  408. this.attrs = attrs;
  409. this.nextEntry = nextEntry;
  410. }
  411. encode(xdr) {
  412. xdr.writeUnsignedHyper(this.cookie);
  413. xdr.writeStr(this.name);
  414. this.attrs.encode(xdr);
  415. }
  416. }
  417. exports.Nfsv4Entry = Nfsv4Entry;
  418. class Nfsv4LockNewOwner {
  419. constructor(openToLockOwner) {
  420. this.openToLockOwner = openToLockOwner;
  421. }
  422. encode(xdr) {
  423. this.openToLockOwner.encode(xdr);
  424. }
  425. }
  426. exports.Nfsv4LockNewOwner = Nfsv4LockNewOwner;
  427. class Nfsv4LockExistingOwner {
  428. constructor(lockStateid, lockSeqid) {
  429. this.lockStateid = lockStateid;
  430. this.lockSeqid = lockSeqid;
  431. }
  432. encode(xdr) {
  433. this.lockStateid.encode(xdr);
  434. xdr.writeUnsignedInt(this.lockSeqid);
  435. }
  436. }
  437. exports.Nfsv4LockExistingOwner = Nfsv4LockExistingOwner;
  438. class Nfsv4LockOwnerInfo {
  439. constructor(newLockOwner, owner) {
  440. this.newLockOwner = newLockOwner;
  441. this.owner = owner;
  442. }
  443. encode(xdr) {
  444. xdr.writeBoolean(this.newLockOwner);
  445. this.owner.encode(xdr);
  446. }
  447. }
  448. exports.Nfsv4LockOwnerInfo = Nfsv4LockOwnerInfo;
  449. class Nfsv4CreateTypeLink {
  450. constructor(linkdata) {
  451. this.linkdata = linkdata;
  452. }
  453. encode(xdr) {
  454. xdr.writeStr(this.linkdata);
  455. }
  456. }
  457. exports.Nfsv4CreateTypeLink = Nfsv4CreateTypeLink;
  458. class Nfsv4CreateTypeDevice {
  459. constructor(devdata) {
  460. this.devdata = devdata;
  461. }
  462. encode(xdr) {
  463. this.devdata.encode(xdr);
  464. }
  465. }
  466. exports.Nfsv4CreateTypeDevice = Nfsv4CreateTypeDevice;
  467. class Nfsv4CreateTypeVoid {
  468. encode(xdr) { }
  469. }
  470. exports.Nfsv4CreateTypeVoid = Nfsv4CreateTypeVoid;
  471. class Nfsv4CreateType {
  472. constructor(type, objtype) {
  473. this.type = type;
  474. this.objtype = objtype;
  475. }
  476. encode(xdr) {
  477. xdr.writeUnsignedInt(this.type);
  478. this.objtype.encode(xdr);
  479. }
  480. }
  481. exports.Nfsv4CreateType = Nfsv4CreateType;
  482. class Nfsv4RpcSecGssInfo {
  483. constructor(oid, qop, service) {
  484. this.oid = oid;
  485. this.qop = qop;
  486. this.service = service;
  487. }
  488. encode(xdr) {
  489. xdr.writeVarlenOpaque(this.oid);
  490. xdr.writeUnsignedInt(this.qop);
  491. xdr.writeUnsignedInt(this.service);
  492. }
  493. }
  494. exports.Nfsv4RpcSecGssInfo = Nfsv4RpcSecGssInfo;
  495. class Nfsv4SecInfoFlavor {
  496. constructor(flavor, flavorInfo) {
  497. this.flavor = flavor;
  498. this.flavorInfo = flavorInfo;
  499. }
  500. encode(xdr) {
  501. xdr.writeUnsignedInt(this.flavor);
  502. this.flavorInfo?.encode(xdr);
  503. }
  504. }
  505. exports.Nfsv4SecInfoFlavor = Nfsv4SecInfoFlavor;
  506. //# sourceMappingURL=structs.js.map