1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _NFS4_KPROT_H
#define _NFS4_KPROT_H
/*
* Kernel specific version.
* NFS Version 4 protocol definitions. From nfs4_prot.x rev 1.119.
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <rpc/rpc.h>
#ifdef _KERNEL
#include <rpc/rpc_rdma.h>
#endif
#include <sys/stream.h>
#define NFS4_FHSIZE 128
#define NFS4_VERIFIER_SIZE 8
#define NFS4_OTHER_SIZE 12
/*
* Reasonable upper bounds to catch badly behaving partners
*/
#define NFS4_OPAQUE_LIMIT 1024
#define NFS4_COMPOUND_LIMIT 2048
#define NFS4_FS_LOCATIONS_LIMIT 65536
#define NFS4_ACL_LIMIT 65536
#define NFS4_SECINFO_LIMIT 65536
#define NFS4_FATTR4_LIMIT 1048576
#define NFS4_DATA_LIMIT 134217728
enum nfs_ftype4 {
NF4REG = 1,
NF4DIR = 2,
NF4BLK = 3,
NF4CHR = 4,
NF4LNK = 5,
NF4SOCK = 6,
NF4FIFO = 7,
NF4ATTRDIR = 8,
NF4NAMEDATTR = 9
};
typedef enum nfs_ftype4 nfs_ftype4;
enum nfsstat4 {
NFS4_OK = 0,
NFS4ERR_PERM = 1,
NFS4ERR_NOENT = 2,
NFS4ERR_IO = 5,
NFS4ERR_NXIO = 6,
NFS4ERR_ACCESS = 13,
NFS4ERR_EXIST = 17,
NFS4ERR_XDEV = 18,
NFS4ERR_NOTDIR = 20,
NFS4ERR_ISDIR = 21,
NFS4ERR_INVAL = 22,
NFS4ERR_FBIG = 27,
NFS4ERR_NOSPC = 28,
NFS4ERR_ROFS = 30,
NFS4ERR_MLINK = 31,
NFS4ERR_NAMETOOLONG = 63,
NFS4ERR_NOTEMPTY = 66,
NFS4ERR_DQUOT = 69,
NFS4ERR_STALE = 70,
NFS4ERR_BADHANDLE = 10001,
NFS4ERR_BAD_COOKIE = 10003,
NFS4ERR_NOTSUPP = 10004,
NFS4ERR_TOOSMALL = 10005,
NFS4ERR_SERVERFAULT = 10006,
NFS4ERR_BADTYPE = 10007,
NFS4ERR_DELAY = 10008,
NFS4ERR_SAME = 10009,
NFS4ERR_DENIED = 10010,
NFS4ERR_EXPIRED = 10011,
NFS4ERR_LOCKED = 10012,
NFS4ERR_GRACE = 10013,
NFS4ERR_FHEXPIRED = 10014,
NFS4ERR_SHARE_DENIED = 10015,
NFS4ERR_WRONGSEC = 10016,
NFS4ERR_CLID_INUSE = 10017,
NFS4ERR_RESOURCE = 10018,
NFS4ERR_MOVED = 10019,
NFS4ERR_NOFILEHANDLE = 10020,
NFS4ERR_MINOR_VERS_MISMATCH = 10021,
NFS4ERR_STALE_CLIENTID = 10022,
NFS4ERR_STALE_STATEID = 10023,
NFS4ERR_OLD_STATEID = 10024,
NFS4ERR_BAD_STATEID = 10025,
NFS4ERR_BAD_SEQID = 10026,
NFS4ERR_NOT_SAME = 10027,
NFS4ERR_LOCK_RANGE = 10028,
NFS4ERR_SYMLINK = 10029,
NFS4ERR_RESTOREFH = 10030,
NFS4ERR_LEASE_MOVED = 10031,
NFS4ERR_ATTRNOTSUPP = 10032,
NFS4ERR_NO_GRACE = 10033,
NFS4ERR_RECLAIM_BAD = 10034,
NFS4ERR_RECLAIM_CONFLICT = 10035,
NFS4ERR_BADXDR = 10036,
NFS4ERR_LOCKS_HELD = 10037,
NFS4ERR_OPENMODE = 10038,
NFS4ERR_BADOWNER = 10039,
NFS4ERR_BADCHAR = 10040,
NFS4ERR_BADNAME = 10041,
NFS4ERR_BAD_RANGE = 10042,
NFS4ERR_LOCK_NOTSUPP = 10043,
NFS4ERR_OP_ILLEGAL = 10044,
NFS4ERR_DEADLOCK = 10045,
NFS4ERR_FILE_OPEN = 10046,
NFS4ERR_ADMIN_REVOKED = 10047,
NFS4ERR_CB_PATH_DOWN = 10048
};
typedef enum nfsstat4 nfsstat4;
/*
* A bitmap can only be 56 bits, treat it as a uint64_t for now
*/
typedef uint64_t bitmap4;
typedef uint64_t offset4;
typedef uint32_t count4;
typedef uint64_t length4;
typedef uint64_t clientid4;
typedef uint32_t nfs_lease4;
typedef uint32_t seqid4;
typedef struct {
uint_t utf8string_len;
char *utf8string_val;
} utf8string;
typedef utf8string component4;
typedef struct {
uint_t pathname4_len;
component4 *pathname4_val;
} pathname4;
typedef uint64_t nfs_lockid4;
typedef uint64_t nfs_cookie4;
typedef struct {
uint_t linktext4_len;
char *linktext4_val;
} linktext4;
typedef utf8string ascii_REQUIRED4;
typedef struct {
uint_t sec_oid4_len;
char *sec_oid4_val;
} sec_oid4;
typedef uint32_t qop4;
typedef uint32_t mode4;
typedef uint64_t changeid4;
typedef uint64_t verifier4;
struct nfstime4 {
int64_t seconds;
uint32_t nseconds;
};
typedef struct nfstime4 nfstime4;
enum time_how4 {
SET_TO_SERVER_TIME4 = 0,
SET_TO_CLIENT_TIME4 = 1
};
typedef enum time_how4 time_how4;
struct settime4 {
time_how4 set_it;
nfstime4 time;
};
typedef struct settime4 settime4;
typedef struct {
uint_t nfs_fh4_len;
char *nfs_fh4_val;
} nfs_fh4;
struct fsid4 {
uint64_t major;
uint64_t minor;
};
typedef struct fsid4 fsid4;
struct fs_location4 {
uint_t server_len;
utf8string *server_val;
pathname4 rootpath;
};
typedef struct fs_location4 fs_location4;
struct fs_locations4 {
pathname4 fs_root;
uint_t locations_len;
fs_location4 *locations_val;
};
typedef struct fs_locations4 fs_locations4;
/*
* This structure is declared in nfs4.h
*/
struct nfs_fsl_info;
/*
* ACL support
*/
#define ACL4_SUPPORT_ALLOW_ACL 0x00000001
#define ACL4_SUPPORT_DENY_ACL 0x00000002
#define ACL4_SUPPORT_AUDIT_ACL 0x00000004
#define ACL4_SUPPORT_ALARM_ACL 0x00000008
typedef uint32_t acetype4;
#define ACE4_ACCESS_ALLOWED_ACE_TYPE 0x00000000
#define ACE4_ACCESS_DENIED_ACE_TYPE 0x00000001
#define ACE4_SYSTEM_AUDIT_ACE_TYPE 0x00000002
#define ACE4_SYSTEM_ALARM_ACE_TYPE 0x00000003
typedef uint32_t aceflag4;
#define ACE4_FILE_INHERIT_ACE 0x00000001
#define ACE4_DIRECTORY_INHERIT_ACE 0x00000002
#define ACE4_NO_PROPAGATE_INHERIT_ACE 0x00000004
#define ACE4_INHERIT_ONLY_ACE 0x00000008
#define ACE4_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
#define ACE4_FAILED_ACCESS_ACE_FLAG 0x00000020
#define ACE4_IDENTIFIER_GROUP 0x00000040
/*
* This defines all valid flag bits, as defined by RFC 7530. If
* any additional flag bits are deemed part of the NFSv4 spec,
* you must also add them to the definition below.
*/
#define ACE4_VALID_FLAG_BITS (\
ACE4_FILE_INHERIT_ACE | \
ACE4_DIRECTORY_INHERIT_ACE | \
ACE4_NO_PROPAGATE_INHERIT_ACE | \
ACE4_INHERIT_ONLY_ACE | \
ACE4_SUCCESSFUL_ACCESS_ACE_FLAG | \
ACE4_FAILED_ACCESS_ACE_FLAG | \
ACE4_IDENTIFIER_GROUP)
typedef uint32_t acemask4;
#define ACE4_READ_DATA 0x00000001
#define ACE4_LIST_DIRECTORY 0x00000001
#define ACE4_WRITE_DATA 0x00000002
#define ACE4_ADD_FILE 0x00000002
#define ACE4_APPEND_DATA 0x00000004
#define ACE4_ADD_SUBDIRECTORY 0x00000004
#define ACE4_READ_NAMED_ATTRS 0x00000008
#define ACE4_WRITE_NAMED_ATTRS 0x00000010
#define ACE4_EXECUTE 0x00000020
#define ACE4_DELETE_CHILD 0x00000040
#define ACE4_READ_ATTRIBUTES 0x00000080
#define ACE4_WRITE_ATTRIBUTES 0x00000100
#define ACE4_DELETE 0x00010000
#define ACE4_READ_ACL 0x00020000
#define ACE4_WRITE_ACL 0x00040000
#define ACE4_WRITE_OWNER 0x00080000
#define ACE4_SYNCHRONIZE 0x00100000
#define ACE4_GENERIC_READ 0x00120081
#define ACE4_GENERIC_WRITE 0x00160106
#define ACE4_GENERIC_EXECUTE 0x001200A0
/*
* This defines all valid access mask bits, as defined by RFC 7530. If
* any additional access mask bits are deemed part of the NFSv4 spec,
* you must also add them to the definition below.
*/
#define ACE4_VALID_MASK_BITS (\
ACE4_READ_DATA | \
ACE4_LIST_DIRECTORY | \
ACE4_WRITE_DATA | \
ACE4_ADD_FILE | \
ACE4_APPEND_DATA | \
ACE4_ADD_SUBDIRECTORY | \
ACE4_READ_NAMED_ATTRS | \
ACE4_WRITE_NAMED_ATTRS | \
ACE4_EXECUTE | \
ACE4_DELETE_CHILD | \
ACE4_READ_ATTRIBUTES | \
ACE4_WRITE_ATTRIBUTES | \
ACE4_DELETE | \
ACE4_READ_ACL | \
ACE4_WRITE_ACL | \
ACE4_WRITE_OWNER | \
ACE4_SYNCHRONIZE)
/* Used to signify an undefined value for an acemask4 */
#define ACE4_MASK_UNDEFINED 0x80000000
#define ACE4_WHO_OWNER "OWNER@"
#define ACE4_WHO_GROUP "GROUP@"
#define ACE4_WHO_EVERYONE "EVERYONE@"
struct nfsace4 {
acetype4 type;
aceflag4 flag;
acemask4 access_mask;
utf8string who;
};
typedef struct nfsace4 nfsace4;
#define MODE4_SUID 0x800
#define MODE4_SGID 0x400
#define MODE4_SVTX 0x200
#define MODE4_RUSR 0x100
#define MODE4_WUSR 0x080
#define MODE4_XUSR 0x040
#define MODE4_RGRP 0x020
#define MODE4_WGRP 0x010
#define MODE4_XGRP 0x008
#define MODE4_ROTH 0x004
#define MODE4_WOTH 0x002
#define MODE4_XOTH 0x001
/*
* ACL conversion helpers
*/
typedef enum {
ace4_unused,
ace4_user_obj,
ace4_user,
ace4_group, /* includes GROUP and GROUP_OBJ */
ace4_other_obj
} ace4_to_aent_state_t;
typedef struct ace4vals {
utf8string *key; /* NB: not allocated here; points to existing utf8 */
avl_node_t avl;
acemask4 mask;
acemask4 allowed;
acemask4 denied;
int aent_type;
} ace4vals_t;
typedef struct ace4_list {
ace4vals_t user_obj;
avl_tree_t user;
int numusers;
ace4vals_t group_obj;
avl_tree_t group;
int numgroups;
ace4vals_t other_obj;
acemask4 acl_mask;
int hasmask;
int dfacl_flag;
ace4_to_aent_state_t state;
int seen; /* bitmask of all aclent_t a_type values seen */
} ace4_list_t;
struct specdata4 {
uint32_t specdata1;
uint32_t specdata2;
};
typedef struct specdata4 specdata4;
#define FH4_PERSISTENT 0x00000000
#define FH4_NOEXPIRE_WITH_OPEN 0x00000001
#define FH4_VOLATILE_ANY 0x00000002
#define FH4_VOL_MIGRATION 0x00000004
#define FH4_VOL_RENAME 0x00000008
typedef bitmap4 fattr4_supported_attrs;
typedef nfs_ftype4 fattr4_type;
typedef uint32_t fattr4_fh_expire_type;
typedef changeid4 fattr4_change;
typedef uint64_t fattr4_size;
typedef bool_t fattr4_link_support;
typedef bool_t fattr4_symlink_support;
typedef bool_t fattr4_named_attr;
typedef fsid4 fattr4_fsid;
typedef bool_t fattr4_unique_handles;
typedef nfs_lease4 fattr4_lease_time;
typedef nfsstat4 fattr4_rdattr_error;
typedef struct {
uint_t fattr4_acl_len;
nfsace4 *fattr4_acl_val;
} fattr4_acl;
typedef uint32_t fattr4_aclsupport;
typedef bool_t fattr4_archive;
typedef bool_t fattr4_cansettime;
typedef bool_t fattr4_case_insensitive;
typedef bool_t fattr4_case_preserving;
typedef bool_t fattr4_chown_restricted;
typedef uint64_t fattr4_fileid;
typedef uint64_t fattr4_files_avail;
typedef nfs_fh4 fattr4_filehandle;
typedef uint64_t fattr4_files_free;
typedef uint64_t fattr4_files_total;
typedef fs_locations4 fattr4_fs_locations;
typedef bool_t fattr4_hidden;
typedef bool_t fattr4_homogeneous;
typedef uint64_t fattr4_maxfilesize;
typedef uint32_t fattr4_maxlink;
typedef uint32_t fattr4_maxname;
typedef uint64_t fattr4_maxread;
typedef uint64_t fattr4_maxwrite;
typedef ascii_REQUIRED4 fattr4_mimetype;
typedef mode4 fattr4_mode;
typedef uint64_t fattr4_mounted_on_fileid;
typedef bool_t fattr4_no_trunc;
typedef uint32_t fattr4_numlinks;
typedef utf8string fattr4_owner;
typedef utf8string fattr4_owner_group;
typedef uint64_t fattr4_quota_avail_hard;
typedef uint64_t fattr4_quota_avail_soft;
typedef uint64_t fattr4_quota_used;
typedef specdata4 fattr4_rawdev;
typedef uint64_t fattr4_space_avail;
typedef uint64_t fattr4_space_free;
typedef uint64_t fattr4_space_total;
typedef uint64_t fattr4_space_used;
typedef bool_t fattr4_system;
typedef nfstime4 fattr4_time_access;
typedef settime4 fattr4_time_access_set;
typedef nfstime4 fattr4_time_backup;
typedef nfstime4 fattr4_time_create;
typedef nfstime4 fattr4_time_delta;
typedef nfstime4 fattr4_time_metadata;
typedef nfstime4 fattr4_time_modify;
typedef settime4 fattr4_time_modify_set;
#define FATTR4_SUPPORTED_ATTRS 0
#define FATTR4_TYPE 1
#define FATTR4_FH_EXPIRE_TYPE 2
#define FATTR4_CHANGE 3
#define FATTR4_SIZE 4
#define FATTR4_LINK_SUPPORT 5
#define FATTR4_SYMLINK_SUPPORT 6
#define FATTR4_NAMED_ATTR 7
#define FATTR4_FSID 8
#define FATTR4_UNIQUE_HANDLES 9
#define FATTR4_LEASE_TIME 10
#define FATTR4_RDATTR_ERROR 11
#define FATTR4_FILEHANDLE 19
#define FATTR4_ACL 12
#define FATTR4_ACLSUPPORT 13
#define FATTR4_ARCHIVE 14
#define FATTR4_CANSETTIME 15
#define FATTR4_CASE_INSENSITIVE 16
#define FATTR4_CASE_PRESERVING 17
#define FATTR4_CHOWN_RESTRICTED 18
#define FATTR4_FILEID 20
#define FATTR4_FILES_AVAIL 21
#define FATTR4_FILES_FREE 22
#define FATTR4_FILES_TOTAL 23
#define FATTR4_FS_LOCATIONS 24
#define FATTR4_HIDDEN 25
#define FATTR4_HOMOGENEOUS 26
#define FATTR4_MAXFILESIZE 27
#define FATTR4_MAXLINK 28
#define FATTR4_MAXNAME 29
#define FATTR4_MAXREAD 30
#define FATTR4_MAXWRITE 31
#define FATTR4_MIMETYPE 32
#define FATTR4_MODE 33
#define FATTR4_NO_TRUNC 34
#define FATTR4_NUMLINKS 35
#define FATTR4_OWNER 36
#define FATTR4_OWNER_GROUP 37
#define FATTR4_QUOTA_AVAIL_HARD 38
#define FATTR4_QUOTA_AVAIL_SOFT 39
#define FATTR4_QUOTA_USED 40
#define FATTR4_RAWDEV 41
#define FATTR4_SPACE_AVAIL 42
#define FATTR4_SPACE_FREE 43
#define FATTR4_SPACE_TOTAL 44
#define FATTR4_SPACE_USED 45
#define FATTR4_SYSTEM 46
#define FATTR4_TIME_ACCESS 47
#define FATTR4_TIME_ACCESS_SET 48
#define FATTR4_TIME_BACKUP 49
#define FATTR4_TIME_CREATE 50
#define FATTR4_TIME_DELTA 51
#define FATTR4_TIME_METADATA 52
#define FATTR4_TIME_MODIFY 53
#define FATTR4_TIME_MODIFY_SET 54
#define FATTR4_MOUNTED_ON_FILEID 55
struct fattr4 {
bitmap4 attrmask;
char *attrlist4;
uint_t attrlist4_len;
};
typedef struct fattr4 fattr4;
struct change_info4 {
bool_t atomic;
changeid4 before;
changeid4 after;
};
typedef struct change_info4 change_info4;
struct clientaddr4 {
char *r_netid;
char *r_addr;
};
typedef struct clientaddr4 clientaddr4;
struct cb_client4 {
uint_t cb_program;
clientaddr4 cb_location;
};
typedef struct cb_client4 cb_client4;
struct stateid4 {
uint32_t seqid;
char other[NFS4_OTHER_SIZE];
};
typedef struct stateid4 stateid4;
struct nfs_client_id4 {
verifier4 verifier;
uint_t id_len;
char *id_val;
struct sockaddr *cl_addr;
};
typedef struct nfs_client_id4 nfs_client_id4;
struct open_owner4 {
clientid4 clientid;
uint_t owner_len;
char *owner_val;
};
typedef struct open_owner4 open_owner4;
struct lock_owner4 {
clientid4 clientid;
uint_t owner_len;
char *owner_val;
};
typedef struct lock_owner4 lock_owner4;
enum nfs_lock_type4 {
READ_LT = 1,
WRITE_LT = 2,
READW_LT = 3,
WRITEW_LT = 4
};
typedef enum nfs_lock_type4 nfs_lock_type4;
#define ACCESS4_READ 0x00000001
#define ACCESS4_LOOKUP 0x00000002
#define ACCESS4_MODIFY 0x00000004
#define ACCESS4_EXTEND 0x00000008
#define ACCESS4_DELETE 0x00000010
#define ACCESS4_EXECUTE 0x00000020
struct ACCESS4args {
uint32_t access;
};
typedef struct ACCESS4args ACCESS4args;
struct ACCESS4res {
nfsstat4 status;
uint32_t supported;
uint32_t access;
};
typedef struct ACCESS4res ACCESS4res;
struct CLOSE4args {
seqid4 seqid;
stateid4 open_stateid;
};
typedef struct CLOSE4args CLOSE4args;
struct CLOSE4res {
nfsstat4 status;
stateid4 open_stateid;
};
typedef struct CLOSE4res CLOSE4res;
struct COMMIT4args {
offset4 offset;
count4 count;
};
typedef struct COMMIT4args COMMIT4args;
struct COMMIT4res {
nfsstat4 status;
verifier4 writeverf;
};
typedef struct COMMIT4res COMMIT4res;
struct CREATE4args {
nfs_ftype4 type;
union {
linktext4 linkdata;
specdata4 devdata;
} ftype4_u;
component4 objname;
fattr4 createattrs;
};
typedef struct CREATE4args CREATE4args;
struct CREATE4cargs {
nfs_ftype4 type;
union {
char *clinkdata;
specdata4 devdata;
} ftype4_u;
char *cname;
fattr4 createattrs;
};
typedef struct CREATE4cargs CREATE4cargs;
struct CREATE4res {
nfsstat4 status;
change_info4 cinfo;
bitmap4 attrset;
};
typedef struct CREATE4res CREATE4res;
struct DELEGPURGE4args {
clientid4 clientid;
};
typedef struct DELEGPURGE4args DELEGPURGE4args;
struct DELEGPURGE4res {
nfsstat4 status;
};
typedef struct DELEGPURGE4res DELEGPURGE4res;
struct DELEGRETURN4args {
stateid4 deleg_stateid;
};
typedef struct DELEGRETURN4args DELEGRETURN4args;
struct DELEGRETURN4res {
nfsstat4 status;
};
typedef struct DELEGRETURN4res DELEGRETURN4res;
struct mntinfo4;
struct GETATTR4args {
bitmap4 attr_request;
struct mntinfo4 *mi;
};
typedef struct GETATTR4args GETATTR4args;
struct nfs4_ga_ext_res;
struct nfs4_ga_res {
vattr_t n4g_va;
unsigned n4g_change_valid:1;
unsigned n4g_mon_fid_valid:1;
unsigned n4g_fsid_valid:1;
uint_t n4g_attrerr;
uint_t n4g_attrwhy;
bitmap4 n4g_resbmap;
fattr4_change n4g_change;
fattr4_fsid n4g_fsid;
fattr4_mounted_on_fileid n4g_mon_fid;
struct nfs4_ga_ext_res *n4g_ext_res;
vsecattr_t n4g_vsa;
};
typedef struct nfs4_ga_res nfs4_ga_res_t;
struct GETATTR4res {
nfsstat4 status;
fattr4 obj_attributes;
nfsstat4 ga_status;
struct nfs4_ga_res ga_res;
};
typedef struct GETATTR4res GETATTR4res;
struct GETFH4res {
nfsstat4 status;
nfs_fh4 object;
};
typedef struct GETFH4res GETFH4res;
struct LINK4args {
component4 newname;
};
typedef struct LINK4args LINK4args;
struct LINK4cargs {
char *cnewname;
};
typedef struct LINK4cargs LINK4cargs;
struct LINK4res {
nfsstat4 status;
change_info4 cinfo;
};
typedef struct LINK4res LINK4res;
struct open_to_lock_owner4 {
seqid4 open_seqid;
stateid4 open_stateid;
seqid4 lock_seqid;
lock_owner4 lock_owner;
};
typedef struct open_to_lock_owner4 open_to_lock_owner4;
struct exist_lock_owner4 {
stateid4 lock_stateid;
seqid4 lock_seqid;
};
typedef struct exist_lock_owner4 exist_lock_owner4;
struct locker4 {
bool_t new_lock_owner;
union {
open_to_lock_owner4 open_owner;
exist_lock_owner4 lock_owner;
} locker4_u;
};
typedef struct locker4 locker4;
struct LOCK4args {
nfs_lock_type4 locktype;
bool_t reclaim;
offset4 offset;
length4 length;
locker4 locker;
};
typedef struct LOCK4args LOCK4args;
struct LOCK4denied {
offset4 offset;
length4 length;
nfs_lock_type4 locktype;
lock_owner4 owner;
};
typedef struct LOCK4denied LOCK4denied;
struct LOCK4res {
nfsstat4 status;
union {
stateid4 lock_stateid;
LOCK4denied denied;
} LOCK4res_u;
};
typedef struct LOCK4res LOCK4res;
struct LOCKT4args {
nfs_lock_type4 locktype;
offset4 offset;
length4 length;
lock_owner4 owner;
};
typedef struct LOCKT4args LOCKT4args;
struct LOCKT4res {
nfsstat4 status;
LOCK4denied denied;
};
typedef struct LOCKT4res LOCKT4res;
struct LOCKU4args {
nfs_lock_type4 locktype;
seqid4 seqid;
stateid4 lock_stateid;
offset4 offset;
length4 length;
};
typedef struct LOCKU4args LOCKU4args;
struct LOCKU4res {
nfsstat4 status;
stateid4 lock_stateid;
};
typedef struct LOCKU4res LOCKU4res;
struct LOOKUP4args {
component4 objname;
};
typedef struct LOOKUP4args LOOKUP4args;
struct LOOKUP4cargs {
char *cname;
};
typedef struct LOOKUP4cargs LOOKUP4cargs;
struct LOOKUP4res {
nfsstat4 status;
};
typedef struct LOOKUP4res LOOKUP4res;
struct LOOKUPP4res {
nfsstat4 status;
};
typedef struct LOOKUPP4res LOOKUPP4res;
struct NVERIFY4args {
fattr4 obj_attributes;
};
typedef struct NVERIFY4args NVERIFY4args;
struct NVERIFY4res {
nfsstat4 status;
};
typedef struct NVERIFY4res NVERIFY4res;
enum createmode4 {
UNCHECKED4 = 0,
GUARDED4 = 1,
EXCLUSIVE4 = 2
};
typedef enum createmode4 createmode4;
enum opentype4 {
OPEN4_NOCREATE = 0,
OPEN4_CREATE = 1
};
typedef enum opentype4 opentype4;
enum limit_by4 {
NFS_LIMIT_SIZE = 1,
NFS_LIMIT_BLOCKS = 2
};
typedef enum limit_by4 limit_by4;
struct nfs_modified_limit4 {
uint32_t num_blocks;
uint32_t bytes_per_block;
};
typedef struct nfs_modified_limit4 nfs_modified_limit4;
struct nfs_space_limit4 {
limit_by4 limitby;
union {
uint64_t filesize;
nfs_modified_limit4 mod_blocks;
} nfs_space_limit4_u;
};
typedef struct nfs_space_limit4 nfs_space_limit4;
#define OPEN4_SHARE_ACCESS_READ 0x00000001
#define OPEN4_SHARE_ACCESS_WRITE 0x00000002
#define OPEN4_SHARE_ACCESS_BOTH 0x00000003
#define OPEN4_SHARE_DENY_NONE 0x00000000
#define OPEN4_SHARE_DENY_READ 0x00000001
#define OPEN4_SHARE_DENY_WRITE 0x00000002
#define OPEN4_SHARE_DENY_BOTH 0x00000003
enum open_delegation_type4 {
OPEN_DELEGATE_NONE = 0,
OPEN_DELEGATE_READ = 1,
OPEN_DELEGATE_WRITE = 2
};
typedef enum open_delegation_type4 open_delegation_type4;
enum open_claim_type4 {
CLAIM_NULL = 0,
CLAIM_PREVIOUS = 1,
CLAIM_DELEGATE_CUR = 2,
CLAIM_DELEGATE_PREV = 3
};
typedef enum open_claim_type4 open_claim_type4;
struct open_claim_delegate_cur4 {
stateid4 delegate_stateid;
component4 file;
};
typedef struct open_claim_delegate_cur4 open_claim_delegate_cur4;
struct copen_claim_delegate_cur4 {
stateid4 delegate_stateid;
char *cfile;
};
typedef struct copen_claim_delegate_cur4 copen_claim_delegate_cur4;
struct OPEN4args {
seqid4 seqid;
uint32_t share_access;
uint32_t share_deny;
open_owner4 owner;
opentype4 opentype;
createmode4 mode;
union {
fattr4 createattrs;
verifier4 createverf;
} createhow4_u;
open_claim_type4 claim;
union {
component4 file;
open_delegation_type4 delegate_type;
open_claim_delegate_cur4 delegate_cur_info;
component4 file_delegate_prev;
} open_claim4_u;
};
typedef struct OPEN4args OPEN4args;
struct OPEN4cargs {
seqid4 seqid;
uint32_t share_access;
uint32_t share_deny;
open_owner4 owner;
opentype4 opentype;
createmode4 mode;
union {
fattr4 createattrs;
verifier4 createverf;
} createhow4_u;
open_claim_type4 claim;
union {
char *cfile;
open_delegation_type4 delegate_type;
copen_claim_delegate_cur4 delegate_cur_info;
char *cfile_delegate_prev;
} open_claim4_u;
};
typedef struct OPEN4cargs OPEN4cargs;
struct open_read_delegation4 {
stateid4 stateid;
bool_t recall;
nfsace4 permissions;
};
typedef struct open_read_delegation4 open_read_delegation4;
struct open_write_delegation4 {
stateid4 stateid;
bool_t recall;
nfs_space_limit4 space_limit;
nfsace4 permissions;
};
typedef struct open_write_delegation4 open_write_delegation4;
struct open_delegation4 {
open_delegation_type4 delegation_type;
union {
open_read_delegation4 read;
open_write_delegation4 write;
} open_delegation4_u;
};
typedef struct open_delegation4 open_delegation4;
#define OPEN4_RESULT_CONFIRM 0x00000002
#define OPEN4_RESULT_LOCKTYPE_POSIX 0x00000004
struct OPEN4res {
nfsstat4 status;
stateid4 stateid;
change_info4 cinfo;
uint32_t rflags;
bitmap4 attrset;
open_delegation4 delegation;
};
typedef struct OPEN4res OPEN4res;
struct OPENATTR4args {
bool_t createdir;
};
typedef struct OPENATTR4args OPENATTR4args;
struct OPENATTR4res {
nfsstat4 status;
};
typedef struct OPENATTR4res OPENATTR4res;
struct OPEN_CONFIRM4args {
stateid4 open_stateid;
seqid4 seqid;
};
typedef struct OPEN_CONFIRM4args OPEN_CONFIRM4args;
struct OPEN_CONFIRM4res {
nfsstat4 status;
stateid4 open_stateid;
};
typedef struct OPEN_CONFIRM4res OPEN_CONFIRM4res;
struct OPEN_DOWNGRADE4args {
stateid4 open_stateid;
seqid4 seqid;
uint32_t share_access;
uint32_t share_deny;
};
typedef struct OPEN_DOWNGRADE4args OPEN_DOWNGRADE4args;
struct OPEN_DOWNGRADE4res {
nfsstat4 status;
stateid4 open_stateid;
};
typedef struct OPEN_DOWNGRADE4res OPEN_DOWNGRADE4res;
struct PUTFH4args {
nfs_fh4 object;
};
typedef struct PUTFH4args PUTFH4args;
/*
* Client only side PUTFH arguments
* This is really a nfs4_sharedfh_t * but the forward declaration
* is problematic;
*/
struct PUTFH4cargs {
void *sfh;
};
typedef struct PUTFH4cargs PUTFH4cargs;
struct PUTFH4res {
nfsstat4 status;
};
typedef struct PUTFH4res PUTFH4res;
struct PUTPUBFH4res {
nfsstat4 status;
};
typedef struct PUTPUBFH4res PUTPUBFH4res;
struct PUTROOTFH4res {
nfsstat4 status;
};
typedef struct PUTROOTFH4res PUTROOTFH4res;
struct READ4args {
stateid4 stateid;
offset4 offset;
count4 count;
/* The following are used for the XDR decode path */
char *res_data_val_alt;
mblk_t *res_mblk;
struct uio *res_uiop;
uint_t res_maxsize;
#ifdef _KERNEL
struct clist *wlist;
CONN *conn;
#endif
};
typedef struct READ4args READ4args;
struct READ4res {
nfsstat4 status;
bool_t eof;
uint_t data_len;
char *data_val;
mblk_t *mblk;
#ifdef _KERNEL
struct clist *wlist;
uint_t wlist_len;
#endif
};
typedef struct READ4res READ4res;
struct rddir4_cache;
struct READDIR4args {
nfs_cookie4 cookie;
verifier4 cookieverf;
count4 dircount;
count4 maxcount;
bitmap4 attr_request;
vnode_t *dvp;
struct mntinfo4 *mi;
cred_t *cr;
struct rddir4_cache *rdc;
hrtime_t t;
};
typedef struct READDIR4args READDIR4args;
struct READDIR4res_clnt {
nfsstat4 status;
verifier4 cookieverf;
bool_t eof;
struct dirent64 *dotp, *dotdotp;
struct rddir4_cache *rdc;
};
typedef struct READDIR4res_clnt READDIR4res_clnt;
struct READDIR4res {
nfsstat4 status;
verifier4 cookieverf;
mblk_t *mblk;
uint_t data_len;
};
typedef struct READDIR4res READDIR4res;
struct READLINK4res {
nfsstat4 status;
linktext4 link;
};
typedef struct READLINK4res READLINK4res;
struct REMOVE4args {
component4 target;
};
typedef struct REMOVE4args REMOVE4args;
struct REMOVE4cargs {
char *ctarget;
};
typedef struct REMOVE4cargs REMOVE4cargs;
struct REMOVE4res {
nfsstat4 status;
change_info4 cinfo;
};
typedef struct REMOVE4res REMOVE4res;
struct RENAME4args {
component4 oldname;
component4 newname;
};
typedef struct RENAME4args RENAME4args;
struct RENAME4cargs {
char *coldname;
char *cnewname;
};
typedef struct RENAME4cargs RENAME4cargs;
struct RENAME4res {
nfsstat4 status;
change_info4 source_cinfo;
change_info4 target_cinfo;
};
typedef struct RENAME4res RENAME4res;
struct RENEW4args {
clientid4 clientid;
};
typedef struct RENEW4args RENEW4args;
struct RENEW4res {
nfsstat4 status;
};
typedef struct RENEW4res RENEW4res;
struct RESTOREFH4res {
nfsstat4 status;
};
typedef struct RESTOREFH4res RESTOREFH4res;
struct SAVEFH4res {
nfsstat4 status;
};
typedef struct SAVEFH4res SAVEFH4res;
struct SECINFO4args {
component4 name;
};
typedef struct SECINFO4args SECINFO4args;
struct SECINFO4cargs {
char *cname;
};
typedef struct SECINFO4cargs SECINFO4cargs;
enum rpc_gss_svc_t {
RPC_GSS_SVC_NONE = 1,
RPC_GSS_SVC_INTEGRITY = 2,
RPC_GSS_SVC_PRIVACY = 3
};
typedef enum rpc_gss_svc_t rpc_gss_svc_t;
struct rpcsec_gss_info {
sec_oid4 oid;
qop4 qop;
rpc_gss_svc_t service;
};
typedef struct rpcsec_gss_info rpcsec_gss_info;
struct secinfo4 {
uint32_t flavor;
rpcsec_gss_info flavor_info;
};
typedef struct secinfo4 secinfo4;
struct SECINFO4res {
nfsstat4 status;
uint_t SECINFO4resok_len;
secinfo4 *SECINFO4resok_val;
};
typedef struct SECINFO4res SECINFO4res;
struct SETATTR4args {
stateid4 stateid;
fattr4 obj_attributes;
};
typedef struct SETATTR4args SETATTR4args;
struct SETATTR4res {
nfsstat4 status;
bitmap4 attrsset;
};
typedef struct SETATTR4res SETATTR4res;
struct SETCLIENTID4args {
nfs_client_id4 client;
cb_client4 callback;
uint32_t callback_ident;
};
typedef struct SETCLIENTID4args SETCLIENTID4args;
struct SETCLIENTID4resok {
clientid4 clientid;
verifier4 setclientid_confirm;
};
typedef struct SETCLIENTID4resok SETCLIENTID4resok;
struct SETCLIENTID4res {
nfsstat4 status;
union {
SETCLIENTID4resok resok4;
clientaddr4 client_using;
} SETCLIENTID4res_u;
};
typedef struct SETCLIENTID4res SETCLIENTID4res;
struct SETCLIENTID_CONFIRM4args {
clientid4 clientid;
verifier4 setclientid_confirm;
};
typedef struct SETCLIENTID_CONFIRM4args SETCLIENTID_CONFIRM4args;
struct SETCLIENTID_CONFIRM4res {
nfsstat4 status;
};
typedef struct SETCLIENTID_CONFIRM4res SETCLIENTID_CONFIRM4res;
struct VERIFY4args {
fattr4 obj_attributes;
};
typedef struct VERIFY4args VERIFY4args;
struct VERIFY4res {
nfsstat4 status;
};
typedef struct VERIFY4res VERIFY4res;
enum stable_how4 {
UNSTABLE4 = 0,
DATA_SYNC4 = 1,
FILE_SYNC4 = 2
};
typedef enum stable_how4 stable_how4;
/*
* mblk doesn't go over the wire. If non-NULL, it points to an mblk chain
* for the write data.
*/
struct WRITE4args {
stateid4 stateid;
offset4 offset;
stable_how4 stable;
uint_t data_len;
char *data_val;
mblk_t *mblk;
#ifdef _KERNEL
struct clist *rlist;
CONN *conn;
#endif
};
typedef struct WRITE4args WRITE4args;
struct WRITE4res {
nfsstat4 status;
count4 count;
stable_how4 committed;
verifier4 writeverf;
};
typedef struct WRITE4res WRITE4res;
struct RELEASE_LOCKOWNER4args {
lock_owner4 lock_owner;
};
typedef struct RELEASE_LOCKOWNER4args RELEASE_LOCKOWNER4args;
struct RELEASE_LOCKOWNER4res {
nfsstat4 status;
};
typedef struct RELEASE_LOCKOWNER4res RELEASE_LOCKOWNER4res;
struct ILLEGAL4res {
nfsstat4 status;
};
typedef struct ILLEGAL4res ILLEGAL4res;
enum nfs_opnum4 {
OP_ACCESS = 3,
OP_CLOSE = 4,
OP_COMMIT = 5,
OP_CREATE = 6,
OP_DELEGPURGE = 7,
OP_DELEGRETURN = 8,
OP_GETATTR = 9,
OP_GETFH = 10,
OP_LINK = 11,
OP_LOCK = 12,
OP_LOCKT = 13,
OP_LOCKU = 14,
OP_LOOKUP = 15,
OP_LOOKUPP = 16,
OP_NVERIFY = 17,
OP_OPEN = 18,
OP_OPENATTR = 19,
OP_OPEN_CONFIRM = 20,
OP_OPEN_DOWNGRADE = 21,
OP_PUTFH = 22,
OP_PUTPUBFH = 23,
OP_PUTROOTFH = 24,
OP_READ = 25,
OP_READDIR = 26,
OP_READLINK = 27,
OP_REMOVE = 28,
OP_RENAME = 29,
OP_RENEW = 30,
OP_RESTOREFH = 31,
OP_SAVEFH = 32,
OP_SECINFO = 33,
OP_SETATTR = 34,
OP_SETCLIENTID = 35,
OP_SETCLIENTID_CONFIRM = 36,
OP_VERIFY = 37,
OP_WRITE = 38,
OP_RELEASE_LOCKOWNER = 39,
OP_ILLEGAL = 10044,
/*
* These are internal client pseudo ops that *MUST* never go over the wire
*/
#define SUNW_PRIVATE_OP 0x10000000
#define REAL_OP4(op) ((op) & ~SUNW_PRIVATE_OP)
OP_CCREATE = OP_CREATE | SUNW_PRIVATE_OP,
OP_CLINK = OP_LINK | SUNW_PRIVATE_OP,
OP_CLOOKUP = OP_LOOKUP | SUNW_PRIVATE_OP,
OP_COPEN = OP_OPEN | SUNW_PRIVATE_OP,
OP_CPUTFH = OP_PUTFH | SUNW_PRIVATE_OP,
OP_CREMOVE = OP_REMOVE | SUNW_PRIVATE_OP,
OP_CRENAME = OP_RENAME | SUNW_PRIVATE_OP,
OP_CSECINFO = OP_SECINFO | SUNW_PRIVATE_OP
};
typedef enum nfs_opnum4 nfs_opnum4;
struct nfs_argop4 {
nfs_opnum4 argop;
union {
ACCESS4args opaccess;
CLOSE4args opclose;
COMMIT4args opcommit;
CREATE4args opcreate;
CREATE4cargs opccreate;
DELEGPURGE4args opdelegpurge;
DELEGRETURN4args opdelegreturn;
GETATTR4args opgetattr;
LINK4args oplink;
LINK4cargs opclink;
LOCK4args oplock;
LOCKT4args oplockt;
LOCKU4args oplocku;
LOOKUP4args oplookup;
LOOKUP4cargs opclookup;
NVERIFY4args opnverify;
OPEN4args opopen;
OPEN4cargs opcopen;
OPENATTR4args opopenattr;
OPEN_CONFIRM4args opopen_confirm;
OPEN_DOWNGRADE4args opopen_downgrade;
PUTFH4args opputfh;
PUTFH4cargs opcputfh;
READ4args opread;
READDIR4args opreaddir;
REMOVE4args opremove;
REMOVE4cargs opcremove;
RENAME4args oprename;
RENAME4cargs opcrename;
RENEW4args oprenew;
SECINFO4args opsecinfo;
SECINFO4cargs opcsecinfo;
SETATTR4args opsetattr;
SETCLIENTID4args opsetclientid;
SETCLIENTID_CONFIRM4args opsetclientid_confirm;
VERIFY4args opverify;
WRITE4args opwrite;
RELEASE_LOCKOWNER4args oprelease_lockowner;
} nfs_argop4_u;
};
typedef struct nfs_argop4 nfs_argop4;
struct nfs_resop4 {
nfs_opnum4 resop;
union {
ACCESS4res opaccess;
CLOSE4res opclose;
COMMIT4res opcommit;
CREATE4res opcreate;
DELEGPURGE4res opdelegpurge;
DELEGRETURN4res opdelegreturn;
GETATTR4res opgetattr;
GETFH4res opgetfh;
LINK4res oplink;
LOCK4res oplock;
LOCKT4res oplockt;
LOCKU4res oplocku;
LOOKUP4res oplookup;
LOOKUPP4res oplookupp;
NVERIFY4res opnverify;
OPEN4res opopen;
OPENATTR4res opopenattr;
OPEN_CONFIRM4res opopen_confirm;
OPEN_DOWNGRADE4res opopen_downgrade;
PUTFH4res opputfh;
PUTPUBFH4res opputpubfh;
PUTROOTFH4res opputrootfh;
READ4res opread;
READDIR4res opreaddir;
READDIR4res_clnt opreaddirclnt;
READLINK4res opreadlink;
REMOVE4res opremove;
RENAME4res oprename;
RENEW4res oprenew;
RESTOREFH4res oprestorefh;
SAVEFH4res opsavefh;
SECINFO4res opsecinfo;
SETATTR4res opsetattr;
SETCLIENTID4res opsetclientid;
SETCLIENTID_CONFIRM4res opsetclientid_confirm;
VERIFY4res opverify;
WRITE4res opwrite;
RELEASE_LOCKOWNER4res oprelease_lockowner;
ILLEGAL4res opillegal;
} nfs_resop4_u;
};
typedef struct nfs_resop4 nfs_resop4;
/*
* Fixed size tag string for easy client encoding
*/
struct _ctag {
int ct_type;
char *ct_str;
uint32_t ct_tag[3];
};
typedef struct _ctag ctag_t;
/*
* Client-only encode-only version
*/
struct COMPOUND4args_clnt {
int ctag;
uint_t array_len;
nfs_argop4 *array;
};
typedef struct COMPOUND4args_clnt COMPOUND4args_clnt;
struct COMPOUND4args {
utf8string tag;
uint32_t minorversion;
uint_t array_len;
nfs_argop4 *array;
};
typedef struct COMPOUND4args COMPOUND4args;
struct COMPOUND4res_clnt {
nfsstat4 status;
uint_t array_len;
uint_t decode_len;
nfs_resop4 *array;
COMPOUND4args_clnt *argsp;
};
typedef struct COMPOUND4res_clnt COMPOUND4res_clnt;
struct COMPOUND4res {
nfsstat4 status;
utf8string tag;
uint_t array_len;
nfs_resop4 *array;
};
typedef struct COMPOUND4res COMPOUND4res;
struct CB_GETATTR4args {
nfs_fh4 fh;
bitmap4 attr_request;
};
typedef struct CB_GETATTR4args CB_GETATTR4args;
struct CB_GETATTR4res {
nfsstat4 status;
fattr4 obj_attributes;
};
typedef struct CB_GETATTR4res CB_GETATTR4res;
struct CB_RECALL4args {
stateid4 stateid;
bool_t truncate;
nfs_fh4 fh;
};
typedef struct CB_RECALL4args CB_RECALL4args;
struct CB_RECALL4res {
nfsstat4 status;
};
typedef struct CB_RECALL4res CB_RECALL4res;
struct CB_ILLEGAL4res {
nfsstat4 status;
};
typedef struct CB_ILLEGAL4res CB_ILLEGAL4res;
enum nfs_cb_opnum4 {
OP_CB_GETATTR = 3,
OP_CB_RECALL = 4,
OP_CB_ILLEGAL = 10044
};
typedef enum nfs_cb_opnum4 nfs_cb_opnum4;
struct nfs_cb_argop4 {
uint_t argop;
union {
CB_GETATTR4args opcbgetattr;
CB_RECALL4args opcbrecall;
} nfs_cb_argop4_u;
};
typedef struct nfs_cb_argop4 nfs_cb_argop4;
struct nfs_cb_resop4 {
uint_t resop;
union {
CB_GETATTR4res opcbgetattr;
CB_RECALL4res opcbrecall;
CB_ILLEGAL4res opcbillegal;
} nfs_cb_resop4_u;
};
typedef struct nfs_cb_resop4 nfs_cb_resop4;
struct CB_COMPOUND4args {
utf8string tag;
uint32_t minorversion;
uint32_t callback_ident;
uint_t array_len;
nfs_cb_argop4 *array;
};
typedef struct CB_COMPOUND4args CB_COMPOUND4args;
struct CB_COMPOUND4res {
nfsstat4 status;
utf8string tag;
uint_t array_len;
nfs_cb_resop4 *array;
};
typedef struct CB_COMPOUND4res CB_COMPOUND4res;
#define NFS4_PROGRAM 100003
#define NFS_V4 4
#define NFSPROC4_NULL 0
#define NFSPROC4_COMPOUND 1
#define NFS4_CALLBACK 0x40000000
#define NFS_CB 1
#define CB_NULL 0
#define CB_COMPOUND 1
extern bool_t xdr_bitmap4(XDR *, bitmap4 *);
extern bool_t xdr_utf8string(XDR *, utf8string *);
extern bool_t xdr_nfs_fh4(XDR *, nfs_fh4 *);
extern bool_t xdr_fattr4_fsid(XDR *, fattr4_fsid *);
extern bool_t xdr_fattr4_acl(XDR *, fattr4_acl *);
extern bool_t xdr_fattr4_fs_locations(XDR *, fattr4_fs_locations *);
extern bool_t xdr_fattr4_rawdev(XDR *, fattr4_rawdev *);
extern bool_t xdr_nfstime4(XDR *, nfstime4 *);
extern bool_t xdr_settime4(XDR *, settime4 *);
extern bool_t xdr_COMPOUND4args_clnt(XDR *, COMPOUND4args_clnt *);
extern bool_t xdr_COMPOUND4args_srv(XDR *, COMPOUND4args *);
extern bool_t xdr_COMPOUND4res_clnt(XDR *, COMPOUND4res_clnt *);
extern bool_t xdr_COMPOUND4res_srv(XDR *, COMPOUND4res *);
extern bool_t xdr_CB_COMPOUND4args_clnt(XDR *, CB_COMPOUND4args *);
extern bool_t xdr_CB_COMPOUND4args_srv(XDR *, CB_COMPOUND4args *);
extern bool_t xdr_CB_COMPOUND4res(XDR *, CB_COMPOUND4res *);
/*
* xdr for referrrals upcall
*/
extern bool_t xdr_knetconfig(XDR *, struct knetconfig *);
extern bool_t xdr_nfs_fsl_info(XDR *, struct nfs_fsl_info *);
#ifdef __cplusplus
}
#endif
#endif /* _NFS4_KPROT_H */
|