1
0

patch-nfs_prot_h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. --- dsniff-2.4.orig/nfs_prot.h 1970-01-01 00:00:00.000000000 +0100
  2. +++ dsniff-2.4/nfs_prot.h 2009-12-11 12:53:10.000000000 +0100
  3. @@ -0,0 +1,528 @@
  4. +/*
  5. + * Please do not edit this file.
  6. + * It was generated using rpcgen.
  7. + */
  8. +
  9. +#ifndef _NFS_PROT_H_RPCGEN
  10. +#define _NFS_PROT_H_RPCGEN
  11. +
  12. +#include <rpc/rpc.h>
  13. +
  14. +
  15. +#ifdef __cplusplus
  16. +extern "C" {
  17. +#endif
  18. +
  19. +#include "config.h"
  20. +#define NFS_PORT 2049
  21. +#define NFS_MAXDATA 8192
  22. +#define NFS_MAXPATHLEN 1024
  23. +#define NFS_MAXNAMLEN 255
  24. +#define NFS_FHSIZE 32
  25. +#define NFS_COOKIESIZE 4
  26. +#define NFS_FIFO_DEV -1
  27. +#define NFSMODE_FMT 0170000
  28. +#define NFSMODE_DIR 0040000
  29. +#define NFSMODE_CHR 0020000
  30. +#define NFSMODE_BLK 0060000
  31. +#define NFSMODE_REG 0100000
  32. +#define NFSMODE_LNK 0120000
  33. +#define NFSMODE_SOCK 0140000
  34. +#define NFSMODE_FIFO 0010000
  35. +
  36. +enum nfsstat {
  37. + NFS_OK = 0,
  38. + NFSERR_PERM = 1,
  39. + NFSERR_NOENT = 2,
  40. + NFSERR_IO = 5,
  41. + NFSERR_NXIO = 6,
  42. + NFSERR_ACCES = 13,
  43. + NFSERR_EXIST = 17,
  44. + NFSERR_XDEV = 18,
  45. + NFSERR_NODEV = 19,
  46. + NFSERR_NOTDIR = 20,
  47. + NFSERR_ISDIR = 21,
  48. + NFSERR_INVAL = 22,
  49. + NFSERR_FBIG = 27,
  50. + NFSERR_NOSPC = 28,
  51. + NFSERR_ROFS = 30,
  52. + NFSERR_OPNOTSUPP = 45,
  53. + NFSERR_NAMETOOLONG = 63,
  54. + NFSERR_NOTEMPTY = 66,
  55. + NFSERR_DQUOT = 69,
  56. + NFSERR_STALE = 70,
  57. + NFSERR_REMOTE = 71,
  58. + NFSERR_WFLUSH = 72,
  59. +};
  60. +typedef enum nfsstat nfsstat;
  61. +
  62. +enum ftype {
  63. + NFNON = 0,
  64. + NFREG = 1,
  65. + NFDIR = 2,
  66. + NFBLK = 3,
  67. + NFCHR = 4,
  68. + NFLNK = 5,
  69. + NFSOCK = 6,
  70. + NFBAD = 7,
  71. + NFFIFO = 8,
  72. +};
  73. +typedef enum ftype ftype;
  74. +
  75. +struct nfs_fh {
  76. + char data[NFS_FHSIZE];
  77. +};
  78. +typedef struct nfs_fh nfs_fh;
  79. +
  80. +struct nfstime {
  81. + u_int seconds;
  82. + u_int useconds;
  83. +};
  84. +typedef struct nfstime nfstime;
  85. +
  86. +struct fattr {
  87. + ftype type;
  88. + u_int mode;
  89. + u_int nlink;
  90. + u_int uid;
  91. + u_int gid;
  92. + u_int size;
  93. + u_int blocksize;
  94. + u_int rdev;
  95. + u_int blocks;
  96. + u_int fsid;
  97. + u_int fileid;
  98. + nfstime atime;
  99. + nfstime mtime;
  100. + nfstime ctime;
  101. +};
  102. +typedef struct fattr fattr;
  103. +
  104. +typedef char *filename;
  105. +
  106. +typedef char *nfspath;
  107. +
  108. +struct diropargs {
  109. + nfs_fh dir;
  110. + filename name;
  111. +};
  112. +typedef struct diropargs diropargs;
  113. +
  114. +struct diropokres {
  115. + nfs_fh file;
  116. + fattr attributes;
  117. +};
  118. +typedef struct diropokres diropokres;
  119. +
  120. +struct diropres {
  121. + nfsstat status;
  122. + union {
  123. + diropokres diropres;
  124. + } diropres_u;
  125. +};
  126. +typedef struct diropres diropres;
  127. +
  128. +struct readargs {
  129. + nfs_fh file;
  130. + u_int offset;
  131. + u_int count;
  132. + u_int totalcount;
  133. +};
  134. +typedef struct readargs readargs;
  135. +
  136. +struct readokres {
  137. + fattr attributes;
  138. + struct {
  139. + u_int data_len;
  140. + char *data_val;
  141. + } data;
  142. +};
  143. +typedef struct readokres readokres;
  144. +
  145. +struct readres {
  146. + nfsstat status;
  147. + union {
  148. + readokres reply;
  149. + } readres_u;
  150. +};
  151. +typedef struct readres readres;
  152. +#define NFS3_FHSIZE 64
  153. +#define NFS3_COOKIEVERFSIZE 8
  154. +#define NFS3_CREATEVERFSIZE 8
  155. +#define NFS3_WRITEVERFSIZE 8
  156. +
  157. +typedef u_int64_t uint64;
  158. +
  159. +typedef int64_t int64;
  160. +
  161. +typedef u_int uint32;
  162. +
  163. +typedef int int32;
  164. +
  165. +typedef char *filename3;
  166. +
  167. +typedef char *nfspath3;
  168. +
  169. +typedef uint64 fileid3;
  170. +
  171. +typedef uint64 cookie3;
  172. +
  173. +typedef char cookieverf3[NFS3_COOKIEVERFSIZE];
  174. +
  175. +typedef char createverf3[NFS3_CREATEVERFSIZE];
  176. +
  177. +typedef char writeverf3[NFS3_WRITEVERFSIZE];
  178. +
  179. +typedef uint32 uid3;
  180. +
  181. +typedef uint32 gid3;
  182. +
  183. +typedef uint64 size3;
  184. +
  185. +typedef uint64 offset3;
  186. +
  187. +typedef uint32 mode3;
  188. +
  189. +typedef uint32 count3;
  190. +
  191. +enum nfsstat3 {
  192. + NFS3_OK = 0,
  193. + NFS3ERR_PERM = 1,
  194. + NFS3ERR_NOENT = 2,
  195. + NFS3ERR_IO = 5,
  196. + NFS3ERR_NXIO = 6,
  197. + NFS3ERR_ACCES = 13,
  198. + NFS3ERR_EXIST = 17,
  199. + NFS3ERR_XDEV = 18,
  200. + NFS3ERR_NODEV = 19,
  201. + NFS3ERR_NOTDIR = 20,
  202. + NFS3ERR_ISDIR = 21,
  203. + NFS3ERR_INVAL = 22,
  204. + NFS3ERR_FBIG = 27,
  205. + NFS3ERR_NOSPC = 28,
  206. + NFS3ERR_ROFS = 30,
  207. + NFS3ERR_MLINK = 31,
  208. + NFS3ERR_NAMETOOLONG = 63,
  209. + NFS3ERR_NOTEMPTY = 66,
  210. + NFS3ERR_DQUOT = 69,
  211. + NFS3ERR_STALE = 70,
  212. + NFS3ERR_REMOTE = 71,
  213. + NFS3ERR_BADHANDLE = 10001,
  214. + NFS3ERR_NOT_SYNC = 10002,
  215. + NFS3ERR_BAD_COOKIE = 10003,
  216. + NFS3ERR_NOTSUPP = 10004,
  217. + NFS3ERR_TOOSMALL = 10005,
  218. + NFS3ERR_SERVERFAULT = 10006,
  219. + NFS3ERR_BADTYPE = 10007,
  220. + NFS3ERR_JUKEBOX = 10008,
  221. +};
  222. +typedef enum nfsstat3 nfsstat3;
  223. +
  224. +enum ftype3 {
  225. + NF3REG = 1,
  226. + NF3DIR = 2,
  227. + NF3BLK = 3,
  228. + NF3CHR = 4,
  229. + NF3LNK = 5,
  230. + NF3SOCK = 6,
  231. + NF3FIFO = 7,
  232. +};
  233. +typedef enum ftype3 ftype3;
  234. +
  235. +struct specdata3 {
  236. + uint32 specdata1;
  237. + uint32 specdata2;
  238. +};
  239. +typedef struct specdata3 specdata3;
  240. +
  241. +struct nfs_fh3 {
  242. + struct {
  243. + u_int data_len;
  244. + char *data_val;
  245. + } data;
  246. +};
  247. +typedef struct nfs_fh3 nfs_fh3;
  248. +
  249. +struct nfstime3 {
  250. + uint32 seconds;
  251. + uint32 nseconds;
  252. +};
  253. +typedef struct nfstime3 nfstime3;
  254. +
  255. +struct fattr3 {
  256. + ftype3 type;
  257. + mode3 mode;
  258. + uint32 nlink;
  259. + uid3 uid;
  260. + gid3 gid;
  261. + size3 size;
  262. + size3 used;
  263. + specdata3 rdev;
  264. + uint64 fsid;
  265. + fileid3 fileid;
  266. + nfstime3 atime;
  267. + nfstime3 mtime;
  268. + nfstime3 ctime;
  269. +};
  270. +typedef struct fattr3 fattr3;
  271. +
  272. +struct post_op_attr {
  273. + bool_t attributes_follow;
  274. + union {
  275. + fattr3 attributes;
  276. + } post_op_attr_u;
  277. +};
  278. +typedef struct post_op_attr post_op_attr;
  279. +
  280. +struct wcc_attr {
  281. + size3 size;
  282. + nfstime3 mtime;
  283. + nfstime3 ctime;
  284. +};
  285. +typedef struct wcc_attr wcc_attr;
  286. +
  287. +struct pre_op_attr {
  288. + bool_t attributes_follow;
  289. + union {
  290. + wcc_attr attributes;
  291. + } pre_op_attr_u;
  292. +};
  293. +typedef struct pre_op_attr pre_op_attr;
  294. +
  295. +struct wcc_data {
  296. + pre_op_attr before;
  297. + post_op_attr after;
  298. +};
  299. +typedef struct wcc_data wcc_data;
  300. +
  301. +struct diropargs3 {
  302. + nfs_fh3 dir;
  303. + filename3 name;
  304. +};
  305. +typedef struct diropargs3 diropargs3;
  306. +
  307. +struct LOOKUP3args {
  308. + diropargs3 what;
  309. +};
  310. +typedef struct LOOKUP3args LOOKUP3args;
  311. +
  312. +struct LOOKUP3resok {
  313. + nfs_fh3 object;
  314. + post_op_attr obj_attributes;
  315. + post_op_attr dir_attributes;
  316. +};
  317. +typedef struct LOOKUP3resok LOOKUP3resok;
  318. +
  319. +struct LOOKUP3resfail {
  320. + post_op_attr dir_attributes;
  321. +};
  322. +typedef struct LOOKUP3resfail LOOKUP3resfail;
  323. +
  324. +struct LOOKUP3res {
  325. + nfsstat3 status;
  326. + union {
  327. + LOOKUP3resok resok;
  328. + LOOKUP3resfail resfail;
  329. + } LOOKUP3res_u;
  330. +};
  331. +typedef struct LOOKUP3res LOOKUP3res;
  332. +
  333. +struct READ3args {
  334. + nfs_fh3 file;
  335. + offset3 offset;
  336. + count3 count;
  337. +};
  338. +typedef struct READ3args READ3args;
  339. +
  340. +struct READ3resok {
  341. + post_op_attr file_attributes;
  342. + count3 count;
  343. + bool_t eof;
  344. + struct {
  345. + u_int data_len;
  346. + char *data_val;
  347. + } data;
  348. +};
  349. +typedef struct READ3resok READ3resok;
  350. +
  351. +struct READ3resfail {
  352. + post_op_attr file_attributes;
  353. +};
  354. +typedef struct READ3resfail READ3resfail;
  355. +
  356. +struct READ3res {
  357. + nfsstat status;
  358. + union {
  359. + READ3resok resok;
  360. + READ3resfail resfail;
  361. + } READ3res_u;
  362. +};
  363. +typedef struct READ3res READ3res;
  364. +
  365. +#define NFS_PROGRAM 100003
  366. +#define NFS_VERSION 2
  367. +
  368. +#if defined(__STDC__) || defined(__cplusplus)
  369. +#define NFSPROC_NULL 0
  370. +extern void * nfsproc_null_2(void *, CLIENT *);
  371. +extern void * nfsproc_null_2_svc(void *, struct svc_req *);
  372. +#define NFSPROC_LOOKUP 4
  373. +extern diropres * nfsproc_lookup_2(diropargs *, CLIENT *);
  374. +extern diropres * nfsproc_lookup_2_svc(diropargs *, struct svc_req *);
  375. +#define NFSPROC_READ 6
  376. +extern readres * nfsproc_read_2(readargs *, CLIENT *);
  377. +extern readres * nfsproc_read_2_svc(readargs *, struct svc_req *);
  378. +extern int nfs_program_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
  379. +
  380. +#else /* K&R C */
  381. +#define NFSPROC_NULL 0
  382. +extern void * nfsproc_null_2();
  383. +extern void * nfsproc_null_2_svc();
  384. +#define NFSPROC_LOOKUP 4
  385. +extern diropres * nfsproc_lookup_2();
  386. +extern diropres * nfsproc_lookup_2_svc();
  387. +#define NFSPROC_READ 6
  388. +extern readres * nfsproc_read_2();
  389. +extern readres * nfsproc_read_2_svc();
  390. +extern int nfs_program_2_freeresult ();
  391. +#endif /* K&R C */
  392. +
  393. +#define NFS3_PROGRAM 100003
  394. +#define NFS_V3 3
  395. +
  396. +#if defined(__STDC__) || defined(__cplusplus)
  397. +#define NFSPROC3_NULL 0
  398. +extern void * nfsproc3_null_3(void *, CLIENT *);
  399. +extern void * nfsproc3_null_3_svc(void *, struct svc_req *);
  400. +#define NFSPROC3_LOOKUP 3
  401. +extern LOOKUP3res * nfsproc3_lookup_3(LOOKUP3args *, CLIENT *);
  402. +extern LOOKUP3res * nfsproc3_lookup_3_svc(LOOKUP3args *, struct svc_req *);
  403. +#define NFSPROC3_READ 6
  404. +extern READ3res * nfsproc3_read_3(READ3args *, CLIENT *);
  405. +extern READ3res * nfsproc3_read_3_svc(READ3args *, struct svc_req *);
  406. +extern int nfs3_program_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
  407. +
  408. +#else /* K&R C */
  409. +#define NFSPROC3_NULL 0
  410. +extern void * nfsproc3_null_3();
  411. +extern void * nfsproc3_null_3_svc();
  412. +#define NFSPROC3_LOOKUP 3
  413. +extern LOOKUP3res * nfsproc3_lookup_3();
  414. +extern LOOKUP3res * nfsproc3_lookup_3_svc();
  415. +#define NFSPROC3_READ 6
  416. +extern READ3res * nfsproc3_read_3();
  417. +extern READ3res * nfsproc3_read_3_svc();
  418. +extern int nfs3_program_3_freeresult ();
  419. +#endif /* K&R C */
  420. +
  421. +/* the xdr functions */
  422. +
  423. +#if defined(__STDC__) || defined(__cplusplus)
  424. +extern bool_t xdr_nfsstat (XDR *, nfsstat*);
  425. +extern bool_t xdr_ftype (XDR *, ftype*);
  426. +extern bool_t xdr_nfs_fh (XDR *, nfs_fh*);
  427. +extern bool_t xdr_nfstime (XDR *, nfstime*);
  428. +extern bool_t xdr_fattr (XDR *, fattr*);
  429. +extern bool_t xdr_filename (XDR *, filename*);
  430. +extern bool_t xdr_nfspath (XDR *, nfspath*);
  431. +extern bool_t xdr_diropargs (XDR *, diropargs*);
  432. +extern bool_t xdr_diropokres (XDR *, diropokres*);
  433. +extern bool_t xdr_diropres (XDR *, diropres*);
  434. +extern bool_t xdr_readargs (XDR *, readargs*);
  435. +extern bool_t xdr_readokres (XDR *, readokres*);
  436. +extern bool_t xdr_readres (XDR *, readres*);
  437. +extern bool_t xdr_uint64 (XDR *, uint64*);
  438. +extern bool_t xdr_int64 (XDR *, int64*);
  439. +extern bool_t xdr_uint32 (XDR *, uint32*);
  440. +extern bool_t xdr_int32 (XDR *, int32*);
  441. +extern bool_t xdr_filename3 (XDR *, filename3*);
  442. +extern bool_t xdr_nfspath3 (XDR *, nfspath3*);
  443. +extern bool_t xdr_fileid3 (XDR *, fileid3*);
  444. +extern bool_t xdr_cookie3 (XDR *, cookie3*);
  445. +extern bool_t xdr_cookieverf3 (XDR *, cookieverf3);
  446. +extern bool_t xdr_createverf3 (XDR *, createverf3);
  447. +extern bool_t xdr_writeverf3 (XDR *, writeverf3);
  448. +extern bool_t xdr_uid3 (XDR *, uid3*);
  449. +extern bool_t xdr_gid3 (XDR *, gid3*);
  450. +extern bool_t xdr_size3 (XDR *, size3*);
  451. +extern bool_t xdr_offset3 (XDR *, offset3*);
  452. +extern bool_t xdr_mode3 (XDR *, mode3*);
  453. +extern bool_t xdr_count3 (XDR *, count3*);
  454. +extern bool_t xdr_nfsstat3 (XDR *, nfsstat3*);
  455. +extern bool_t xdr_ftype3 (XDR *, ftype3*);
  456. +extern bool_t xdr_specdata3 (XDR *, specdata3*);
  457. +extern bool_t xdr_nfs_fh3 (XDR *, nfs_fh3*);
  458. +extern bool_t xdr_nfstime3 (XDR *, nfstime3*);
  459. +extern bool_t xdr_fattr3 (XDR *, fattr3*);
  460. +extern bool_t xdr_post_op_attr (XDR *, post_op_attr*);
  461. +extern bool_t xdr_wcc_attr (XDR *, wcc_attr*);
  462. +extern bool_t xdr_pre_op_attr (XDR *, pre_op_attr*);
  463. +extern bool_t xdr_wcc_data (XDR *, wcc_data*);
  464. +extern bool_t xdr_diropargs3 (XDR *, diropargs3*);
  465. +extern bool_t xdr_LOOKUP3args (XDR *, LOOKUP3args*);
  466. +extern bool_t xdr_LOOKUP3resok (XDR *, LOOKUP3resok*);
  467. +extern bool_t xdr_LOOKUP3resfail (XDR *, LOOKUP3resfail*);
  468. +extern bool_t xdr_LOOKUP3res (XDR *, LOOKUP3res*);
  469. +extern bool_t xdr_READ3args (XDR *, READ3args*);
  470. +extern bool_t xdr_READ3resok (XDR *, READ3resok*);
  471. +extern bool_t xdr_READ3resfail (XDR *, READ3resfail*);
  472. +extern bool_t xdr_READ3res (XDR *, READ3res*);
  473. +
  474. +#else /* K&R C */
  475. +extern bool_t xdr_nfsstat ();
  476. +extern bool_t xdr_ftype ();
  477. +extern bool_t xdr_nfs_fh ();
  478. +extern bool_t xdr_nfstime ();
  479. +extern bool_t xdr_fattr ();
  480. +extern bool_t xdr_filename ();
  481. +extern bool_t xdr_nfspath ();
  482. +extern bool_t xdr_diropargs ();
  483. +extern bool_t xdr_diropokres ();
  484. +extern bool_t xdr_diropres ();
  485. +extern bool_t xdr_readargs ();
  486. +extern bool_t xdr_readokres ();
  487. +extern bool_t xdr_readres ();
  488. +extern bool_t xdr_uint64 ();
  489. +extern bool_t xdr_int64 ();
  490. +extern bool_t xdr_uint32 ();
  491. +extern bool_t xdr_int32 ();
  492. +extern bool_t xdr_filename3 ();
  493. +extern bool_t xdr_nfspath3 ();
  494. +extern bool_t xdr_fileid3 ();
  495. +extern bool_t xdr_cookie3 ();
  496. +extern bool_t xdr_cookieverf3 ();
  497. +extern bool_t xdr_createverf3 ();
  498. +extern bool_t xdr_writeverf3 ();
  499. +extern bool_t xdr_uid3 ();
  500. +extern bool_t xdr_gid3 ();
  501. +extern bool_t xdr_size3 ();
  502. +extern bool_t xdr_offset3 ();
  503. +extern bool_t xdr_mode3 ();
  504. +extern bool_t xdr_count3 ();
  505. +extern bool_t xdr_nfsstat3 ();
  506. +extern bool_t xdr_ftype3 ();
  507. +extern bool_t xdr_specdata3 ();
  508. +extern bool_t xdr_nfs_fh3 ();
  509. +extern bool_t xdr_nfstime3 ();
  510. +extern bool_t xdr_fattr3 ();
  511. +extern bool_t xdr_post_op_attr ();
  512. +extern bool_t xdr_wcc_attr ();
  513. +extern bool_t xdr_pre_op_attr ();
  514. +extern bool_t xdr_wcc_data ();
  515. +extern bool_t xdr_diropargs3 ();
  516. +extern bool_t xdr_LOOKUP3args ();
  517. +extern bool_t xdr_LOOKUP3resok ();
  518. +extern bool_t xdr_LOOKUP3resfail ();
  519. +extern bool_t xdr_LOOKUP3res ();
  520. +extern bool_t xdr_READ3args ();
  521. +extern bool_t xdr_READ3resok ();
  522. +extern bool_t xdr_READ3resfail ();
  523. +extern bool_t xdr_READ3res ();
  524. +
  525. +#endif /* K&R C */
  526. +
  527. +#ifdef __cplusplus
  528. +}
  529. +#endif
  530. +
  531. +#endif /* !_NFS_PROT_H_RPCGEN */