/// struct LAYOUTCOMMIT4args { /// /* CURRENT_FH: file */ /// offset4 loca_offset; /// length4 loca_length; /// bool loca_reclaim; /// stateid4 loca_stateid; /// newoffset4 loca_last_write_offset; /// newtime4 loca_time_modify; /// layoutupdate4 loca_layoutupdate; /// }; /// union newsize4 switch (bool ns_sizechanged) { /// case TRUE: /// length4 ns_size; /// case FALSE: /// void; /// }; /// /// struct LAYOUTCOMMIT4resok { /// newsize4 locr_newsize; /// }; /// /// union LAYOUTCOMMIT4res switch (nfsstat4 locr_status) { /// case NFS4_OK: /// LAYOUTCOMMIT4resok locr_resok4; /// default: /// void; /// }; /// /// struct LAYOUTGET4args { /// /* CURRENT_FH: file */ /// bool loga_signal_layout_avail; /// layouttype4 loga_layout_type; /// layoutiomode4 loga_iomode; /// offset4 loga_offset; /// length4 loga_length; /// length4 loga_minlength; /// stateid4 loga_stateid; /// count4 loga_maxcount; /// }; /// struct LAYOUTGET4resok { /// bool logr_return_on_close; /// stateid4 logr_stateid; /// layout4 logr_layout<>; /// }; ///
/// union LAYOUTGET4res switch (nfsstat4 logr_status) { /// case NFS4_OK: /// LAYOUTGET4resok logr_resok4; /// case NFS4ERR_LAYOUTTRYLATER: /// bool logr_will_signal_layout_avail; /// default: /// void; /// }; /// /// /// struct LAYOUTRETURN4args { /// /* CURRENT_FH: file */ /// bool lora_reclaim; /// layouttype4 lora_layout_type; /// layoutiomode4 lora_iomode; /// layoutreturn4 lora_layoutreturn; /// }; /// /// /// union layoutreturn_stateid switch (bool lrs_present) { /// case TRUE: /// stateid4 lrs_stateid; /// case FALSE: /// void; /// }; /// /// union LAYOUTRETURN4res switch (nfsstat4 lorr_status) { /// case NFS4_OK: /// layoutreturn_stateid lorr_stateid; /// default: /// void; /// }; /// /// enum secinfo_style4 { /// SECINFO_STYLE4_CURRENT_FH = 0, /// SECINFO_STYLE4_PARENT = 1 /// }; /// /// /* CURRENT_FH: object or child directory */ /// typedef secinfo_style4 SECINFO_NO_NAME4args; /// /// /* CURRENTFH: consumed if status is NFS4_OK */ /// typedef SECINFO4res SECINFO_NO_NAME4res; ///
/// struct SEQUENCE4args { /// sessionid4 sa_sessionid; /// sequenceid4 sa_sequenceid; /// slotid4 sa_slotid; /// slotid4 sa_highest_slotid; /// bool sa_cachethis; /// }; /// /// const SEQ4_STATUS_CB_PATH_DOWN = 0x00000001; /// const SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING = 0x00000002; /// const SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED = 0x00000004; /// const SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED = 0x00000008; /// const SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED = 0x00000010; /// const SEQ4_STATUS_ADMIN_STATE_REVOKED = 0x00000020; /// const SEQ4_STATUS_RECALLABLE_STATE_REVOKED = 0x00000040; /// const SEQ4_STATUS_LEASE_MOVED = 0x00000080; /// const SEQ4_STATUS_RESTART_RECLAIM_NEEDED = 0x00000100; /// const SEQ4_STATUS_CB_PATH_DOWN_SESSION = 0x00000200; /// const SEQ4_STATUS_BACKCHANNEL_FAULT = 0x00000400; /// const SEQ4_STATUS_DEVID_CHANGED = 0x00000800; /// const SEQ4_STATUS_DEVID_DELETED = 0x00001000; /// /// struct SEQUENCE4resok { /// sessionid4 sr_sessionid; /// sequenceid4 sr_sequenceid; /// slotid4 sr_slotid; /// slotid4 sr_highest_slotid; /// slotid4 sr_target_highest_slotid; /// uint32_t sr_status_flags; /// }; /// /// union SEQUENCE4res switch (nfsstat4 sr_status) { /// case NFS4_OK: /// SEQUENCE4resok sr_resok4; /// default: /// void; /// }; /// /// struct ssa_digest_input4 { /// SEQUENCE4args sdi_seqargs; /// }; /// /// struct SET_SSV4args { /// opaque ssa_ssv<>; /// opaque ssa_digest<>; /// }; ///
/// struct ssr_digest_input4 { /// SEQUENCE4res sdi_seqres; /// }; /// /// struct SET_SSV4resok { /// opaque ssr_digest<>; /// }; /// /// union SET_SSV4res switch (nfsstat4 ssr_status) { /// case NFS4_OK: /// SET_SSV4resok ssr_resok4; /// default: /// void; /// }; /// /// struct TEST_STATEID4args { /// stateid4 ts_stateids<>; /// }; /// /// struct TEST_STATEID4resok { /// nfsstat4 tsr_status_codes<>; /// }; /// /// union TEST_STATEID4res switch (nfsstat4 tsr_status) { /// case NFS4_OK: /// TEST_STATEID4resok tsr_resok4; /// default: /// void; /// }; /// /// union deleg_claim4 switch (open_claim_type4 dc_claim) { /// /* /// * No special rights to object. Ordinary delegation /// * request of the specified object. Object identified /// * by filehandle. /// */ /// case CLAIM_FH: /* New to NFSv4.1 */ /// /* CURRENT_FH: object being delegated */ /// void; /// /// /* /// * Right to file based on a delegation granted /// * to a previous boot instance of the client. /// * File is specified by filehandle. /// */ /// case CLAIM_DELEG_PREV_FH: /* New to NFSv4.1 */ /// /* CURRENT_FH: object being delegated */ /// void;
/// /// /* /// * Right to the file established by an open previous /// * to server reboot. File identified by filehandle. /// * Used during server reclaim grace period. /// */ /// case CLAIM_PREVIOUS: /// /* CURRENT_FH: object being reclaimed */ /// open_delegation_type4 dc_delegate_type; /// }; /// /// struct WANT_DELEGATION4args { /// uint32_t wda_want; /// deleg_claim4 wda_claim; /// }; /// /// union WANT_DELEGATION4res switch (nfsstat4 wdr_status) { /// case NFS4_OK: /// open_delegation4 wdr_resok4; /// default: /// void; /// }; /// /// struct DESTROY_CLIENTID4args { /// clientid4 dca_clientid; /// }; /// /// struct DESTROY_CLIENTID4res { /// nfsstat4 dcr_status; /// }; /// /// struct RECLAIM_COMPLETE4args { /// /* /// * If rca_one_fs TRUE, /// * /// * CURRENT_FH: object in /// * file system for which the /// * reclaim is complete. /// */ /// bool rca_one_fs; /// }; /// /// struct RECLAIM_COMPLETE4res { /// nfsstat4 rcr_status; /// }; ///
/// struct COPY4args { /// /* SAVED_FH: source file */ /// /* CURRENT_FH: destination file */ /// stateid4 ca_src_stateid; /// stateid4 ca_dst_stateid; /// offset4 ca_src_offset; /// offset4 ca_dst_offset; /// length4 ca_count; /// bool ca_consecutive; /// bool ca_synchronous; /// netloc4 ca_source_server<>; /// }; /// /// /// struct copy_requirements4 { /// bool cr_consecutive; /// bool cr_synchronous; /// }; /// /// struct COPY4resok { /// write_response4 cr_response; /// copy_requirements4 cr_requirements; /// }; /// /// union COPY4res switch (nfsstat4 cr_status) { /// case NFS4_OK: /// COPY4resok cr_resok4; /// case NFS4ERR_OFFLOAD_NO_REQS: /// copy_requirements4 cr_requirements; /// default: /// void; /// }; /// /// struct COPY_NOTIFY4args { /// /* CURRENT_FH: source file */ /// stateid4 cna_src_stateid; /// netloc4 cna_destination_server; /// }; /// /// struct COPY_NOTIFY4resok { /// nfstime4 cnr_lease_time; /// stateid4 cnr_stateid; /// netloc4 cnr_source_server<>; /// }; ///
/// union COPY_NOTIFY4res switch (nfsstat4 cnr_status) { /// case NFS4_OK: /// COPY_NOTIFY4resok resok4; /// default: /// void; /// }; /// /// struct OFFLOAD_CANCEL4args { /// /* CURRENT_FH: file to cancel */ /// stateid4 oca_stateid; /// }; /// /// struct OFFLOAD_CANCEL4res { /// nfsstat4 ocr_status; /// }; /// /// /// struct OFFLOAD_STATUS4args { /// /* CURRENT_FH: destination file */ /// stateid4 osa_stateid; /// }; /// /// struct OFFLOAD_STATUS4resok { /// length4 osr_count; /// nfsstat4 osr_complete<1>; /// }; /// /// union OFFLOAD_STATUS4res switch (nfsstat4 osr_status) { /// case NFS4_OK: /// OFFLOAD_STATUS4resok osr_resok4; /// default: /// void; /// }; /// /// struct ALLOCATE4args { /// /* CURRENT_FH: file */ /// stateid4 aa_stateid; /// offset4 aa_offset; /// length4 aa_length; /// }; /// struct ALLOCATE4res { /// nfsstat4 ar_status; /// }; ///
/// struct DEALLOCATE4args { /// /* CURRENT_FH: file */ /// stateid4 da_stateid; /// offset4 da_offset; /// length4 da_length; /// }; /// /// /// struct DEALLOCATE4res { /// nfsstat4 dr_status; /// }; /// enum IO_ADVISE_type4 { /// IO_ADVISE4_NORMAL = 0, /// IO_ADVISE4_SEQUENTIAL = 1, /// IO_ADVISE4_SEQUENTIAL_BACKWARDS = 2, /// IO_ADVISE4_RANDOM = 3, /// IO_ADVISE4_WILLNEED = 4, /// IO_ADVISE4_WILLNEED_OPPORTUNISTIC = 5, /// IO_ADVISE4_DONTNEED = 6, /// IO_ADVISE4_NOREUSE = 7, /// IO_ADVISE4_READ = 8, /// IO_ADVISE4_WRITE = 9, /// IO_ADVISE4_INIT_PROXIMITY = 10 /// }; /// /// struct IO_ADVISE4args { /// /* CURRENT_FH: file */ /// stateid4 iaa_stateid; /// offset4 iaa_offset; /// length4 iaa_count; /// bitmap4 iaa_hints; /// }; /// /// struct IO_ADVISE4resok { /// bitmap4 ior_hints; /// }; /// /// union IO_ADVISE4res switch (nfsstat4 ior_status) { /// case NFS4_OK: /// IO_ADVISE4resok resok4; /// default: /// void; /// }; /// ///
/// struct device_error4 { /// deviceid4 de_deviceid; /// nfsstat4 de_status; /// nfs_opnum4 de_opnum; /// }; /// /// /// struct LAYOUTERROR4args { /// /* CURRENT_FH: file */ /// offset4 lea_offset; /// length4 lea_length; /// stateid4 lea_stateid; /// device_error4 lea_errors<>; /// }; /// /// struct LAYOUTERROR4res { /// nfsstat4 ler_status; /// }; /// /// struct io_info4 { /// uint64_t ii_count; /// uint64_t ii_bytes; /// }; /// /// struct LAYOUTSTATS4args { /// /* CURRENT_FH: file */ /// offset4 lsa_offset; /// length4 lsa_length; /// stateid4 lsa_stateid; /// io_info4 lsa_read; /// io_info4 lsa_write; /// deviceid4 lsa_deviceid; /// layoutupdate4 lsa_layoutupdate; /// }; /// /// struct LAYOUTSTATS4res { /// nfsstat4 lsr_status; /// }; /// /// struct READ_PLUS4args { /// /* CURRENT_FH: file */ /// stateid4 rpa_stateid; /// offset4 rpa_offset; /// count4 rpa_count; /// };
/// union read_plus_content switch (data_content4 rpc_content) { /// case NFS4_CONTENT_DATA: /// data4 rpc_data; /// case NFS4_CONTENT_HOLE: /// data_info4 rpc_hole; /// default: /// void; /// }; /// /// /* /// * Allow a return of an array of contents. /// */ /// struct read_plus_res4 { /// bool rpr_eof; /// read_plus_content rpr_contents<>; /// }; /// /// union READ_PLUS4res switch (nfsstat4 rp_status) { /// case NFS4_OK: /// read_plus_res4 rp_resok4; /// default: /// void; /// }; /// /// struct SEEK4args { /// /* CURRENT_FH: file */ /// stateid4 sa_stateid; /// offset4 sa_offset; /// data_content4 sa_what; /// }; /// struct seek_res4 { /// bool sr_eof; /// offset4 sr_offset; /// }; /// union SEEK4res switch (nfsstat4 sa_status) { /// case NFS4_OK: /// seek_res4 resok4; /// default: /// void; /// }; /// /// struct WRITE_SAME4args { /// /* CURRENT_FH: file */ /// stateid4 wsa_stateid; /// stable_how4 wsa_stable; /// app_data_block4 wsa_adb; /// }; ///
/// /// union WRITE_SAME4res switch (nfsstat4 wsr_status) { /// case NFS4_OK: /// write_response4 resok4; /// default: /// void; /// }; /// /// /// /* /// * Operation arrays (the rest) /// */ /// /// union nfs_argop4 switch (nfs_opnum4 argop) { /// case OP_ACCESS: ACCESS4args opaccess; /// case OP_CLOSE: CLOSE4args opclose; /// case OP_COMMIT: COMMIT4args opcommit; /// case OP_CREATE: CREATE4args opcreate; /// case OP_DELEGPURGE: DELEGPURGE4args opdelegpurge; /// case OP_DELEGRETURN: DELEGRETURN4args opdelegreturn; /// case OP_GETATTR: GETATTR4args opgetattr; /// case OP_GETFH: void; /// case OP_LINK: LINK4args oplink; /// case OP_LOCK: LOCK4args oplock; /// case OP_LOCKT: LOCKT4args oplockt; /// case OP_LOCKU: LOCKU4args oplocku; /// case OP_LOOKUP: LOOKUP4args oplookup; /// case OP_LOOKUPP: void; /// case OP_NVERIFY: NVERIFY4args opnverify; /// case OP_OPEN: OPEN4args opopen; /// case OP_OPENATTR: OPENATTR4args opopenattr; /// /// /* Not for NFSv4.1 */ /// case OP_OPEN_CONFIRM: OPEN_CONFIRM4args opopen_confirm; /// /// case OP_OPEN_DOWNGRADE: OPEN_DOWNGRADE4args opopen_downgrade; /// /// case OP_PUTFH: PUTFH4args opputfh; /// case OP_PUTPUBFH: void; /// case OP_PUTROOTFH: void; /// case OP_READ: READ4args opread; /// case OP_READDIR: READDIR4args opreaddir; /// case OP_READLINK: void; /// case OP_REMOVE: REMOVE4args opremove; /// case OP_RENAME: RENAME4args oprename; ///
/// /* Not for NFSv4.1 */ /// case OP_RENEW: RENEW4args oprenew; /// /// case OP_RESTOREFH: void; /// case OP_SAVEFH: void; /// case OP_SECINFO: SECINFO4args opsecinfo; /// case OP_SETATTR: SETATTR4args opsetattr; /// /// /* Not for NFSv4.1 */ /// case OP_SETCLIENTID: SETCLIENTID4args opsetclientid; /// /// /* Not for NFSv4.1 */ /// case OP_SETCLIENTID_CONFIRM: /// SETCLIENTID_CONFIRM4args /// opsetclientid_confirm; /// /// case OP_VERIFY: VERIFY4args opverify; /// case OP_WRITE: WRITE4args opwrite; /// /// /* Not for NFSv4.1 */ /// case OP_RELEASE_LOCKOWNER: /// RELEASE_LOCKOWNER4args /// oprelease_lockowner; /// /// /* Operations new to NFSv4.1 */ /// case OP_BACKCHANNEL_CTL: /// BACKCHANNEL_CTL4args opbackchannel_ctl; /// /// case OP_BIND_CONN_TO_SESSION: /// BIND_CONN_TO_SESSION4args /// opbind_conn_to_session; /// /// case OP_EXCHANGE_ID: EXCHANGE_ID4args opexchange_id; /// /// case OP_CREATE_SESSION: CREATE_SESSION4args opcreate_session; /// /// case OP_DESTROY_SESSION: /// DESTROY_SESSION4args opdestroy_session; /// /// case OP_FREE_STATEID: FREE_STATEID4args opfree_stateid; /// /// case OP_GET_DIR_DELEGATION: /// GET_DIR_DELEGATION4args /// opget_dir_delegation; ///
/// case OP_GETDEVICEINFO: GETDEVICEINFO4args opgetdeviceinfo; /// case OP_GETDEVICELIST: GETDEVICELIST4args opgetdevicelist; /// case OP_LAYOUTCOMMIT: LAYOUTCOMMIT4args oplayoutcommit; /// case OP_LAYOUTGET: LAYOUTGET4args oplayoutget; /// case OP_LAYOUTRETURN: LAYOUTRETURN4args oplayoutreturn; /// /// case OP_SECINFO_NO_NAME: /// SECINFO_NO_NAME4args opsecinfo_no_name; /// /// case OP_SEQUENCE: SEQUENCE4args opsequence; /// case OP_SET_SSV: SET_SSV4args opset_ssv; /// case OP_TEST_STATEID: TEST_STATEID4args optest_stateid; /// /// case OP_WANT_DELEGATION: /// WANT_DELEGATION4args opwant_delegation; /// /// case OP_DESTROY_CLIENTID: /// DESTROY_CLIENTID4args /// opdestroy_clientid; /// /// case OP_RECLAIM_COMPLETE: /// RECLAIM_COMPLETE4args /// opreclaim_complete; /// /// /* Operations new to NFSv4.2 */ /// case OP_ALLOCATE: ALLOCATE4args opallocate; /// case OP_COPY: COPY4args opcopy; /// case OP_COPY_NOTIFY: COPY_NOTIFY4args opoffload_notify; /// case OP_DEALLOCATE: DEALLOCATE4args opdeallocate; /// case OP_IO_ADVISE: IO_ADVISE4args opio_advise; /// case OP_LAYOUTERROR: LAYOUTERROR4args oplayouterror; /// case OP_LAYOUTSTATS: LAYOUTSTATS4args oplayoutstats; /// case OP_OFFLOAD_CANCEL: OFFLOAD_CANCEL4args opoffload_cancel; /// case OP_OFFLOAD_STATUS: OFFLOAD_STATUS4args opoffload_status; /// case OP_READ_PLUS: READ_PLUS4args opread_plus; /// case OP_SEEK: SEEK4args opseek; /// case OP_WRITE_SAME: WRITE_SAME4args opwrite_same; /// case OP_CLONE: CLONE4args opclone; ///
/// /* Operations not new to NFSv4.1 */ /// case OP_ILLEGAL: void; /// }; /// /// union nfs_resop4 switch (nfs_opnum4 resop) { /// case OP_ACCESS: ACCESS4res opaccess; /// case OP_CLOSE: CLOSE4res opclose; /// case OP_COMMIT: COMMIT4res opcommit; /// case OP_CREATE: CREATE4res opcreate; /// case OP_DELEGPURGE: DELEGPURGE4res opdelegpurge; /// case OP_DELEGRETURN: DELEGRETURN4res opdelegreturn; /// case OP_GETATTR: GETATTR4res opgetattr; /// case OP_GETFH: GETFH4res opgetfh; /// case OP_LINK: LINK4res oplink; /// case OP_LOCK: LOCK4res oplock; /// case OP_LOCKT: LOCKT4res oplockt; /// case OP_LOCKU: LOCKU4res oplocku; /// case OP_LOOKUP: LOOKUP4res oplookup; /// case OP_LOOKUPP: LOOKUPP4res oplookupp; /// case OP_NVERIFY: NVERIFY4res opnverify; /// case OP_OPEN: OPEN4res opopen; /// case OP_OPENATTR: OPENATTR4res opopenattr; /// /* Not for NFSv4.1 */ /// case OP_OPEN_CONFIRM: OPEN_CONFIRM4res opopen_confirm; /// /// case OP_OPEN_DOWNGRADE: OPEN_DOWNGRADE4res opopen_downgrade; /// /// case OP_PUTFH: PUTFH4res opputfh; /// case OP_PUTPUBFH: PUTPUBFH4res opputpubfh; /// case OP_PUTROOTFH: PUTROOTFH4res opputrootfh; /// case OP_READ: READ4res opread; /// case OP_READDIR: READDIR4res opreaddir; /// case OP_READLINK: READLINK4res opreadlink; /// case OP_REMOVE: REMOVE4res opremove; /// case OP_RENAME: RENAME4res oprename; /// /* Not for NFSv4.1 */ /// case OP_RENEW: RENEW4res oprenew; /// case OP_RESTOREFH: RESTOREFH4res oprestorefh; /// case OP_SAVEFH: SAVEFH4res opsavefh; /// case OP_SECINFO: SECINFO4res opsecinfo; /// case OP_SETATTR: SETATTR4res opsetattr; /// /* Not for NFSv4.1 */ /// case OP_SETCLIENTID: SETCLIENTID4res opsetclientid; ///
/// /* Not for NFSv4.1 */ /// case OP_SETCLIENTID_CONFIRM: /// SETCLIENTID_CONFIRM4res /// opsetclientid_confirm; /// case OP_VERIFY: VERIFY4res opverify; /// case OP_WRITE: WRITE4res opwrite; /// /// /* Not for NFSv4.1 */ /// case OP_RELEASE_LOCKOWNER: /// RELEASE_LOCKOWNER4res /// oprelease_lockowner; /// /// /* Operations new to NFSv4.1 */ /// case OP_BACKCHANNEL_CTL: /// BACKCHANNEL_CTL4res opbackchannel_ctl; /// /// case OP_BIND_CONN_TO_SESSION: /// BIND_CONN_TO_SESSION4res /// opbind_conn_to_session; /// /// case OP_EXCHANGE_ID: EXCHANGE_ID4res opexchange_id; /// /// case OP_CREATE_SESSION: CREATE_SESSION4res opcreate_session; /// /// case OP_DESTROY_SESSION: /// DESTROY_SESSION4res opdestroy_session; /// /// case OP_FREE_STATEID: FREE_STATEID4res opfree_stateid; /// /// case OP_GET_DIR_DELEGATION: /// GET_DIR_DELEGATION4res /// opget_dir_delegation; /// /// case OP_GETDEVICEINFO: GETDEVICEINFO4res opgetdeviceinfo; /// case OP_GETDEVICELIST: GETDEVICELIST4res opgetdevicelist; /// case OP_LAYOUTCOMMIT: LAYOUTCOMMIT4res oplayoutcommit; /// case OP_LAYOUTGET: LAYOUTGET4res oplayoutget; /// case OP_LAYOUTRETURN: LAYOUTRETURN4res oplayoutreturn; /// /// case OP_SECINFO_NO_NAME: /// SECINFO_NO_NAME4res opsecinfo_no_name; /// /// case OP_SEQUENCE: SEQUENCE4res opsequence; /// case OP_SET_SSV: SET_SSV4res opset_ssv; /// case OP_TEST_STATEID: TEST_STATEID4res optest_stateid; /// /// case OP_WANT_DELEGATION: /// WANT_DELEGATION4res opwant_delegation;
/// /// case OP_DESTROY_CLIENTID: /// DESTROY_CLIENTID4res /// opdestroy_clientid; /// /// case OP_RECLAIM_COMPLETE: /// RECLAIM_COMPLETE4res /// opreclaim_complete; /// /// /* Operations new to NFSv4.2 */ /// case OP_ALLOCATE: ALLOCATE4res opallocate; /// case OP_COPY: COPY4res opcopy; /// case OP_COPY_NOTIFY: COPY_NOTIFY4res opcopy_notify; /// case OP_DEALLOCATE: DEALLOCATE4res opdeallocate; /// case OP_IO_ADVISE: IO_ADVISE4res opio_advise; /// case OP_LAYOUTERROR: LAYOUTERROR4res oplayouterror; /// case OP_LAYOUTSTATS: LAYOUTSTATS4res oplayoutstats; /// case OP_OFFLOAD_CANCEL: OFFLOAD_CANCEL4res opoffload_cancel; /// case OP_OFFLOAD_STATUS: OFFLOAD_STATUS4res opoffload_status; /// case OP_READ_PLUS: READ_PLUS4res opread_plus; /// case OP_SEEK: SEEK4res opseek; /// case OP_WRITE_SAME: WRITE_SAME4res opwrite_same; /// case OP_CLONE: CLONE4res opclone; /// /// /* Operations not new to NFSv4.1 */ /// case OP_ILLEGAL: ILLEGAL4res opillegal; /// }; /// /// struct COMPOUND4args { /// utf8str_cs tag; /// uint32_t minorversion; /// nfs_argop4 argarray<>; /// }; /// /// struct COMPOUND4res { /// nfsstat4 status; /// utf8str_cs tag; /// nfs_resop4 resarray<>; /// }; /// ///
/// /* /// * Remote file service routines /// */ /// program NFS4_PROGRAM { /// version NFS_V4 { /// void /// NFSPROC4_NULL(void) = 0; /// /// COMPOUND4res /// NFSPROC4_COMPOUND(COMPOUND4args) = 1; /// /// } = 4; /// } = 100003; /// /// /* /// * NFS4 callback procedure definitions and program /// */ /// struct CB_GETATTR4args { /// nfs_fh4 fh; /// bitmap4 attr_request; /// }; /// /// struct CB_GETATTR4resok { /// fattr4 obj_attributes; /// }; /// /// union CB_GETATTR4res switch (nfsstat4 status) { /// case NFS4_OK: /// CB_GETATTR4resok resok4; /// default: /// void; /// }; /// /// struct CB_RECALL4args { /// stateid4 stateid; /// bool truncate; /// nfs_fh4 fh; /// }; /// /// struct CB_RECALL4res { /// nfsstat4 status; /// }; ///
/// /* /// * CB_ILLEGAL: Response for illegal operation numbers /// */ /// struct CB_ILLEGAL4res { /// nfsstat4 status; /// }; /// /// /* /// * NFSv4.1 callback arguments and results /// */ /// /// enum layoutrecall_type4 { /// LAYOUTRECALL4_FILE = LAYOUT4_RET_REC_FILE, /// LAYOUTRECALL4_FSID = LAYOUT4_RET_REC_FSID, /// LAYOUTRECALL4_ALL = LAYOUT4_RET_REC_ALL /// }; /// /// struct layoutrecall_file4 { /// nfs_fh4 lor_fh; /// offset4 lor_offset; /// length4 lor_length; /// stateid4 lor_stateid; /// }; /// /// union layoutrecall4 switch (layoutrecall_type4 lor_recalltype) { /// case LAYOUTRECALL4_FILE: /// layoutrecall_file4 lor_layout; /// case LAYOUTRECALL4_FSID: /// fsid4 lor_fsid; /// case LAYOUTRECALL4_ALL: /// void; /// }; /// /// struct CB_LAYOUTRECALL4args { /// layouttype4 clora_type; /// layoutiomode4 clora_iomode; /// bool clora_changed; /// layoutrecall4 clora_recall; /// }; /// struct CB_LAYOUTRECALL4res { /// nfsstat4 clorr_status; /// }; ///
/// /* /// * Directory notification types /// */ /// enum notify_type4 { /// NOTIFY4_CHANGE_CHILD_ATTRS = 0, /// NOTIFY4_CHANGE_DIR_ATTRS = 1, /// NOTIFY4_REMOVE_ENTRY = 2, /// NOTIFY4_ADD_ENTRY = 3, /// NOTIFY4_RENAME_ENTRY = 4, /// NOTIFY4_CHANGE_COOKIE_VERIFIER = 5 /// }; /// /// /* Changed entry information */ /// struct notify_entry4 { /// component4 ne_file; /// fattr4 ne_attrs; /// }; /// /// /* Previous entry information */ /// struct prev_entry4 { /// notify_entry4 pe_prev_entry; /// /* What READDIR returned for this entry */ /// nfs_cookie4 pe_prev_entry_cookie; /// }; /// /// struct notify_remove4 { /// notify_entry4 nrm_old_entry; /// nfs_cookie4 nrm_old_entry_cookie; /// }; /// /// struct notify_add4 { /// /* /// * During a rename, contains /// * the object that was deleted. /// */ /// notify_remove4 nad_old_entry<1>; /// notify_entry4 nad_new_entry; /// /* What READDIR would have returned for this entry */ /// nfs_cookie4 nad_new_entry_cookie<1>; /// prev_entry4 nad_prev_entry<1>; /// bool nad_last_entry; /// }; /// /// struct notify_attr4 { /// notify_entry4 na_changed_entry; /// }; ///
/// struct notify_rename4 { /// notify_remove4 nrn_old_entry; /// notify_add4 nrn_new_entry; /// }; /// /// struct notify_verifier4 { /// verifier4 nv_old_cookieverf; /// verifier4 nv_new_cookieverf; /// }; /// /// /* /// * Objects of type notify_<>4 and /// * notify_device_<>4 are encoded in this. /// */ /// typedef opaque notifylist4<>; /// /// struct notify4 { /// /* Composed from notify_type4 or notify_deviceid_type4 */ /// bitmap4 notify_mask; /// notifylist4 notify_vals; /// }; /// /// struct CB_NOTIFY4args { /// stateid4 cna_stateid; /// nfs_fh4 cna_fh; /// notify4 cna_changes<>; /// }; /// /// struct CB_NOTIFY4res { /// nfsstat4 cnr_status; /// }; /// /// struct CB_PUSH_DELEG4args { /// nfs_fh4 cpda_fh; /// open_delegation4 cpda_delegation; /// /// }; /// /// struct CB_PUSH_DELEG4res { /// nfsstat4 cpdr_status; /// }; ///
/// const RCA4_TYPE_MASK_RDATA_DLG = 0; /// const RCA4_TYPE_MASK_WDATA_DLG = 1; /// const RCA4_TYPE_MASK_DIR_DLG = 2; /// const RCA4_TYPE_MASK_FILE_LAYOUT = 3; /// const RCA4_TYPE_MASK_BLK_LAYOUT = 4; /// const RCA4_TYPE_MASK_OBJ_LAYOUT_MIN = 8; /// const RCA4_TYPE_MASK_OBJ_LAYOUT_MAX = 9; /// const RCA4_TYPE_MASK_OTHER_LAYOUT_MIN = 12; /// const RCA4_TYPE_MASK_OTHER_LAYOUT_MAX = 15; /// /// struct CB_RECALL_ANY4args { /// uint32_t craa_objects_to_keep; /// bitmap4 craa_type_mask; /// }; /// /// struct CB_RECALL_ANY4res { /// nfsstat4 crar_status; /// }; /// /// typedef CB_RECALL_ANY4args CB_RECALLABLE_OBJ_AVAIL4args; /// /// struct CB_RECALLABLE_OBJ_AVAIL4res { /// nfsstat4 croa_status; /// }; /// /// struct CB_RECALL_SLOT4args { /// slotid4 rsa_target_highest_slotid; /// }; /// /// struct CB_RECALL_SLOT4res { /// nfsstat4 rsr_status; /// }; /// /// struct referring_call4 { /// sequenceid4 rc_sequenceid; /// slotid4 rc_slotid; /// }; /// /// struct referring_call_list4 { /// sessionid4 rcl_sessionid; /// referring_call4 rcl_referring_calls<>; /// }; ///
/// struct CB_SEQUENCE4args { /// sessionid4 csa_sessionid; /// sequenceid4 csa_sequenceid; /// slotid4 csa_slotid; /// slotid4 csa_highest_slotid; /// bool csa_cachethis; /// referring_call_list4 csa_referring_call_lists<>; /// }; /// /// struct CB_SEQUENCE4resok { /// sessionid4 csr_sessionid; /// sequenceid4 csr_sequenceid; /// slotid4 csr_slotid; /// slotid4 csr_highest_slotid; /// slotid4 csr_target_highest_slotid; /// }; /// /// union CB_SEQUENCE4res switch (nfsstat4 csr_status) { /// case NFS4_OK: /// CB_SEQUENCE4resok csr_resok4; /// default: /// void; /// }; /// /// struct CB_WANTS_CANCELLED4args { /// bool cwca_contended_wants_cancelled; /// bool cwca_resourced_wants_cancelled; /// }; /// /// struct CB_WANTS_CANCELLED4res { /// nfsstat4 cwcr_status; /// }; /// /// struct CB_NOTIFY_LOCK4args { /// nfs_fh4 cnla_fh; /// lock_owner4 cnla_lock_owner; /// }; /// /// struct CB_NOTIFY_LOCK4res { /// nfsstat4 cnlr_status; /// }; ///
/// /* /// * Device notification types /// */ /// enum notify_deviceid_type4 { /// NOTIFY_DEVICEID4_CHANGE = 1, /// NOTIFY_DEVICEID4_DELETE = 2 /// }; /// /// /* For NOTIFY4_DEVICEID4_DELETE */ /// struct notify_deviceid_delete4 { /// layouttype4 ndd_layouttype; /// deviceid4 ndd_deviceid; /// }; /// /// /* For NOTIFY4_DEVICEID4_CHANGE */ /// struct notify_deviceid_change4 { /// layouttype4 ndc_layouttype; /// deviceid4 ndc_deviceid; /// bool ndc_immediate; /// }; /// /// struct CB_NOTIFY_DEVICEID4args { /// notify4 cnda_changes<>; /// }; /// /// struct CB_NOTIFY_DEVICEID4res { /// nfsstat4 cndr_status; /// }; /// /// union offload_info4 switch (nfsstat4 coa_status) { /// case NFS4_OK: /// write_response4 coa_resok4; /// default: /// length4 coa_bytes_copied; /// }; /// struct CB_OFFLOAD4args { /// nfs_fh4 coa_fh; /// stateid4 coa_stateid; /// offload_info4 coa_offload_info; /// }; /// struct CB_OFFLOAD4res { /// nfsstat4 cor_status; /// };
/// /* /// * Various definitions for CB_COMPOUND /// */ /// % /// enum nfs_cb_opnum4 { /// OP_CB_GETATTR = 3, /// OP_CB_RECALL = 4, /// %/* Callback operations new to NFSv4.1 */ /// OP_CB_LAYOUTRECALL = 5, /// OP_CB_NOTIFY = 6, /// OP_CB_PUSH_DELEG = 7, /// OP_CB_RECALL_ANY = 8, /// OP_CB_RECALLABLE_OBJ_AVAIL = 9, /// OP_CB_RECALL_SLOT = 10, /// OP_CB_SEQUENCE = 11, /// OP_CB_WANTS_CANCELLED = 12, /// OP_CB_NOTIFY_LOCK = 13, /// OP_CB_NOTIFY_DEVICEID = 14, /// %/* Callback operations new to NFSv4.2 */ /// OP_CB_OFFLOAD = 15, /// /// OP_CB_ILLEGAL = 10044 /// }; /// /// union nfs_cb_argop4 switch (nfs_cb_opnum4 argop) { /// case OP_CB_GETATTR: /// CB_GETATTR4args opcbgetattr; /// /// /* New NFSv4.1 operations */ /// case OP_CB_RECALL: /// CB_RECALL4args opcbrecall; /// case OP_CB_LAYOUTRECALL: /// CB_LAYOUTRECALL4args opcblayoutrecall; /// case OP_CB_NOTIFY: /// CB_NOTIFY4args opcbnotify; /// case OP_CB_PUSH_DELEG: /// CB_PUSH_DELEG4args opcbpush_deleg; /// case OP_CB_RECALL_ANY: /// CB_RECALL_ANY4args opcbrecall_any; /// case OP_CB_RECALLABLE_OBJ_AVAIL: /// CB_RECALLABLE_OBJ_AVAIL4args opcbrecallable_obj_avail; /// case OP_CB_RECALL_SLOT: /// CB_RECALL_SLOT4args opcbrecall_slot; /// case OP_CB_SEQUENCE: /// CB_SEQUENCE4args opcbsequence;
/// case OP_CB_WANTS_CANCELLED: /// CB_WANTS_CANCELLED4args opcbwants_cancelled; /// case OP_CB_NOTIFY_LOCK: /// CB_NOTIFY_LOCK4args opcbnotify_lock; /// case OP_CB_NOTIFY_DEVICEID: /// CB_NOTIFY_DEVICEID4args opcbnotify_deviceid; /// /// /* New NFSv4.2 operations */ /// case OP_CB_OFFLOAD: /// CB_OFFLOAD4args opcboffload; /// /// case OP_CB_ILLEGAL: void; /// }; /// /// union nfs_cb_resop4 switch (nfs_cb_opnum4 resop) { /// case OP_CB_GETATTR: CB_GETATTR4res opcbgetattr; /// case OP_CB_RECALL: CB_RECALL4res opcbrecall; /// /// /* New NFSv4.1 operations */ /// case OP_CB_LAYOUTRECALL: /// CB_LAYOUTRECALL4res /// opcblayoutrecall; /// /// case OP_CB_NOTIFY: CB_NOTIFY4res opcbnotify; /// /// case OP_CB_PUSH_DELEG: CB_PUSH_DELEG4res /// opcbpush_deleg; /// /// case OP_CB_RECALL_ANY: CB_RECALL_ANY4res /// opcbrecall_any; /// /// case OP_CB_RECALLABLE_OBJ_AVAIL: /// CB_RECALLABLE_OBJ_AVAIL4res /// opcbrecallable_obj_avail; /// /// case OP_CB_RECALL_SLOT: /// CB_RECALL_SLOT4res /// opcbrecall_slot; /// /// case OP_CB_SEQUENCE: CB_SEQUENCE4res opcbsequence; /// /// case OP_CB_WANTS_CANCELLED: /// CB_WANTS_CANCELLED4res /// opcbwants_cancelled; ///
/// case OP_CB_NOTIFY_LOCK: /// CB_NOTIFY_LOCK4res /// opcbnotify_lock; /// /// case OP_CB_NOTIFY_DEVICEID: /// CB_NOTIFY_DEVICEID4res /// opcbnotify_deviceid; /// /// /* New NFSv4.2 operations */ /// case OP_CB_OFFLOAD: CB_OFFLOAD4res opcboffload; /// /// /* Not new operation */ /// case OP_CB_ILLEGAL: CB_ILLEGAL4res opcbillegal; /// }; /// /// /// struct CB_COMPOUND4args { /// utf8str_cs tag; /// uint32_t minorversion; /// uint32_t callback_ident; /// nfs_cb_argop4 argarray<>; /// }; /// /// struct CB_COMPOUND4res { /// nfsstat4 status; /// utf8str_cs tag; /// nfs_cb_resop4 resarray<>; /// }; /// /// /// /// /* /// * Program number is in the transient range, since the client /// * will assign the exact transient program number and provide /// * that to the server via the CREATE_SESSION or /// * BACKCHANNEL_CTL operations. /// */ /// program NFS4_CALLBACK { /// version NFS_CB { /// void /// CB_NULL(void) = 0; /// CB_COMPOUND4res /// CB_COMPOUND(CB_COMPOUND4args) = 1; /// } = 1; /// } = 0x40000000; <CODE ENDS>
3. Security Considerations
See the Security Considerations section of [RFC7862].4. IANA Considerations
See the IANA Considerations section of [RFC7862].5. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <http://www.rfc-editor.org/info/rfc2119>. [RFC4506] Eisler, M., Ed., "XDR: External Data Representation Standard", STD 67, RFC 4506, DOI 10.17487/RFC4506, May 2006, <http://www.rfc-editor.org/info/rfc4506>. [RFC5662] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., "Network File System (NFS) Version 4 Minor Version 1 External Data Representation Standard (XDR) Description", RFC 5662, DOI 10.17487/RFC5662, January 2010, <http://www.rfc-editor.org/info/rfc5662>. [RFC7531] Haynes, T., Ed., and D. Noveck, Ed., "Network File System (NFS) Version 4 External Data Representation Standard (XDR) Description", RFC 7531, DOI 10.17487/RFC7531, March 2015, <http://www.rfc-editor.org/info/rfc7531>. [RFC7862] Haynes, T., "Network File System (NFS) Version 4 Minor Version 2 Protocol", RFC 7862, DOI 10.17487/RFC7862, November 2016, <http://www.rfc-editor.org/info/rfc7862>.
Acknowledgments
Tom Haynes would like to thank NetApp, Inc. for its funding of his time on this project.Author's Address
Thomas Haynes Primary Data, Inc. 4300 El Camino Real Ste 100 Los Altos, CA 94022 United States of America Phone: +1 408 215 1519 Email: thomas.haynes@primarydata.com