diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..0a04128 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/NFSLibrary/NFSLibrary.csproj b/NFSLibrary/NFSLibrary.csproj deleted file mode 100644 index 1171b46..0000000 --- a/NFSLibrary/NFSLibrary.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - netstandard2.1 - 8.0 - Randy von der Weide - NFS-Client - NFS-Client - https://github.com/SonnyX/NFS-Client - nfs nfs-client - 1.0.0 - - \ No newline at end of file diff --git a/NFS-Client.sln b/src/NFS-Client.sln similarity index 50% rename from NFS-Client.sln rename to src/NFS-Client.sln index 773eec3..ed8584b 100644 --- a/NFS-Client.sln +++ b/src/NFS-Client.sln @@ -1,10 +1,14 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30804.86 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34723.18 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NFSLibrary", "NFSLibrary\NFSLibrary.csproj", "{3BAE52C4-75A4-427A-A751-D03459920F79}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.Client", "Test.Client\Test.Client.csproj", "{2E411995-07ED-489A-A437-1E946C8E06B2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Nfs", "Test.Nfs\Test.Nfs.csproj", "{995FA4DB-F5DA-41B0-A025-5827DC392208}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +19,14 @@ Global {3BAE52C4-75A4-427A-A751-D03459920F79}.Debug|Any CPU.Build.0 = Debug|Any CPU {3BAE52C4-75A4-427A-A751-D03459920F79}.Release|Any CPU.ActiveCfg = Release|Any CPU {3BAE52C4-75A4-427A-A751-D03459920F79}.Release|Any CPU.Build.0 = Release|Any CPU + {2E411995-07ED-489A-A437-1E946C8E06B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E411995-07ED-489A-A437-1E946C8E06B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E411995-07ED-489A-A437-1E946C8E06B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E411995-07ED-489A-A437-1E946C8E06B2}.Release|Any CPU.Build.0 = Release|Any CPU + {995FA4DB-F5DA-41B0-A025-5827DC392208}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {995FA4DB-F5DA-41B0-A025-5827DC392208}.Debug|Any CPU.Build.0 = Debug|Any CPU + {995FA4DB-F5DA-41B0-A025-5827DC392208}.Release|Any CPU.ActiveCfg = Release|Any CPU + {995FA4DB-F5DA-41B0-A025-5827DC392208}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/NFSLibrary/NFS.cs b/src/NFSLibrary/NFS.cs similarity index 100% rename from NFSLibrary/NFS.cs rename to src/NFSLibrary/NFS.cs diff --git a/src/NFSLibrary/NFSLibrary.csproj b/src/NFSLibrary/NFSLibrary.csproj new file mode 100644 index 0000000..fc76cf7 --- /dev/null +++ b/src/NFSLibrary/NFSLibrary.csproj @@ -0,0 +1,13 @@ + + + + netstandard2.1 + 8.0 + Randy von der Weide + NFS-Client + NFS-Client + https://github.com/SonnyX/NFS-Client + nfs nfs-client + 1.0.1 + + \ No newline at end of file diff --git a/NFSLibrary/Protocols/Commons/Enumerators.cs b/src/NFSLibrary/Protocols/Commons/Enumerators.cs similarity index 99% rename from NFSLibrary/Protocols/Commons/Enumerators.cs rename to src/NFSLibrary/Protocols/Commons/Enumerators.cs index 2703541..990a6aa 100644 --- a/NFSLibrary/Protocols/Commons/Enumerators.cs +++ b/src/NFSLibrary/Protocols/Commons/Enumerators.cs @@ -5,7 +5,7 @@ */ /** * Enumeration (collection of constants). - */ + */ namespace NFSLibrary.Protocols.Commons { @@ -62,40 +62,40 @@ public enum NFSMountStats MNTERR_PERM = 1, /* Not owner */ MNTERR_NOENT = 2, /* No such file or directory */ MNTERR_SRCH = 3, /* No such process */ - MNTERR_INTR = 4, /* Interrupted system call */ + MNTERR_INTR = 4, /* Interrupted system call */ MNTERR_IO = 5, /* I/O error */ - MNTERR_NXIO = 6, /* No such device or address */ - MNTERR_TOOBIG = 7, /* Arg list too long */ - MNTERR_NOEXEC = 8, /* Exec format error */ - MNTERR_BADF = 9, /* Bad file number */ - MNTERR_CHILD = 10, /* No child processes */ + MNTERR_NXIO = 6, /* No such device or address */ + MNTERR_TOOBIG = 7, /* Arg list too long */ + MNTERR_NOEXEC = 8, /* Exec format error */ + MNTERR_BADF = 9, /* Bad file number */ + MNTERR_CHILD = 10, /* No child processes */ MNTERR_AGAIN = 11, /* Try again (Linux), No more processes (SCO Unix) */ MNTERR_NOMEM = 12, /* Out of memory (Linux), Not enough space (SCO Unix) */ MNTERR_ACCES = 13, /* Permission denied */ - MNTERR_FAULT = 14, /* Bad address */ + MNTERR_FAULT = 14, /* Bad address */ MNTERR_NOTBLK = 15, /* Block device required */ - MNTERR_BUSY = 16, /* Device or resource busy (Linux), Device busy (SCO Unix) */ - MNTERR_EXIST = 17, /* File exists */ - MNTERR_XDEV = 18, /* Cross-device link */ - MNTERR_NODEV = 19, /* No such device */ + MNTERR_BUSY = 16, /* Device or resource busy (Linux), Device busy (SCO Unix) */ + MNTERR_EXIST = 17, /* File exists */ + MNTERR_XDEV = 18, /* Cross-device link */ + MNTERR_NODEV = 19, /* No such device */ MNTERR_NOTDIR = 20, /* Not a directory */ - MNTERR_ISDIR = 21, /* Is a directory */ + MNTERR_ISDIR = 21, /* Is a directory */ MNTERR_INVAL = 22, /* Invalid argument */ - MNTERR_NFILE = 23, /* File table overflow */ - MNTERR_MFILE = 24, /* Too many open files */ - MNTERR_NOTTY = 25, /* Not a typewriter */ - MNTERR_TXTBSY = 26, /* Text file busy */ - MNTERR_FBIG = 27, /* File too large */ - MNTERR_NOSPC = 28, /* No space left on device */ - MNTERR_SPIPE = 29, /* Illegal seek */ - MNTERR_ROFS = 30, /* Read-only file system */ - MNTERR_MLINK = 31, /* Too many links */ - MNTERR_PIPE = 32, /* Broken pipe */ + MNTERR_NFILE = 23, /* File table overflow */ + MNTERR_MFILE = 24, /* Too many open files */ + MNTERR_NOTTY = 25, /* Not a typewriter */ + MNTERR_TXTBSY = 26, /* Text file busy */ + MNTERR_FBIG = 27, /* File too large */ + MNTERR_NOSPC = 28, /* No space left on device */ + MNTERR_SPIPE = 29, /* Illegal seek */ + MNTERR_ROFS = 30, /* Read-only file system */ + MNTERR_MLINK = 31, /* Too many links */ + MNTERR_PIPE = 32, /* Broken pipe */ MNTERR_NAMETOOLONG = 63, /* Filename too long */ MNTERR_NOTSUPP = 10004, /* Operation not supported */ MNTERR_SERVERFAULT = 10006 /* A failure on the server */ }; - + // End of nfsstat.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/Commons/Exceptions.cs b/src/NFSLibrary/Protocols/Commons/Exceptions.cs similarity index 99% rename from NFSLibrary/Protocols/Commons/Exceptions.cs rename to src/NFSLibrary/Protocols/Commons/Exceptions.cs index 6ad5b1e..9a17955 100644 --- a/NFSLibrary/Protocols/Commons/Exceptions.cs +++ b/src/NFSLibrary/Protocols/Commons/Exceptions.cs @@ -5,7 +5,7 @@ */ /** * Enumeration (collection of constants). - */ + */ using System; @@ -66,8 +66,8 @@ public static void ThrowException(NFSStats ErrorCode) switch (ErrorCode) { case NFSStats.NFSERR_ACCES: - throw new NFSAuthenticationException(Message); - + throw new NFSAuthenticationException(Message); + case NFSStats.NFSERR_DQUOT: case NFSStats.NFSERR_EXIST: case NFSStats.NFSERR_FBIG: @@ -226,8 +226,8 @@ public static void ThrowException(NFSMountStats ErrorCode) switch (ErrorCode) { case NFSMountStats.MNTERR_ACCES: - throw new NFSMountAuthenticationException(Message); - + throw new NFSMountAuthenticationException(Message); + case NFSMountStats.MNTERR_EXIST: case NFSMountStats.MNTERR_FBIG: case NFSMountStats.MNTERR_IO: diff --git a/NFSLibrary/Protocols/Commons/Exports.cs b/src/NFSLibrary/Protocols/Commons/Exports.cs similarity index 99% rename from NFSLibrary/Protocols/Commons/Exports.cs rename to src/NFSLibrary/Protocols/Commons/Exports.cs index 0a53c0a..a8ed22a 100644 --- a/NFSLibrary/Protocols/Commons/Exports.cs +++ b/src/NFSLibrary/Protocols/Commons/Exports.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -87,6 +87,6 @@ public Exports Next { return this._next; } } } - + // End of exports.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/Commons/Groups.cs b/src/NFSLibrary/Protocols/Commons/Groups.cs similarity index 99% rename from NFSLibrary/Protocols/Commons/Groups.cs rename to src/NFSLibrary/Protocols/Commons/Groups.cs index 9b4eea5..6cb783f 100644 --- a/NFSLibrary/Protocols/Commons/Groups.cs +++ b/src/NFSLibrary/Protocols/Commons/Groups.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -78,6 +78,6 @@ public Groups NextGroup { return this._grnext; } } } - + // End of groups.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/Commons/INFS.cs b/src/NFSLibrary/Protocols/Commons/INFS.cs similarity index 100% rename from NFSLibrary/Protocols/Commons/INFS.cs rename to src/NFSLibrary/Protocols/Commons/INFS.cs diff --git a/NFSLibrary/Protocols/Commons/NFSAttributes.cs b/src/NFSLibrary/Protocols/Commons/NFSAttributes.cs similarity index 100% rename from NFSLibrary/Protocols/Commons/NFSAttributes.cs rename to src/NFSLibrary/Protocols/Commons/NFSAttributes.cs diff --git a/NFSLibrary/Protocols/Commons/NFSHandle.cs b/src/NFSLibrary/Protocols/Commons/NFSHandle.cs similarity index 99% rename from NFSLibrary/Protocols/Commons/NFSHandle.cs rename to src/NFSLibrary/Protocols/Commons/NFSHandle.cs index 92bc52e..0c656e6 100644 --- a/NFSLibrary/Protocols/Commons/NFSHandle.cs +++ b/src/NFSLibrary/Protocols/Commons/NFSHandle.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -50,11 +50,11 @@ public void xdrDecode(XdrDecodingStream xdr) switch (this._version) { case 2: - this._value = xdr.xdrDecodeOpaque(V2.RPC.NFSv2Protocol.FHSIZE); + this._value = xdr.xdrDecodeOpaque(V2.RPC.NFSv2Protocol.FHSIZE); break; case 3: - this._value = xdr.xdrDecodeDynamicOpaque(); + this._value = xdr.xdrDecodeDynamicOpaque(); break; } } @@ -73,6 +73,6 @@ public int Version { this._version = value; } } } - + // End of nfshandle.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/Commons/NFSPermission.cs b/src/NFSLibrary/Protocols/Commons/NFSPermission.cs similarity index 100% rename from NFSLibrary/Protocols/Commons/NFSPermission.cs rename to src/NFSLibrary/Protocols/Commons/NFSPermission.cs diff --git a/NFSLibrary/Protocols/Commons/NFSTimeValue.cs b/src/NFSLibrary/Protocols/Commons/NFSTimeValue.cs similarity index 99% rename from NFSLibrary/Protocols/Commons/NFSTimeValue.cs rename to src/NFSLibrary/Protocols/Commons/NFSTimeValue.cs index 6e8e97b..b88a02a 100644 --- a/NFSLibrary/Protocols/Commons/NFSTimeValue.cs +++ b/src/NFSLibrary/Protocols/Commons/NFSTimeValue.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -50,6 +50,6 @@ public int UnixSeconds { this._useconds = value; } } } - + // End of nfstimeval.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/Commons/Name.cs b/src/NFSLibrary/Protocols/Commons/Name.cs similarity index 99% rename from NFSLibrary/Protocols/Commons/Name.cs rename to src/NFSLibrary/Protocols/Commons/Name.cs index 7ff63c9..c6c661d 100644 --- a/NFSLibrary/Protocols/Commons/Name.cs +++ b/src/NFSLibrary/Protocols/Commons/Name.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; using System; @@ -36,6 +36,6 @@ public String Value { this._value = value; } } } - + // End of filename.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/NFSv2.cs b/src/NFSLibrary/Protocols/V2/NFSv2.cs similarity index 100% rename from NFSLibrary/Protocols/V2/NFSv2.cs rename to src/NFSLibrary/Protocols/V2/NFSv2.cs diff --git a/NFSLibrary/Protocols/V2/RPC/CreateArguments.cs b/src/NFSLibrary/Protocols/V2/RPC/CreateArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/CreateArguments.cs rename to src/NFSLibrary/Protocols/V2/RPC/CreateArguments.cs index 9af432c..aebd491 100644 --- a/NFSLibrary/Protocols/V2/RPC/CreateArguments.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/CreateArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -132,6 +132,6 @@ public NFSTimeValue ModifiedTime { this._mtime = value; } } } - + // End of createargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/Entry.cs b/src/NFSLibrary/Protocols/V2/RPC/Entry.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/Entry.cs rename to src/NFSLibrary/Protocols/V2/RPC/Entry.cs index 49285c3..8ba5550 100644 --- a/NFSLibrary/Protocols/V2/RPC/Entry.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/Entry.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -78,6 +78,6 @@ public Entry NextEntry { return this._nextentry; } } } - + // End of entry.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/FSStatStatus.cs b/src/NFSLibrary/Protocols/V2/RPC/FSStatStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/FSStatStatus.cs rename to src/NFSLibrary/Protocols/V2/RPC/FSStatStatus.cs index e99eb7f..5c0bacf 100644 --- a/NFSLibrary/Protocols/V2/RPC/FSStatStatus.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/FSStatStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -62,6 +62,6 @@ public Info OK { return this._ok; } } } - + // End of statfsres.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/FileArguments.cs b/src/NFSLibrary/Protocols/V2/RPC/FileArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/FileArguments.cs rename to src/NFSLibrary/Protocols/V2/RPC/FileArguments.cs index 29d67c2..6f76ec3 100644 --- a/NFSLibrary/Protocols/V2/RPC/FileArguments.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/FileArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -50,6 +50,6 @@ public CreateAttributes Attributes { this._attributes = value; } } } - + // End of sattrargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/FileAttributes.cs b/src/NFSLibrary/Protocols/V2/RPC/FileAttributes.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/FileAttributes.cs rename to src/NFSLibrary/Protocols/V2/RPC/FileAttributes.cs index 88214ad..18629e2 100644 --- a/NFSLibrary/Protocols/V2/RPC/FileAttributes.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/FileAttributes.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -52,11 +52,11 @@ public void xdrEncode(XdrEncodingStream xdr) public void xdrDecode(XdrDecodingStream xdr) { - this._type = (NFSItemTypes)xdr.xdrDecodeInt(); - + this._type = (NFSItemTypes)xdr.xdrDecodeInt(); + this._mode = new NFSPermission(); - this._mode.Mode = xdr.xdrDecodeInt(); - + this._mode.Mode = xdr.xdrDecodeInt(); + this._nlink = xdr.xdrDecodeInt(); this._uid = xdr.xdrDecodeInt(); this._gid = xdr.xdrDecodeInt(); @@ -177,6 +177,6 @@ public NFSTimeValue CreateTime { return this._ctime; } } } - + // End of fattr.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/FileStatus.cs b/src/NFSLibrary/Protocols/V2/RPC/FileStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/FileStatus.cs rename to src/NFSLibrary/Protocols/V2/RPC/FileStatus.cs index 1543a9f..5265b8c 100644 --- a/NFSLibrary/Protocols/V2/RPC/FileStatus.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/FileStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -62,6 +62,6 @@ public FileAttributes Attributes { return this._attributes; } } } - + // End of attrstat.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/Info.cs b/src/NFSLibrary/Protocols/V2/RPC/Info.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/Info.cs rename to src/NFSLibrary/Protocols/V2/RPC/Info.cs index 58650de..e910eb9 100644 --- a/NFSLibrary/Protocols/V2/RPC/Info.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/Info.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -70,6 +70,6 @@ public int BAvailable { return this._bavail; } } } - + // End of info.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/ItemArguments.cs b/src/NFSLibrary/Protocols/V2/RPC/ItemArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/ItemArguments.cs rename to src/NFSLibrary/Protocols/V2/RPC/ItemArguments.cs index f62492c..867ee07 100644 --- a/NFSLibrary/Protocols/V2/RPC/ItemArguments.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/ItemArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -61,6 +61,6 @@ public int Count { this._count = value; } } } - + // End of readdirargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/ItemOperationArguments.cs b/src/NFSLibrary/Protocols/V2/RPC/ItemOperationArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/ItemOperationArguments.cs rename to src/NFSLibrary/Protocols/V2/RPC/ItemOperationArguments.cs index 5d7485d..f91e82a 100644 --- a/NFSLibrary/Protocols/V2/RPC/ItemOperationArguments.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/ItemOperationArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -50,6 +50,6 @@ public Name Name { this._name = value; } } } - + // End of diropargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/ItemOperationStatus.cs b/src/NFSLibrary/Protocols/V2/RPC/ItemOperationStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/ItemOperationStatus.cs rename to src/NFSLibrary/Protocols/V2/RPC/ItemOperationStatus.cs index e44e4d9..d3d61a4 100644 --- a/NFSLibrary/Protocols/V2/RPC/ItemOperationStatus.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/ItemOperationStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -100,6 +100,6 @@ public FileAttributes Attributes { return this._attributes; } } } - + // End of diropres.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/ItemStatus.cs b/src/NFSLibrary/Protocols/V2/RPC/ItemStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/ItemStatus.cs rename to src/NFSLibrary/Protocols/V2/RPC/ItemStatus.cs index 98cfa5b..61e7440 100644 --- a/NFSLibrary/Protocols/V2/RPC/ItemStatus.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/ItemStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -104,6 +104,6 @@ public bool EOF { return this._eof; } } } - + // End of readdirres.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/LinkArguments.cs b/src/NFSLibrary/Protocols/V2/RPC/LinkArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/LinkArguments.cs rename to src/NFSLibrary/Protocols/V2/RPC/LinkArguments.cs index 549e08b..d4c59de 100644 --- a/NFSLibrary/Protocols/V2/RPC/LinkArguments.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/LinkArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -46,6 +46,6 @@ public ItemOperationArguments To { return this._to; } } } - + // End of linkargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/LinkStatus.cs b/src/NFSLibrary/Protocols/V2/RPC/LinkStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/LinkStatus.cs rename to src/NFSLibrary/Protocols/V2/RPC/LinkStatus.cs index 7ce1e5b..1c2aab7 100644 --- a/NFSLibrary/Protocols/V2/RPC/LinkStatus.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/LinkStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -62,6 +62,6 @@ public Name LinkName { return this._linkname; } } } - + // End of readlinkres.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/Mount/MountList.cs b/src/NFSLibrary/Protocols/V2/RPC/Mount/MountList.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/Mount/MountList.cs rename to src/NFSLibrary/Protocols/V2/RPC/Mount/MountList.cs index 2eb8fb2..12a037f 100644 --- a/NFSLibrary/Protocols/V2/RPC/Mount/MountList.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/Mount/MountList.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -90,6 +90,6 @@ public MountList NextEntry { return this._nextentry; } } } - + // End of mountlist.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/Mount/MountStatus.cs b/src/NFSLibrary/Protocols/V2/RPC/Mount/MountStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/Mount/MountStatus.cs rename to src/NFSLibrary/Protocols/V2/RPC/Mount/MountStatus.cs index 61b12a4..83a3c3c 100644 --- a/NFSLibrary/Protocols/V2/RPC/Mount/MountStatus.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/Mount/MountStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -66,6 +66,6 @@ public NFSMountStats Status { return this._status; } } } - + // End of fhstatus.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocol.cs b/src/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocol.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocol.cs rename to src/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocol.cs index d9299d8..d3b4798 100644 --- a/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocol.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocol.cs @@ -5,7 +5,7 @@ */ /** * A collection of constants used by the "NFSv2MountProtocol" ONC/RPC program. - */ + */ namespace NFSLibrary.Protocols.V2.RPC.Mount { @@ -25,6 +25,6 @@ public class NFSv2MountProtocol public const int MNTNAMLEN = 255; public const int FHSIZE = 32; } - + // End of NFSv2MountProtocol.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolClient.cs b/src/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolClient.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolClient.cs rename to src/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolClient.cs index 2016d55..b1c9c59 100644 --- a/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolClient.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolClient.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -12,7 +12,7 @@ * The class NFSv2MountProtocolClient implements the client stub proxy * for the MOUNTPROG remote program. It provides method stubs * which, when called, in turn call the appropriate remote method (procedure). - */ + */ namespace NFSLibrary.Protocols.V2.RPC.Mount { @@ -26,7 +26,7 @@ public class NFSv2MountProtocolClient : OncRpcClientStub * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv2MountProtocolClient(IPAddress host, int protocol) : base(host, NFSv2MountProtocol.MOUNTPROG, 1, 0, protocol, true) @@ -47,7 +47,7 @@ public NFSv2MountProtocolClient(IPAddress host, int protocol, bool useSecurePort * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv2MountProtocolClient(IPAddress host, int port, int protocol) : base(host, NFSv2MountProtocol.MOUNTPROG, 1, port, protocol, true) @@ -61,7 +61,7 @@ public NFSv2MountProtocolClient(IPAddress host, int port, int protocol) * protocol. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv2MountProtocolClient(OncRpcClient client) : base(client) @@ -78,7 +78,7 @@ public NFSv2MountProtocolClient(OncRpcClient client) * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv2MountProtocolClient(IPAddress host, int program, int version, int protocol) : base(host, program, version, 0, protocol, true) @@ -96,7 +96,7 @@ public NFSv2MountProtocolClient(IPAddress host, int program, int version, int pr * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv2MountProtocolClient(IPAddress host, int program, int version, int port, int protocol) : base(host, program, version, port, protocol, true) @@ -112,7 +112,7 @@ public NFSv2MountProtocolClient(IPAddress host, int program, int version, int po * Call remote procedure MOUNTPROC_NULL_1. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public void MOUNTPROC_NULL() { @@ -128,7 +128,7 @@ public void MOUNTPROC_NULL() * @return Result from remote procedure call (of type fhstatus). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public MountStatus MOUNTPROC_MNT(Name arg1) { @@ -144,7 +144,7 @@ public MountStatus MOUNTPROC_MNT(Name arg1) * @return Result from remote procedure call (of type mountlist). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public MountList MOUNTPROC_DUMP() { @@ -161,7 +161,7 @@ public MountList MOUNTPROC_DUMP() * @param arg1 parameter (of type dirpath) to the remote procedure call. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public void MOUNTPROC_UMNT(Name arg1) { @@ -174,7 +174,7 @@ public void MOUNTPROC_UMNT(Name arg1) * Call remote procedure MOUNTPROC_UMNTALL_1. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public void MOUNTPROC_UMNTALL() { @@ -189,7 +189,7 @@ public void MOUNTPROC_UMNTALL() * @return Result from remote procedure call (of type exports). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public Exports MOUNTPROC_EXPORT() { @@ -201,6 +201,6 @@ public Exports MOUNTPROC_EXPORT() return result_; } } - + // End of NFSv2MountProtocolClient.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolServerStub.cs b/src/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolServerStub.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolServerStub.cs rename to src/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolServerStub.cs index 82d2502..8c08591 100644 --- a/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolServerStub.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/Mount/NFSv2MountProtocolServerStub.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -10,7 +10,7 @@ using System.Net; /** - */ + */ namespace NFSLibrary.Protocols.V2.RPC.Mount { @@ -119,6 +119,6 @@ public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int vers public abstract Exports MOUNTPROC_EXPORT(); } - + // End of NFSv2MountProtocolServerStub.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/NFSCookie.cs b/src/NFSLibrary/Protocols/V2/RPC/NFSCookie.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/NFSCookie.cs rename to src/NFSLibrary/Protocols/V2/RPC/NFSCookie.cs index def1ca8..f2a4cb7 100644 --- a/NFSLibrary/Protocols/V2/RPC/NFSCookie.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/NFSCookie.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -33,6 +33,6 @@ public int Value { return this._value; } } } - + // End of nfscookie.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/NFSv2Protocol.cs b/src/NFSLibrary/Protocols/V2/RPC/NFSv2Protocol.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/NFSv2Protocol.cs rename to src/NFSLibrary/Protocols/V2/RPC/NFSv2Protocol.cs index 81b4e02..536c6b8 100644 --- a/NFSLibrary/Protocols/V2/RPC/NFSv2Protocol.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/NFSv2Protocol.cs @@ -5,7 +5,7 @@ */ /** * A collection of constants used by the "NFSv2Protocol" ONC/RPC program. - */ + */ namespace NFSLibrary.Protocols.V2.RPC { @@ -39,6 +39,6 @@ public class NFSv2Protocol public const int MAXDATA = 8192; public const int FHSIZE = 32; } - + // End of NFSv2Protocol.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolClient.cs b/src/NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolClient.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolClient.cs rename to src/NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolClient.cs index e1ed3ab..0890327 100644 --- a/NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolClient.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolClient.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -12,7 +12,7 @@ * The class NFSv2ProtocolClient implements the client stub proxy * for the NFS_PROGRAM remote program. It provides method stubs * which, when called, in turn call the appropriate remote method (procedure). - */ + */ namespace NFSLibrary.Protocols.V2.RPC { @@ -26,7 +26,7 @@ public class NFSv2ProtocolClient : OncRpcClientStub * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv2ProtocolClient(IPAddress host, int protocol) : base(host, NFSv2Protocol.NFS_PROGRAM, 2, 0, protocol, true) @@ -36,8 +36,8 @@ public NFSv2ProtocolClient(IPAddress host, int protocol) public NFSv2ProtocolClient(IPAddress host, int protocol, bool useSecurePort) : base(host, NFSv2Protocol.NFS_PROGRAM, 2, 0, protocol, useSecurePort) { - } - + } + /** * Constructs a NFSv2ProtocolClient client stub proxy object * from which the NFS_PROGRAM remote program can be accessed. @@ -47,8 +47,8 @@ public NFSv2ProtocolClient(IPAddress host, int protocol, bool useSecurePort) * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ - + */ + public NFSv2ProtocolClient(IPAddress host, int port, int protocol) : base(host, NFSv2Protocol.NFS_PROGRAM, 2, port, protocol, true) { @@ -61,7 +61,7 @@ public NFSv2ProtocolClient(IPAddress host, int port, int protocol) * protocol. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv2ProtocolClient(OncRpcClient client) : base(client) @@ -78,7 +78,7 @@ public NFSv2ProtocolClient(OncRpcClient client) * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv2ProtocolClient(IPAddress host, int program, int version, int protocol) : base(host, program, version, 0, protocol, true) @@ -96,7 +96,7 @@ public NFSv2ProtocolClient(IPAddress host, int program, int version, int protoco * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv2ProtocolClient(IPAddress host, int program, int version, int port, int protocol) : base(host, program, version, port, protocol, true) @@ -112,7 +112,7 @@ public NFSv2ProtocolClient(IPAddress host, int program, int version, int port, i * Call remote procedure NFSPROC_NULL_2. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public void NFSPROC_NULL() { @@ -128,7 +128,7 @@ public void NFSPROC_NULL() * @return Result from remote procedure call (of type attrstat). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public FileStatus NFSPROC_GETATTR(NFSHandle arg1) { @@ -145,7 +145,7 @@ public FileStatus NFSPROC_GETATTR(NFSHandle arg1) * @return Result from remote procedure call (of type attrstat). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public FileStatus NFSPROC_SETATTR(FileArguments arg1) { @@ -160,7 +160,7 @@ public FileStatus NFSPROC_SETATTR(FileArguments arg1) * Call remote procedure NFSPROC_ROOT_2. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public void NFSPROC_ROOT() { @@ -176,7 +176,7 @@ public void NFSPROC_ROOT() * @return Result from remote procedure call (of type diropres). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ItemOperationStatus NFSPROC_LOOKUP(ItemOperationArguments arg1) { @@ -193,7 +193,7 @@ public ItemOperationStatus NFSPROC_LOOKUP(ItemOperationArguments arg1) * @return Result from remote procedure call (of type readlinkres). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public LinkStatus NFSPROC_READLINK(NFSHandle arg1) { @@ -210,7 +210,7 @@ public LinkStatus NFSPROC_READLINK(NFSHandle arg1) * @return Result from remote procedure call (of type readres). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ReadStatus NFSPROC_READ(ReadArguments arg1) { @@ -225,7 +225,7 @@ public ReadStatus NFSPROC_READ(ReadArguments arg1) * Call remote procedure NFSPROC_WRITECACHE_2. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public void NFSPROC_WRITECACHE() { @@ -241,7 +241,7 @@ public void NFSPROC_WRITECACHE() * @return Result from remote procedure call (of type attrstat). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public FileStatus NFSPROC_WRITE(WriteArguments arg1) { @@ -258,7 +258,7 @@ public FileStatus NFSPROC_WRITE(WriteArguments arg1) * @return Result from remote procedure call (of type diropres). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ItemOperationStatus NFSPROC_CREATE(CreateArguments arg1) { @@ -275,7 +275,7 @@ public ItemOperationStatus NFSPROC_CREATE(CreateArguments arg1) * @return Result from remote procedure call (of type nfsstat). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public int NFSPROC_REMOVE(ItemOperationArguments arg1) { @@ -292,7 +292,7 @@ public int NFSPROC_REMOVE(ItemOperationArguments arg1) * @return Result from remote procedure call (of type nfsstat). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public int NFSPROC_RENAME(RenameArguments arg1) { @@ -309,7 +309,7 @@ public int NFSPROC_RENAME(RenameArguments arg1) * @return Result from remote procedure call (of type nfsstat). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public int NFSPROC_LINK(LinkArguments arg1) { @@ -326,7 +326,7 @@ public int NFSPROC_LINK(LinkArguments arg1) * @return Result from remote procedure call (of type nfsstat). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public int NFSPROC_SYMLINK(SymlinkArguments arg1) { @@ -343,7 +343,7 @@ public int NFSPROC_SYMLINK(SymlinkArguments arg1) * @return Result from remote procedure call (of type diropres). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ItemOperationStatus NFSPROC_MKDIR(CreateArguments arg1) { @@ -360,7 +360,7 @@ public ItemOperationStatus NFSPROC_MKDIR(CreateArguments arg1) * @return Result from remote procedure call (of type nfsstat). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public int NFSPROC_RMDIR(ItemOperationArguments arg1) { @@ -377,7 +377,7 @@ public int NFSPROC_RMDIR(ItemOperationArguments arg1) * @return Result from remote procedure call (of type readdirres). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ItemStatus NFSPROC_READDIR(ItemArguments arg1) { @@ -394,7 +394,7 @@ public ItemStatus NFSPROC_READDIR(ItemArguments arg1) * @return Result from remote procedure call (of type statfsres). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public FSStatStatus NFSPROC_STATFS(NFSHandle arg1) { @@ -405,6 +405,6 @@ public FSStatStatus NFSPROC_STATFS(NFSHandle arg1) return result_; } } - + // End of NFSv2ProtocolClient.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolServerStub.cs b/src/NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolServerStub.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolServerStub.cs rename to src/NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolServerStub.cs index ecab2bb..f20f62a 100644 --- a/NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolServerStub.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/NFSv2ProtocolServerStub.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -10,7 +10,7 @@ using System.Net; /** - */ + */ namespace NFSLibrary.Protocols.V2.RPC { @@ -267,6 +267,6 @@ public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int vers public abstract FSStatStatus NFSPROC_STATFS(NFSHandle arg1); } - + // End of NFSv2ProtocolServerStub.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/ReadArguments.cs b/src/NFSLibrary/Protocols/V2/RPC/ReadArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/ReadArguments.cs rename to src/NFSLibrary/Protocols/V2/RPC/ReadArguments.cs index ae2f3bb..ec798e4 100644 --- a/NFSLibrary/Protocols/V2/RPC/ReadArguments.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/ReadArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -72,6 +72,6 @@ public int TotalCount { this._totalcount = value; } } } - + // End of readargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/ReadStatus.cs b/src/NFSLibrary/Protocols/V2/RPC/ReadStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/ReadStatus.cs rename to src/NFSLibrary/Protocols/V2/RPC/ReadStatus.cs index 252a77f..d5a2d02 100644 --- a/NFSLibrary/Protocols/V2/RPC/ReadStatus.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/ReadStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -97,6 +97,6 @@ public byte[] Data { return this._data; } } } - + // End of readres.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/RenameArguments.cs b/src/NFSLibrary/Protocols/V2/RPC/RenameArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/RenameArguments.cs rename to src/NFSLibrary/Protocols/V2/RPC/RenameArguments.cs index e373bce..dc3ca5f 100644 --- a/NFSLibrary/Protocols/V2/RPC/RenameArguments.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/RenameArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -47,6 +47,6 @@ public ItemOperationArguments To { this._to = value; } } } - + // End of renameargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/SymlinkArguments.cs b/src/NFSLibrary/Protocols/V2/RPC/SymlinkArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/SymlinkArguments.cs rename to src/NFSLibrary/Protocols/V2/RPC/SymlinkArguments.cs index 4653608..49beb8e 100644 --- a/NFSLibrary/Protocols/V2/RPC/SymlinkArguments.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/SymlinkArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -53,6 +53,6 @@ public CreateAttributes Attributes { return this._attributes; } } } - + // End of symlinkargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V2/RPC/WriteArguments.cs b/src/NFSLibrary/Protocols/V2/RPC/WriteArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V2/RPC/WriteArguments.cs rename to src/NFSLibrary/Protocols/V2/RPC/WriteArguments.cs index 70897c1..f1a73e7 100644 --- a/NFSLibrary/Protocols/V2/RPC/WriteArguments.cs +++ b/src/NFSLibrary/Protocols/V2/RPC/WriteArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -83,6 +83,6 @@ public byte[] Data { this._data = value; } } } - + // End of writeargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/NFSv3.cs b/src/NFSLibrary/Protocols/V3/NFSv3.cs similarity index 100% rename from NFSLibrary/Protocols/V3/NFSv3.cs rename to src/NFSLibrary/Protocols/V3/NFSv3.cs diff --git a/NFSLibrary/Protocols/V3/RPC/AccessArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/AccessArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/AccessArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/AccessArguments.cs index ccea936..d2648f8 100644 --- a/NFSLibrary/Protocols/V3/RPC/AccessArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/AccessArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -50,6 +50,6 @@ public int Access { this._access = value; } } } - + // End of ACCESS3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/AccessStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/AccessStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/AccessStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/AccessStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/CommitArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/CommitArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/CommitArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/CommitArguments.cs index 7678e58..a472217 100644 --- a/NFSLibrary/Protocols/V3/RPC/CommitArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/CommitArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -61,6 +61,6 @@ public int Count { this._count = value; } } } - + // End of COMMIT3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/CommitStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/CommitStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/CommitStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/CommitStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/Entry.cs b/src/NFSLibrary/Protocols/V3/RPC/Entry.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/Entry.cs rename to src/NFSLibrary/Protocols/V3/RPC/Entry.cs index 3897c0c..8b3c59c 100644 --- a/NFSLibrary/Protocols/V3/RPC/Entry.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/Entry.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -78,6 +78,6 @@ public Entry NextEntry { return this._nextentry; } } } - + // End of entry3.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderArguments.cs index d4fa01a..48fd0e7 100644 --- a/NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -83,6 +83,6 @@ public int MaximumLength { this._maxcount = value; } } } - + // End of READDIRPLUS3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderStatus.cs index c900bed..3bd14e1 100644 --- a/NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderStatus.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/ExtendedReadFolderStatus.cs @@ -2,9 +2,9 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ -using NFSLibrary.Protocols.Commons; +using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; namespace NFSLibrary.Protocols.V3.RPC @@ -204,6 +204,6 @@ public FolderEntry NextEntry { return this._nextentry; } } } - + // End of READDIRPLUS3res.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/FSInfoArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/FSInfoArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/FSInfoArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/FSInfoArguments.cs index 49af083..eb3a7dd 100644 --- a/NFSLibrary/Protocols/V3/RPC/FSInfoArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/FSInfoArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -23,7 +23,7 @@ public void xdrEncode(XdrEncodingStream xdr) { this._fsroot.xdrEncode(xdr); } public void xdrDecode(XdrDecodingStream xdr) - { + { this._fsroot = new NFSHandle(); this._fsroot.Version = V3.RPC.NFSv3Protocol.NFS_V3; this._fsroot.xdrDecode(xdr); @@ -37,6 +37,6 @@ public NFSHandle FSRoot { this._fsroot = value; } } } - + // End of FSINFO3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/FSInfoStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/FSInfoStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/FSInfoStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/FSInfoStatus.cs index 092f1ef..97b3d7e 100644 --- a/NFSLibrary/Protocols/V3/RPC/FSInfoStatus.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/FSInfoStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -148,6 +148,6 @@ public PostOperationAttributes Attributes { return this.obj_attributes; } } } - + // End of FSINFO3res.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/FSStatisticsArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/FSStatisticsArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/FSStatisticsArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/FSStatisticsArguments.cs index d02da9b..8b1aa59 100644 --- a/NFSLibrary/Protocols/V3/RPC/FSStatisticsArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/FSStatisticsArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -37,6 +37,6 @@ public NFSHandle FSRoot { this._fsroot = value; } } } - + // End of FSSTAT3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/FSStatisticsStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/FSStatisticsStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/FSStatisticsStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/FSStatisticsStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/FileAttributes.cs b/src/NFSLibrary/Protocols/V3/RPC/FileAttributes.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/FileAttributes.cs rename to src/NFSLibrary/Protocols/V3/RPC/FileAttributes.cs index 0e6cad2..f4356ee 100644 --- a/NFSLibrary/Protocols/V3/RPC/FileAttributes.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/FileAttributes.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -59,11 +59,11 @@ public void xdrDecode(XdrDecodingStream xdr) this._uid = xdr.xdrDecodeInt(); this._gid = xdr.xdrDecodeInt(); this._size = xdr.xdrDecodeLong(); - this._used = xdr.xdrDecodeLong(); - + this._used = xdr.xdrDecodeLong(); + this._rdev = new SpecInformation(); - this._rdev.xdrDecode(xdr); - + this._rdev.xdrDecode(xdr); + this._fsid = xdr.xdrDecodeLong(); this._fileid = xdr.xdrDecodeLong(); this._atime = new NFSTimeValue(xdr); @@ -149,6 +149,6 @@ public NFSTimeValue CreateTime { return this._ctime; } } } - + // End of fattr3.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/GetAttributeArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/GetAttributeArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/GetAttributeArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/GetAttributeArguments.cs index 5444292..b8041b0 100644 --- a/NFSLibrary/Protocols/V3/RPC/GetAttributeArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/GetAttributeArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -37,6 +37,6 @@ public NFSHandle Handle { this._handle = value; } } } - + // End of GETATTR3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/GetAttributeStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/GetAttributeStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/GetAttributeStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/GetAttributeStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/ItemOperationArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/ItemOperationArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/ItemOperationArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/ItemOperationArguments.cs index dc2901d..07b93c3 100644 --- a/NFSLibrary/Protocols/V3/RPC/ItemOperationArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/ItemOperationArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -50,6 +50,6 @@ public Name Name { this._name = value; } } } - + // End of diropargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/ItemOperationStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/ItemOperationStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/ItemOperationStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/ItemOperationStatus.cs index 0b8e279..07303d6 100644 --- a/NFSLibrary/Protocols/V3/RPC/ItemOperationStatus.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/ItemOperationStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -78,6 +78,6 @@ public PostOperationAttributes Attributes { return this._dir_attributes; } } } - + // End of LOOKUP3res.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/LinkArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/LinkArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/LinkArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/LinkArguments.cs index 2f2bd20..991f2c7 100644 --- a/NFSLibrary/Protocols/V3/RPC/LinkArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/LinkArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -50,6 +50,6 @@ public ItemOperationArguments Link { this._link = value; } } } - + // End of LINK3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/LinkStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/LinkStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/LinkStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/LinkStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/MakeAttributes.cs b/src/NFSLibrary/Protocols/V3/RPC/MakeAttributes.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/MakeAttributes.cs rename to src/NFSLibrary/Protocols/V3/RPC/MakeAttributes.cs index 94695c1..243f42f 100644 --- a/NFSLibrary/Protocols/V3/RPC/MakeAttributes.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/MakeAttributes.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -100,7 +100,7 @@ public void xdrDecode(XdrDecodingStream xdr) this._setmtime = (xdr.xdrDecodeBoolean() ? TimeHow.SET_TO_CLIENT_TIME : TimeHow.DONT_CHANGE); if (this._setmtime != TimeHow.DONT_CHANGE) - { this._mtime = new NFSTimeValue(xdr); } + { this._mtime = new NFSTimeValue(xdr); } } public NFSPermission Mode @@ -199,6 +199,6 @@ public TimeHow SetModifiedTime { this._setmtime = value; } } } - + // End of sattr3.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/MakeFileArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/MakeFileArguments.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/MakeFileArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/MakeFileArguments.cs diff --git a/NFSLibrary/Protocols/V3/RPC/MakeFileStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/MakeFileStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/MakeFileStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/MakeFileStatus.cs index 5bf87cb..1cd5dea 100644 --- a/NFSLibrary/Protocols/V3/RPC/MakeFileStatus.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/MakeFileStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -78,6 +78,6 @@ public WritingData Data { return this._dir_wcc; } } } - + // End of MKDIR3res.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/MakeFolderArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/MakeFolderArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/MakeFolderArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/MakeFolderArguments.cs index be7e46a..0e5d12f 100644 --- a/NFSLibrary/Protocols/V3/RPC/MakeFolderArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/MakeFolderArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -47,6 +47,6 @@ public MakeAttributes Attributes { this._attributes = value; } } } - + // End of MKDIR3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/MakeFolderStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/MakeFolderStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/MakeFolderStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/MakeFolderStatus.cs index 701433f..e28bde9 100644 --- a/NFSLibrary/Protocols/V3/RPC/MakeFolderStatus.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/MakeFolderStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -93,6 +93,6 @@ public WritingData Data { return this._dir_wcc; } } } - + // End of MKDIR3res.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/MakeNodeArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/MakeNodeArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/MakeNodeArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/MakeNodeArguments.cs index 5f8cb37..a4ad462 100644 --- a/NFSLibrary/Protocols/V3/RPC/MakeNodeArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/MakeNodeArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -197,6 +197,6 @@ public SpecInformation Specifications { this._spec = value; } } } - + // End of MKNOD3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/MakeNodeStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/MakeNodeStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/MakeNodeStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/MakeNodeStatus.cs index 827c637..6b8ded9 100644 --- a/NFSLibrary/Protocols/V3/RPC/MakeNodeStatus.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/MakeNodeStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -78,6 +78,6 @@ public WritingData Data { return this._dir_wcc; } } } - + // End of MKNOD3res.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/Mount/MountBody.cs b/src/NFSLibrary/Protocols/V3/RPC/Mount/MountBody.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/Mount/MountBody.cs rename to src/NFSLibrary/Protocols/V3/RPC/Mount/MountBody.cs index c8565d4..c846d83 100644 --- a/NFSLibrary/Protocols/V3/RPC/Mount/MountBody.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/Mount/MountBody.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -53,6 +53,6 @@ public MountList NextEntry { return this._nextentry; } } } - + // End of mountbody3.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/Mount/MountList.cs b/src/NFSLibrary/Protocols/V3/RPC/Mount/MountList.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/Mount/MountList.cs rename to src/NFSLibrary/Protocols/V3/RPC/Mount/MountList.cs index e0b9b67..d85b3c1 100644 --- a/NFSLibrary/Protocols/V3/RPC/Mount/MountList.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/Mount/MountList.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -42,6 +42,6 @@ public MountBody Value { return this._value; } } } - + // End of mountlist3.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/Mount/MountStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/Mount/MountStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/Mount/MountStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/Mount/MountStatus.cs index 255339e..fbff315 100644 --- a/NFSLibrary/Protocols/V3/RPC/Mount/MountStatus.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/Mount/MountStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -101,6 +101,6 @@ public int[] AuthFlavors { return this._auth_flavors; } } } - + // End of mountres3.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocol.cs b/src/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocol.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocol.cs rename to src/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocol.cs index 0f339aa..539c5e4 100644 --- a/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocol.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocol.cs @@ -5,7 +5,7 @@ */ /** * A collection of constants used by the "NFSv3MountProtocol" ONC/RPC program. - */ + */ namespace NFSLibrary.Protocols.V3.RPC.Mount { @@ -25,6 +25,6 @@ public class NFSv3MountProtocol public const int MNTNAMLEN = 255; public const int FHSIZE = 64; } - + // End of NFSv3MountProtocol.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolClient.cs b/src/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolClient.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolClient.cs rename to src/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolClient.cs index 5ea78a4..598c637 100644 --- a/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolClient.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolClient.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -12,7 +12,7 @@ * The class NFSv3MountProtocolClient implements the client stub proxy * for the MOUNT_PROGRAM remote program. It provides method stubs * which, when called, in turn call the appropriate remote method (procedure). - */ + */ namespace NFSLibrary.Protocols.V3.RPC.Mount { @@ -26,7 +26,7 @@ public class NFSv3MountProtocolClient : OncRpcClientStub * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3MountProtocolClient(IPAddress host, int protocol) : base(host, NFSv3MountProtocol.MOUNTPROG, 3, 0, protocol, true) @@ -47,7 +47,7 @@ public NFSv3MountProtocolClient(IPAddress host, int protocol, bool useSecurePort * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3MountProtocolClient(IPAddress host, int port, int protocol) : base(host, NFSv3MountProtocol.MOUNTPROG, 3, port, protocol, true) @@ -61,7 +61,7 @@ public NFSv3MountProtocolClient(IPAddress host, int port, int protocol) * protocol. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3MountProtocolClient(OncRpcClient client) : base(client) @@ -78,7 +78,7 @@ public NFSv3MountProtocolClient(OncRpcClient client) * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3MountProtocolClient(IPAddress host, int program, int version, int protocol) : base(host, program, version, 0, protocol, true) @@ -96,7 +96,7 @@ public NFSv3MountProtocolClient(IPAddress host, int program, int version, int pr * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3MountProtocolClient(IPAddress host, int program, int version, int port, int protocol) : base(host, program, version, port, protocol, true) @@ -112,7 +112,7 @@ public NFSv3MountProtocolClient(IPAddress host, int program, int version, int po * Call remote procedure MOUNTPROC3_NULL_3. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public void MOUNTPROC3_NULL() { @@ -127,7 +127,7 @@ public void MOUNTPROC3_NULL() * @return Result from remote procedure call (of type mountres3). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public MountStatus MOUNTPROC3_MNT(Name arg1) { @@ -143,7 +143,7 @@ public MountStatus MOUNTPROC3_MNT(Name arg1) * @return Result from remote procedure call (of type mountlist3). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public MountList MOUNTPROC3_DUMP() { @@ -160,7 +160,7 @@ public MountList MOUNTPROC3_DUMP() * @param arg1 parameter (of type dirpath) to the remote procedure call. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public void MOUNTPROC3_UMNT(Name arg1) { @@ -173,7 +173,7 @@ public void MOUNTPROC3_UMNT(Name arg1) * Call remote procedure MOUNTPROC3_UMNTALL_3. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public void MOUNTPROC3_UMNTALL() { @@ -188,7 +188,7 @@ public void MOUNTPROC3_UMNTALL() * @return Result from remote procedure call (of type exports3). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public Exports MOUNTPROC3_EXPORT() { @@ -200,6 +200,6 @@ public Exports MOUNTPROC3_EXPORT() return result_; } } - + // End of NFSv3MountProtocolClient.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolServerStub.cs b/src/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolServerStub.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolServerStub.cs rename to src/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolServerStub.cs index 459e36f..62d983c 100644 --- a/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolServerStub.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/Mount/NFSv3MountProtocolServerStub.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -10,7 +10,7 @@ using System.Net; /** - */ + */ namespace NFSLibrary.Protocols.V3.RPC.Mount { @@ -90,8 +90,8 @@ public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int vers { call.retrieveCall(XdrVoid.XDR_VOID); Exports result_ = MOUNTPROC3_EXPORT(); - call.reply(result_); - + call.reply(result_); + break; } default: @@ -117,6 +117,6 @@ public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int vers public abstract Exports MOUNTPROC3_EXPORT(); } - + // End of NFSv3MountProtocolServerStub.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/NFSCookie.cs b/src/NFSLibrary/Protocols/V3/RPC/NFSCookie.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/NFSCookie.cs rename to src/NFSLibrary/Protocols/V3/RPC/NFSCookie.cs index 284fec7..1902934 100644 --- a/NFSLibrary/Protocols/V3/RPC/NFSCookie.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/NFSCookie.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -33,6 +33,6 @@ public long Value { return this._value; } } } - + // End of cookie3.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/NFSv3Protocol.cs b/src/NFSLibrary/Protocols/V3/RPC/NFSv3Protocol.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/NFSv3Protocol.cs rename to src/NFSLibrary/Protocols/V3/RPC/NFSv3Protocol.cs index 4702448..05a8a6e 100644 --- a/NFSLibrary/Protocols/V3/RPC/NFSv3Protocol.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/NFSv3Protocol.cs @@ -5,7 +5,7 @@ */ /** * A collection of constants used by the "NFSv3Protocol" ONC/RPC program. - */ + */ namespace NFSLibrary.Protocols.V3.RPC { @@ -54,6 +54,6 @@ public class NFSv3Protocol public const int NFS3_CREATEVERFSIZE = 8; public const int NFS3_FHSIZE = 64; } - + // End of NFSv3Protocol.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolClient.cs b/src/NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolClient.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolClient.cs rename to src/NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolClient.cs index 7d7bda1..084c50a 100644 --- a/NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolClient.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolClient.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; using System.Net; @@ -11,7 +11,7 @@ * The class NFSv3ProtocolClient implements the client stub proxy * for the NFS_PROGRAM remote program. It provides method stubs * which, when called, in turn call the appropriate remote method (procedure). - */ + */ namespace NFSLibrary.Protocols.V3.RPC { @@ -25,7 +25,7 @@ public class NFSv3ProtocolClient : OncRpcClientStub * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3ProtocolClient(IPAddress host, int protocol) : base(host, NFSv3Protocol.NFS_PROGRAM, 3, 0, protocol, true) @@ -46,7 +46,7 @@ public NFSv3ProtocolClient(IPAddress host, int protocol, bool useSecurePort) * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3ProtocolClient(IPAddress host, int port, int protocol) : base(host, NFSv3Protocol.NFS_PROGRAM, 3, port, protocol, true) @@ -60,7 +60,7 @@ public NFSv3ProtocolClient(IPAddress host, int port, int protocol) * protocol. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3ProtocolClient(OncRpcClient client) : base(client) @@ -77,7 +77,7 @@ public NFSv3ProtocolClient(OncRpcClient client) * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3ProtocolClient(IPAddress host, int program, int version, int protocol) : base(host, program, version, 0, protocol, true) @@ -95,7 +95,7 @@ public NFSv3ProtocolClient(IPAddress host, int program, int version, int protoco * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3ProtocolClient(IPAddress host, int program, int version, int port, int protocol) : base(host, program, version, port, protocol, true) @@ -113,7 +113,7 @@ public NFSv3ProtocolClient(IPAddress host, int program, int version, int port, i * used for ONC/RPC calls. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public NFSv3ProtocolClient(IPAddress host, int program, int version, int port, int protocol, bool useSecurePort) : base(host, program, version, port, protocol, useSecurePort) @@ -124,7 +124,7 @@ public NFSv3ProtocolClient(IPAddress host, int program, int version, int port, i * Call remote procedure NFSPROC3_NULL_3. * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public void NFSPROC3_NULL() { @@ -139,11 +139,11 @@ public void NFSPROC3_NULL() * @return Result from remote procedure call (of type GETATTR3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_GETATTR(GetAttributeArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_GETATTR, NFSv3Protocol.NFS_V3, arg1, result_); @@ -157,11 +157,11 @@ public ResultObject NFSPROC3_GETATTR * @return Result from remote procedure call (of type SETATTR3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_SETATTR(SetAttributeArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_SETATTR, NFSv3Protocol.NFS_V3, arg1, result_); @@ -175,11 +175,11 @@ public ResultObject NFSPROC3_SETAT * @return Result from remote procedure call (of type LOOKUP3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_LOOKUP(ItemOperationArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_LOOKUP, NFSv3Protocol.NFS_V3, arg1, result_); @@ -193,11 +193,11 @@ public ResultObject * @return Result from remote procedure call (of type ACCESS3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_ACCESS(AccessArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_ACCESS, NFSv3Protocol.NFS_V3, arg1, result_); @@ -211,11 +211,11 @@ public ResultObject NFSPROC3_ACCESS(AccessArgu * @return Result from remote procedure call (of type READLINK3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_READLINK(ReadLinkArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_READLINK, NFSv3Protocol.NFS_V3, arg1, result_); @@ -229,11 +229,11 @@ public ResultObject NFSPROC3_READLINK(Read * @return Result from remote procedure call (of type READ3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_READ(ReadArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_READ, NFSv3Protocol.NFS_V3, arg1, result_); @@ -247,11 +247,11 @@ public ResultObject NFSPROC3_READ(ReadArguments ar * @return Result from remote procedure call (of type WRITE3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_WRITE(WriteArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_WRITE, NFSv3Protocol.NFS_V3, arg1, result_); @@ -265,11 +265,11 @@ public ResultObject NFSPROC3_WRITE(WriteArgument * @return Result from remote procedure call (of type CREATE3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_CREATE(MakeFileArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_CREATE, NFSv3Protocol.NFS_V3, arg1, result_); @@ -283,11 +283,11 @@ public ResultObject NFSPROC3_CREATE(MakeFi * @return Result from remote procedure call (of type MKDIR3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_MKDIR(MakeFolderArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_MKDIR, NFSv3Protocol.NFS_V3, arg1, result_); @@ -301,11 +301,11 @@ public ResultObject NFSPROC3_MKDIR(Mak * @return Result from remote procedure call (of type SYMLINK3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_SYMLINK(SymlinkArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_SYMLINK, NFSv3Protocol.NFS_V3, arg1, result_); @@ -319,11 +319,11 @@ public ResultObject NFSPROC3_SYMLINK(Symlink * @return Result from remote procedure call (of type MKNOD3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_MKNOD(MakeNodeArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_MKNOD, NFSv3Protocol.NFS_V3, arg1, result_); @@ -337,11 +337,11 @@ public ResultObject NFSPROC3_MKNOD(MakeNod * @return Result from remote procedure call (of type REMOVE3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_REMOVE(ItemOperationArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_REMOVE, NFSv3Protocol.NFS_V3, arg1, result_); @@ -355,11 +355,11 @@ public ResultObject NFSPROC3_REMOVE(ItemOperat * @return Result from remote procedure call (of type RMDIR3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_RMDIR(ItemOperationArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_RMDIR, NFSv3Protocol.NFS_V3, arg1, result_); @@ -373,11 +373,11 @@ public ResultObject NFSPROC3_RMDIR(ItemOperati * @return Result from remote procedure call (of type RENAME3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_RENAME(RenameArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_RENAME, NFSv3Protocol.NFS_V3, arg1, result_); @@ -391,11 +391,11 @@ public ResultObject NFSPROC3_RENAME(RenameArgu * @return Result from remote procedure call (of type LINK3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_LINK(LinkArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_LINK, NFSv3Protocol.NFS_V3, arg1, result_); @@ -409,7 +409,7 @@ public ResultObject NFSPROC3_LINK(LinkArguments ar * @return Result from remote procedure call (of type READDIR3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_READDIR(ReadFolderArguments arg1) { @@ -427,7 +427,7 @@ public ResultObject NFSPRO * @return Result from remote procedure call (of type READDIRPLUS3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_READDIRPLUS(ExtendedReadFolderArguments arg1) { @@ -445,11 +445,11 @@ public ResultObject NF * @return Result from remote procedure call (of type FSSTAT3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_FSSTAT(FSStatisticsArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_FSSTAT, NFSv3Protocol.NFS_V3, arg1, result_); @@ -463,11 +463,11 @@ public ResultObject NFSPROC3_FSSTA * @return Result from remote procedure call (of type FSINFO3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_FSINFO(FSInfoArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_FSINFO, NFSv3Protocol.NFS_V3, arg1, result_); @@ -481,11 +481,11 @@ public ResultObject NFSPROC3_FSINFO(FSInfoArgu * @return Result from remote procedure call (of type PATHCONF3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_PATHCONF(PathConfigurationArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_PATHCONF, NFSv3Protocol.NFS_V3, arg1, result_); @@ -499,11 +499,11 @@ public ResultObject NFSP * @return Result from remote procedure call (of type COMMIT3res). * @throws OncRpcException if an ONC/RPC error occurs. * @throws IOException if an I/O error occurs. - */ + */ public ResultObject NFSPROC3_COMMIT(CommitArguments arg1) { - ResultObject result_ = + ResultObject result_ = new ResultObject(); client.call(NFSv3Protocol.NFSPROC3_COMMIT, NFSv3Protocol.NFS_V3, arg1, result_); @@ -511,6 +511,6 @@ public ResultObject NFSPROC3_COMMIT(CommitArgu return result_; } } - + // End of NFSv3ProtocolClient.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolServerStub.cs b/src/NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolServerStub.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolServerStub.cs rename to src/NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolServerStub.cs index 70bf08a..78e6e87 100644 --- a/NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolServerStub.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/NFSv3ProtocolServerStub.cs @@ -2,14 +2,14 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; using org.acplt.oncrpc.server; using System.Net; /** - */ + */ namespace NFSLibrary.Protocols.V3.RPC { @@ -335,6 +335,6 @@ public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int vers public abstract ResultObject NFSPROC3_COMMIT(CommitArguments arg1); } - + // End of NFSv3ProtocolServerStub.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/PathConfigurationArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/PathConfigurationArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/PathConfigurationArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/PathConfigurationArguments.cs index bfc09bb..ed6b92d 100644 --- a/NFSLibrary/Protocols/V3/RPC/PathConfigurationArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/PathConfigurationArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -37,6 +37,6 @@ public NFSHandle Handle { this._obj = value; } } } - + // End of PATHCONF3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/PathConfigurationStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/PathConfigurationStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/PathConfigurationStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/PathConfigurationStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/PostOperationAttributes.cs b/src/NFSLibrary/Protocols/V3/RPC/PostOperationAttributes.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/PostOperationAttributes.cs rename to src/NFSLibrary/Protocols/V3/RPC/PostOperationAttributes.cs index 6b08cf7..baf47e6 100644 --- a/NFSLibrary/Protocols/V3/RPC/PostOperationAttributes.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/PostOperationAttributes.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -47,6 +47,6 @@ public FileAttributes Attributes { return this._attributes; } } } - + // End of post_op_attr.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/PreOperationAttributes.cs b/src/NFSLibrary/Protocols/V3/RPC/PreOperationAttributes.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/PreOperationAttributes.cs rename to src/NFSLibrary/Protocols/V3/RPC/PreOperationAttributes.cs index 1d0bc3e..15d6deb 100644 --- a/NFSLibrary/Protocols/V3/RPC/PreOperationAttributes.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/PreOperationAttributes.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -45,6 +45,6 @@ public WritingAttributes Attributes { return this._attributes; } } } - + // End of pre_op_attr.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/ReadArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/ReadArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/ReadArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/ReadArguments.cs index 3a17f91..f477aa2 100644 --- a/NFSLibrary/Protocols/V3/RPC/ReadArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/ReadArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -61,6 +61,6 @@ public int Count { this._count = value; } } } - + // End of readargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/ReadFolderArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/ReadFolderArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/ReadFolderArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/ReadFolderArguments.cs index 4d223df..4c4caf9 100644 --- a/NFSLibrary/Protocols/V3/RPC/ReadFolderArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/ReadFolderArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -73,6 +73,6 @@ public int Count { this._count = value; } } } - + // End of READDIR3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/ReadFolderStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/ReadFolderStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/ReadFolderStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/ReadFolderStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/ReadLinkArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/ReadLinkArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/ReadLinkArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/ReadLinkArguments.cs index b4a6528..cc69bae 100644 --- a/NFSLibrary/Protocols/V3/RPC/ReadLinkArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/ReadLinkArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; diff --git a/NFSLibrary/Protocols/V3/RPC/ReadLinkStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/ReadLinkStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/ReadLinkStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/ReadLinkStatus.cs index 55ed8a2..7a6652e 100644 --- a/NFSLibrary/Protocols/V3/RPC/ReadLinkStatus.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/ReadLinkStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -67,6 +67,6 @@ public PostOperationAttributes Attributes { return this._symlink_attributes; } } } - + // End of READLINK3res.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/ReadStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/ReadStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/ReadStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/ReadStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/RemoveStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/RemoveStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/RemoveStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/RemoveStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/RenameArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/RenameArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/RenameArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/RenameArguments.cs index a7f4ee1..4408576 100644 --- a/NFSLibrary/Protocols/V3/RPC/RenameArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/RenameArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -47,6 +47,6 @@ public ItemOperationArguments To { this._to = value; } } } - + // End of renameargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/RenameStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/RenameStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/RenameStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/RenameStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/ResultObject.cs b/src/NFSLibrary/Protocols/V3/RPC/ResultObject.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/ResultObject.cs rename to src/NFSLibrary/Protocols/V3/RPC/ResultObject.cs index c25473f..e459dc3 100644 --- a/NFSLibrary/Protocols/V3/RPC/ResultObject.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/ResultObject.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -28,7 +28,7 @@ public void xdrEncode(XdrEncodingStream xdr) switch (this._status) { - case NFSStats.NFS_OK: + case NFSStats.NFS_OK: ((XdrAble)this._resok).xdrEncode(xdr); break; @@ -40,8 +40,8 @@ public void xdrEncode(XdrEncodingStream xdr) public void xdrDecode(XdrDecodingStream xdr) { - this._status = (NFSStats)xdr.xdrDecodeInt(); - + this._status = (NFSStats)xdr.xdrDecodeInt(); + switch (this._status) { case NFSStats.NFS_OK: @@ -76,6 +76,6 @@ public F FAIL { return this._resfail; } } } - + // End of FSSTAT3res.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/SetAttributeArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/SetAttributeArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/SetAttributeArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/SetAttributeArguments.cs index 155e9f1..d90edaf 100644 --- a/NFSLibrary/Protocols/V3/RPC/SetAttributeArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/SetAttributeArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -74,6 +74,6 @@ public NFSTimeValue GuardCreateTime { this._guardctime = value; } } } - + // End of SETATTR3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/SetAttributeStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/SetAttributeStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/SetAttributeStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/SetAttributeStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/SpecInformation.cs b/src/NFSLibrary/Protocols/V3/RPC/SpecInformation.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/SpecInformation.cs rename to src/NFSLibrary/Protocols/V3/RPC/SpecInformation.cs index f9c1c94..3e9c1dc 100644 --- a/NFSLibrary/Protocols/V3/RPC/SpecInformation.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/SpecInformation.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -43,6 +43,6 @@ public int SpecData2 { return this._specdata2; } } } - + // End of specdata3.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/SymlinkArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/SymlinkArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/SymlinkArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/SymlinkArguments.cs index 70dd67b..fed6b62 100644 --- a/NFSLibrary/Protocols/V3/RPC/SymlinkArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/SymlinkArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -80,6 +80,6 @@ public Name Name { return this._symlink_data; } } } - + // End of SYMLINK3args.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/SymlinkStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/SymlinkStatus.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/SymlinkStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/SymlinkStatus.cs index ee812a4..29b715a 100644 --- a/NFSLibrary/Protocols/V3/RPC/SymlinkStatus.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/SymlinkStatus.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -78,6 +78,6 @@ public WritingData Data { return this._dir_wcc; } } } - + // End of SYMLINK3res.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/WriteArguments.cs b/src/NFSLibrary/Protocols/V3/RPC/WriteArguments.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/WriteArguments.cs rename to src/NFSLibrary/Protocols/V3/RPC/WriteArguments.cs index dc67303..7e570dc 100644 --- a/NFSLibrary/Protocols/V3/RPC/WriteArguments.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/WriteArguments.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -73,8 +73,8 @@ public StableHow Stable { return this._stable; } set { this._stable = value; } - } - + } + public byte[] Data { get @@ -83,6 +83,6 @@ public byte[] Data { this._data = value; } } } - + // End of writeargs.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/WriteStatus.cs b/src/NFSLibrary/Protocols/V3/RPC/WriteStatus.cs similarity index 100% rename from NFSLibrary/Protocols/V3/RPC/WriteStatus.cs rename to src/NFSLibrary/Protocols/V3/RPC/WriteStatus.cs diff --git a/NFSLibrary/Protocols/V3/RPC/WritingAttributes.cs b/src/NFSLibrary/Protocols/V3/RPC/WritingAttributes.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/WritingAttributes.cs rename to src/NFSLibrary/Protocols/V3/RPC/WritingAttributes.cs index 78fa1f2..3bb4389 100644 --- a/NFSLibrary/Protocols/V3/RPC/WritingAttributes.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/WritingAttributes.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using NFSLibrary.Protocols.Commons; using org.acplt.oncrpc; @@ -53,6 +53,6 @@ public NFSTimeValue CreateTime { return this._ctime; } } } - + // End of wcc_attr.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V3/RPC/WritingData.cs b/src/NFSLibrary/Protocols/V3/RPC/WritingData.cs similarity index 99% rename from NFSLibrary/Protocols/V3/RPC/WritingData.cs rename to src/NFSLibrary/Protocols/V3/RPC/WritingData.cs index 823091b..7042b84 100644 --- a/NFSLibrary/Protocols/V3/RPC/WritingData.cs +++ b/src/NFSLibrary/Protocols/V3/RPC/WritingData.cs @@ -2,7 +2,7 @@ * Automatically generated by jrpcgen 1.0.7 on 27/08/2010 * jrpcgen is part of the "Remote Tea.Net" ONC/RPC package for C# * See http://remotetea.sourceforge.net for details - */ + */ using org.acplt.oncrpc; @@ -43,6 +43,6 @@ public PostOperationAttributes After { return this._after; } } } - + // End of wcc_data.cs } \ No newline at end of file diff --git a/NFSLibrary/Protocols/V4/NFSv4.1.cs b/src/NFSLibrary/Protocols/V4/NFSv4.1.cs similarity index 100% rename from NFSLibrary/Protocols/V4/NFSv4.1.cs rename to src/NFSLibrary/Protocols/V4/NFSv4.1.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ACCESS4args.cs b/src/NFSLibrary/Protocols/V4/RPC/ACCESS4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ACCESS4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/ACCESS4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ACCESS4res.cs b/src/NFSLibrary/Protocols/V4/RPC/ACCESS4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ACCESS4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/ACCESS4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ACCESS4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/ACCESS4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ACCESS4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/ACCESS4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/BACKCHANNEL_CTL4args.cs b/src/NFSLibrary/Protocols/V4/RPC/BACKCHANNEL_CTL4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/BACKCHANNEL_CTL4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/BACKCHANNEL_CTL4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/BACKCHANNEL_CTL4res.cs b/src/NFSLibrary/Protocols/V4/RPC/BACKCHANNEL_CTL4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/BACKCHANNEL_CTL4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/BACKCHANNEL_CTL4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4args.cs b/src/NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4res.cs b/src/NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/BIND_CONN_TO_SESSION4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/CLOSE4args.cs b/src/NFSLibrary/Protocols/V4/RPC/CLOSE4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/CLOSE4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/CLOSE4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/CLOSE4res.cs b/src/NFSLibrary/Protocols/V4/RPC/CLOSE4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/CLOSE4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/CLOSE4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/COMMIT4args.cs b/src/NFSLibrary/Protocols/V4/RPC/COMMIT4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/COMMIT4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/COMMIT4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/COMMIT4res.cs b/src/NFSLibrary/Protocols/V4/RPC/COMMIT4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/COMMIT4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/COMMIT4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/COMMIT4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/COMMIT4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/COMMIT4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/COMMIT4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/COMPOUND4args.cs b/src/NFSLibrary/Protocols/V4/RPC/COMPOUND4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/COMPOUND4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/COMPOUND4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/COMPOUND4res.cs b/src/NFSLibrary/Protocols/V4/RPC/COMPOUND4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/COMPOUND4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/COMPOUND4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/CREATE4args.cs b/src/NFSLibrary/Protocols/V4/RPC/CREATE4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/CREATE4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/CREATE4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/CREATE4res.cs b/src/NFSLibrary/Protocols/V4/RPC/CREATE4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/CREATE4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/CREATE4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/CREATE4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/CREATE4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/CREATE4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/CREATE4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4args.cs b/src/NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4res.cs b/src/NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/CREATE_SESSION4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_COMPOUND4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_COMPOUND4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_COMPOUND4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_COMPOUND4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_COMPOUND4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_COMPOUND4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_COMPOUND4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_COMPOUND4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_GETATTR4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_ILLEGAL4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_ILLEGAL4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_ILLEGAL4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_ILLEGAL4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_LAYOUTRECALL4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_LAYOUTRECALL4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_LAYOUTRECALL4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_LAYOUTRECALL4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_LAYOUTRECALL4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_LAYOUTRECALL4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_LAYOUTRECALL4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_LAYOUTRECALL4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_DEVICEID4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_DEVICEID4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_DEVICEID4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_DEVICEID4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_DEVICEID4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_DEVICEID4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_DEVICEID4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_DEVICEID4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_LOCK4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_LOCK4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_LOCK4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_LOCK4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_LOCK4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_LOCK4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_LOCK4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_NOTIFY_LOCK4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_PUSH_DELEG4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_PUSH_DELEG4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_PUSH_DELEG4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_PUSH_DELEG4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_PUSH_DELEG4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_PUSH_DELEG4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_PUSH_DELEG4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_PUSH_DELEG4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALLABLE_OBJ_AVAIL4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALLABLE_OBJ_AVAIL4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALLABLE_OBJ_AVAIL4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALLABLE_OBJ_AVAIL4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALLABLE_OBJ_AVAIL4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALLABLE_OBJ_AVAIL4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALLABLE_OBJ_AVAIL4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALLABLE_OBJ_AVAIL4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_ANY4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_ANY4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_ANY4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_ANY4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_ANY4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_ANY4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_ANY4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_ANY4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_SLOT4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_SLOT4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_SLOT4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_SLOT4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_SLOT4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_SLOT4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_SLOT4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_RECALL_SLOT4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_SEQUENCE4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_WANTS_CANCELLED4args.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_WANTS_CANCELLED4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_WANTS_CANCELLED4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_WANTS_CANCELLED4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/CB_WANTS_CANCELLED4res.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/CB_WANTS_CANCELLED4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/CB_WANTS_CANCELLED4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/CB_WANTS_CANCELLED4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callback.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callback.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callback.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callback.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callbackClient.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callbackClient.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callbackClient.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callbackClient.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callbackServerStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callbackServerStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callbackServerStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/NFSv4_callbackServerStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall_file4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall_file4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall_file4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall_file4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall_type4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall_type4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall_type4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/layoutrecall_type4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_argop4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_argop4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_argop4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_argop4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_opnum4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_opnum4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_opnum4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_opnum4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_resop4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_resop4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_resop4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/nfs_cb_resop4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify_add4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify_add4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify_add4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify_add4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify_attr4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify_attr4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify_attr4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify_attr4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_change4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_change4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_change4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_change4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_delete4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_delete4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_delete4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_delete4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_type4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_type4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_type4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify_deviceid_type4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify_entry4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify_entry4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify_entry4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify_entry4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify_remove4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify_remove4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify_remove4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify_remove4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify_rename4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify_rename4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify_rename4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify_rename4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify_type4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify_type4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify_type4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify_type4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notify_verifier4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notify_verifier4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notify_verifier4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notify_verifier4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/notifylist4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/notifylist4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/notifylist4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/notifylist4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/prev_entry4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/prev_entry4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/prev_entry4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/prev_entry4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/referring_call4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/referring_call4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/referring_call4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/referring_call4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Callback/referring_call_list4.cs b/src/NFSLibrary/Protocols/V4/RPC/Callback/referring_call_list4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Callback/referring_call_list4.cs rename to src/NFSLibrary/Protocols/V4/RPC/Callback/referring_call_list4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/DELEGPURGE4args.cs b/src/NFSLibrary/Protocols/V4/RPC/DELEGPURGE4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/DELEGPURGE4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/DELEGPURGE4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/DELEGPURGE4res.cs b/src/NFSLibrary/Protocols/V4/RPC/DELEGPURGE4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/DELEGPURGE4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/DELEGPURGE4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/DELEGRETURN4args.cs b/src/NFSLibrary/Protocols/V4/RPC/DELEGRETURN4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/DELEGRETURN4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/DELEGRETURN4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/DELEGRETURN4res.cs b/src/NFSLibrary/Protocols/V4/RPC/DELEGRETURN4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/DELEGRETURN4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/DELEGRETURN4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/DESTROY_CLIENTID4args.cs b/src/NFSLibrary/Protocols/V4/RPC/DESTROY_CLIENTID4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/DESTROY_CLIENTID4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/DESTROY_CLIENTID4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/DESTROY_CLIENTID4res.cs b/src/NFSLibrary/Protocols/V4/RPC/DESTROY_CLIENTID4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/DESTROY_CLIENTID4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/DESTROY_CLIENTID4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/DESTROY_SESSION4args.cs b/src/NFSLibrary/Protocols/V4/RPC/DESTROY_SESSION4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/DESTROY_SESSION4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/DESTROY_SESSION4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/DESTROY_SESSION4res.cs b/src/NFSLibrary/Protocols/V4/RPC/DESTROY_SESSION4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/DESTROY_SESSION4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/DESTROY_SESSION4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4args.cs b/src/NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4res.cs b/src/NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/EXCHANGE_ID4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/FREE_STATEID4args.cs b/src/NFSLibrary/Protocols/V4/RPC/FREE_STATEID4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/FREE_STATEID4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/FREE_STATEID4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/FREE_STATEID4res.cs b/src/NFSLibrary/Protocols/V4/RPC/FREE_STATEID4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/FREE_STATEID4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/FREE_STATEID4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETATTR4args.cs b/src/NFSLibrary/Protocols/V4/RPC/GETATTR4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETATTR4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETATTR4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETATTR4res.cs b/src/NFSLibrary/Protocols/V4/RPC/GETATTR4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETATTR4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETATTR4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETATTR4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/GETATTR4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETATTR4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETATTR4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4args.cs b/src/NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4res.cs b/src/NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETDEVICEINFO4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4args.cs b/src/NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4res.cs b/src/NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETDEVICELIST4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETFH4res.cs b/src/NFSLibrary/Protocols/V4/RPC/GETFH4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETFH4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETFH4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GETFH4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/GETFH4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GETFH4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/GETFH4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4args.cs b/src/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4res.cs b/src/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4res_non_fatal.cs b/src/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4res_non_fatal.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4res_non_fatal.cs rename to src/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4res_non_fatal.cs diff --git a/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/GET_DIR_DELEGATION4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ILLEGAL4res.cs b/src/NFSLibrary/Protocols/V4/RPC/ILLEGAL4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ILLEGAL4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/ILLEGAL4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4args.cs b/src/NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4res.cs b/src/NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/LAYOUTCOMMIT4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LAYOUTGET4args.cs b/src/NFSLibrary/Protocols/V4/RPC/LAYOUTGET4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LAYOUTGET4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/LAYOUTGET4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LAYOUTGET4res.cs b/src/NFSLibrary/Protocols/V4/RPC/LAYOUTGET4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LAYOUTGET4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/LAYOUTGET4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LAYOUTGET4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/LAYOUTGET4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LAYOUTGET4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/LAYOUTGET4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LAYOUTRETURN4args.cs b/src/NFSLibrary/Protocols/V4/RPC/LAYOUTRETURN4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LAYOUTRETURN4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/LAYOUTRETURN4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LAYOUTRETURN4res.cs b/src/NFSLibrary/Protocols/V4/RPC/LAYOUTRETURN4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LAYOUTRETURN4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/LAYOUTRETURN4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LINK4args.cs b/src/NFSLibrary/Protocols/V4/RPC/LINK4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LINK4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/LINK4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LINK4res.cs b/src/NFSLibrary/Protocols/V4/RPC/LINK4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LINK4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/LINK4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LINK4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/LINK4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LINK4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/LINK4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOCK4args.cs b/src/NFSLibrary/Protocols/V4/RPC/LOCK4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOCK4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOCK4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOCK4denied.cs b/src/NFSLibrary/Protocols/V4/RPC/LOCK4denied.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOCK4denied.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOCK4denied.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOCK4res.cs b/src/NFSLibrary/Protocols/V4/RPC/LOCK4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOCK4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOCK4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOCK4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/LOCK4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOCK4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOCK4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOCKT4args.cs b/src/NFSLibrary/Protocols/V4/RPC/LOCKT4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOCKT4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOCKT4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOCKT4res.cs b/src/NFSLibrary/Protocols/V4/RPC/LOCKT4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOCKT4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOCKT4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOCKU4args.cs b/src/NFSLibrary/Protocols/V4/RPC/LOCKU4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOCKU4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOCKU4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOCKU4res.cs b/src/NFSLibrary/Protocols/V4/RPC/LOCKU4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOCKU4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOCKU4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOOKUP4args.cs b/src/NFSLibrary/Protocols/V4/RPC/LOOKUP4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOOKUP4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOOKUP4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOOKUP4res.cs b/src/NFSLibrary/Protocols/V4/RPC/LOOKUP4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOOKUP4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOOKUP4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/LOOKUPP4res.cs b/src/NFSLibrary/Protocols/V4/RPC/LOOKUPP4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/LOOKUPP4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/LOOKUPP4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/NFSv4Protocol.cs b/src/NFSLibrary/Protocols/V4/RPC/NFSv4Protocol.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/NFSv4Protocol.cs rename to src/NFSLibrary/Protocols/V4/RPC/NFSv4Protocol.cs diff --git a/NFSLibrary/Protocols/V4/RPC/NFSv4ProtocolClient.cs b/src/NFSLibrary/Protocols/V4/RPC/NFSv4ProtocolClient.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/NFSv4ProtocolClient.cs rename to src/NFSLibrary/Protocols/V4/RPC/NFSv4ProtocolClient.cs diff --git a/NFSLibrary/Protocols/V4/RPC/NFSv4ProtocolServerStub.cs b/src/NFSLibrary/Protocols/V4/RPC/NFSv4ProtocolServerStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/NFSv4ProtocolServerStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/NFSv4ProtocolServerStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/NVERIFY4args.cs b/src/NFSLibrary/Protocols/V4/RPC/NVERIFY4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/NVERIFY4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/NVERIFY4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/NVERIFY4res.cs b/src/NFSLibrary/Protocols/V4/RPC/NVERIFY4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/NVERIFY4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/NVERIFY4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPEN4args.cs b/src/NFSLibrary/Protocols/V4/RPC/OPEN4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPEN4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPEN4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPEN4res.cs b/src/NFSLibrary/Protocols/V4/RPC/OPEN4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPEN4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPEN4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPEN4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/OPEN4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPEN4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPEN4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPENATTR4args.cs b/src/NFSLibrary/Protocols/V4/RPC/OPENATTR4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPENATTR4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPENATTR4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPENATTR4res.cs b/src/NFSLibrary/Protocols/V4/RPC/OPENATTR4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPENATTR4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPENATTR4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4args.cs b/src/NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4res.cs b/src/NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPEN_CONFIRM4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4args.cs b/src/NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4res.cs b/src/NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/OPEN_DOWNGRADE4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/PUTFH4args.cs b/src/NFSLibrary/Protocols/V4/RPC/PUTFH4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/PUTFH4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/PUTFH4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/PUTFH4res.cs b/src/NFSLibrary/Protocols/V4/RPC/PUTFH4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/PUTFH4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/PUTFH4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/PUTPUBFH4res.cs b/src/NFSLibrary/Protocols/V4/RPC/PUTPUBFH4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/PUTPUBFH4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/PUTPUBFH4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/PUTROOTFH4res.cs b/src/NFSLibrary/Protocols/V4/RPC/PUTROOTFH4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/PUTROOTFH4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/PUTROOTFH4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/READ4args.cs b/src/NFSLibrary/Protocols/V4/RPC/READ4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/READ4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/READ4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/READ4res.cs b/src/NFSLibrary/Protocols/V4/RPC/READ4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/READ4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/READ4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/READ4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/READ4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/READ4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/READ4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/READDIR4args.cs b/src/NFSLibrary/Protocols/V4/RPC/READDIR4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/READDIR4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/READDIR4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/READDIR4res.cs b/src/NFSLibrary/Protocols/V4/RPC/READDIR4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/READDIR4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/READDIR4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/READDIR4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/READDIR4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/READDIR4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/READDIR4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/READLINK4res.cs b/src/NFSLibrary/Protocols/V4/RPC/READLINK4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/READLINK4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/READLINK4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/READLINK4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/READLINK4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/READLINK4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/READLINK4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/RECLAIM_COMPLETE4args.cs b/src/NFSLibrary/Protocols/V4/RPC/RECLAIM_COMPLETE4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/RECLAIM_COMPLETE4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/RECLAIM_COMPLETE4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/RECLAIM_COMPLETE4res.cs b/src/NFSLibrary/Protocols/V4/RPC/RECLAIM_COMPLETE4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/RECLAIM_COMPLETE4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/RECLAIM_COMPLETE4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/RELEASE_LOCKOWNER4args.cs b/src/NFSLibrary/Protocols/V4/RPC/RELEASE_LOCKOWNER4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/RELEASE_LOCKOWNER4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/RELEASE_LOCKOWNER4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/RELEASE_LOCKOWNER4res.cs b/src/NFSLibrary/Protocols/V4/RPC/RELEASE_LOCKOWNER4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/RELEASE_LOCKOWNER4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/RELEASE_LOCKOWNER4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/REMOVE4args.cs b/src/NFSLibrary/Protocols/V4/RPC/REMOVE4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/REMOVE4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/REMOVE4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/REMOVE4res.cs b/src/NFSLibrary/Protocols/V4/RPC/REMOVE4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/REMOVE4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/REMOVE4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/REMOVE4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/REMOVE4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/REMOVE4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/REMOVE4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/RENAME4args.cs b/src/NFSLibrary/Protocols/V4/RPC/RENAME4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/RENAME4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/RENAME4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/RENAME4res.cs b/src/NFSLibrary/Protocols/V4/RPC/RENAME4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/RENAME4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/RENAME4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/RENAME4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/RENAME4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/RENAME4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/RENAME4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/RENEW4args.cs b/src/NFSLibrary/Protocols/V4/RPC/RENEW4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/RENEW4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/RENEW4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/RENEW4res.cs b/src/NFSLibrary/Protocols/V4/RPC/RENEW4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/RENEW4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/RENEW4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/RESTOREFH4res.cs b/src/NFSLibrary/Protocols/V4/RPC/RESTOREFH4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/RESTOREFH4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/RESTOREFH4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SAVEFH4res.cs b/src/NFSLibrary/Protocols/V4/RPC/SAVEFH4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SAVEFH4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/SAVEFH4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SECINFO4args.cs b/src/NFSLibrary/Protocols/V4/RPC/SECINFO4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SECINFO4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/SECINFO4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SECINFO4res.cs b/src/NFSLibrary/Protocols/V4/RPC/SECINFO4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SECINFO4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/SECINFO4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SECINFO4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/SECINFO4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SECINFO4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/SECINFO4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SECINFO_NO_NAME4args.cs b/src/NFSLibrary/Protocols/V4/RPC/SECINFO_NO_NAME4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SECINFO_NO_NAME4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/SECINFO_NO_NAME4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SECINFO_NO_NAME4res.cs b/src/NFSLibrary/Protocols/V4/RPC/SECINFO_NO_NAME4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SECINFO_NO_NAME4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/SECINFO_NO_NAME4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SEQUENCE4args.cs b/src/NFSLibrary/Protocols/V4/RPC/SEQUENCE4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SEQUENCE4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/SEQUENCE4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SEQUENCE4res.cs b/src/NFSLibrary/Protocols/V4/RPC/SEQUENCE4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SEQUENCE4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/SEQUENCE4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SEQUENCE4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/SEQUENCE4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SEQUENCE4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/SEQUENCE4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SETATTR4args.cs b/src/NFSLibrary/Protocols/V4/RPC/SETATTR4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SETATTR4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/SETATTR4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SETATTR4res.cs b/src/NFSLibrary/Protocols/V4/RPC/SETATTR4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SETATTR4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/SETATTR4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SETCLIENTID4args.cs b/src/NFSLibrary/Protocols/V4/RPC/SETCLIENTID4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SETCLIENTID4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/SETCLIENTID4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SETCLIENTID4res.cs b/src/NFSLibrary/Protocols/V4/RPC/SETCLIENTID4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SETCLIENTID4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/SETCLIENTID4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SETCLIENTID4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/SETCLIENTID4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SETCLIENTID4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/SETCLIENTID4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SETCLIENTID_CONFIRM4args.cs b/src/NFSLibrary/Protocols/V4/RPC/SETCLIENTID_CONFIRM4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SETCLIENTID_CONFIRM4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/SETCLIENTID_CONFIRM4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SETCLIENTID_CONFIRM4res.cs b/src/NFSLibrary/Protocols/V4/RPC/SETCLIENTID_CONFIRM4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SETCLIENTID_CONFIRM4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/SETCLIENTID_CONFIRM4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SET_SSV4args.cs b/src/NFSLibrary/Protocols/V4/RPC/SET_SSV4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SET_SSV4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/SET_SSV4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SET_SSV4res.cs b/src/NFSLibrary/Protocols/V4/RPC/SET_SSV4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SET_SSV4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/SET_SSV4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/SET_SSV4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/SET_SSV4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/SET_SSV4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/SET_SSV4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/AcessStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/AcessStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/AcessStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/AcessStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/CloseStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/CloseStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/CloseStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/CloseStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/CreateSessionStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/CreateSessionStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/CreateSessionStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/CreateSessionStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/CreateStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/CreateStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/CreateStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/CreateStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/DestroyClientIdStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/DestroyClientIdStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/DestroyClientIdStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/DestroyClientIdStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/DestroySessionStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/DestroySessionStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/DestroySessionStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/DestroySessionStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/ExchengeIDStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/ExchengeIDStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/ExchengeIDStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/ExchengeIDStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/GetattrStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/GetattrStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/GetattrStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/GetattrStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/GetfhStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/GetfhStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/GetfhStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/GetfhStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/LookupStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/LookupStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/LookupStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/LookupStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/OpenStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/OpenStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/OpenStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/OpenStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/PutfhStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/PutfhStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/PutfhStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/PutfhStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/PutrootfhStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/PutrootfhStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/PutrootfhStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/PutrootfhStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/ReadDirStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/ReadDirStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/ReadDirStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/ReadDirStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/ReadStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/ReadStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/ReadStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/ReadStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/ReclaimCompleteStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/ReclaimCompleteStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/ReclaimCompleteStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/ReclaimCompleteStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/RemoveStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/RemoveStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/RemoveStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/RemoveStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/SequenceStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/SequenceStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/SequenceStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/SequenceStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/Stubs/WriteStub.cs b/src/NFSLibrary/Protocols/V4/RPC/Stubs/WriteStub.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/Stubs/WriteStub.cs rename to src/NFSLibrary/Protocols/V4/RPC/Stubs/WriteStub.cs diff --git a/NFSLibrary/Protocols/V4/RPC/TEST_STATEID4args.cs b/src/NFSLibrary/Protocols/V4/RPC/TEST_STATEID4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/TEST_STATEID4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/TEST_STATEID4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/TEST_STATEID4res.cs b/src/NFSLibrary/Protocols/V4/RPC/TEST_STATEID4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/TEST_STATEID4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/TEST_STATEID4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/TEST_STATEID4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/TEST_STATEID4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/TEST_STATEID4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/TEST_STATEID4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/VERIFY4args.cs b/src/NFSLibrary/Protocols/V4/RPC/VERIFY4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/VERIFY4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/VERIFY4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/VERIFY4res.cs b/src/NFSLibrary/Protocols/V4/RPC/VERIFY4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/VERIFY4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/VERIFY4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/WANT_DELEGATION4args.cs b/src/NFSLibrary/Protocols/V4/RPC/WANT_DELEGATION4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/WANT_DELEGATION4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/WANT_DELEGATION4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/WANT_DELEGATION4res.cs b/src/NFSLibrary/Protocols/V4/RPC/WANT_DELEGATION4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/WANT_DELEGATION4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/WANT_DELEGATION4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/WRITE4args.cs b/src/NFSLibrary/Protocols/V4/RPC/WRITE4args.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/WRITE4args.cs rename to src/NFSLibrary/Protocols/V4/RPC/WRITE4args.cs diff --git a/NFSLibrary/Protocols/V4/RPC/WRITE4res.cs b/src/NFSLibrary/Protocols/V4/RPC/WRITE4res.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/WRITE4res.cs rename to src/NFSLibrary/Protocols/V4/RPC/WRITE4res.cs diff --git a/NFSLibrary/Protocols/V4/RPC/WRITE4resok.cs b/src/NFSLibrary/Protocols/V4/RPC/WRITE4resok.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/WRITE4resok.cs rename to src/NFSLibrary/Protocols/V4/RPC/WRITE4resok.cs diff --git a/NFSLibrary/Protocols/V4/RPC/aceflag4.cs b/src/NFSLibrary/Protocols/V4/RPC/aceflag4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/aceflag4.cs rename to src/NFSLibrary/Protocols/V4/RPC/aceflag4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/acemask4.cs b/src/NFSLibrary/Protocols/V4/RPC/acemask4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/acemask4.cs rename to src/NFSLibrary/Protocols/V4/RPC/acemask4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/acetype4.cs b/src/NFSLibrary/Protocols/V4/RPC/acetype4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/acetype4.cs rename to src/NFSLibrary/Protocols/V4/RPC/acetype4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/aclflag4.cs b/src/NFSLibrary/Protocols/V4/RPC/aclflag4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/aclflag4.cs rename to src/NFSLibrary/Protocols/V4/RPC/aclflag4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/attr_notice4.cs b/src/NFSLibrary/Protocols/V4/RPC/attr_notice4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/attr_notice4.cs rename to src/NFSLibrary/Protocols/V4/RPC/attr_notice4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/attrlist4.cs b/src/NFSLibrary/Protocols/V4/RPC/attrlist4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/attrlist4.cs rename to src/NFSLibrary/Protocols/V4/RPC/attrlist4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/auth_flavor.cs b/src/NFSLibrary/Protocols/V4/RPC/auth_flavor.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/auth_flavor.cs rename to src/NFSLibrary/Protocols/V4/RPC/auth_flavor.cs diff --git a/NFSLibrary/Protocols/V4/RPC/authsys_parms.cs b/src/NFSLibrary/Protocols/V4/RPC/authsys_parms.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/authsys_parms.cs rename to src/NFSLibrary/Protocols/V4/RPC/authsys_parms.cs diff --git a/NFSLibrary/Protocols/V4/RPC/bitmap4.cs b/src/NFSLibrary/Protocols/V4/RPC/bitmap4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/bitmap4.cs rename to src/NFSLibrary/Protocols/V4/RPC/bitmap4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/callback_sec_parms4.cs b/src/NFSLibrary/Protocols/V4/RPC/callback_sec_parms4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/callback_sec_parms4.cs rename to src/NFSLibrary/Protocols/V4/RPC/callback_sec_parms4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/cb_client4.cs b/src/NFSLibrary/Protocols/V4/RPC/cb_client4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/cb_client4.cs rename to src/NFSLibrary/Protocols/V4/RPC/cb_client4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/change_info4.cs b/src/NFSLibrary/Protocols/V4/RPC/change_info4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/change_info4.cs rename to src/NFSLibrary/Protocols/V4/RPC/change_info4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/change_policy4.cs b/src/NFSLibrary/Protocols/V4/RPC/change_policy4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/change_policy4.cs rename to src/NFSLibrary/Protocols/V4/RPC/change_policy4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/changeid4.cs b/src/NFSLibrary/Protocols/V4/RPC/changeid4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/changeid4.cs rename to src/NFSLibrary/Protocols/V4/RPC/changeid4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/channel_attrs4.cs b/src/NFSLibrary/Protocols/V4/RPC/channel_attrs4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/channel_attrs4.cs rename to src/NFSLibrary/Protocols/V4/RPC/channel_attrs4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/channel_dir_from_client4.cs b/src/NFSLibrary/Protocols/V4/RPC/channel_dir_from_client4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/channel_dir_from_client4.cs rename to src/NFSLibrary/Protocols/V4/RPC/channel_dir_from_client4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/channel_dir_from_server4.cs b/src/NFSLibrary/Protocols/V4/RPC/channel_dir_from_server4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/channel_dir_from_server4.cs rename to src/NFSLibrary/Protocols/V4/RPC/channel_dir_from_server4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/client_owner4.cs b/src/NFSLibrary/Protocols/V4/RPC/client_owner4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/client_owner4.cs rename to src/NFSLibrary/Protocols/V4/RPC/client_owner4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/clientaddr4.cs b/src/NFSLibrary/Protocols/V4/RPC/clientaddr4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/clientaddr4.cs rename to src/NFSLibrary/Protocols/V4/RPC/clientaddr4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/clientid4.cs b/src/NFSLibrary/Protocols/V4/RPC/clientid4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/clientid4.cs rename to src/NFSLibrary/Protocols/V4/RPC/clientid4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/component4.cs b/src/NFSLibrary/Protocols/V4/RPC/component4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/component4.cs rename to src/NFSLibrary/Protocols/V4/RPC/component4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/count4.cs b/src/NFSLibrary/Protocols/V4/RPC/count4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/count4.cs rename to src/NFSLibrary/Protocols/V4/RPC/count4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/createhow4.cs b/src/NFSLibrary/Protocols/V4/RPC/createhow4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/createhow4.cs rename to src/NFSLibrary/Protocols/V4/RPC/createhow4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/createmode4.cs b/src/NFSLibrary/Protocols/V4/RPC/createmode4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/createmode4.cs rename to src/NFSLibrary/Protocols/V4/RPC/createmode4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/createtype4.cs b/src/NFSLibrary/Protocols/V4/RPC/createtype4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/createtype4.cs rename to src/NFSLibrary/Protocols/V4/RPC/createtype4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/creatverfattr.cs b/src/NFSLibrary/Protocols/V4/RPC/creatverfattr.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/creatverfattr.cs rename to src/NFSLibrary/Protocols/V4/RPC/creatverfattr.cs diff --git a/NFSLibrary/Protocols/V4/RPC/deleg_claim4.cs b/src/NFSLibrary/Protocols/V4/RPC/deleg_claim4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/deleg_claim4.cs rename to src/NFSLibrary/Protocols/V4/RPC/deleg_claim4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/device_addr4.cs b/src/NFSLibrary/Protocols/V4/RPC/device_addr4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/device_addr4.cs rename to src/NFSLibrary/Protocols/V4/RPC/device_addr4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/deviceid4.cs b/src/NFSLibrary/Protocols/V4/RPC/deviceid4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/deviceid4.cs rename to src/NFSLibrary/Protocols/V4/RPC/deviceid4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/dirlist4.cs b/src/NFSLibrary/Protocols/V4/RPC/dirlist4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/dirlist4.cs rename to src/NFSLibrary/Protocols/V4/RPC/dirlist4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/entry4.cs b/src/NFSLibrary/Protocols/V4/RPC/entry4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/entry4.cs rename to src/NFSLibrary/Protocols/V4/RPC/entry4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/exist_lock_owner4.cs b/src/NFSLibrary/Protocols/V4/RPC/exist_lock_owner4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/exist_lock_owner4.cs rename to src/NFSLibrary/Protocols/V4/RPC/exist_lock_owner4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_acl.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_acl.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_acl.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_acl.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_aclsupport.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_aclsupport.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_aclsupport.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_aclsupport.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_archive.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_archive.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_archive.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_archive.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_cansettime.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_cansettime.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_cansettime.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_cansettime.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_case_insensitive.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_case_insensitive.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_case_insensitive.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_case_insensitive.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_case_preserving.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_case_preserving.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_case_preserving.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_case_preserving.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_change.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_change.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_change.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_change.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_change_policy.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_change_policy.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_change_policy.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_change_policy.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_chown_restricted.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_chown_restricted.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_chown_restricted.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_chown_restricted.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_dacl.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_dacl.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_dacl.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_dacl.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_dir_notif_delay.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_dir_notif_delay.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_dir_notif_delay.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_dir_notif_delay.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_dirent_notif_delay.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_dirent_notif_delay.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_dirent_notif_delay.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_dirent_notif_delay.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_fh_expire_type.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_fh_expire_type.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_fh_expire_type.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_fh_expire_type.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_filehandle.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_filehandle.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_filehandle.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_filehandle.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_fileid.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_fileid.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_fileid.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_fileid.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_files_avail.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_files_avail.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_files_avail.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_files_avail.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_files_free.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_files_free.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_files_free.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_files_free.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_files_total.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_files_total.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_files_total.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_files_total.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_fs_charset_cap.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_fs_charset_cap.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_fs_charset_cap.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_fs_charset_cap.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_fs_layout_types.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_fs_layout_types.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_fs_layout_types.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_fs_layout_types.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_fs_locations.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_fs_locations.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_fs_locations.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_fs_locations.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_fs_locations_info.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_fs_locations_info.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_fs_locations_info.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_fs_locations_info.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_fs_status.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_fs_status.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_fs_status.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_fs_status.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_fsid.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_fsid.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_fsid.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_fsid.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_hidden.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_hidden.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_hidden.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_hidden.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_homogeneous.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_homogeneous.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_homogeneous.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_homogeneous.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_layout_alignment.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_layout_alignment.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_layout_alignment.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_layout_alignment.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_layout_blksize.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_layout_blksize.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_layout_blksize.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_layout_blksize.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_layout_hint.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_layout_hint.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_layout_hint.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_layout_hint.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_layout_types.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_layout_types.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_layout_types.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_layout_types.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_lease_time.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_lease_time.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_lease_time.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_lease_time.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_link_support.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_link_support.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_link_support.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_link_support.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_maxfilesize.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_maxfilesize.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_maxfilesize.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_maxfilesize.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_maxlink.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_maxlink.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_maxlink.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_maxlink.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_maxname.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_maxname.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_maxname.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_maxname.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_maxread.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_maxread.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_maxread.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_maxread.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_maxwrite.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_maxwrite.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_maxwrite.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_maxwrite.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_mdsthreshold.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_mdsthreshold.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_mdsthreshold.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_mdsthreshold.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_mimetype.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_mimetype.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_mimetype.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_mimetype.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_mode.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_mode.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_mode.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_mode.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_mode_set_masked.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_mode_set_masked.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_mode_set_masked.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_mode_set_masked.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_mounted_on_fileid.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_mounted_on_fileid.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_mounted_on_fileid.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_mounted_on_fileid.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_named_attr.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_named_attr.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_named_attr.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_named_attr.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_no_trunc.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_no_trunc.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_no_trunc.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_no_trunc.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_numlinks.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_numlinks.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_numlinks.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_numlinks.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_owner.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_owner.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_owner.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_owner.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_owner_group.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_owner_group.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_owner_group.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_owner_group.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_quota_avail_hard.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_quota_avail_hard.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_quota_avail_hard.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_quota_avail_hard.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_quota_avail_soft.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_quota_avail_soft.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_quota_avail_soft.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_quota_avail_soft.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_quota_used.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_quota_used.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_quota_used.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_quota_used.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_rawdev.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_rawdev.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_rawdev.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_rawdev.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_rdattr_error.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_rdattr_error.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_rdattr_error.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_rdattr_error.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_retentevt_get.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_retentevt_get.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_retentevt_get.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_retentevt_get.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_retentevt_set.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_retentevt_set.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_retentevt_set.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_retentevt_set.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_retention_get.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_retention_get.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_retention_get.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_retention_get.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_retention_hold.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_retention_hold.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_retention_hold.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_retention_hold.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_retention_set.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_retention_set.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_retention_set.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_retention_set.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_sacl.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_sacl.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_sacl.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_sacl.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_size.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_size.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_size.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_size.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_space_avail.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_space_avail.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_space_avail.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_space_avail.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_space_free.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_space_free.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_space_free.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_space_free.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_space_total.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_space_total.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_space_total.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_space_total.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_space_used.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_space_used.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_space_used.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_space_used.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_suppattr_exclcreat.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_suppattr_exclcreat.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_suppattr_exclcreat.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_suppattr_exclcreat.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_supported_attrs.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_supported_attrs.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_supported_attrs.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_supported_attrs.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_symlink_support.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_symlink_support.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_symlink_support.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_symlink_support.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_system.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_system.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_system.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_system.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_time_access.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_time_access.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_time_access.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_time_access.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_time_access_set.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_time_access_set.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_time_access_set.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_time_access_set.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_time_backup.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_time_backup.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_time_backup.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_time_backup.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_time_create.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_time_create.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_time_create.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_time_create.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_time_delta.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_time_delta.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_time_delta.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_time_delta.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_time_metadata.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_time_metadata.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_time_metadata.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_time_metadata.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_time_modify.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_time_modify.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_time_modify.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_time_modify.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_time_modify_set.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_time_modify_set.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_time_modify_set.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_time_modify_set.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_type.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_type.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_type.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_type.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fattr4_unique_handles.cs b/src/NFSLibrary/Protocols/V4/RPC/fattr4_unique_handles.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fattr4_unique_handles.cs rename to src/NFSLibrary/Protocols/V4/RPC/fattr4_unique_handles.cs diff --git a/NFSLibrary/Protocols/V4/RPC/filelayout_hint_care4.cs b/src/NFSLibrary/Protocols/V4/RPC/filelayout_hint_care4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/filelayout_hint_care4.cs rename to src/NFSLibrary/Protocols/V4/RPC/filelayout_hint_care4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fs4_status.cs b/src/NFSLibrary/Protocols/V4/RPC/fs4_status.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fs4_status.cs rename to src/NFSLibrary/Protocols/V4/RPC/fs4_status.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fs4_status_type.cs b/src/NFSLibrary/Protocols/V4/RPC/fs4_status_type.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fs4_status_type.cs rename to src/NFSLibrary/Protocols/V4/RPC/fs4_status_type.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fs_charset_cap4.cs b/src/NFSLibrary/Protocols/V4/RPC/fs_charset_cap4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fs_charset_cap4.cs rename to src/NFSLibrary/Protocols/V4/RPC/fs_charset_cap4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fs_location4.cs b/src/NFSLibrary/Protocols/V4/RPC/fs_location4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fs_location4.cs rename to src/NFSLibrary/Protocols/V4/RPC/fs_location4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fs_locations4.cs b/src/NFSLibrary/Protocols/V4/RPC/fs_locations4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fs_locations4.cs rename to src/NFSLibrary/Protocols/V4/RPC/fs_locations4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fs_locations_info4.cs b/src/NFSLibrary/Protocols/V4/RPC/fs_locations_info4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fs_locations_info4.cs rename to src/NFSLibrary/Protocols/V4/RPC/fs_locations_info4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fs_locations_item4.cs b/src/NFSLibrary/Protocols/V4/RPC/fs_locations_item4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fs_locations_item4.cs rename to src/NFSLibrary/Protocols/V4/RPC/fs_locations_item4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fs_locations_server4.cs b/src/NFSLibrary/Protocols/V4/RPC/fs_locations_server4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fs_locations_server4.cs rename to src/NFSLibrary/Protocols/V4/RPC/fs_locations_server4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/fsid4.cs b/src/NFSLibrary/Protocols/V4/RPC/fsid4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/fsid4.cs rename to src/NFSLibrary/Protocols/V4/RPC/fsid4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/gddrnf4_status.cs b/src/NFSLibrary/Protocols/V4/RPC/gddrnf4_status.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/gddrnf4_status.cs rename to src/NFSLibrary/Protocols/V4/RPC/gddrnf4_status.cs diff --git a/NFSLibrary/Protocols/V4/RPC/gss_cb_handles4.cs b/src/NFSLibrary/Protocols/V4/RPC/gss_cb_handles4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/gss_cb_handles4.cs rename to src/NFSLibrary/Protocols/V4/RPC/gss_cb_handles4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/gsshandle4_t.cs b/src/NFSLibrary/Protocols/V4/RPC/gsshandle4_t.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/gsshandle4_t.cs rename to src/NFSLibrary/Protocols/V4/RPC/gsshandle4_t.cs diff --git a/NFSLibrary/Protocols/V4/RPC/int64_t.cs b/src/NFSLibrary/Protocols/V4/RPC/int64_t.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/int64_t.cs rename to src/NFSLibrary/Protocols/V4/RPC/int64_t.cs diff --git a/NFSLibrary/Protocols/V4/RPC/layout4.cs b/src/NFSLibrary/Protocols/V4/RPC/layout4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/layout4.cs rename to src/NFSLibrary/Protocols/V4/RPC/layout4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/layout_content4.cs b/src/NFSLibrary/Protocols/V4/RPC/layout_content4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/layout_content4.cs rename to src/NFSLibrary/Protocols/V4/RPC/layout_content4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/layouthint4.cs b/src/NFSLibrary/Protocols/V4/RPC/layouthint4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/layouthint4.cs rename to src/NFSLibrary/Protocols/V4/RPC/layouthint4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/layoutiomode4.cs b/src/NFSLibrary/Protocols/V4/RPC/layoutiomode4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/layoutiomode4.cs rename to src/NFSLibrary/Protocols/V4/RPC/layoutiomode4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/layoutreturn4.cs b/src/NFSLibrary/Protocols/V4/RPC/layoutreturn4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/layoutreturn4.cs rename to src/NFSLibrary/Protocols/V4/RPC/layoutreturn4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/layoutreturn_file4.cs b/src/NFSLibrary/Protocols/V4/RPC/layoutreturn_file4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/layoutreturn_file4.cs rename to src/NFSLibrary/Protocols/V4/RPC/layoutreturn_file4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/layoutreturn_stateid.cs b/src/NFSLibrary/Protocols/V4/RPC/layoutreturn_stateid.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/layoutreturn_stateid.cs rename to src/NFSLibrary/Protocols/V4/RPC/layoutreturn_stateid.cs diff --git a/NFSLibrary/Protocols/V4/RPC/layoutreturn_type4.cs b/src/NFSLibrary/Protocols/V4/RPC/layoutreturn_type4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/layoutreturn_type4.cs rename to src/NFSLibrary/Protocols/V4/RPC/layoutreturn_type4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/layouttype4.cs b/src/NFSLibrary/Protocols/V4/RPC/layouttype4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/layouttype4.cs rename to src/NFSLibrary/Protocols/V4/RPC/layouttype4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/layoutupdate4.cs b/src/NFSLibrary/Protocols/V4/RPC/layoutupdate4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/layoutupdate4.cs rename to src/NFSLibrary/Protocols/V4/RPC/layoutupdate4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/length4.cs b/src/NFSLibrary/Protocols/V4/RPC/length4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/length4.cs rename to src/NFSLibrary/Protocols/V4/RPC/length4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/limit_by4.cs b/src/NFSLibrary/Protocols/V4/RPC/limit_by4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/limit_by4.cs rename to src/NFSLibrary/Protocols/V4/RPC/limit_by4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/linktext4.cs b/src/NFSLibrary/Protocols/V4/RPC/linktext4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/linktext4.cs rename to src/NFSLibrary/Protocols/V4/RPC/linktext4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/lock_owner4.cs b/src/NFSLibrary/Protocols/V4/RPC/lock_owner4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/lock_owner4.cs rename to src/NFSLibrary/Protocols/V4/RPC/lock_owner4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/locker4.cs b/src/NFSLibrary/Protocols/V4/RPC/locker4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/locker4.cs rename to src/NFSLibrary/Protocols/V4/RPC/locker4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/mdsthreshold4.cs b/src/NFSLibrary/Protocols/V4/RPC/mdsthreshold4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/mdsthreshold4.cs rename to src/NFSLibrary/Protocols/V4/RPC/mdsthreshold4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/mode4.cs b/src/NFSLibrary/Protocols/V4/RPC/mode4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/mode4.cs rename to src/NFSLibrary/Protocols/V4/RPC/mode4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/mode_masked4.cs b/src/NFSLibrary/Protocols/V4/RPC/mode_masked4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/mode_masked4.cs rename to src/NFSLibrary/Protocols/V4/RPC/mode_masked4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/multipath_list4.cs b/src/NFSLibrary/Protocols/V4/RPC/multipath_list4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/multipath_list4.cs rename to src/NFSLibrary/Protocols/V4/RPC/multipath_list4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/netaddr4.cs b/src/NFSLibrary/Protocols/V4/RPC/netaddr4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/netaddr4.cs rename to src/NFSLibrary/Protocols/V4/RPC/netaddr4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/newoffset4.cs b/src/NFSLibrary/Protocols/V4/RPC/newoffset4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/newoffset4.cs rename to src/NFSLibrary/Protocols/V4/RPC/newoffset4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/newsize4.cs b/src/NFSLibrary/Protocols/V4/RPC/newsize4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/newsize4.cs rename to src/NFSLibrary/Protocols/V4/RPC/newsize4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/newtime4.cs b/src/NFSLibrary/Protocols/V4/RPC/newtime4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/newtime4.cs rename to src/NFSLibrary/Protocols/V4/RPC/newtime4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfl_util4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfl_util4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfl_util4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfl_util4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_argop4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_argop4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_argop4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_argop4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_client_id4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_client_id4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_client_id4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_client_id4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_cookie4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_cookie4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_cookie4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_cookie4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_fh4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_fh4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_fh4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_fh4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_ftype4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_ftype4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_ftype4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_ftype4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_impl_id4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_impl_id4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_impl_id4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_impl_id4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_lease4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_lease4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_lease4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_lease4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_lock_type4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_lock_type4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_lock_type4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_lock_type4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_modified_limit4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_modified_limit4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_modified_limit4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_modified_limit4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_opnum4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_opnum4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_opnum4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_opnum4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_resop4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_resop4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_resop4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_resop4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfs_space_limit4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfs_space_limit4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfs_space_limit4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfs_space_limit4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfsace4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfsace4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfsace4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfsace4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfsacl41.cs b/src/NFSLibrary/Protocols/V4/RPC/nfsacl41.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfsacl41.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfsacl41.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfsstat4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfsstat4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfsstat4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfsstat4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfstime4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfstime4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfstime4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfstime4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layout4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layout4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layout4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layout4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layout_ds_addr4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layout_ds_addr4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layout_ds_addr4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layout_ds_addr4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layouthint4.cs b/src/NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layouthint4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layouthint4.cs rename to src/NFSLibrary/Protocols/V4/RPC/nfsv4_1_file_layouthint4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/offset4.cs b/src/NFSLibrary/Protocols/V4/RPC/offset4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/offset4.cs rename to src/NFSLibrary/Protocols/V4/RPC/offset4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/open_claim4.cs b/src/NFSLibrary/Protocols/V4/RPC/open_claim4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/open_claim4.cs rename to src/NFSLibrary/Protocols/V4/RPC/open_claim4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/open_claim_delegate_cur4.cs b/src/NFSLibrary/Protocols/V4/RPC/open_claim_delegate_cur4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/open_claim_delegate_cur4.cs rename to src/NFSLibrary/Protocols/V4/RPC/open_claim_delegate_cur4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/open_claim_type4.cs b/src/NFSLibrary/Protocols/V4/RPC/open_claim_type4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/open_claim_type4.cs rename to src/NFSLibrary/Protocols/V4/RPC/open_claim_type4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/open_delegation4.cs b/src/NFSLibrary/Protocols/V4/RPC/open_delegation4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/open_delegation4.cs rename to src/NFSLibrary/Protocols/V4/RPC/open_delegation4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/open_delegation_type4.cs b/src/NFSLibrary/Protocols/V4/RPC/open_delegation_type4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/open_delegation_type4.cs rename to src/NFSLibrary/Protocols/V4/RPC/open_delegation_type4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/open_none_delegation4.cs b/src/NFSLibrary/Protocols/V4/RPC/open_none_delegation4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/open_none_delegation4.cs rename to src/NFSLibrary/Protocols/V4/RPC/open_none_delegation4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/open_owner4.cs b/src/NFSLibrary/Protocols/V4/RPC/open_owner4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/open_owner4.cs rename to src/NFSLibrary/Protocols/V4/RPC/open_owner4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/open_read_delegation4.cs b/src/NFSLibrary/Protocols/V4/RPC/open_read_delegation4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/open_read_delegation4.cs rename to src/NFSLibrary/Protocols/V4/RPC/open_read_delegation4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/open_to_lock_owner4.cs b/src/NFSLibrary/Protocols/V4/RPC/open_to_lock_owner4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/open_to_lock_owner4.cs rename to src/NFSLibrary/Protocols/V4/RPC/open_to_lock_owner4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/open_write_delegation4.cs b/src/NFSLibrary/Protocols/V4/RPC/open_write_delegation4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/open_write_delegation4.cs rename to src/NFSLibrary/Protocols/V4/RPC/open_write_delegation4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/openflag4.cs b/src/NFSLibrary/Protocols/V4/RPC/openflag4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/openflag4.cs rename to src/NFSLibrary/Protocols/V4/RPC/openflag4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/opentype4.cs b/src/NFSLibrary/Protocols/V4/RPC/opentype4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/opentype4.cs rename to src/NFSLibrary/Protocols/V4/RPC/opentype4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/pathname4.cs b/src/NFSLibrary/Protocols/V4/RPC/pathname4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/pathname4.cs rename to src/NFSLibrary/Protocols/V4/RPC/pathname4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/qop4.cs b/src/NFSLibrary/Protocols/V4/RPC/qop4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/qop4.cs rename to src/NFSLibrary/Protocols/V4/RPC/qop4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/retention_get4.cs b/src/NFSLibrary/Protocols/V4/RPC/retention_get4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/retention_get4.cs rename to src/NFSLibrary/Protocols/V4/RPC/retention_get4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/retention_set4.cs b/src/NFSLibrary/Protocols/V4/RPC/retention_set4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/retention_set4.cs rename to src/NFSLibrary/Protocols/V4/RPC/retention_set4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/rpc_gss_svc_t.cs b/src/NFSLibrary/Protocols/V4/RPC/rpc_gss_svc_t.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/rpc_gss_svc_t.cs rename to src/NFSLibrary/Protocols/V4/RPC/rpc_gss_svc_t.cs diff --git a/NFSLibrary/Protocols/V4/RPC/rpcsec_gss_info.cs b/src/NFSLibrary/Protocols/V4/RPC/rpcsec_gss_info.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/rpcsec_gss_info.cs rename to src/NFSLibrary/Protocols/V4/RPC/rpcsec_gss_info.cs diff --git a/NFSLibrary/Protocols/V4/RPC/sec_oid4.cs b/src/NFSLibrary/Protocols/V4/RPC/sec_oid4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/sec_oid4.cs rename to src/NFSLibrary/Protocols/V4/RPC/sec_oid4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/secinfo4.cs b/src/NFSLibrary/Protocols/V4/RPC/secinfo4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/secinfo4.cs rename to src/NFSLibrary/Protocols/V4/RPC/secinfo4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/secinfo_style4.cs b/src/NFSLibrary/Protocols/V4/RPC/secinfo_style4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/secinfo_style4.cs rename to src/NFSLibrary/Protocols/V4/RPC/secinfo_style4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/seqid4.cs b/src/NFSLibrary/Protocols/V4/RPC/seqid4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/seqid4.cs rename to src/NFSLibrary/Protocols/V4/RPC/seqid4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/sequenceid4.cs b/src/NFSLibrary/Protocols/V4/RPC/sequenceid4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/sequenceid4.cs rename to src/NFSLibrary/Protocols/V4/RPC/sequenceid4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/server_owner4.cs b/src/NFSLibrary/Protocols/V4/RPC/server_owner4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/server_owner4.cs rename to src/NFSLibrary/Protocols/V4/RPC/server_owner4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/sessionid4.cs b/src/NFSLibrary/Protocols/V4/RPC/sessionid4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/sessionid4.cs rename to src/NFSLibrary/Protocols/V4/RPC/sessionid4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/settime4.cs b/src/NFSLibrary/Protocols/V4/RPC/settime4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/settime4.cs rename to src/NFSLibrary/Protocols/V4/RPC/settime4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/slotid4.cs b/src/NFSLibrary/Protocols/V4/RPC/slotid4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/slotid4.cs rename to src/NFSLibrary/Protocols/V4/RPC/slotid4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/specdata4.cs b/src/NFSLibrary/Protocols/V4/RPC/specdata4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/specdata4.cs rename to src/NFSLibrary/Protocols/V4/RPC/specdata4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ssa_digest_input4.cs b/src/NFSLibrary/Protocols/V4/RPC/ssa_digest_input4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ssa_digest_input4.cs rename to src/NFSLibrary/Protocols/V4/RPC/ssa_digest_input4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ssr_digest_input4.cs b/src/NFSLibrary/Protocols/V4/RPC/ssr_digest_input4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ssr_digest_input4.cs rename to src/NFSLibrary/Protocols/V4/RPC/ssr_digest_input4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ssv_mic_plain_tkn4.cs b/src/NFSLibrary/Protocols/V4/RPC/ssv_mic_plain_tkn4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ssv_mic_plain_tkn4.cs rename to src/NFSLibrary/Protocols/V4/RPC/ssv_mic_plain_tkn4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ssv_mic_tkn4.cs b/src/NFSLibrary/Protocols/V4/RPC/ssv_mic_tkn4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ssv_mic_tkn4.cs rename to src/NFSLibrary/Protocols/V4/RPC/ssv_mic_tkn4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ssv_prot_info4.cs b/src/NFSLibrary/Protocols/V4/RPC/ssv_prot_info4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ssv_prot_info4.cs rename to src/NFSLibrary/Protocols/V4/RPC/ssv_prot_info4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ssv_seal_cipher_tkn4.cs b/src/NFSLibrary/Protocols/V4/RPC/ssv_seal_cipher_tkn4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ssv_seal_cipher_tkn4.cs rename to src/NFSLibrary/Protocols/V4/RPC/ssv_seal_cipher_tkn4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ssv_seal_plain_tkn4.cs b/src/NFSLibrary/Protocols/V4/RPC/ssv_seal_plain_tkn4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ssv_seal_plain_tkn4.cs rename to src/NFSLibrary/Protocols/V4/RPC/ssv_seal_plain_tkn4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ssv_sp_parms4.cs b/src/NFSLibrary/Protocols/V4/RPC/ssv_sp_parms4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ssv_sp_parms4.cs rename to src/NFSLibrary/Protocols/V4/RPC/ssv_sp_parms4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/ssv_subkey4.cs b/src/NFSLibrary/Protocols/V4/RPC/ssv_subkey4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/ssv_subkey4.cs rename to src/NFSLibrary/Protocols/V4/RPC/ssv_subkey4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/stable_how4.cs b/src/NFSLibrary/Protocols/V4/RPC/stable_how4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/stable_how4.cs rename to src/NFSLibrary/Protocols/V4/RPC/stable_how4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/state_owner4.cs b/src/NFSLibrary/Protocols/V4/RPC/state_owner4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/state_owner4.cs rename to src/NFSLibrary/Protocols/V4/RPC/state_owner4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/state_protect4_a.cs b/src/NFSLibrary/Protocols/V4/RPC/state_protect4_a.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/state_protect4_a.cs rename to src/NFSLibrary/Protocols/V4/RPC/state_protect4_a.cs diff --git a/NFSLibrary/Protocols/V4/RPC/state_protect4_r.cs b/src/NFSLibrary/Protocols/V4/RPC/state_protect4_r.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/state_protect4_r.cs rename to src/NFSLibrary/Protocols/V4/RPC/state_protect4_r.cs diff --git a/NFSLibrary/Protocols/V4/RPC/state_protect_how4.cs b/src/NFSLibrary/Protocols/V4/RPC/state_protect_how4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/state_protect_how4.cs rename to src/NFSLibrary/Protocols/V4/RPC/state_protect_how4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/state_protect_ops4.cs b/src/NFSLibrary/Protocols/V4/RPC/state_protect_ops4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/state_protect_ops4.cs rename to src/NFSLibrary/Protocols/V4/RPC/state_protect_ops4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/stateid4.cs b/src/NFSLibrary/Protocols/V4/RPC/stateid4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/stateid4.cs rename to src/NFSLibrary/Protocols/V4/RPC/stateid4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/threshold4_read_iosize.cs b/src/NFSLibrary/Protocols/V4/RPC/threshold4_read_iosize.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/threshold4_read_iosize.cs rename to src/NFSLibrary/Protocols/V4/RPC/threshold4_read_iosize.cs diff --git a/NFSLibrary/Protocols/V4/RPC/threshold4_read_size.cs b/src/NFSLibrary/Protocols/V4/RPC/threshold4_read_size.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/threshold4_read_size.cs rename to src/NFSLibrary/Protocols/V4/RPC/threshold4_read_size.cs diff --git a/NFSLibrary/Protocols/V4/RPC/threshold4_write_iosize.cs b/src/NFSLibrary/Protocols/V4/RPC/threshold4_write_iosize.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/threshold4_write_iosize.cs rename to src/NFSLibrary/Protocols/V4/RPC/threshold4_write_iosize.cs diff --git a/NFSLibrary/Protocols/V4/RPC/threshold4_write_size.cs b/src/NFSLibrary/Protocols/V4/RPC/threshold4_write_size.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/threshold4_write_size.cs rename to src/NFSLibrary/Protocols/V4/RPC/threshold4_write_size.cs diff --git a/NFSLibrary/Protocols/V4/RPC/threshold_item4.cs b/src/NFSLibrary/Protocols/V4/RPC/threshold_item4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/threshold_item4.cs rename to src/NFSLibrary/Protocols/V4/RPC/threshold_item4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/time_how4.cs b/src/NFSLibrary/Protocols/V4/RPC/time_how4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/time_how4.cs rename to src/NFSLibrary/Protocols/V4/RPC/time_how4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/uint32_t.cs b/src/NFSLibrary/Protocols/V4/RPC/uint32_t.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/uint32_t.cs rename to src/NFSLibrary/Protocols/V4/RPC/uint32_t.cs diff --git a/NFSLibrary/Protocols/V4/RPC/uint64_t.cs b/src/NFSLibrary/Protocols/V4/RPC/uint64_t.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/uint64_t.cs rename to src/NFSLibrary/Protocols/V4/RPC/uint64_t.cs diff --git a/NFSLibrary/Protocols/V4/RPC/utf8str_cis.cs b/src/NFSLibrary/Protocols/V4/RPC/utf8str_cis.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/utf8str_cis.cs rename to src/NFSLibrary/Protocols/V4/RPC/utf8str_cis.cs diff --git a/NFSLibrary/Protocols/V4/RPC/utf8str_cs.cs b/src/NFSLibrary/Protocols/V4/RPC/utf8str_cs.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/utf8str_cs.cs rename to src/NFSLibrary/Protocols/V4/RPC/utf8str_cs.cs diff --git a/NFSLibrary/Protocols/V4/RPC/utf8str_mixed.cs b/src/NFSLibrary/Protocols/V4/RPC/utf8str_mixed.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/utf8str_mixed.cs rename to src/NFSLibrary/Protocols/V4/RPC/utf8str_mixed.cs diff --git a/NFSLibrary/Protocols/V4/RPC/utf8string.cs b/src/NFSLibrary/Protocols/V4/RPC/utf8string.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/utf8string.cs rename to src/NFSLibrary/Protocols/V4/RPC/utf8string.cs diff --git a/NFSLibrary/Protocols/V4/RPC/verifier4.cs b/src/NFSLibrary/Protocols/V4/RPC/verifier4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/verifier4.cs rename to src/NFSLibrary/Protocols/V4/RPC/verifier4.cs diff --git a/NFSLibrary/Protocols/V4/RPC/why_no_delegation4.cs b/src/NFSLibrary/Protocols/V4/RPC/why_no_delegation4.cs similarity index 100% rename from NFSLibrary/Protocols/V4/RPC/why_no_delegation4.cs rename to src/NFSLibrary/Protocols/V4/RPC/why_no_delegation4.cs diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAcceptStatus.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAcceptStatus.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAcceptStatus.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAcceptStatus.cs index cdbba72..f3f8b43 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAcceptStatus.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAcceptStatus.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// A collection of constants used to identify the acceptance status of /// ONC/RPC reply messages. @@ -37,12 +37,12 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcAcceptStatus - { + public class OncRpcAcceptStatus + { /// The remote procedure was called and executed successfully. /// The remote procedure was called and executed successfully. - public const int ONCRPC_SUCCESS = 0; - + public const int ONCRPC_SUCCESS = 0; + /// The program requested is not available. /// /// The program requested is not available. So the remote host @@ -50,22 +50,22 @@ public class OncRpcAcceptStatus /// which you tried to send a RPC call message doesn't know of this /// program either. /// - public const int ONCRPC_PROG_UNAVAIL = 1; - + public const int ONCRPC_PROG_UNAVAIL = 1; + /// A program version number mismatch occured. /// /// A program version number mismatch occured. The remote ONC/RPC /// server does not support this particular version of the program. /// - public const int ONCRPC_PROG_MISMATCH = 2; - + public const int ONCRPC_PROG_MISMATCH = 2; + /// The procedure requested is not available. /// /// The procedure requested is not available. The remote ONC/RPC server /// does not support this particular procedure. /// - public const int ONCRPC_PROC_UNAVAIL = 3; - + public const int ONCRPC_PROC_UNAVAIL = 3; + /// /// The server could not decode the arguments sent within the ONC/RPC /// call message. @@ -74,8 +74,8 @@ public class OncRpcAcceptStatus /// The server could not decode the arguments sent within the ONC/RPC /// call message. /// - public const int ONCRPC_GARBAGE_ARGS = 4; - + public const int ONCRPC_GARBAGE_ARGS = 4; + /// /// The server encountered a system error and thus was not able to /// process the procedure call. @@ -85,6 +85,6 @@ public class OncRpcAcceptStatus /// process the procedure call. Causes might be memory shortage, /// desinterest and sloth. /// - public const int ONCRPC_SYSTEM_ERR = 5; + public const int ONCRPC_SYSTEM_ERR = 5; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthConstants.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthConstants.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthConstants.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthConstants.cs index 5941179..7ecac57 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthConstants.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthConstants.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// A collection of constants related to authentication and generally usefull /// for ONC/RPC. @@ -37,18 +37,18 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcAuthConstants - { + public class OncRpcAuthConstants + { /// Maximum length of opaque authentication information. /// Maximum length of opaque authentication information. - public const int ONCRPC_MAX_AUTH_BYTES = 400; - + public const int ONCRPC_MAX_AUTH_BYTES = 400; + /// Maximum length of machine name. /// Maximum length of machine name. - public const int ONCRPC_MAX_MACHINE_NAME = 255; - + public const int ONCRPC_MAX_MACHINE_NAME = 255; + /// Maximum allowed number of groups. /// Maximum allowed number of groups. - public const int ONCRPC_MAX_GROUPS = 16; + public const int ONCRPC_MAX_GROUPS = 16; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthStatus.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthStatus.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthStatus.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthStatus.cs index f79ab62..c68489c 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthStatus.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthStatus.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// A collection of constants used to identify the authentication status /// (or any authentication errors) in ONC/RPC replies of the corresponding @@ -39,12 +39,12 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcAuthStatus - { + public class OncRpcAuthStatus + { /// There is no authentication problem or error. /// There is no authentication problem or error. - public const int ONCRPC_AUTH_OK = 0; - + public const int ONCRPC_AUTH_OK = 0; + /// /// The ONC/RPC server detected a bad credential (that is, the seal was /// broken). @@ -53,8 +53,8 @@ public class OncRpcAuthStatus /// The ONC/RPC server detected a bad credential (that is, the seal was /// broken). /// - public const int ONCRPC_AUTH_BADCRED = 1; - + public const int ONCRPC_AUTH_BADCRED = 1; + /// /// The ONC/RPC server has rejected the credential and forces the caller /// to begin a new session. @@ -63,8 +63,8 @@ public class OncRpcAuthStatus /// The ONC/RPC server has rejected the credential and forces the caller /// to begin a new session. /// - public const int ONCRPC_AUTH_REJECTEDCRED = 2; - + public const int ONCRPC_AUTH_REJECTEDCRED = 2; + /// /// The ONC/RPC server detected a bad verifier (that is, the seal was /// broken). @@ -73,8 +73,8 @@ public class OncRpcAuthStatus /// The ONC/RPC server detected a bad verifier (that is, the seal was /// broken). /// - public const int ONCRPC_AUTH_BADVERF = 3; - + public const int ONCRPC_AUTH_BADVERF = 3; + /// /// The ONC/RPC server detected an expired verifier (which can also happen /// if the verifier was replayed). @@ -83,18 +83,18 @@ public class OncRpcAuthStatus /// The ONC/RPC server detected an expired verifier (which can also happen /// if the verifier was replayed). /// - public const int ONCRPC_AUTH_REJECTEDVERF = 4; - + public const int ONCRPC_AUTH_REJECTEDVERF = 4; + /// The ONC/RPC server rejected the authentication for security reasons. /// The ONC/RPC server rejected the authentication for security reasons. - public const int ONCRPC_AUTH_TOOWEAK = 5; - + public const int ONCRPC_AUTH_TOOWEAK = 5; + /// The ONC/RPC client detected a bogus response verifier. /// The ONC/RPC client detected a bogus response verifier. - public const int ONCRPC_AUTH_INVALIDRESP = 6; - + public const int ONCRPC_AUTH_INVALIDRESP = 6; + /// Authentication at the ONC/RPC client failed for an unknown reason. /// Authentication at the ONC/RPC client failed for an unknown reason. - public const int ONCRPC_AUTH_FAILED = 7; + public const int ONCRPC_AUTH_FAILED = 7; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthType.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthType.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthType.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthType.cs index e755197..2069ad6 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthType.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthType.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// A collection of constants used to identify the authentication schemes /// available for ONC/RPC. @@ -38,12 +38,12 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcAuthType - { + public class OncRpcAuthType + { /// No authentication scheme used for this remote procedure call. /// No authentication scheme used for this remote procedure call. - public const int ONCRPC_AUTH_NONE = 0; - + public const int ONCRPC_AUTH_NONE = 0; + /// The so-called "Unix" authentication scheme is not supported. /// /// The so-called "Unix" authentication scheme is not supported. This one @@ -51,12 +51,12 @@ public class OncRpcAuthType /// is simply far too weak to use in typical situations where /// authentication is requested. /// - public const int ONCRPC_AUTH_UNIX = 1; - + public const int ONCRPC_AUTH_UNIX = 1; + /// The so-called "short hand Unix style" is not supported. /// The so-called "short hand Unix style" is not supported. - public const int ONCRPC_AUTH_SHORT = 2; - + public const int ONCRPC_AUTH_SHORT = 2; + /// /// The DES authentication scheme (using encrypted time stamps) is not /// supported -- and besides, it's not a silver bullet either. @@ -65,6 +65,6 @@ public class OncRpcAuthType /// The DES authentication scheme (using encrypted time stamps) is not /// supported -- and besides, it's not a silver bullet either. /// - public const int ONCRPC_AUTH_DES = 3; + public const int ONCRPC_AUTH_DES = 3; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthenticationException.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthenticationException.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthenticationException.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthenticationException.cs index c7c796e..fcccc03 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthenticationException.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcAuthenticationException.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The class OncRpcAuthenticationException indicates an /// authentication exception. @@ -36,15 +36,15 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2005/11/11 21:01:44 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - [System.Serializable] - public class OncRpcAuthenticationException : org.acplt.oncrpc.OncRpcException - { + [System.Serializable] + public class OncRpcAuthenticationException : org.acplt.oncrpc.OncRpcException + { /// Defines the serial version UID for OncRpcAuthenticationException. /// /// Defines the serial version UID for OncRpcAuthenticationException. /// - private const long serialVersionUID = 7747394107888423440L; - + private const long serialVersionUID = 7747394107888423440L; + /// /// Initializes an OncRpcAuthenticationException /// with a detail of @@ -60,11 +60,11 @@ public class OncRpcAuthenticationException : org.acplt.oncrpc.OncRpcException /// OncRpcAuthStatus constants /// . /// - public OncRpcAuthenticationException(int authStatus) : base(RPC_AUTHERROR) - { - authStatusDetail = authStatus; - } - + public OncRpcAuthenticationException(int authStatus) : base(RPC_AUTHERROR) + { + authStatusDetail = authStatus; + } + /// /// Returns the authentication status detail of this ONC/RPC exception /// object. @@ -74,11 +74,11 @@ public OncRpcAuthenticationException(int authStatus) : base(RPC_AUTHERROR) /// object. /// /// The authentication status of this OncRpcException. - public virtual int getAuthStatus() - { - return authStatusDetail; - } - + public virtual int getAuthStatus() + { + return authStatusDetail; + } + /// /// Specific authentication status detail (reason why this authentication /// exception was thrown). @@ -88,6 +88,6 @@ public virtual int getAuthStatus() /// exception was thrown). /// /// - private int authStatusDetail; + private int authStatusDetail; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastAdapter.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastAdapter.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastAdapter.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastAdapter.cs index 80f5b72..5ddf903 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastAdapter.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastAdapter.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// An abstract adapter class for /// receiving @@ -41,13 +41,13 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public abstract class OncRpcBroadcastAdapter : org.acplt.oncrpc.OncRpcBroadcastListener - { + public abstract class OncRpcBroadcastAdapter : org.acplt.oncrpc.OncRpcBroadcastListener + { /// Invoked when a reply to an ONC/RPC broadcast call is received. /// Invoked when a reply to an ONC/RPC broadcast call is received. /// OncRpcBroadcastEvent - public virtual void replyReceived(org.acplt.oncrpc.OncRpcBroadcastEvent evt) - { - } + public virtual void replyReceived(org.acplt.oncrpc.OncRpcBroadcastEvent evt) + { + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastEvent.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastEvent.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastEvent.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastEvent.cs index e466999..b0310db 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastEvent.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastEvent.cs @@ -23,9 +23,9 @@ */ using System.Net; - + namespace org.acplt.oncrpc -{ +{ /// /// The class OncRpcBroadcastEvent defines an event fired by /// ONC/RPC UDP/IP-based clients @@ -42,13 +42,13 @@ namespace org.acplt.oncrpc /// $Revision: 1.3 $ $Date: 2005/11/11 21:19:20 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - [System.Serializable] - public class OncRpcBroadcastEvent - { + [System.Serializable] + public class OncRpcBroadcastEvent + { /// Defines the serial version UID for OncRpcBroadcastEvent. /// Defines the serial version UID for OncRpcBroadcastEvent. - private const long serialVersionUID = 1604512454490873965L; - + private const long serialVersionUID = 1604512454490873965L; + /// /// Creates a new KscPackageUpdateEvent object and /// initializes its state. @@ -67,63 +67,63 @@ public class OncRpcBroadcastEvent /// Procedure number of ONC/RPC call. /// The ONC/RPC call resulting in this reply. /// The ONC/RPC reply itself. - public OncRpcBroadcastEvent(org.acplt.oncrpc.OncRpcUdpClient source, IPAddress - replyAddress, int procedureNumber, org.acplt.oncrpc.XdrAble @params, org.acplt.oncrpc.XdrAble - reply) - { - this.replyAddress = replyAddress; - this.procedureNumber = procedureNumber; - this.@params = @params; - this.reply = reply; - } - + public OncRpcBroadcastEvent(org.acplt.oncrpc.OncRpcUdpClient source, IPAddress + replyAddress, int procedureNumber, org.acplt.oncrpc.XdrAble @params, org.acplt.oncrpc.XdrAble + reply) + { + this.replyAddress = replyAddress; + this.procedureNumber = procedureNumber; + this.@params = @params; + this.reply = reply; + } + /// Returns the address of the sender of the ONC/RPC reply message. /// Returns the address of the sender of the ONC/RPC reply message. /// address of sender of reply. - public virtual IPAddress getReplyAddress() - { - return replyAddress; - } - + public virtual IPAddress getReplyAddress() + { + return replyAddress; + } + /// Returns ONC/RPC reply message. /// Returns ONC/RPC reply message. /// reply message object. - public virtual org.acplt.oncrpc.XdrAble getReply() - { - return reply; - } - + public virtual org.acplt.oncrpc.XdrAble getReply() + { + return reply; + } + /// Returns the number of the remote procedure called. /// Returns the number of the remote procedure called. /// procedure number. - public virtual int getProcedureNumber() - { - return procedureNumber; - } - + public virtual int getProcedureNumber() + { + return procedureNumber; + } + /// Returns the parameter message sent in a broadcast RPC. /// Returns the parameter message sent in a broadcast RPC. /// parameter message object. - public virtual org.acplt.oncrpc.XdrAble getParams() - { - return @params; - } - + public virtual org.acplt.oncrpc.XdrAble getParams() + { + return @params; + } + /// Contains the address of the sender of the ONC/RPC reply message. /// Contains the address of the sender of the ONC/RPC reply message. /// - private IPAddress replyAddress; - + private IPAddress replyAddress; + /// Contains the number of the remote procedure called. /// Contains the number of the remote procedure called. /// - private int procedureNumber; - + private int procedureNumber; + /// Contains the parameters sent in the ONC/RPC broadcast call. /// Contains the parameters sent in the ONC/RPC broadcast call. /// - private org.acplt.oncrpc.XdrAble @params; - + private org.acplt.oncrpc.XdrAble @params; + /// /// Contains the reply from a remote ONC/RPC server, which answered /// the broadcast call. @@ -133,6 +133,6 @@ public virtual org.acplt.oncrpc.XdrAble getParams() /// the broadcast call. /// /// - private org.acplt.oncrpc.XdrAble reply; + private org.acplt.oncrpc.XdrAble reply; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastListener.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastListener.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastListener.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastListener.cs index bc56c73..1df1980 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastListener.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcBroadcastListener.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The listener class for /// receiving @@ -35,8 +35,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public interface OncRpcBroadcastListener - { + public interface OncRpcBroadcastListener + { /// Invoked when a reply to an ONC/RPC broadcast call is received. /// /// Invoked when a reply to an ONC/RPC broadcast call is received. @@ -47,6 +47,6 @@ public interface OncRpcBroadcastListener /// packet drops when you stay too long in the processing stage. /// /// OncRpcBroadcastEvent - void replyReceived(org.acplt.oncrpc.OncRpcBroadcastEvent evt); + void replyReceived(org.acplt.oncrpc.OncRpcBroadcastEvent evt); } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcCallMessage.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcCallMessage.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcCallMessage.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcCallMessage.cs index 92eeb3e..702f0e1 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcCallMessage.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcCallMessage.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The OncRpcCallMessage class represents a remote procedure call /// message as defined by ONC/RPC in RFC 1831. @@ -46,33 +46,33 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2003/08/14 07:55:07 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public abstract class OncRpcCallMessage : org.acplt.oncrpc.OncRpcMessage - { + public abstract class OncRpcCallMessage : org.acplt.oncrpc.OncRpcMessage + { /// Protocol version used by this ONC/RPC Java implementation. /// /// Protocol version used by this ONC/RPC Java implementation. The protocol /// version 2 is defined in RFC 1831. /// - public const int ONCRPC_VERSION = 2; - + public const int ONCRPC_VERSION = 2; + /// Protocol version used by this ONC/RPC call message. /// Protocol version used by this ONC/RPC call message. - public int oncRpcVersion; - + public int oncRpcVersion; + /// Program number of this particular remote procedure call message. /// Program number of this particular remote procedure call message. - public int program; - + public int program; + /// Program version number of this particular remote procedure call message. /// /// Program version number of this particular remote procedure call message. /// - public int version; - + public int version; + /// Number (identifier) of remote procedure to call. /// Number (identifier) of remote procedure to call. - public int procedure; - + public int procedure; + /// Constructs and initialises a new ONC/RPC call message header. /// Constructs and initialises a new ONC/RPC call message header. /// @@ -82,16 +82,16 @@ public abstract class OncRpcCallMessage : org.acplt.oncrpc.OncRpcMessage /// Program number of the remote procedure to call. /// Program version number of the remote procedure to call. /// Procedure number (identifier) of the procedure to call. - public OncRpcCallMessage(int messageId, int program, int version, int procedure) : - base(messageId) - { - messageType = org.acplt.oncrpc.OncRpcMessageType.ONCRPC_CALL; - oncRpcVersion = ONCRPC_VERSION; - this.program = program; - this.version = version; - this.procedure = procedure; - } - + public OncRpcCallMessage(int messageId, int program, int version, int procedure) : + base(messageId) + { + messageType = org.acplt.oncrpc.OncRpcMessageType.ONCRPC_CALL; + oncRpcVersion = ONCRPC_VERSION; + this.program = program; + this.version = version; + this.procedure = procedure; + } + /// Constructs a new (incompletely initialized) ONC/RPC call message header. /// /// @@ -103,13 +103,13 @@ public OncRpcCallMessage(int messageId, int program, int version, int procedure) /// ONCRPC_VERSION /// . /// - public OncRpcCallMessage() : base(0) - { - messageType = org.acplt.oncrpc.OncRpcMessageType.ONCRPC_CALL; - oncRpcVersion = ONCRPC_VERSION; - this.program = 0; - this.version = 0; - this.procedure = 0; - } + public OncRpcCallMessage() : base(0) + { + messageType = org.acplt.oncrpc.OncRpcMessageType.ONCRPC_CALL; + oncRpcVersion = ONCRPC_VERSION; + this.program = 0; + this.version = 0; + this.procedure = 0; + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClient.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClient.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClient.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClient.cs index a5b7657..b97e9c0 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClient.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClient.cs @@ -24,9 +24,9 @@ using System; using System.Net; - + namespace org.acplt.oncrpc -{ +{ /// /// The abstract OncRpcClient class is the foundation for /// protcol-specific ONC/RPC clients. @@ -256,8 +256,8 @@ namespace org.acplt.oncrpc /// $Revision: 1.3 $ $Date: 2003/08/14 13:48:33 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public abstract class OncRpcClient - { + public abstract class OncRpcClient + { /// Constructs an OncRpcClient object (the generic part). /// /// Constructs an OncRpcClient object (the generic part). If @@ -277,46 +277,46 @@ public abstract class OncRpcClient /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - internal OncRpcClient(IPAddress host, int program, int version, int port - , int protocol) - { - // - // Set up the basics... - // - this.host = host; - this.program = program; - this.version = version; - // - // Initialize the message identifier with some more-or-less random - // value. - // - long seed = DateTime.Now.Ticks; - xid = ((int)seed) ^ ((int)((seed) >> (32 & 0x1f))); - // - // If the port number of the ONC/RPC server to contact is not yet - // known, try to find it out. For this we need to contact the portmap - // process at the given host and ask it for the desired program. - // - // In case of tunneling through the HTTP protocol, we accept a port - // number of zero and do not resolve it. This task is left up to - // the other end of the HTTP tunnel (at the web server). - // - if ((port == 0) && (protocol != org.acplt.oncrpc.OncRpcProtocols.ONCRPC_HTTP)) - { - org.acplt.oncrpc.OncRpcPortmapClient portmap = new org.acplt.oncrpc.OncRpcPortmapClient - (host); - try - { - port = portmap.getPort(program, version, protocol); - } - finally - { - portmap.close(); - } - } - this.port = port; - } - + internal OncRpcClient(IPAddress host, int program, int version, int port + , int protocol) + { + // + // Set up the basics... + // + this.host = host; + this.program = program; + this.version = version; + // + // Initialize the message identifier with some more-or-less random + // value. + // + long seed = DateTime.Now.Ticks; + xid = ((int)seed) ^ ((int)((seed) >> (32 & 0x1f))); + // + // If the port number of the ONC/RPC server to contact is not yet + // known, try to find it out. For this we need to contact the portmap + // process at the given host and ask it for the desired program. + // + // In case of tunneling through the HTTP protocol, we accept a port + // number of zero and do not resolve it. This task is left up to + // the other end of the HTTP tunnel (at the web server). + // + if ((port == 0) && (protocol != org.acplt.oncrpc.OncRpcProtocols.ONCRPC_HTTP)) + { + org.acplt.oncrpc.OncRpcPortmapClient portmap = new org.acplt.oncrpc.OncRpcPortmapClient + (host); + try + { + port = portmap.getPort(program, version, protocol); + } + finally + { + portmap.close(); + } + } + this.port = port; + } + /// /// Creates a new ONC/RPC client object, which can handle the requested /// protocol. @@ -338,12 +338,12 @@ internal OncRpcClient(IPAddress host, int program, int version, int port /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public static OncRpcClient newOncRpcClient(IPAddress - host, int program, int version, int protocol, bool useSecurePort) - { - return newOncRpcClient(host, program, version, 0, protocol, useSecurePort); - } - + public static OncRpcClient newOncRpcClient(IPAddress + host, int program, int version, int protocol, bool useSecurePort) + { + return newOncRpcClient(host, program, version, 0, protocol, useSecurePort); + } + /// /// Creates a new ONC/RPC client object, which can handle the requested /// protocol. @@ -369,34 +369,34 @@ public static OncRpcClient newOncRpcClient(IPAddress /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public static OncRpcClient newOncRpcClient(IPAddress - host, int program, int version, int port, int protocol, bool useSecurePort) - { - switch (protocol) - { - case org.acplt.oncrpc.OncRpcProtocols.ONCRPC_UDP: - { - // - // Now we need to create a protocol client object, which will know - // how to create the network connection and how to send and receive - // data to and from it. - // - return new OncRpcUdpClient(host, program, version, port, useSecurePort); - } - - case OncRpcProtocols.ONCRPC_TCP: - { - return new OncRpcTcpClient(host, program, version, port, useSecurePort); - } - - default: - { - throw (new OncRpcException(OncRpcException.RPC_UNKNOWNPROTO - )); - } - } - } - + public static OncRpcClient newOncRpcClient(IPAddress + host, int program, int version, int port, int protocol, bool useSecurePort) + { + switch (protocol) + { + case org.acplt.oncrpc.OncRpcProtocols.ONCRPC_UDP: + { + // + // Now we need to create a protocol client object, which will know + // how to create the network connection and how to send and receive + // data to and from it. + // + return new OncRpcUdpClient(host, program, version, port, useSecurePort); + } + + case OncRpcProtocols.ONCRPC_TCP: + { + return new OncRpcTcpClient(host, program, version, port, useSecurePort); + } + + default: + { + throw (new OncRpcException(OncRpcException.RPC_UNKNOWNPROTO + )); + } + } + } + /// /// Close the connection to an ONC/RPC server and free all network-related /// resources. @@ -408,10 +408,10 @@ public static OncRpcClient newOncRpcClient(IPAddress /// /// if an ONC/RPC error occurs. /// - public virtual void close() - { - } - + public virtual void close() + { + } + /// Calls a remote procedure on an ONC/RPC server. /// /// Calls a remote procedure on an ONC/RPC server. @@ -434,18 +434,18 @@ public virtual void close() /// The object receiving the result of the procedure call. /// if an ONC/RPC error occurs. /// - public virtual void call(int procedureNumber, XdrAble @params, XdrAble - result) - { - lock (this) - { - // - // Use the default version number as specified for this client. - // - call(procedureNumber, version, @params, result); - } - } - + public virtual void call(int procedureNumber, XdrAble @params, XdrAble + result) + { + lock (this) + { + // + // Use the default version number as specified for this client. + // + call(procedureNumber, version, @params, result); + } + } + /// Calls a remote procedure on an ONC/RPC server. /// Calls a remote procedure on an ONC/RPC server. /// Procedure number of the procedure to call. @@ -459,9 +459,9 @@ public virtual void call(int procedureNumber, XdrAble @params, XdrAble /// The object receiving the result of the procedure call. /// if an ONC/RPC error occurs. /// - public abstract void call(int procedureNumber, int versionNumber, XdrAble - parameters, XdrAble result); - + public abstract void call(int procedureNumber, int versionNumber, XdrAble + parameters, XdrAble result); + /// /// Set the timout for remote procedure calls to wait for an answer from /// the ONC/RPC server. @@ -481,108 +481,108 @@ public abstract void call(int procedureNumber, int versionNumber, XdrAble /// Timeout in milliseconds. A timeout of zero indicates /// batched calls. /// - public virtual void setTimeout(int milliseconds) - { - if (milliseconds < 0) - { - throw (new System.ArgumentException("timeouts can not be negative.")); - } - timeout = milliseconds; - } - + public virtual void setTimeout(int milliseconds) + { + if (milliseconds < 0) + { + throw (new System.ArgumentException("timeouts can not be negative.")); + } + timeout = milliseconds; + } + /// Retrieve the current timeout set for remote procedure calls. /// /// Retrieve the current timeout set for remote procedure calls. A timeout /// of zero indicates batching calls (no reply message is expected). /// /// Current timeout. - public virtual int getTimeout() - { - return timeout; - } - + public virtual int getTimeout() + { + return timeout; + } + /// Returns the program number specified when creating this client. /// Returns the program number specified when creating this client. /// ONC/RPC program number. - public virtual int getProgram() - { - return program; - } - + public virtual int getProgram() + { + return program; + } + /// Returns the version number specified when creating this client. /// Returns the version number specified when creating this client. /// ONC/RPC version number of ONC/RPC program. - public virtual int getVersion() - { - return version; - } - + public virtual int getVersion() + { + return version; + } + /// Returns the IP address of the server's host this client is connected to. /// /// Returns the IP address of the server's host this client is connected to. /// /// IP address of host. - public virtual IPAddress getHost() - { - return host; - } - + public virtual IPAddress getHost() + { + return host; + } + /// Returns port number of the server this client is connected to. /// Returns port number of the server this client is connected to. /// port number of ONC/RPC server. - public virtual int getPort() - { - return port; - } - + public virtual int getPort() + { + return port; + } + /// Sets the authentication to be used when making ONC/RPC calls. /// Sets the authentication to be used when making ONC/RPC calls. /// /// Authentication protocol handling object encapsulating /// authentication information. /// - public virtual void setAuth(OncRpcClientAuth auth) - { - this.auth = auth; - } - + public virtual void setAuth(OncRpcClientAuth auth) + { + this.auth = auth; + } + /// Returns the current authentication. /// Returns the current authentication. /// /// Authentication protocol handling object encapsulating /// authentication information. /// - public virtual OncRpcClientAuth getAuth() - { - return auth; - } - + public virtual OncRpcClientAuth getAuth() + { + return auth; + } + /// Set the character encoding for (de-)serializing strings. /// Set the character encoding for (de-)serializing strings. /// /// the encoding to use for (de-)serializing strings. /// If null, the system's default encoding is to be used. /// - public abstract void setCharacterEncoding(string characterEncoding); - + public abstract void setCharacterEncoding(string characterEncoding); + /// Get the character encoding for (de-)serializing strings. /// Get the character encoding for (de-)serializing strings. /// /// the encoding currently used for (de-)serializing strings. /// If null, then the system's default encoding is used. /// - public abstract string getCharacterEncoding(); - + public abstract string getCharacterEncoding(); + /// Create next message identifier. /// /// Create next message identifier. Message identifiers are used to match /// corresponding ONC/RPC call and reply messages. /// - internal virtual void nextXid() - { - xid++; - } - + internal virtual void nextXid() + { + xid++; + } + /// /// Internet address of the host where the ONC/RPC server we want to /// communicate with is located at. @@ -591,8 +591,8 @@ internal virtual void nextXid() /// Internet address of the host where the ONC/RPC server we want to /// communicate with is located at. /// - internal IPAddress host; - + internal IPAddress host; + /// Timeout (in milliseconds) for communication with an ONC/RPC server. /// /// Timeout (in milliseconds) for communication with an ONC/RPC server. @@ -602,20 +602,20 @@ internal virtual void nextXid() /// will throw an exception if no answer from the ONC/RPC server is /// received within the timeout time span. /// - internal int timeout = 30000; - + internal int timeout = 30000; + /// Program number of the ONC/RPC server to communicate with. /// Program number of the ONC/RPC server to communicate with. - internal int program; - + internal int program; + /// Version number of the ONC/RPC server to communicate with. /// Version number of the ONC/RPC server to communicate with. - internal int version; - + internal int version; + /// Port number at which the ONC/RPC server can be contacted. /// Port number at which the ONC/RPC server can be contacted. - internal int port; - + internal int port; + /// /// The message id (also sometimes known as "transaction id") used for /// the next call message. @@ -624,10 +624,10 @@ internal virtual void nextXid() /// The message id (also sometimes known as "transaction id") used for /// the next call message. /// - internal int xid; - + internal int xid; + /// Authentication protocol object to be used when issuing ONC/RPC calls. /// Authentication protocol object to be used when issuing ONC/RPC calls. - internal OncRpcClientAuth auth; + internal OncRpcClientAuth auth; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuth.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuth.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuth.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuth.cs index b8f94d1..a34561f 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuth.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuth.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The OncRpcClientAuth class is the base class for handling /// all protocol issues of ONC/RPC authentication on the client side. @@ -55,8 +55,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public abstract class OncRpcClientAuth - { + public abstract class OncRpcClientAuth + { /// /// Encodes ONC/RPC authentication information in form of a credential /// and a verifier when sending an ONC/RPC call message. @@ -72,8 +72,8 @@ public abstract class OncRpcClientAuth /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - internal abstract void xdrEncodeCredVerf(org.acplt.oncrpc.XdrEncodingStream xdr); - + internal abstract void xdrEncodeCredVerf(org.acplt.oncrpc.XdrEncodingStream xdr); + /// /// Decodes ONC/RPC authentication information in form of a verifier /// when receiving an ONC/RPC reply message. @@ -93,8 +93,8 @@ public abstract class OncRpcClientAuth /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - internal abstract void xdrDecodeVerf(org.acplt.oncrpc.XdrDecodingStream xdr); - + internal abstract void xdrDecodeVerf(org.acplt.oncrpc.XdrDecodingStream xdr); + /// /// Indicates whether the ONC/RPC authentication credential can be /// refreshed. @@ -104,6 +104,6 @@ public abstract class OncRpcClientAuth /// refreshed. /// /// true, if the credential can be refreshed - public abstract bool canRefreshCred(); + public abstract bool canRefreshCred(); } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthNone.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthNone.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthNone.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthNone.cs index ffd85f3..070a925 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthNone.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthNone.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The OncRpcClientAuthNone class handles protocol issues of /// ONC/RPC AUTH_NONE authentication. @@ -37,8 +37,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcClientAuthNone : org.acplt.oncrpc.OncRpcClientAuth - { + public class OncRpcClientAuthNone : org.acplt.oncrpc.OncRpcClientAuth + { /// /// Encodes ONC/RPC authentication information in form of a credential /// and a verifier when sending an ONC/RPC call message. @@ -54,24 +54,24 @@ public class OncRpcClientAuthNone : org.acplt.oncrpc.OncRpcClientAuth /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - internal override void xdrEncodeCredVerf(org.acplt.oncrpc.XdrEncodingStream xdr) - { - // - // The credential only consists of the indication of AUTH_NONE with - // no opaque authentication data following. - // - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); - xdr.xdrEncodeInt(0); - // - // But we also need to encode the verifier. This is always of type - // AUTH_NONE too. For some obscure historical reasons, we have to - // deal with credentials and verifiers, although they belong together, - // according to Sun's specification. - // - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); - xdr.xdrEncodeInt(0); - } - + internal override void xdrEncodeCredVerf(org.acplt.oncrpc.XdrEncodingStream xdr) + { + // + // The credential only consists of the indication of AUTH_NONE with + // no opaque authentication data following. + // + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); + xdr.xdrEncodeInt(0); + // + // But we also need to encode the verifier. This is always of type + // AUTH_NONE too. For some obscure historical reasons, we have to + // deal with credentials and verifiers, although they belong together, + // according to Sun's specification. + // + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); + xdr.xdrEncodeInt(0); + } + /// /// Decodes ONC/RPC authentication information in form of a verifier /// when receiving an ONC/RPC reply message. @@ -91,21 +91,21 @@ internal override void xdrEncodeCredVerf(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - internal override void xdrDecodeVerf(org.acplt.oncrpc.XdrDecodingStream xdr) - { - // - // Make sure that we received a AUTH_NONE verifier and that it - // does not contain any opaque data. Anything different from this - // is not kosher and an authentication exception will be thrown. - // - if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || ( - xdr.xdrDecodeInt() != 0)) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_FAILED)); - } - } - + internal override void xdrDecodeVerf(org.acplt.oncrpc.XdrDecodingStream xdr) + { + // + // Make sure that we received a AUTH_NONE verifier and that it + // does not contain any opaque data. Anything different from this + // is not kosher and an authentication exception will be thrown. + // + if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || ( + xdr.xdrDecodeInt() != 0)) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_FAILED)); + } + } + /// /// Indicates whether the ONC/RPC authentication credential can be /// refreshed. @@ -115,15 +115,15 @@ internal override void xdrDecodeVerf(org.acplt.oncrpc.XdrDecodingStream xdr) /// refreshed. /// /// true, if the credential can be refreshed - public override bool canRefreshCred() - { - // - // Nothing to do here, as AUTH_NONE doesn't know anything of - // credential refreshing. How refreshing... - // - return false; - } - + public override bool canRefreshCred() + { + // + // Nothing to do here, as AUTH_NONE doesn't know anything of + // credential refreshing. How refreshing... + // + return false; + } + /// /// Contains a singleton which comes in handy if you just need an /// AUTH_NONE authentification for an ONC/RPC client. @@ -132,7 +132,7 @@ public override bool canRefreshCred() /// Contains a singleton which comes in handy if you just need an /// AUTH_NONE authentification for an ONC/RPC client. /// - public static readonly org.acplt.oncrpc.OncRpcClientAuthNone AUTH_NONE = new org.acplt.oncrpc.OncRpcClientAuthNone - (); + public static readonly org.acplt.oncrpc.OncRpcClientAuthNone AUTH_NONE = new org.acplt.oncrpc.OncRpcClientAuthNone + (); } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthUnix.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthUnix.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthUnix.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthUnix.cs index 3b8b26a..9acf0e2 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthUnix.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientAuthUnix.cs @@ -23,9 +23,9 @@ */ using System; - + namespace org.acplt.oncrpc -{ +{ /// /// The OncRpcClientAuthUnix class handles protocol issues of /// ONC/RPC AUTH_UNIX (and thus AUTH_SHORT) @@ -41,8 +41,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcClientAuthUnix : org.acplt.oncrpc.OncRpcClientAuth - { + public class OncRpcClientAuthUnix : org.acplt.oncrpc.OncRpcClientAuth + { /// /// Constructs a new OncRpcClientAuthUnix authentication /// protocol handling object capable of handling AUTH_UNIX @@ -63,15 +63,15 @@ public class OncRpcClientAuthUnix : org.acplt.oncrpc.OncRpcClientAuth /// Caller's effective user ID. /// Caller's effective group ID. /// Array of group IDs the caller is a member of. - public OncRpcClientAuthUnix(string machinename, int uid, int gid, int[] gids) - { - this.stamp = (int)(DateTime.Now.Ticks / (TimeSpan.TicksPerMillisecond * 1000)); - this.machinename = machinename; - this.uid = uid; - this.gid = gid; - this.gids = gids; - } - + public OncRpcClientAuthUnix(string machinename, int uid, int gid, int[] gids) + { + this.stamp = (int)(DateTime.Now.Ticks / (TimeSpan.TicksPerMillisecond * 1000)); + this.machinename = machinename; + this.uid = uid; + this.gid = gid; + this.gids = gids; + } + /// /// Constructs a new OncRpcClientAuthUnix authentication /// protocol handling object capable of handling AUTH_UNIX @@ -91,11 +91,11 @@ public OncRpcClientAuthUnix(string machinename, int uid, int gid, int[] gids) /// /// Caller's effective user ID. /// Caller's effective group ID. - public OncRpcClientAuthUnix(string machinename, int uid, int gid) : this(machinename - , uid, gid, NO_GIDS) - { - } - + public OncRpcClientAuthUnix(string machinename, int uid, int gid) : this(machinename + , uid, gid, NO_GIDS) + { + } + /// /// Encodes ONC/RPC authentication information in form of a credential /// and a verifier when sending an ONC/RPC call message. @@ -115,56 +115,56 @@ public OncRpcClientAuthUnix(string machinename, int uid, int gid) : this(machine /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - internal override void xdrEncodeCredVerf(org.acplt.oncrpc.XdrEncodingStream xdr) - { - if (shorthandCred == null) - { - // - // Encode the credential, which contains some unsecure information - // about user and group ID, etc. Note that the credential itself - // is encoded as a variable-sized bunch of octets. - // - if ((gids.Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_GROUPS) || (machinename - .Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_MACHINE_NAME)) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_FAILED)); - } - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_UNIX); - int len = 4 + ((machinename.Length + 7) & ~3) + 4 + 4 + gids.Length * 4 + 4; - // length of stamp - // len string incl. len - // length of uid - // length of gid - // length of vector of gids incl. len - if (len > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_AUTH_BYTES) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_FAILED)); - } - xdr.xdrEncodeInt(len); - xdr.xdrEncodeInt(stamp); - xdr.xdrEncodeString(machinename); - xdr.xdrEncodeInt(uid); - xdr.xdrEncodeInt(gid); - xdr.xdrEncodeIntVector(gids); - } - else - { - // - // Use shorthand credential instead of original credential. - // - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT); - xdr.xdrEncodeDynamicOpaque(shorthandCred); - } - // - // We also need to encode the verifier, which is always of - // type AUTH_NONE. - // - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); - xdr.xdrEncodeInt(0); - } - + internal override void xdrEncodeCredVerf(org.acplt.oncrpc.XdrEncodingStream xdr) + { + if (shorthandCred == null) + { + // + // Encode the credential, which contains some unsecure information + // about user and group ID, etc. Note that the credential itself + // is encoded as a variable-sized bunch of octets. + // + if ((gids.Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_GROUPS) || (machinename + .Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_MACHINE_NAME)) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_FAILED)); + } + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_UNIX); + int len = 4 + ((machinename.Length + 7) & ~3) + 4 + 4 + gids.Length * 4 + 4; + // length of stamp + // len string incl. len + // length of uid + // length of gid + // length of vector of gids incl. len + if (len > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_AUTH_BYTES) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_FAILED)); + } + xdr.xdrEncodeInt(len); + xdr.xdrEncodeInt(stamp); + xdr.xdrEncodeString(machinename); + xdr.xdrEncodeInt(uid); + xdr.xdrEncodeInt(gid); + xdr.xdrEncodeIntVector(gids); + } + else + { + // + // Use shorthand credential instead of original credential. + // + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT); + xdr.xdrEncodeDynamicOpaque(shorthandCred); + } + // + // We also need to encode the verifier, which is always of + // type AUTH_NONE. + // + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); + xdr.xdrEncodeInt(0); + } + /// /// Decodes ONC/RPC authentication information in form of a verifier /// when receiving an ONC/RPC reply message. @@ -184,57 +184,57 @@ internal override void xdrEncodeCredVerf(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - internal override void xdrDecodeVerf(org.acplt.oncrpc.XdrDecodingStream xdr) - { - switch (xdr.xdrDecodeInt()) - { - case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE: - { - // - // The verifier sent in response to AUTH_UNIX or AUTH_SHORT credentials - // can only be AUTH_NONE or AUTH_SHORT. In the latter case we drop - // any old shorthand credential and use the new one. - // - // - // Make sure that the verifier does not contain any opaque data. - // Anything different from this is not kosher and an authentication - // exception will be thrown. - // - if (xdr.xdrDecodeInt() != 0) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_FAILED)); - } - break; - } - - case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT: - { - // - // Fetch the credential from the XDR stream and make sure that - // it does conform to the length restriction as set forth in - // the ONC/RPC protocol. - // - shorthandCred = xdr.xdrDecodeDynamicOpaque(); - if (shorthandCred.Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_AUTH_BYTES) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_FAILED)); - } - break; - } - - default: - { - // - // Do not accept any other kind of verifier sent. - // - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_INVALIDRESP)); - } - } - } - + internal override void xdrDecodeVerf(org.acplt.oncrpc.XdrDecodingStream xdr) + { + switch (xdr.xdrDecodeInt()) + { + case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE: + { + // + // The verifier sent in response to AUTH_UNIX or AUTH_SHORT credentials + // can only be AUTH_NONE or AUTH_SHORT. In the latter case we drop + // any old shorthand credential and use the new one. + // + // + // Make sure that the verifier does not contain any opaque data. + // Anything different from this is not kosher and an authentication + // exception will be thrown. + // + if (xdr.xdrDecodeInt() != 0) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_FAILED)); + } + break; + } + + case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT: + { + // + // Fetch the credential from the XDR stream and make sure that + // it does conform to the length restriction as set forth in + // the ONC/RPC protocol. + // + shorthandCred = xdr.xdrDecodeDynamicOpaque(); + if (shorthandCred.Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_AUTH_BYTES) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_FAILED)); + } + break; + } + + default: + { + // + // Do not accept any other kind of verifier sent. + // + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_INVALIDRESP)); + } + } + } + /// /// Indicates whether the ONC/RPC authentication credential can be /// refreshed. @@ -244,129 +244,129 @@ internal override void xdrDecodeVerf(org.acplt.oncrpc.XdrDecodingStream xdr) /// refreshed. /// /// true, if the credential can be refreshed - public override bool canRefreshCred() - { - // - // If we don't use a shorthand credential at this time, then there's - // no hope to refresh the credentials. - // - if (shorthandCred == null) - { - return false; - } - // - // Otherwise just dump the shorthand credentials and let the caller - // retry. This will probably result in the ONC/RPC server replying - // with a new shorthand credential. - // - shorthandCred = null; - // - // Ah, yes. We need to update the "stamp" (more a timestamp, but - // Sun coding style is sometimes interesting). As is my style too. - // - stamp = (int)(DateTime.Now.Ticks / (TimeSpan.TicksPerMillisecond * 1000)); - // - // Oh, yes. We can refresh the credential. Maybe. - // - return true; - } - + public override bool canRefreshCred() + { + // + // If we don't use a shorthand credential at this time, then there's + // no hope to refresh the credentials. + // + if (shorthandCred == null) + { + return false; + } + // + // Otherwise just dump the shorthand credentials and let the caller + // retry. This will probably result in the ONC/RPC server replying + // with a new shorthand credential. + // + shorthandCred = null; + // + // Ah, yes. We need to update the "stamp" (more a timestamp, but + // Sun coding style is sometimes interesting). As is my style too. + // + stamp = (int)(DateTime.Now.Ticks / (TimeSpan.TicksPerMillisecond * 1000)); + // + // Oh, yes. We can refresh the credential. Maybe. + // + return true; + } + /// Sets the timestamp information in the credential. /// Sets the timestamp information in the credential. /// New timestamp - public virtual void setStamp(int stamp) - { - this.stamp = stamp; - } - + public virtual void setStamp(int stamp) + { + this.stamp = stamp; + } + /// Returns the timestamp information from the credential. /// Returns the timestamp information from the credential. /// timestamp from credential. - public virtual int getStamp() - { - return stamp; - } - + public virtual int getStamp() + { + return stamp; + } + /// Sets the machine name information in the credential. /// Sets the machine name information in the credential. /// Machine name. - public virtual void setMachinename(string machinename) - { - this.machinename = machinename; - } - + public virtual void setMachinename(string machinename) + { + this.machinename = machinename; + } + /// Returns the machine name information from the credential. /// Returns the machine name information from the credential. /// machine name. - public virtual string getMachinename() - { - return machinename; - } - + public virtual string getMachinename() + { + return machinename; + } + /// Sets the user ID in the credential. /// Sets the user ID in the credential. /// User ID. - public virtual void setUid(int uid) - { - this.uid = uid; - } - + public virtual void setUid(int uid) + { + this.uid = uid; + } + /// Returns the user ID from the credential. /// Returns the user ID from the credential. /// user ID. - public virtual int getUid() - { - return uid; - } - + public virtual int getUid() + { + return uid; + } + /// Sets the group ID in the credential. /// Sets the group ID in the credential. /// Group ID. - public virtual void setGid(int gid) - { - this.gid = gid; - } - + public virtual void setGid(int gid) + { + this.gid = gid; + } + /// Returns the group ID from the credential. /// Returns the group ID from the credential. /// group ID. - public virtual int getGid() - { - return gid; - } - + public virtual int getGid() + { + return gid; + } + /// Sets the group IDs in the credential. /// Sets the group IDs in the credential. /// Array of group IDs. - public virtual void setGids(int[] gids) - { - this.gids = gids; - } - + public virtual void setGids(int[] gids) + { + this.gids = gids; + } + /// Returns the group IDs from the credential. /// Returns the group IDs from the credential. /// array of group IDs. - public virtual int[] getGids() - { - return gids; - } - + public virtual int[] getGids() + { + return gids; + } + /// Contains timestamp as supplied through credential. /// Contains timestamp as supplied through credential. - private int stamp; - + private int stamp; + /// Contains the machine name of caller supplied through credential. /// Contains the machine name of caller supplied through credential. - private string machinename; - + private string machinename; + /// Contains the user ID of caller supplied through credential. /// Contains the user ID of caller supplied through credential. - private int uid; - + private int uid; + /// Contains the group ID of caller supplied through credential. /// Contains the group ID of caller supplied through credential. - private int gid; - + private int gid; + /// /// Contains a set of group IDs the caller belongs to, as supplied /// through credential. @@ -375,8 +375,8 @@ public virtual int[] getGids() /// Contains a set of group IDs the caller belongs to, as supplied /// through credential. /// - private int[] gids; - + private int[] gids; + /// /// Holds the "shorthand" credentials of type AUTH_SHORT /// optionally returned by an ONC/RPC server to be used on subsequent @@ -387,10 +387,10 @@ public virtual int[] getGids() /// optionally returned by an ONC/RPC server to be used on subsequent /// ONC/RPC calls. /// - private byte[] shorthandCred; - + private byte[] shorthandCred; + /// Contains an empty array of group IDs. /// Contains an empty array of group IDs. - public static readonly int[] NO_GIDS = new int[0]; + public static readonly int[] NO_GIDS = new int[0]; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientCallMessage.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientCallMessage.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientCallMessage.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientCallMessage.cs index 2f3cc9f..035daa7 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientCallMessage.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientCallMessage.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The OncRpcClientCallMessage class represents a remote procedure /// call message on the client side. @@ -37,8 +37,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcClientCallMessage : org.acplt.oncrpc.OncRpcCallMessage - { + public class OncRpcClientCallMessage : org.acplt.oncrpc.OncRpcCallMessage + { /// Constructs and initialises a new ONC/RPC call message header. /// Constructs and initialises a new ONC/RPC call message header. /// @@ -49,13 +49,13 @@ public class OncRpcClientCallMessage : org.acplt.oncrpc.OncRpcCallMessage /// Program version number of the remote procedure to call. /// Procedure number (identifier) of the procedure to call. /// Authentication protocol handling object. - public OncRpcClientCallMessage(int messageId, int program, int version, int procedure - , org.acplt.oncrpc.OncRpcClientAuth auth) : base(messageId, program, version, procedure - ) - { - this.auth = auth; - } - + public OncRpcClientCallMessage(int messageId, int program, int version, int procedure + , org.acplt.oncrpc.OncRpcClientAuth auth) : base(messageId, program, version, procedure + ) + { + this.auth = auth; + } + /// /// Encodes -- that is: serializes -- a ONC/RPC message header object /// into a XDR stream according to RFC 1831. @@ -68,32 +68,32 @@ public OncRpcClientCallMessage(int messageId, int program, int version, int proc /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeInt(messageId); - xdr.xdrEncodeInt(messageType); - xdr.xdrEncodeInt(oncRpcVersion); - xdr.xdrEncodeInt(program); - xdr.xdrEncodeInt(version); - xdr.xdrEncodeInt(procedure); - // - // Now encode the authentication data. If we have an authentication - // protocol handling object at hand, then we let do the dirty work - // for us. Otherwise, we fall back to AUTH_NONE handling. - // - if (auth != null) - { - auth.xdrEncodeCredVerf(xdr); - } - else - { - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); - xdr.xdrEncodeInt(0); - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); - xdr.xdrEncodeInt(0); - } - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeInt(messageId); + xdr.xdrEncodeInt(messageType); + xdr.xdrEncodeInt(oncRpcVersion); + xdr.xdrEncodeInt(program); + xdr.xdrEncodeInt(version); + xdr.xdrEncodeInt(procedure); + // + // Now encode the authentication data. If we have an authentication + // protocol handling object at hand, then we let do the dirty work + // for us. Otherwise, we fall back to AUTH_NONE handling. + // + if (auth != null) + { + auth.xdrEncodeCredVerf(xdr); + } + else + { + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); + xdr.xdrEncodeInt(0); + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); + xdr.xdrEncodeInt(0); + } + } + /// /// Client-side authentication protocol handling object to use when /// decoding the reply message. @@ -102,6 +102,6 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// Client-side authentication protocol handling object to use when /// decoding the reply message. /// - internal org.acplt.oncrpc.OncRpcClientAuth auth; + internal org.acplt.oncrpc.OncRpcClientAuth auth; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientReplyMessage.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientReplyMessage.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientReplyMessage.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientReplyMessage.cs index c259cd1..cc895d7 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientReplyMessage.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientReplyMessage.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The OncRpcReplyMessage class represents an ONC/RPC reply /// message as defined by ONC/RPC in RFC 1831. @@ -44,8 +44,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcClientReplyMessage : org.acplt.oncrpc.OncRpcReplyMessage - { + public class OncRpcClientReplyMessage : org.acplt.oncrpc.OncRpcReplyMessage + { /// /// Initializes a new OncRpcReplyMessage object to represent /// an invalid state. @@ -60,11 +60,11 @@ public class OncRpcClientReplyMessage : org.acplt.oncrpc.OncRpcReplyMessage /// Client-side authentication protocol handling object which /// is to be used when decoding the verifier data contained in the reply. /// - public OncRpcClientReplyMessage(org.acplt.oncrpc.OncRpcClientAuth auth) : base() - { - this.auth = auth; - } - + public OncRpcClientReplyMessage(org.acplt.oncrpc.OncRpcClientAuth auth) : base() + { + this.auth = auth; + } + /// /// Check whether this OncRpcReplyMessage represents an /// accepted and successfully executed remote procedure call. @@ -77,12 +77,12 @@ public OncRpcClientReplyMessage(org.acplt.oncrpc.OncRpcClientAuth auth) : base() /// true if remote procedure call was accepted and /// successfully executed. /// - public virtual bool successfullyAccepted() - { - return (replyStatus == org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED) && - (acceptStatus == org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SUCCESS); - } - + public virtual bool successfullyAccepted() + { + return (replyStatus == org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED) && + (acceptStatus == org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SUCCESS); + } + /// /// Return an appropriate exception object according to the state this /// reply message header object is in. @@ -98,74 +98,74 @@ public virtual bool successfullyAccepted() /// or a subclass /// thereof. /// - public virtual org.acplt.oncrpc.OncRpcException newException() - { - switch (replyStatus) - { - case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED: - { - switch (acceptStatus) - { - case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SUCCESS: - { - return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_SUCCESS - ); - } - - case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROC_UNAVAIL: - { - return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PROCUNAVAIL - ); - } - - case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_MISMATCH: - { - return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PROGVERSMISMATCH - ); - } - - case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_UNAVAIL: - { - return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PROGUNAVAIL - ); - } - - case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_GARBAGE_ARGS: - { - return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTDECODEARGS - ); - } - - case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SYSTEM_ERR: - { - return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_SYSTEMERROR - ); - } - } - break; - } - - case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_DENIED: - { - switch (rejectStatus) - { - case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_AUTH_ERROR: - { - return new org.acplt.oncrpc.OncRpcAuthenticationException(authStatus); - } - - case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_RPC_MISMATCH: - { - return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_FAILED - ); - } - } - break; - } - } - return new org.acplt.oncrpc.OncRpcException(); - } - + public virtual org.acplt.oncrpc.OncRpcException newException() + { + switch (replyStatus) + { + case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED: + { + switch (acceptStatus) + { + case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SUCCESS: + { + return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_SUCCESS + ); + } + + case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROC_UNAVAIL: + { + return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PROCUNAVAIL + ); + } + + case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_MISMATCH: + { + return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PROGVERSMISMATCH + ); + } + + case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_UNAVAIL: + { + return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PROGUNAVAIL + ); + } + + case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_GARBAGE_ARGS: + { + return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTDECODEARGS + ); + } + + case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SYSTEM_ERR: + { + return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_SYSTEMERROR + ); + } + } + break; + } + + case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_DENIED: + { + switch (rejectStatus) + { + case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_AUTH_ERROR: + { + return new org.acplt.oncrpc.OncRpcAuthenticationException(authStatus); + } + + case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_RPC_MISMATCH: + { + return new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_FAILED + ); + } + } + break; + } + } + return new org.acplt.oncrpc.OncRpcException(); + } + /// /// Decodes -- that is: deserializes -- a ONC/RPC message header object /// from a XDR stream. @@ -177,112 +177,112 @@ public virtual org.acplt.oncrpc.OncRpcException newException() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - messageId = xdr.xdrDecodeInt(); - // - // Make sure that we are really decoding an ONC/RPC message call - // header. Otherwise, throw the appropriate OncRpcException exception. - // - messageType = xdr.xdrDecodeInt(); - if (messageType != org.acplt.oncrpc.OncRpcMessageType.ONCRPC_REPLY) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_WRONGMESSAGE - )); - } - replyStatus = xdr.xdrDecodeInt(); - switch (replyStatus) - { - case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED: - { - // - // Decode the information returned for accepted message calls. - // If we have an associated client-side authentication protocol - // object, we use that. Otherwise we fall back to the default - // handling of only the AUTH_NONE authentication. - // - if (auth != null) - { - auth.xdrDecodeVerf(xdr); - } - else - { - // - // If we don't have a protocol handler and the server sent its - // reply using another authentication scheme than AUTH_NONE, we - // will throw an exception. Also we check that no-one is - // actually sending opaque information within AUTH_NONE. - // - if (xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_FAILED)); - } - if (xdr.xdrDecodeInt() != 0) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_FAILED)); - } - } - // - // Even if the call was accepted by the server, it can still - // indicate an error. Depending on the status of the accepted - // call we will receive an indication about the range of - // versions a particular program (server) supports. - // - acceptStatus = xdr.xdrDecodeInt(); - switch (acceptStatus) - { - case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_MISMATCH: - { - lowVersion = xdr.xdrDecodeInt(); - highVersion = xdr.xdrDecodeInt(); - break; - } - - default: - { - // - // Otherwise "open ended set of problem", like the author - // of Sun's ONC/RPC source once wrote... - // - break; - } - } - break; - } - - case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_DENIED: - { - // - // Encode the information returned for denied message calls. - // - rejectStatus = xdr.xdrDecodeInt(); - switch (rejectStatus) - { - case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_RPC_MISMATCH: - { - lowVersion = xdr.xdrDecodeInt(); - highVersion = xdr.xdrDecodeInt(); - break; - } - - case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_AUTH_ERROR: - { - authStatus = xdr.xdrDecodeInt(); - break; - } - - default: - { - break; - } - } - break; - } - } - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + messageId = xdr.xdrDecodeInt(); + // + // Make sure that we are really decoding an ONC/RPC message call + // header. Otherwise, throw the appropriate OncRpcException exception. + // + messageType = xdr.xdrDecodeInt(); + if (messageType != org.acplt.oncrpc.OncRpcMessageType.ONCRPC_REPLY) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_WRONGMESSAGE + )); + } + replyStatus = xdr.xdrDecodeInt(); + switch (replyStatus) + { + case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED: + { + // + // Decode the information returned for accepted message calls. + // If we have an associated client-side authentication protocol + // object, we use that. Otherwise we fall back to the default + // handling of only the AUTH_NONE authentication. + // + if (auth != null) + { + auth.xdrDecodeVerf(xdr); + } + else + { + // + // If we don't have a protocol handler and the server sent its + // reply using another authentication scheme than AUTH_NONE, we + // will throw an exception. Also we check that no-one is + // actually sending opaque information within AUTH_NONE. + // + if (xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_FAILED)); + } + if (xdr.xdrDecodeInt() != 0) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_FAILED)); + } + } + // + // Even if the call was accepted by the server, it can still + // indicate an error. Depending on the status of the accepted + // call we will receive an indication about the range of + // versions a particular program (server) supports. + // + acceptStatus = xdr.xdrDecodeInt(); + switch (acceptStatus) + { + case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_MISMATCH: + { + lowVersion = xdr.xdrDecodeInt(); + highVersion = xdr.xdrDecodeInt(); + break; + } + + default: + { + // + // Otherwise "open ended set of problem", like the author + // of Sun's ONC/RPC source once wrote... + // + break; + } + } + break; + } + + case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_DENIED: + { + // + // Encode the information returned for denied message calls. + // + rejectStatus = xdr.xdrDecodeInt(); + switch (rejectStatus) + { + case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_RPC_MISMATCH: + { + lowVersion = xdr.xdrDecodeInt(); + highVersion = xdr.xdrDecodeInt(); + break; + } + + case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_AUTH_ERROR: + { + authStatus = xdr.xdrDecodeInt(); + break; + } + + default: + { + break; + } + } + break; + } + } + } + /// /// Client-side authentication protocol handling object to use when /// decoding the reply message. @@ -291,6 +291,6 @@ public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) /// Client-side authentication protocol handling object to use when /// decoding the reply message. /// - internal org.acplt.oncrpc.OncRpcClientAuth auth; + internal org.acplt.oncrpc.OncRpcClientAuth auth; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientStub.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientStub.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientStub.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientStub.cs index 461ab47..5e14d8b 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientStub.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcClientStub.cs @@ -23,9 +23,9 @@ */ using System.Net; - + namespace org.acplt.oncrpc -{ +{ /// /// The abstract OncRpcClientStub class is the base class to /// build ONC/RPC-program specific clients upon. @@ -51,8 +51,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public abstract class OncRpcClientStub - { + public abstract class OncRpcClientStub + { /// /// Construct a new OncRpcClientStub for communication with /// a remote ONC/RPC server. @@ -75,13 +75,13 @@ public abstract class OncRpcClientStub /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public OncRpcClientStub(IPAddress host, int program, int version, int - port, int protocol, bool useSecurePort) - { - client = org.acplt.oncrpc.OncRpcClient.newOncRpcClient(host, program, version, port - , protocol, useSecurePort); - } - + public OncRpcClientStub(IPAddress host, int program, int version, int + port, int protocol, bool useSecurePort) + { + client = org.acplt.oncrpc.OncRpcClient.newOncRpcClient(host, program, version, port + , protocol, useSecurePort); + } + /// /// Construct a new OncRpcClientStub which uses the given /// client proxy object for communication with a remote ONC/RPC server. @@ -96,11 +96,11 @@ public OncRpcClientStub(IPAddress host, int program, int version, int /// /// /// - public OncRpcClientStub(org.acplt.oncrpc.OncRpcClient client) - { - this.client = client; - } - + public OncRpcClientStub(org.acplt.oncrpc.OncRpcClient client) + { + this.client = client; + } + /// /// Close the connection to an ONC/RPC server and free all network-related /// resources. @@ -112,21 +112,21 @@ public OncRpcClientStub(org.acplt.oncrpc.OncRpcClient client) /// /// if an ONC/RPC error occurs. /// - public virtual void close() - { - if (client != null) - { - try - { - client.close(); - } - finally - { - client = null; - } - } - } - + public virtual void close() + { + if (client != null) + { + try + { + client.close(); + } + finally + { + client = null; + } + } + } + /// /// Returns ONC/RPC client proxy object used for communication with a /// remote ONC/RPC server. @@ -136,11 +136,11 @@ public virtual void close() /// remote ONC/RPC server. /// /// ONC/RPC client proxy. - public virtual org.acplt.oncrpc.OncRpcClient GetClient() - { - return client; - } - + public virtual org.acplt.oncrpc.OncRpcClient GetClient() + { + return client; + } + /// /// The real ONC/RPC client which is responsible for handling a particular /// IP protocol. @@ -149,6 +149,6 @@ public virtual org.acplt.oncrpc.OncRpcClient GetClient() /// The real ONC/RPC client which is responsible for handling a particular /// IP protocol. /// - protected org.acplt.oncrpc.OncRpcClient client; + protected org.acplt.oncrpc.OncRpcClient client; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcConstants.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcConstants.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcConstants.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcConstants.cs index 937df66..aef4c88 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcConstants.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcConstants.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// A collection of constants generally usefull for ONC/RPC. /// A collection of constants generally usefull for ONC/RPC. /// Converted to C# using the db4o Sharpen tool. @@ -31,29 +31,29 @@ namespace org.acplt.oncrpc /// $Revision: 1.3 $ $Date: 2005/11/11 21:02:47 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class OncRpcConstants - { + public class OncRpcConstants + { /// The current version of the Remote Tea Java library as a string. /// The current version of the Remote Tea Java library as a string. - public static readonly string REMOTETEA_VERSION_STRING = "1.0.4"; - + public static readonly string REMOTETEA_VERSION_STRING = "1.0.4"; + /// The current major version number of the Remote Tea Java library. /// The current major version number of the Remote Tea Java library. - public const int REMOTETEA_VERSION_MAJOR = 1; - + public const int REMOTETEA_VERSION_MAJOR = 1; + /// The current minor version number of the Remote Tea Java library. /// The current minor version number of the Remote Tea Java library. - public const int REMOTETEA_VERSION_MINOR = 0; - + public const int REMOTETEA_VERSION_MINOR = 0; + /// The current patch level of the Remote Tea Java library. /// The current patch level of the Remote Tea Java library. - public const int REMOTETEA_VERSION_PATCHLEVEL = 4; - + public const int REMOTETEA_VERSION_PATCHLEVEL = 4; + /// The current preversion version number. /// /// The current preversion version number. If not zero, then this /// indicates a preversion (no, not perversion... ooops, sorry). /// - public const int REMOTETEA_VERSION_PREVERSION = 0; + public const int REMOTETEA_VERSION_PREVERSION = 0; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcDumpResult.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcDumpResult.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcDumpResult.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcDumpResult.cs index c892be6..face76b 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcDumpResult.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcDumpResult.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Objects of class OncRpcDumpResult represent the outcome of /// the PMAP_DUMP operation on a portmapper. @@ -38,8 +38,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcDumpResult : org.acplt.oncrpc.XdrAble - { + public class OncRpcDumpResult : org.acplt.oncrpc.XdrAble + { /// /// Vector of server ident objects describing the currently registered /// ONC/RPC servers (also known as "programmes"). @@ -48,18 +48,18 @@ public class OncRpcDumpResult : org.acplt.oncrpc.XdrAble /// Vector of server ident objects describing the currently registered /// ONC/RPC servers (also known as "programmes"). /// - public System.Collections.ArrayList servers; - + public System.Collections.ArrayList servers; + /// Initialize an OncRpcServerIdent object. /// /// Initialize an OncRpcServerIdent object. Afterwards, the /// servers field is initialized to contain no elements. /// - public OncRpcDumpResult() - { - servers = new System.Collections.ArrayList(); - } - + public OncRpcDumpResult() + { + servers = new System.Collections.ArrayList(); + } + /// /// Encodes -- that is: serializes -- the result of a PMAP_DUMP operationg /// into a XDR stream. @@ -71,33 +71,33 @@ public OncRpcDumpResult() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - if (servers == null) - { - xdr.xdrEncodeBoolean(false); - } - else - { - // - // Now encode all server ident objects into the xdr stream. Each - // object is preceeded by a boolan, which indicates to the receiver - // whether an object follows. After the last object has been - // encoded the receiver will find a boolean false in the stream. - // - int count = servers.Count; - int index = 0; - while (count > 0) - { - xdr.xdrEncodeBoolean(true); - ((org.acplt.oncrpc.XdrAble)servers[index]).xdrEncode(xdr); - index++; - count--; - } - xdr.xdrEncodeBoolean(false); - } - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + if (servers == null) + { + xdr.xdrEncodeBoolean(false); + } + else + { + // + // Now encode all server ident objects into the xdr stream. Each + // object is preceeded by a boolan, which indicates to the receiver + // whether an object follows. After the last object has been + // encoded the receiver will find a boolean false in the stream. + // + int count = servers.Count; + int index = 0; + while (count > 0) + { + xdr.xdrEncodeBoolean(true); + ((org.acplt.oncrpc.XdrAble)servers[index]).xdrEncode(xdr); + index++; + count--; + } + xdr.xdrEncodeBoolean(false); + } + } + /// /// Decodes -- that is: deserializes -- the result from a PMAP_DUMP remote /// procedure call from a XDR stream. @@ -109,22 +109,22 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - // - // Calling removeAllElements() instead of clear() preserves - // pre-JDK2 compatibility. - // - servers.Clear(); - // - // Pull the server ident object off the xdr stream. Each object is - // preceeded by a boolean value indicating whether there is still an - // object in the pipe. - // - while (xdr.xdrDecodeBoolean()) - { - servers.Add(new org.acplt.oncrpc.OncRpcServerIdent(xdr)); - } - } + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + // + // Calling removeAllElements() instead of clear() preserves + // pre-JDK2 compatibility. + // + servers.Clear(); + // + // Pull the server ident object off the xdr stream. Each object is + // preceeded by a boolean value indicating whether there is still an + // object in the pipe. + // + while (xdr.xdrDecodeBoolean()) + { + servers.Add(new org.acplt.oncrpc.OncRpcServerIdent(xdr)); + } + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcException.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcException.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcException.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcException.cs index a9f6a07..6cdbda6 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcException.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcException.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The class OncRpcException indicates ONC/RPC conditions /// that a reasonable application might want to catch. @@ -49,22 +49,22 @@ namespace org.acplt.oncrpc /// $Revision: 1.3 $ $Date: 2008/01/02 15:13:35 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - [System.Serializable] - public class OncRpcException : System.Exception - { + [System.Serializable] + public class OncRpcException : System.Exception + { /// Defines the serial version UID for OncRpcException. /// Defines the serial version UID for OncRpcException. - private const long serialVersionUID = -2170017056632137324L; - + private const long serialVersionUID = -2170017056632137324L; + /// /// Constructs an OncRpcException with a reason of /// RPC_FAILED /// . /// - public OncRpcException() : this(org.acplt.oncrpc.OncRpcException.RPC_FAILED) - { - } - + public OncRpcException() : this(org.acplt.oncrpc.OncRpcException.RPC_FAILED) + { + } + /// /// Constructs an OncRpcException with the specified detail /// message. @@ -74,12 +74,12 @@ public OncRpcException() : this(org.acplt.oncrpc.OncRpcException.RPC_FAILED) /// message. /// /// The detail message. - public OncRpcException(string s) : base() - { - reason = RPC_FAILED; - message = s; - } - + public OncRpcException(string s) : base() + { + reason = RPC_FAILED; + message = s; + } + /// /// Constructs an OncRpcException with the specified detail /// reason and message. @@ -90,12 +90,12 @@ public OncRpcException(string s) : base() /// /// The detail reason. /// The detail message. - public OncRpcException(int r, string s) : base() - { - reason = r; - message = s; - } - + public OncRpcException(int r, string s) : base() + { + reason = r; + message = s; + } + /// /// Constructs an OncRpcException with the specified detail /// reason. @@ -109,139 +109,139 @@ public OncRpcException(int r, string s) : base() /// should be "public final static integers" -- defined in this /// interface. /// - public OncRpcException(int r) : base() - { - reason = r; - switch (r) - { - case RPC_CANTENCODEARGS: - { - message = "can not encode RPC arguments"; - break; - } - - case RPC_CANTDECODERES: - { - message = "can not decode RPC result"; - break; - } - - case RPC_CANTRECV: - { - message = "can not receive ONC/RPC data"; - break; - } - - case RPC_CANTSEND: - { - message = "can not send ONC/RPC data"; - break; - } - - case RPC_TIMEDOUT: - { - message = "ONC/RPC call timed out"; - break; - } - - case RPC_VERSMISMATCH: - { - message = "ONC/RPC version mismatch"; - break; - } - - case RPC_AUTHERROR: - { - message = "ONC/RPC authentification error"; - break; - } - - case RPC_PROGUNAVAIL: - { - message = "ONC/RPC program not available"; - break; - } - - case RPC_CANTDECODEARGS: - { - message = "can not decode ONC/RPC arguments"; - break; - } - - case RPC_PROGVERSMISMATCH: - { - message = "ONC/RPC program version mismatch"; - break; - } - - case RPC_PROCUNAVAIL: - { - message = "ONC/RPC procedure not available"; - break; - } - - case RPC_SYSTEMERROR: - { - message = "ONC/RPC system error"; - break; - } - - case RPC_UNKNOWNPROTO: - { - message = "unknown protocol"; - break; - } - - case RPC_PMAPFAILURE: - { - message = "ONC/RPC portmap failure"; - break; - } - - case RPC_PROGNOTREGISTERED: - { - message = "ONC/RPC program not registered"; - break; - } - - case RPC_FAILED: - { - message = "ONC/RPC generic failure"; - break; - } - - case RPC_BUFFEROVERFLOW: - { - message = "ONC/RPC buffer overflow"; - break; - } - - case RPC_BUFFERUNDERFLOW: - { - message = "ONC/RPC buffer underflow"; - break; - } - - case RPC_WRONGMESSAGE: - { - message = "wrong ONC/RPC message type received"; - break; - } - - case RPC_CANNOTREGISTER: - { - message = "cannot register ONC/RPC port with local portmap"; - break; - } - - case RPC_SUCCESS: - default: - { - break; - } - } - } - + public OncRpcException(int r) : base() + { + reason = r; + switch (r) + { + case RPC_CANTENCODEARGS: + { + message = "can not encode RPC arguments"; + break; + } + + case RPC_CANTDECODERES: + { + message = "can not decode RPC result"; + break; + } + + case RPC_CANTRECV: + { + message = "can not receive ONC/RPC data"; + break; + } + + case RPC_CANTSEND: + { + message = "can not send ONC/RPC data"; + break; + } + + case RPC_TIMEDOUT: + { + message = "ONC/RPC call timed out"; + break; + } + + case RPC_VERSMISMATCH: + { + message = "ONC/RPC version mismatch"; + break; + } + + case RPC_AUTHERROR: + { + message = "ONC/RPC authentification error"; + break; + } + + case RPC_PROGUNAVAIL: + { + message = "ONC/RPC program not available"; + break; + } + + case RPC_CANTDECODEARGS: + { + message = "can not decode ONC/RPC arguments"; + break; + } + + case RPC_PROGVERSMISMATCH: + { + message = "ONC/RPC program version mismatch"; + break; + } + + case RPC_PROCUNAVAIL: + { + message = "ONC/RPC procedure not available"; + break; + } + + case RPC_SYSTEMERROR: + { + message = "ONC/RPC system error"; + break; + } + + case RPC_UNKNOWNPROTO: + { + message = "unknown protocol"; + break; + } + + case RPC_PMAPFAILURE: + { + message = "ONC/RPC portmap failure"; + break; + } + + case RPC_PROGNOTREGISTERED: + { + message = "ONC/RPC program not registered"; + break; + } + + case RPC_FAILED: + { + message = "ONC/RPC generic failure"; + break; + } + + case RPC_BUFFEROVERFLOW: + { + message = "ONC/RPC buffer overflow"; + break; + } + + case RPC_BUFFERUNDERFLOW: + { + message = "ONC/RPC buffer underflow"; + break; + } + + case RPC_WRONGMESSAGE: + { + message = "wrong ONC/RPC message type received"; + break; + } + + case RPC_CANNOTREGISTER: + { + message = "cannot register ONC/RPC port with local portmap"; + break; + } + + case RPC_SUCCESS: + default: + { + break; + } + } + } + /// Returns the error message string of this ONC/RPC object. /// Returns the error message string of this ONC/RPC object. /// @@ -249,14 +249,14 @@ public OncRpcException(int r) : base() /// object if it was created either with an error message string or an /// ONC/RPC error code. /// - public override string Message - { - get - { - return message; - } - } - + public override string Message + { + get + { + return message; + } + } + /// Returns the error reason of this ONC/RPC exception object. /// Returns the error reason of this ONC/RPC exception object. /// @@ -268,15 +268,15 @@ public override string Message /// created /// with no error reason. /// - public virtual int getReason() - { - return reason; - } - + public virtual int getReason() + { + return reason; + } + /// The remote procedure call was carried out successfully. /// The remote procedure call was carried out successfully. - public const int RPC_SUCCESS = 0; - + public const int RPC_SUCCESS = 0; + /// /// The client can not encode the argments to be sent for the remote /// procedure call. @@ -285,28 +285,28 @@ public virtual int getReason() /// The client can not encode the argments to be sent for the remote /// procedure call. /// - public const int RPC_CANTENCODEARGS = 1; - + public const int RPC_CANTENCODEARGS = 1; + /// The client can not decode the result from the remote procedure call. /// The client can not decode the result from the remote procedure call. - public const int RPC_CANTDECODERES = 2; - + public const int RPC_CANTDECODERES = 2; + /// Encoded information can not be sent. /// Encoded information can not be sent. - public const int RPC_CANTSEND = 3; - + public const int RPC_CANTSEND = 3; + /// Information to be decoded can not be received. /// Information to be decoded can not be received. - public const int RPC_CANTRECV = 4; - + public const int RPC_CANTRECV = 4; + /// The remote procedure call timed out. /// The remote procedure call timed out. - public const int RPC_TIMEDOUT = 5; - + public const int RPC_TIMEDOUT = 5; + /// ONC/RPC versions of server and client are not compatible. /// ONC/RPC versions of server and client are not compatible. - public const int RPC_VERSMISMATCH = 6; - + public const int RPC_VERSMISMATCH = 6; + /// /// The ONC/RPC server did not accept the authentication sent by the /// client. @@ -315,12 +315,12 @@ public virtual int getReason() /// The ONC/RPC server did not accept the authentication sent by the /// client. Bad girl/guy! /// - public const int RPC_AUTHERROR = 7; - + public const int RPC_AUTHERROR = 7; + /// The ONC/RPC server does not support this particular program. /// The ONC/RPC server does not support this particular program. - public const int RPC_PROGUNAVAIL = 8; - + public const int RPC_PROGUNAVAIL = 8; + /// /// The ONC/RPC server does not support this particular version of the /// program. @@ -329,12 +329,12 @@ public virtual int getReason() /// The ONC/RPC server does not support this particular version of the /// program. /// - public const int RPC_PROGVERSMISMATCH = 9; - + public const int RPC_PROGVERSMISMATCH = 9; + /// The given procedure is not available at the ONC/RPC server. /// The given procedure is not available at the ONC/RPC server. - public const int RPC_PROCUNAVAIL = 10; - + public const int RPC_PROCUNAVAIL = 10; + /// /// The ONC/RPC server could not decode the arguments sent within the /// call message. @@ -343,8 +343,8 @@ public virtual int getReason() /// The ONC/RPC server could not decode the arguments sent within the /// call message. /// - public const int RPC_CANTDECODEARGS = 11; - + public const int RPC_CANTDECODEARGS = 11; + /// /// The ONC/RPC server encountered a system error and thus was not able /// to carry out the requested remote function call successfully. @@ -353,8 +353,8 @@ public virtual int getReason() /// The ONC/RPC server encountered a system error and thus was not able /// to carry out the requested remote function call successfully. /// - public const int RPC_SYSTEMERROR = 12; - + public const int RPC_SYSTEMERROR = 12; + /// The caller specified an unknown/unsupported IP protocol. /// /// The caller specified an unknown/unsupported IP protocol. Currently, @@ -364,36 +364,36 @@ public virtual int getReason() /// OncRpcProtocols.ONCRPC_UDP /// are supported. /// - public const int RPC_UNKNOWNPROTO = 17; - + public const int RPC_UNKNOWNPROTO = 17; + /// The portmapper could not be contacted at the given host. /// The portmapper could not be contacted at the given host. - public const int RPC_PMAPFAILURE = 14; - + public const int RPC_PMAPFAILURE = 14; + /// The requested program is not registered with the given host. /// The requested program is not registered with the given host. - public const int RPC_PROGNOTREGISTERED = 15; - + public const int RPC_PROGNOTREGISTERED = 15; + /// A generic ONC/RPC exception occured. /// A generic ONC/RPC exception occured. Shit happens... - public const int RPC_FAILED = 16; - + public const int RPC_FAILED = 16; + /// A buffer overflow occured with an encoding XDR stream. /// /// A buffer overflow occured with an encoding XDR stream. This happens /// if you use UDP-based (datagram-based) XDR streams and you try to encode /// more data than can fit into the sending buffers. /// - public const int RPC_BUFFEROVERFLOW = 42; - + public const int RPC_BUFFEROVERFLOW = 42; + /// A buffer underflow occured with an decoding XDR stream. /// /// A buffer underflow occured with an decoding XDR stream. This happens /// if you try to decode more data than was sent by the other communication /// partner. /// - public const int RPC_BUFFERUNDERFLOW = 43; - + public const int RPC_BUFFERUNDERFLOW = 43; + /// /// Either a ONC/RPC server or client received the wrong type of ONC/RPC /// message when waiting for a request or reply. @@ -407,8 +407,8 @@ public virtual int getReason() /// OncRpcReplyMessage /// throw exceptions with this reason. /// - public const int RPC_WRONGMESSAGE = 44; - + public const int RPC_WRONGMESSAGE = 44; + /// /// Indicates that a server could not register a transport with the /// ONC/RPC port mapper. @@ -417,8 +417,8 @@ public virtual int getReason() /// Indicates that a server could not register a transport with the /// ONC/RPC port mapper. /// - public const int RPC_CANNOTREGISTER = 45; - + public const int RPC_CANNOTREGISTER = 45; + /// /// Specific detail (reason) about this OncRpcException, /// like the ONC/RPC error code, as defined by the RPC_xxx @@ -430,8 +430,8 @@ public virtual int getReason() /// constants of this interface. /// /// - private int reason; - + private int reason; + /// /// Specific detail about this OncRpcException, like a /// detailed error message. @@ -441,6 +441,6 @@ public virtual int getReason() /// detailed error message. /// /// - private string message; + private string message; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcGetPortResult.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcGetPortResult.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcGetPortResult.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcGetPortResult.cs index 2449208..2ab7323 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcGetPortResult.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcGetPortResult.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The OncRpcGetPortResult class represents the result from /// a PMAP_GETPORT remote procedure call to the ONC/RPC portmapper. @@ -37,16 +37,16 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcGetPortResult : org.acplt.oncrpc.XdrAble - { + public class OncRpcGetPortResult : org.acplt.oncrpc.XdrAble + { /// The port number of the ONC/RPC in question. /// /// The port number of the ONC/RPC in question. This is the only interesting /// piece of information in this class. Go live with it, you don't have /// alternatives. /// - public int port; - + public int port; + /// /// Default constructor for initializing an OncRpcGetPortParams /// result object. @@ -55,11 +55,11 @@ public class OncRpcGetPortResult : org.acplt.oncrpc.XdrAble /// Default constructor for initializing an OncRpcGetPortParams /// result object. It sets the port member to a useless value. /// - public OncRpcGetPortResult() - { - port = 0; - } - + public OncRpcGetPortResult() + { + port = 0; + } + /// /// Encodes -- that is: serializes -- an OncRpcGetPortParams /// object into a XDR stream. @@ -71,11 +71,11 @@ public OncRpcGetPortResult() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeInt(port); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeInt(port); + } + /// /// Decodes -- that is: deserializes -- an OncRpcGetPortParams /// object from a XDR stream. @@ -87,9 +87,9 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - port = xdr.xdrDecodeInt(); - } + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + port = xdr.xdrDecodeInt(); + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessage.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessage.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessage.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessage.cs index f62068d..6220e14 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessage.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessage.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The OncRpcMessage class is an abstract superclass for all /// the message types ONC/RPC defines (well, an overwhelming count of two). @@ -39,8 +39,8 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2003/08/14 07:56:37 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public abstract class OncRpcMessage - { + public abstract class OncRpcMessage + { /// /// Constructs a new OncRpcMessage object with default /// values: a given message type and no particular message identifier. @@ -49,12 +49,12 @@ public abstract class OncRpcMessage /// Constructs a new OncRpcMessage object with default /// values: a given message type and no particular message identifier. /// - public OncRpcMessage(int messageId) - { - this.messageId = messageId; - messageType = -1; - } - + public OncRpcMessage(int messageId) + { + this.messageId = messageId; + messageType = -1; + } + /// /// The message id is used to identify matching ONC/RPC calls and /// replies. @@ -65,8 +65,8 @@ public OncRpcMessage(int messageId) /// sending a request. The matching reply then must have the same /// message identifier, so the receiver can match calls and replies. /// - public int messageId; - + public int messageId; + /// /// The kind of ONC/RPC message, which can be either a call or a /// reply. @@ -78,6 +78,6 @@ public OncRpcMessage(int messageId) /// . /// /// OncRpcMessageType - public int messageType; + public int messageType; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessageType.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessageType.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessageType.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessageType.cs index 5089324..d236b00 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessageType.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcMessageType.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// A collection of constants used for ONC/RPC messages to identify the /// type of message. @@ -41,21 +41,21 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcMessageType - { + public class OncRpcMessageType + { /// Identifies an ONC/RPC call. /// /// Identifies an ONC/RPC call. By a "call" a client request that a server /// carries out a particular remote procedure. /// - public const int ONCRPC_CALL = 0; - + public const int ONCRPC_CALL = 0; + /// Identifies an ONC/RPC reply. /// /// Identifies an ONC/RPC reply. A server responds with a "reply" after /// a client has sent a "call" for a particular remote procedure, sending /// back the results of calling that procedure. /// - public const int ONCRPC_REPLY = 1; + public const int ONCRPC_REPLY = 1; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapClient.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapClient.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapClient.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapClient.cs index d80a62c..29ea06c 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapClient.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapClient.cs @@ -24,9 +24,9 @@ using System; using System.Net; - + namespace org.acplt.oncrpc -{ +{ /// /// The class OncRpcPortmapClient is a specialized ONC/RPC client, /// which can talk to the portmapper on a given host using the famous @@ -147,8 +147,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcPortmapClient - { + public class OncRpcPortmapClient + { /// /// Constructs and initializes an ONC/RPC client object, which can /// communicate with the portmapper at the specified host using the @@ -163,11 +163,11 @@ public class OncRpcPortmapClient /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public OncRpcPortmapClient(IPAddress host) : this(host, org.acplt.oncrpc.OncRpcProtocols - .ONCRPC_UDP, 0) - { - } - + public OncRpcPortmapClient(IPAddress host) : this(host, org.acplt.oncrpc.OncRpcProtocols + .ONCRPC_UDP, 0) + { + } + /// /// Constructs and initializes an ONC/RPC client object, which can /// communicate with the portmapper at the given host using the @@ -188,11 +188,11 @@ public OncRpcPortmapClient(IPAddress host) : this(host, org.acplt.oncrpc.OncRpcP /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public OncRpcPortmapClient(IPAddress host, int protocol) : this(host, - protocol, -1) - { - } - + public OncRpcPortmapClient(IPAddress host, int protocol) : this(host, + protocol, -1) + { + } + /// /// Constructs and initializes an ONC/RPC client object, which can /// communicate with the portmapper at the given host using the @@ -220,42 +220,42 @@ public OncRpcPortmapClient(IPAddress host, int protocol) : this(host, /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public OncRpcPortmapClient(IPAddress host, int protocol, int timeout) - { - switch (protocol) - { - case org.acplt.oncrpc.OncRpcProtocols.ONCRPC_UDP: - { - portmapClient = new org.acplt.oncrpc.OncRpcUdpClient(host, PMAP_PROGRAM, PMAP_VERSION - , PMAP_PORT, false); - break; - } - - case org.acplt.oncrpc.OncRpcProtocols.ONCRPC_TCP: - { - portmapClient = new org.acplt.oncrpc.OncRpcTcpClient(host, PMAP_PROGRAM, PMAP_VERSION - , PMAP_PORT, 0, timeout, false); - // default buff size - break; - } - - default: - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_UNKNOWNPROTO - )); - } - } - } - + public OncRpcPortmapClient(IPAddress host, int protocol, int timeout) + { + switch (protocol) + { + case org.acplt.oncrpc.OncRpcProtocols.ONCRPC_UDP: + { + portmapClient = new org.acplt.oncrpc.OncRpcUdpClient(host, PMAP_PROGRAM, PMAP_VERSION + , PMAP_PORT, false); + break; + } + + case org.acplt.oncrpc.OncRpcProtocols.ONCRPC_TCP: + { + portmapClient = new org.acplt.oncrpc.OncRpcTcpClient(host, PMAP_PROGRAM, PMAP_VERSION + , PMAP_PORT, 0, timeout, false); + // default buff size + break; + } + + default: + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_UNKNOWNPROTO + )); + } + } + } + /// Closes the connection to the portmapper. /// Closes the connection to the portmapper. /// OncRpcException /// - public virtual void close() - { - portmapClient.close(); - } - + public virtual void close() + { + portmapClient.close(); + } + /// /// Returns the client proxy object used for communicating with the /// portmapper. @@ -265,11 +265,11 @@ public virtual void close() /// portmapper. /// /// portmap client proxy object (subclass of OncRpcClient). - public virtual org.acplt.oncrpc.OncRpcClient getOncRpcClient() - { - return portmapClient; - } - + public virtual org.acplt.oncrpc.OncRpcClient getOncRpcClient() + { + return portmapClient; + } + /// /// Asks the portmapper this OncRpcPortmapClient object is /// a proxy for, for the port number of a particular ONC/RPC server @@ -302,45 +302,45 @@ public virtual org.acplt.oncrpc.OncRpcClient getOncRpcClient() /// is not available. /// /// - public virtual int getPort(int program, int version, int protocol) - { - // - // Fill in the request parameters. Note that params.port is - // not used. BTW - it is automatically initialized as 0 by the - // constructor of the OncRpcServerParams class. - // - org.acplt.oncrpc.OncRpcServerIdent @params = new org.acplt.oncrpc.OncRpcServerIdent - (program, version, protocol, 0); - org.acplt.oncrpc.OncRpcGetPortResult result = new org.acplt.oncrpc.OncRpcGetPortResult - (); - // - // Try to contact the portmap process. If something goes "boing" - // at this stage, then rethrow the exception as a generic portmap - // failure exception. Otherwise, if the port number returned is - // zero, then no appropriate server was found. In this case, - // throw an exception, that the program requested could not be - // found. - // - try - { - portmapClient.call(org.acplt.oncrpc.OncRpcPortmapServices.PMAP_GETPORT, @params, - result); - } - catch (org.acplt.oncrpc.OncRpcException) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PMAPFAILURE - )); - } - // - // In case the program is not registered, throw an exception too. - // - if (result.port == 0) - { - throw (new org.acplt.oncrpc.OncRpcProgramNotRegisteredException()); - } - return result.port; - } - + public virtual int getPort(int program, int version, int protocol) + { + // + // Fill in the request parameters. Note that params.port is + // not used. BTW - it is automatically initialized as 0 by the + // constructor of the OncRpcServerParams class. + // + org.acplt.oncrpc.OncRpcServerIdent @params = new org.acplt.oncrpc.OncRpcServerIdent + (program, version, protocol, 0); + org.acplt.oncrpc.OncRpcGetPortResult result = new org.acplt.oncrpc.OncRpcGetPortResult + (); + // + // Try to contact the portmap process. If something goes "boing" + // at this stage, then rethrow the exception as a generic portmap + // failure exception. Otherwise, if the port number returned is + // zero, then no appropriate server was found. In this case, + // throw an exception, that the program requested could not be + // found. + // + try + { + portmapClient.call(org.acplt.oncrpc.OncRpcPortmapServices.PMAP_GETPORT, @params, + result); + } + catch (org.acplt.oncrpc.OncRpcException) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PMAPFAILURE + )); + } + // + // In case the program is not registered, throw an exception too. + // + if (result.port == 0) + { + throw (new org.acplt.oncrpc.OncRpcProgramNotRegisteredException()); + } + return result.port; + } + /// /// Register an ONC/RPC with the given program number, version and protocol /// at the given port with the portmapper. @@ -368,32 +368,32 @@ public virtual int getPort(int program, int version, int protocol) /// ). /// /// - public virtual bool setPort(int program, int version, int protocol, int port) - { - // - // Fill in the request parameters. - // - org.acplt.oncrpc.OncRpcServerIdent @params = new org.acplt.oncrpc.OncRpcServerIdent - (program, version, protocol, port); - org.acplt.oncrpc.XdrBoolean result = new org.acplt.oncrpc.XdrBoolean(false); - // - // Try to contact the portmap process. If something goes "boing" - // at this stage, then rethrow the exception as a generic portmap - // failure exception. - // - try - { - portmapClient.call(org.acplt.oncrpc.OncRpcPortmapServices.PMAP_SET, @params, result - ); - } - catch (org.acplt.oncrpc.OncRpcException) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PMAPFAILURE - )); - } - return result.booleanValue(); - } - + public virtual bool setPort(int program, int version, int protocol, int port) + { + // + // Fill in the request parameters. + // + org.acplt.oncrpc.OncRpcServerIdent @params = new org.acplt.oncrpc.OncRpcServerIdent + (program, version, protocol, port); + org.acplt.oncrpc.XdrBoolean result = new org.acplt.oncrpc.XdrBoolean(false); + // + // Try to contact the portmap process. If something goes "boing" + // at this stage, then rethrow the exception as a generic portmap + // failure exception. + // + try + { + portmapClient.call(org.acplt.oncrpc.OncRpcPortmapServices.PMAP_SET, @params, result + ); + } + catch (org.acplt.oncrpc.OncRpcException) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PMAPFAILURE + )); + } + return result.booleanValue(); + } + /// Unregister an ONC/RPC with the given program number and version. /// /// Unregister an ONC/RPC with the given program number and version. The @@ -412,35 +412,35 @@ public virtual bool setPort(int program, int version, int protocol, int port) /// ). /// /// - public virtual bool unsetPort(int program, int version) - { - // - // Fill in the request parameters. - // - OncRpcServerIdent @params = new OncRpcServerIdent - (program, version, 0, 0); - XdrBoolean result = new XdrBoolean(false); - // - // Try to contact the portmap process. If something goes "boing" - // at this stage, then rethrow the exception as a generic portmap - // failure exception. - // - try - { - portmapClient.call(OncRpcPortmapServices.PMAP_UNSET, @params, result - ); - } - catch (OncRpcException e) + public virtual bool unsetPort(int program, int version) + { + // + // Fill in the request parameters. + // + OncRpcServerIdent @params = new OncRpcServerIdent + (program, version, 0, 0); + XdrBoolean result = new XdrBoolean(false); + // + // Try to contact the portmap process. If something goes "boing" + // at this stage, then rethrow the exception as a generic portmap + // failure exception. + // + try + { + portmapClient.call(OncRpcPortmapServices.PMAP_UNSET, @params, result + ); + } + catch (OncRpcException e) { // Temp output Console.Out.WriteLine(e.Message); - Console.Out.WriteLine(e.StackTrace); - throw (new OncRpcException(OncRpcException.RPC_PMAPFAILURE - )); - } - return result.booleanValue(); - } - + Console.Out.WriteLine(e.StackTrace); + throw (new OncRpcException(OncRpcException.RPC_PMAPFAILURE + )); + } + return result.booleanValue(); + } + /// /// Retrieves a list of all registered ONC/RPC servers at the same host /// as the contacted portmapper. @@ -461,38 +461,38 @@ public virtual bool unsetPort(int program, int version) /// ). /// /// - public virtual org.acplt.oncrpc.OncRpcServerIdent[] listServers() - { - // - // Fill in the request parameters. - // - org.acplt.oncrpc.OncRpcDumpResult result = new org.acplt.oncrpc.OncRpcDumpResult( - ); - // - // Try to contact the portmap process. If something goes "boing" - // at this stage, then rethrow the exception as a generic portmap - // failure exception. - // - try - { - portmapClient.call(org.acplt.oncrpc.OncRpcPortmapServices.PMAP_DUMP, org.acplt.oncrpc.XdrVoid - .XDR_VOID, result); - } - catch (org.acplt.oncrpc.OncRpcException) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PMAPFAILURE - )); - } - // - // Copy the server ident object references from the Vector - // into the vector (array). - // - org.acplt.oncrpc.OncRpcServerIdent[] info = new org.acplt.oncrpc.OncRpcServerIdent - [result.servers.Count]; - result.servers.CopyTo(info); - return info; - } - + public virtual org.acplt.oncrpc.OncRpcServerIdent[] listServers() + { + // + // Fill in the request parameters. + // + org.acplt.oncrpc.OncRpcDumpResult result = new org.acplt.oncrpc.OncRpcDumpResult( + ); + // + // Try to contact the portmap process. If something goes "boing" + // at this stage, then rethrow the exception as a generic portmap + // failure exception. + // + try + { + portmapClient.call(org.acplt.oncrpc.OncRpcPortmapServices.PMAP_DUMP, org.acplt.oncrpc.XdrVoid + .XDR_VOID, result); + } + catch (org.acplt.oncrpc.OncRpcException) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_PMAPFAILURE + )); + } + // + // Copy the server ident object references from the Vector + // into the vector (array). + // + org.acplt.oncrpc.OncRpcServerIdent[] info = new org.acplt.oncrpc.OncRpcServerIdent + [result.servers.Count]; + result.servers.CopyTo(info); + return info; + } + /// Ping the portmapper (try to call procedure 0). /// Ping the portmapper (try to call procedure 0). /// @@ -501,33 +501,33 @@ public virtual org.acplt.oncrpc.OncRpcServerIdent[] listServers() /// ). /// /// - public virtual void ping() - { - try - { - portmapClient.call(0, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID); - } - catch (org.acplt.oncrpc.OncRpcException) - { - throw (new OncRpcException(OncRpcException.RPC_PMAPFAILURE - )); - } - } - + public virtual void ping() + { + try + { + portmapClient.call(0, XdrVoid.XDR_VOID, XdrVoid.XDR_VOID); + } + catch (org.acplt.oncrpc.OncRpcException) + { + throw (new OncRpcException(OncRpcException.RPC_PMAPFAILURE + )); + } + } + /// Well-known port where the portmap process can be found on Internet hosts. /// /// Well-known port where the portmap process can be found on Internet hosts. /// - public const int PMAP_PORT = 111; - + public const int PMAP_PORT = 111; + /// Program number of the portmapper as defined in RFC 1832. /// Program number of the portmapper as defined in RFC 1832. - public const int PMAP_PROGRAM = 100000; - + public const int PMAP_PROGRAM = 100000; + /// Program version number of the portmapper as defined in RFC 1832. /// Program version number of the portmapper as defined in RFC 1832. - public const int PMAP_VERSION = 2; - + public const int PMAP_VERSION = 2; + /// /// The particular transport-specific ONC/RPC client object used for /// talking to the portmapper. @@ -536,6 +536,6 @@ public virtual void ping() /// The particular transport-specific ONC/RPC client object used for /// talking to the portmapper. /// - internal org.acplt.oncrpc.OncRpcClient portmapClient; + internal org.acplt.oncrpc.OncRpcClient portmapClient; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapServices.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapServices.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapServices.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapServices.cs index 960e4af..b3e836a 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapServices.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcPortmapServices.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// A collection of constants used for ONC/RPC messages to identify the /// remote procedure calls offered by ONC/RPC portmappers. @@ -37,16 +37,16 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcPortmapServices - { + public class OncRpcPortmapServices + { /// Procedure number of portmap service to register an ONC/RPC server. /// Procedure number of portmap service to register an ONC/RPC server. - public const int PMAP_SET = 1; - + public const int PMAP_SET = 1; + /// Procedure number of portmap service to unregister an ONC/RPC server. /// Procedure number of portmap service to unregister an ONC/RPC server. - public const int PMAP_UNSET = 2; - + public const int PMAP_UNSET = 2; + /// /// Procedure number of portmap service to retrieve port number of /// a particular ONC/RPC server. @@ -55,8 +55,8 @@ public class OncRpcPortmapServices /// Procedure number of portmap service to retrieve port number of /// a particular ONC/RPC server. /// - public const int PMAP_GETPORT = 3; - + public const int PMAP_GETPORT = 3; + /// /// Procedure number of portmap service to return information about all /// currently registered ONC/RPC servers. @@ -65,8 +65,8 @@ public class OncRpcPortmapServices /// Procedure number of portmap service to return information about all /// currently registered ONC/RPC servers. /// - public const int PMAP_DUMP = 4; - + public const int PMAP_DUMP = 4; + /// /// Procedure number of portmap service to indirectly call a remote /// procedure an ONC/RPC server through the ONC/RPC portmapper. @@ -75,6 +75,6 @@ public class OncRpcPortmapServices /// Procedure number of portmap service to indirectly call a remote /// procedure an ONC/RPC server through the ONC/RPC portmapper. /// - public const int PMAP_CALLIT = 5; + public const int PMAP_CALLIT = 5; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProgramNotRegisteredException.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProgramNotRegisteredException.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProgramNotRegisteredException.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProgramNotRegisteredException.cs index ed97c5a..ff7fd2f 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProgramNotRegisteredException.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProgramNotRegisteredException.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The class OncRpcProgramNotRegisteredException indicates /// that the requests ONC/RPC program is not available at the specified host. @@ -36,15 +36,15 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2005/11/11 21:03:30 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - [System.Serializable] - public class OncRpcProgramNotRegisteredException : org.acplt.oncrpc.OncRpcException - { + [System.Serializable] + public class OncRpcProgramNotRegisteredException : org.acplt.oncrpc.OncRpcException + { /// Defines the serial version UID for OncRpcProgramNotRegisteredException. /// /// Defines the serial version UID for OncRpcProgramNotRegisteredException. /// - private const long serialVersionUID = 5073156463000368270L; - + private const long serialVersionUID = 5073156463000368270L; + /// /// Constructs an ONC/RPC program not registered exception with a detail /// code of OncRpcException.RPC_PROGNOTREGISTERED and an @@ -55,9 +55,9 @@ public class OncRpcProgramNotRegisteredException : org.acplt.oncrpc.OncRpcExcept /// code of OncRpcException.RPC_PROGNOTREGISTERED and an /// appropriate clear-text detail message. /// - public OncRpcProgramNotRegisteredException() : base(org.acplt.oncrpc.OncRpcException - .RPC_PROGNOTREGISTERED) - { - } + public OncRpcProgramNotRegisteredException() : base(org.acplt.oncrpc.OncRpcException + .RPC_PROGNOTREGISTERED) + { + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProtocols.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProtocols.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProtocols.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProtocols.cs index 066f7ad..c18024f 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProtocols.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcProtocols.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// A collection of protocol constants used by the ONC/RPC package. /// /// A collection of protocol constants used by the ONC/RPC package. Each @@ -35,8 +35,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcProtocols - { + public class OncRpcProtocols + { /// /// Use the UDP protocol of the IP (Internet Protocol) suite as the /// network communication protocol for doing remote procedure calls. @@ -47,8 +47,8 @@ public class OncRpcProtocols /// This is the same as the IPPROTO_UDP definition from the famous /// BSD socket API. /// - public const int ONCRPC_UDP = 17; - + public const int ONCRPC_UDP = 17; + /// /// Use the TCP protocol of the IP (Internet Protocol) suite as the /// network communication protocol for doing remote procedure calls. @@ -59,8 +59,8 @@ public class OncRpcProtocols /// This is the same as the IPPROTO_TCP definition from the famous /// BSD socket API. /// - public const int ONCRPC_TCP = 6; - + public const int ONCRPC_TCP = 6; + /// /// Use the HTTP application protocol for tunneling ONC remote procedure /// calls. @@ -70,6 +70,6 @@ public class OncRpcProtocols /// calls. This is definetely not similiar to any definition in the /// famous BSD socket API. /// - public const int ONCRPC_HTTP = -42; + public const int ONCRPC_HTTP = -42; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcRejectStatus.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcRejectStatus.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcRejectStatus.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcRejectStatus.cs index 72467bf..551074e 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcRejectStatus.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcRejectStatus.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// A collection of constants used to describe why a remote procedure call /// message was rejected. @@ -44,14 +44,14 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcRejectStatus - { + public class OncRpcRejectStatus + { /// Wrong ONC/RPC protocol version used in call (it needs to be version 2). /// Wrong ONC/RPC protocol version used in call (it needs to be version 2). - public const int ONCRPC_RPC_MISMATCH = 0; - + public const int ONCRPC_RPC_MISMATCH = 0; + /// The remote ONC/RPC server could not authenticate the caller. /// The remote ONC/RPC server could not authenticate the caller. - public const int ONCRPC_AUTH_ERROR = 1; + public const int ONCRPC_AUTH_ERROR = 1; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyMessage.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyMessage.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyMessage.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyMessage.cs index bff3efd..50392aa 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyMessage.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyMessage.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The OncRpcReplyMessage class represents an ONC/RPC reply /// message as defined by ONC/RPC in RFC 1831. @@ -43,8 +43,8 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2003/08/14 07:56:59 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public abstract class OncRpcReplyMessage : OncRpcMessage - { + public abstract class OncRpcReplyMessage : OncRpcMessage + { /// The reply status of the reply message. /// /// The reply status of the reply message. This can be either @@ -60,8 +60,8 @@ public abstract class OncRpcReplyMessage : OncRpcMessage /// rejected replies was driven by the motivation not to use polymorphism /// and thus have to upcast and downcast references all the time. /// - public int replyStatus; - + public int replyStatus; + /// /// Acceptance status in case this reply was sent in response to an /// accepted call ( @@ -76,8 +76,8 @@ public abstract class OncRpcReplyMessage : OncRpcMessage /// result data will follow /// the reply message header. /// - public int acceptStatus; - + public int acceptStatus; + /// /// Rejectance status in case this reply sent in response to a /// rejected call ( @@ -88,8 +88,8 @@ public abstract class OncRpcReplyMessage : OncRpcMessage /// OncRpcRejectStatus /// interface. /// - public int rejectStatus; - + public int rejectStatus; + /// /// Lowest supported version in case of /// OncRpcRejectStatus.ONCRPC_RPC_MISMATCH @@ -99,8 +99,8 @@ public abstract class OncRpcReplyMessage : OncRpcMessage /// /// . /// - public int lowVersion; - + public int lowVersion; + /// /// Highest supported version in case of /// OncRpcRejectStatus.ONCRPC_RPC_MISMATCH @@ -110,8 +110,8 @@ public abstract class OncRpcReplyMessage : OncRpcMessage /// /// . /// - public int highVersion; - + public int highVersion; + /// /// Contains the reason for authentification failure in the case /// of @@ -119,8 +119,8 @@ public abstract class OncRpcReplyMessage : OncRpcMessage /// /// . /// - public int authStatus; - + public int authStatus; + /// /// Initializes a new OncRpcReplyMessage object to represent /// an invalid state. @@ -131,17 +131,17 @@ public abstract class OncRpcReplyMessage : OncRpcMessage /// next step the real state of the reply message is immediately decoded /// from a XDR stream. /// - public OncRpcReplyMessage() : base(0) - { - messageType = org.acplt.oncrpc.OncRpcMessageType.ONCRPC_REPLY; - replyStatus = org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED; - acceptStatus = org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SYSTEM_ERR; - rejectStatus = UNUSED_PARAMETER; - lowVersion = 0; - highVersion = 0; - authStatus = UNUSED_PARAMETER; - } - + public OncRpcReplyMessage() : base(0) + { + messageType = org.acplt.oncrpc.OncRpcMessageType.ONCRPC_REPLY; + replyStatus = org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED; + acceptStatus = org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SYSTEM_ERR; + rejectStatus = UNUSED_PARAMETER; + lowVersion = 0; + highVersion = 0; + authStatus = UNUSED_PARAMETER; + } + /// /// Initializes a new OncRpcReplyMessage object and initializes /// its complete state from the given parameters. @@ -176,19 +176,19 @@ public OncRpcReplyMessage() : base(0) /// OncRpcAuthStatus /// ). /// - public OncRpcReplyMessage(org.acplt.oncrpc.OncRpcCallMessage call, int replyStatus - , int acceptStatus, int rejectStatus, int lowVersion, int highVersion, int authStatus - ) : base(call.messageId) - { - messageType = org.acplt.oncrpc.OncRpcMessageType.ONCRPC_REPLY; - this.replyStatus = replyStatus; - this.acceptStatus = acceptStatus; - this.rejectStatus = rejectStatus; - this.lowVersion = lowVersion; - this.highVersion = highVersion; - this.authStatus = authStatus; - } - + public OncRpcReplyMessage(org.acplt.oncrpc.OncRpcCallMessage call, int replyStatus + , int acceptStatus, int rejectStatus, int lowVersion, int highVersion, int authStatus + ) : base(call.messageId) + { + messageType = org.acplt.oncrpc.OncRpcMessageType.ONCRPC_REPLY; + this.replyStatus = replyStatus; + this.acceptStatus = acceptStatus; + this.rejectStatus = rejectStatus; + this.lowVersion = lowVersion; + this.highVersion = highVersion; + this.authStatus = authStatus; + } + /// /// Dummy, which can be used to identify unused parameters when constructing /// OncRpcReplyMessage objects. @@ -197,6 +197,6 @@ public OncRpcReplyMessage(org.acplt.oncrpc.OncRpcCallMessage call, int replyStat /// Dummy, which can be used to identify unused parameters when constructing /// OncRpcReplyMessage objects. /// - public const int UNUSED_PARAMETER = 0; + public const int UNUSED_PARAMETER = 0; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyStatus.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyStatus.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyStatus.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyStatus.cs index d749649..ae58256 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyStatus.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcReplyStatus.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// A collection of constants used to identify the (overall) status of an /// ONC/RPC reply message. @@ -37,8 +37,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcReplyStatus - { + public class OncRpcReplyStatus + { /// /// Reply status identifying that the corresponding message call was /// accepted. @@ -47,8 +47,8 @@ public class OncRpcReplyStatus /// Reply status identifying that the corresponding message call was /// accepted. /// - public const int ONCRPC_MSG_ACCEPTED = 0; - + public const int ONCRPC_MSG_ACCEPTED = 0; + /// /// Reply status identifying that the corresponding message call was /// denied. @@ -57,6 +57,6 @@ public class OncRpcReplyStatus /// Reply status identifying that the corresponding message call was /// denied. /// - public const int ONCRPC_MSG_DENIED = 1; + public const int ONCRPC_MSG_DENIED = 1; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcServerIdent.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcServerIdent.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcServerIdent.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcServerIdent.cs index f55b1f9..144f615 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcServerIdent.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcServerIdent.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The class OncRpcServerIdent represents an tuple /// { program, version, protocol, port} uniquely identifying a particular @@ -43,16 +43,16 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcServerIdent : XdrAble - { + public class OncRpcServerIdent : XdrAble + { /// The program number of the ONC/RPC server in question. /// The program number of the ONC/RPC server in question. - public int program; - + public int program; + /// The program version number of the ONC/RPC server in question. /// The program version number of the ONC/RPC server in question. - public int version; - + public int version; + /// The protocol used for communicating with the ONC/RPC server in question. /// /// @@ -62,12 +62,12 @@ public class OncRpcServerIdent : XdrAble /// OncRpcProtocols /// interface. /// - public int protocol; - + public int protocol; + /// The port number of the ONC/RPC server in question. /// The port number of the ONC/RPC server in question. - public int port; - + public int port; + /// /// Constuct an OncRpcServerIdent object with senseless /// default values for the requested program number, version number, @@ -78,14 +78,14 @@ public class OncRpcServerIdent : XdrAble /// default values for the requested program number, version number, /// protocol type and port number. /// - public OncRpcServerIdent() - { - program = 0; - version = 0; - protocol = 0; - port = 0; - } - + public OncRpcServerIdent() + { + program = 0; + version = 0; + protocol = 0; + port = 0; + } + /// /// Constructs an OncRpcServerIdent object with the /// requested program number, version number, protocol type and port @@ -96,14 +96,14 @@ public OncRpcServerIdent() /// requested program number, version number, protocol type and port /// number. /// - public OncRpcServerIdent(int program, int version, int protocol, int port) - { - this.program = program; - this.version = version; - this.protocol = protocol; - this.port = port; - } - + public OncRpcServerIdent(int program, int version, int protocol, int port) + { + this.program = program; + this.version = version; + this.protocol = protocol; + this.port = port; + } + /// /// Constructs an OncRpcServerIdent object and restores /// its state from the given XDR stream. @@ -114,11 +114,11 @@ public OncRpcServerIdent(int program, int version, int protocol, int port) /// /// /// - public OncRpcServerIdent(org.acplt.oncrpc.XdrDecodingStream xdr) - { - xdrDecode(xdr); - } - + public OncRpcServerIdent(org.acplt.oncrpc.XdrDecodingStream xdr) + { + xdrDecode(xdr); + } + /// /// Encodes -- that is: serializes -- an OncRpcServerIdent object /// into a XDR stream. @@ -130,14 +130,14 @@ public OncRpcServerIdent(org.acplt.oncrpc.XdrDecodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeInt(program); - xdr.xdrEncodeInt(version); - xdr.xdrEncodeInt(protocol); - xdr.xdrEncodeInt(port); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeInt(program); + xdr.xdrEncodeInt(version); + xdr.xdrEncodeInt(protocol); + xdr.xdrEncodeInt(port); + } + /// /// Decodes -- that is: deserializes -- an OncRpcServerIdent object /// from a XDR stream. @@ -149,12 +149,12 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - program = xdr.xdrDecodeInt(); - version = xdr.xdrDecodeInt(); - protocol = xdr.xdrDecodeInt(); - port = xdr.xdrDecodeInt(); - } + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + program = xdr.xdrDecodeInt(); + version = xdr.xdrDecodeInt(); + protocol = xdr.xdrDecodeInt(); + port = xdr.xdrDecodeInt(); + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTcpClient.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTcpClient.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTcpClient.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTcpClient.cs index cb20785..9179e1f 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTcpClient.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTcpClient.cs @@ -26,9 +26,9 @@ using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; - + namespace org.acplt.oncrpc -{ +{ /// /// ONC/RPC client which communicates with ONC/RPC servers over the network /// using the stream-oriented protocol TCP/IP. @@ -41,8 +41,8 @@ namespace org.acplt.oncrpc /// $Revision: 1.5 $ $Date: 2005/11/11 21:04:30 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class OncRpcTcpClient : OncRpcClient - { + public class OncRpcTcpClient : OncRpcClient + { /// /// Constructs a new OncRpcTcpClient object, which connects /// to the ONC/RPC server at host for calling remote procedures @@ -62,11 +62,11 @@ public class OncRpcTcpClient : OncRpcClient /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public OncRpcTcpClient(IPAddress host, int program, int version) : this - (host, program, version, 0, 0, true) - { - } - + public OncRpcTcpClient(IPAddress host, int program, int version) : this + (host, program, version, 0, 0, true) + { + } + /// /// Constructs a new OncRpcTcpClient object, which connects /// to the ONC/RPC server at host for calling remote procedures @@ -93,10 +93,10 @@ public OncRpcTcpClient(IPAddress host, int program, int version) : this /// public OncRpcTcpClient(IPAddress host, int program, int version, int port, bool useSecurePort ) - : this(host, program, version, port, 0, useSecurePort) - { - } - + : this(host, program, version, port, 0, useSecurePort) + { + } + /// /// Constructs a new OncRpcTcpClient object, which connects /// to the ONC/RPC server at host for calling remote procedures @@ -132,10 +132,10 @@ public OncRpcTcpClient(IPAddress host, int program, int version, int port, bool /// public OncRpcTcpClient(IPAddress host, int program, int version, int port , int bufferSize, bool useSecurePort) - : this(host, program, version, port, bufferSize, -1, useSecurePort) - { - } - + : this(host, program, version, port, bufferSize, -1, useSecurePort) + { + } + /// /// Constructs a new OncRpcTcpClient object, which connects /// to the ONC/RPC server at host for calling remote procedures @@ -177,39 +177,39 @@ public OncRpcTcpClient(IPAddress host, int program, int version, int port /// public OncRpcTcpClient(IPAddress host, int program, int version, int port , int bufferSize, int timeout, bool useSecurePort) - : base(host, program, version, port, org.acplt.oncrpc.OncRpcProtocols - .ONCRPC_TCP) - { - // - // Construct the inherited part of our object. This will also try to - // lookup the port of the desired ONC/RPC server, if no port number - // was specified (port = 0). - // - // - // Let the host operating system choose which port (and network - // interface) to use. Then set the buffer sizes for sending and - // receiving UDP datagrams. Finally set the destination of packets. - // - if (bufferSize == 0) - { - bufferSize = 128000; - } - // default setting - if (bufferSize < 1024) - { - bufferSize = 1024; - } - // - // Note that we use this.port at this time, because the superclass - // might have resolved the port number in case the caller specified - // simply 0 as the port number. - // - // Construct the socket and connect + : base(host, program, version, port, org.acplt.oncrpc.OncRpcProtocols + .ONCRPC_TCP) + { + // + // Construct the inherited part of our object. This will also try to + // lookup the port of the desired ONC/RPC server, if no port number + // was specified (port = 0). + // + // + // Let the host operating system choose which port (and network + // interface) to use. Then set the buffer sizes for sending and + // receiving UDP datagrams. Finally set the destination of packets. + // + if (bufferSize == 0) + { + bufferSize = 128000; + } + // default setting + if (bufferSize < 1024) + { + bufferSize = 1024; + } + // + // Note that we use this.port at this time, because the superclass + // might have resolved the port number in case the caller specified + // simply 0 as the port number. + // + // Construct the socket and connect socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); if (useSecurePort) - { - var localEp = new IPEndPoint(IPAddress.Any, GetLocalPort()); + { + var localEp = new IPEndPoint(IPAddress.Any, GetLocalPort()); socket.Bind(localEp); } @@ -220,21 +220,21 @@ public OncRpcTcpClient(IPAddress host, int program, int version, int port socket.SendTimeout = timeout; socket.ReceiveTimeout = timeout; } - socket.NoDelay = true; - if (socket.SendBufferSize < bufferSize) - { - socket.SendBufferSize = bufferSize; - } - if (socket.ReceiveBufferSize < bufferSize) - { - socket.ReceiveBufferSize = bufferSize; - } - // - // Create the necessary encoding and decoding streams, so we can - // communicate at all. - // - sendingXdr = new org.acplt.oncrpc.XdrTcpEncodingStream(socket, bufferSize); - receivingXdr = new org.acplt.oncrpc.XdrTcpDecodingStream(socket, bufferSize); + socket.NoDelay = true; + if (socket.SendBufferSize < bufferSize) + { + socket.SendBufferSize = bufferSize; + } + if (socket.ReceiveBufferSize < bufferSize) + { + socket.ReceiveBufferSize = bufferSize; + } + // + // Create the necessary encoding and decoding streams, so we can + // communicate at all. + // + sendingXdr = new org.acplt.oncrpc.XdrTcpEncodingStream(socket, bufferSize); + receivingXdr = new org.acplt.oncrpc.XdrTcpDecodingStream(socket, bufferSize); } private int GetLocalPort() @@ -269,7 +269,7 @@ private int GetLocalPort() /// /// if an ONC/RPC error occurs. /// - public override void close() + public override void close() { if (socket != null) { @@ -282,31 +282,31 @@ public override void close() } socket = null; } - socket = null; - if (sendingXdr != null) - { - try - { - sendingXdr.Close(); - } - catch (System.IO.IOException) - { - } - sendingXdr = null; - } - if (receivingXdr != null) - { - try - { - receivingXdr.Close(); - } - catch (System.IO.IOException) - { - } - receivingXdr = null; - } - } - + socket = null; + if (sendingXdr != null) + { + try + { + sendingXdr.Close(); + } + catch (System.IO.IOException) + { + } + sendingXdr = null; + } + if (receivingXdr != null) + { + try + { + receivingXdr.Close(); + } + catch (System.IO.IOException) + { + } + receivingXdr = null; + } + } + /// Calls a remote procedure on an ONC/RPC server. /// /// Calls a remote procedure on an ONC/RPC server. @@ -328,176 +328,176 @@ public override void close() /// The object receiving the result of the procedure call. /// if an ONC/RPC error occurs. /// - public override void call(int procedureNumber, int versionNumber, org.acplt.oncrpc.XdrAble - @params, org.acplt.oncrpc.XdrAble result) - { - lock (this) - { - // Refresh: - for (int refreshesLeft = 1; refreshesLeft >= 0; --refreshesLeft) - { - // - // First, build the ONC/RPC call header. Then put the sending - // stream into a known state and encode the parameters to be - // sent. Finally tell the encoding stream to send all its data - // to the server. Then wait for an answer, receive it and decode - // it. So that's the bottom line of what we do right here. - // - nextXid(); - org.acplt.oncrpc.OncRpcClientCallMessage callHeader = new org.acplt.oncrpc.OncRpcClientCallMessage - (xid, program, versionNumber, procedureNumber, auth); - org.acplt.oncrpc.OncRpcClientReplyMessage replyHeader = new org.acplt.oncrpc.OncRpcClientReplyMessage - (auth); - // - // Send call message to server. If we receive an IOException, - // then we'll throw the appropriate ONC/RPC (client) exception. - // Note that we use a connected stream, so we don't need to - // specify a destination when beginning serialization. - // - try + public override void call(int procedureNumber, int versionNumber, org.acplt.oncrpc.XdrAble + @params, org.acplt.oncrpc.XdrAble result) + { + lock (this) + { + // Refresh: + for (int refreshesLeft = 1; refreshesLeft >= 0; --refreshesLeft) + { + // + // First, build the ONC/RPC call header. Then put the sending + // stream into a known state and encode the parameters to be + // sent. Finally tell the encoding stream to send all its data + // to the server. Then wait for an answer, receive it and decode + // it. So that's the bottom line of what we do right here. + // + nextXid(); + org.acplt.oncrpc.OncRpcClientCallMessage callHeader = new org.acplt.oncrpc.OncRpcClientCallMessage + (xid, program, versionNumber, procedureNumber, auth); + org.acplt.oncrpc.OncRpcClientReplyMessage replyHeader = new org.acplt.oncrpc.OncRpcClientReplyMessage + (auth); + // + // Send call message to server. If we receive an IOException, + // then we'll throw the appropriate ONC/RPC (client) exception. + // Note that we use a connected stream, so we don't need to + // specify a destination when beginning serialization. + // + try + { + socket.ReceiveTimeout = transmissionTimeout; + sendingXdr.beginEncoding(null, 0); + callHeader.xdrEncode(sendingXdr); + @params.xdrEncode(sendingXdr); + if (timeout != 0) + { + sendingXdr.endEncoding(); + } + else + { + sendingXdr.endEncoding(false); + } + } + catch (System.IO.IOException e) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTSEND + , e.Message)); + } + // + // Receive reply message from server -- at least try to do so... + // In case of batched calls we don't need no stinkin' answer, so + // we can do other, more interesting things. + // + if (timeout == 0) + { + return; + } + try { - socket.ReceiveTimeout = transmissionTimeout; - sendingXdr.beginEncoding(null, 0); - callHeader.xdrEncode(sendingXdr); - @params.xdrEncode(sendingXdr); - if (timeout != 0) - { - sendingXdr.endEncoding(); - } - else - { - sendingXdr.endEncoding(false); - } - } - catch (System.IO.IOException e) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTSEND - , e.Message)); - } - // - // Receive reply message from server -- at least try to do so... - // In case of batched calls we don't need no stinkin' answer, so - // we can do other, more interesting things. - // - if (timeout == 0) - { - return; - } - try - { - // - // Keep receiving until we get the matching reply. - // - while (true) + // + // Keep receiving until we get the matching reply. + // + while (true) { - socket.ReceiveTimeout = timeout; + socket.ReceiveTimeout = timeout; receivingXdr.beginDecoding(); - socket.ReceiveTimeout = transmissionTimeout; - // - // First, pull off the reply message header of the - // XDR stream. In case we also received a verifier - // from the server and this verifier was invalid, broken - // or tampered with, we will get an - // OncRpcAuthenticationException right here, which will - // propagate up to the caller. If the server reported - // an authentication problem itself, then this will - // be handled as any other rejected ONC/RPC call. - // - try - { - replyHeader.xdrDecode(receivingXdr); - } - catch (org.acplt.oncrpc.OncRpcException e) - { - // - // ** SF bug #1262106 ** - // - // We ran into some sort of trouble. Usually this will have - // been a buffer underflow. Whatever, end the decoding process - // and ensure this way that the next call has a chance to start - // from a clean state. - // - receivingXdr.endDecoding(); - - // continue; - - throw (e); - } - // - // Only deserialize the result, if the reply matches the - // call. Otherwise skip this record. - // - if (replyHeader.messageId == callHeader.messageId) - { - break; - } - receivingXdr.endDecoding(); - } - // - // Make sure that the call was accepted. In case of unsuccessful - // calls, throw an exception, if it's not an authentication - // exception. In that case try to refresh the credential first. - // - if (!replyHeader.successfullyAccepted()) - { - receivingXdr.endDecoding(); - // - // Check whether there was an authentication - // problem. In this case first try to refresh the - // credentials. - // - if ((refreshesLeft > 0) && (replyHeader.replyStatus == org.acplt.oncrpc.OncRpcReplyStatus - .ONCRPC_MSG_DENIED) && (replyHeader.rejectStatus == org.acplt.oncrpc.OncRpcRejectStatus - .ONCRPC_AUTH_ERROR) && (auth != null) && auth.canRefreshCred()) - { - // continue Refresh; - continue; - } - // - // Nope. No chance. This gets tough. - // - throw (replyHeader.newException()); - } - try - { - result.xdrDecode(receivingXdr); - } - catch (org.acplt.oncrpc.OncRpcException e) - { - // - // ** SF bug #1262106 ** - // - // We ran into some sort of trouble. Usually this will have - // been a buffer underflow. Whatever, end the decoding process - // and ensure this way that the next call has a chance to start - // from a clean state. - // - receivingXdr.endDecoding(); - + socket.ReceiveTimeout = transmissionTimeout; + // + // First, pull off the reply message header of the + // XDR stream. In case we also received a verifier + // from the server and this verifier was invalid, broken + // or tampered with, we will get an + // OncRpcAuthenticationException right here, which will + // propagate up to the caller. If the server reported + // an authentication problem itself, then this will + // be handled as any other rejected ONC/RPC call. + // + try + { + replyHeader.xdrDecode(receivingXdr); + } + catch (org.acplt.oncrpc.OncRpcException e) + { + // + // ** SF bug #1262106 ** + // + // We ran into some sort of trouble. Usually this will have + // been a buffer underflow. Whatever, end the decoding process + // and ensure this way that the next call has a chance to start + // from a clean state. + // + receivingXdr.endDecoding(); + + // continue; + + throw (e); + } + // + // Only deserialize the result, if the reply matches the + // call. Otherwise skip this record. + // + if (replyHeader.messageId == callHeader.messageId) + { + break; + } + receivingXdr.endDecoding(); + } + // + // Make sure that the call was accepted. In case of unsuccessful + // calls, throw an exception, if it's not an authentication + // exception. In that case try to refresh the credential first. + // + if (!replyHeader.successfullyAccepted()) + { + receivingXdr.endDecoding(); + // + // Check whether there was an authentication + // problem. In this case first try to refresh the + // credentials. + // + if ((refreshesLeft > 0) && (replyHeader.replyStatus == org.acplt.oncrpc.OncRpcReplyStatus + .ONCRPC_MSG_DENIED) && (replyHeader.rejectStatus == org.acplt.oncrpc.OncRpcRejectStatus + .ONCRPC_AUTH_ERROR) && (auth != null) && auth.canRefreshCred()) + { + // continue Refresh; + continue; + } + // + // Nope. No chance. This gets tough. + // + throw (replyHeader.newException()); + } + try + { + result.xdrDecode(receivingXdr); + } + catch (org.acplt.oncrpc.OncRpcException e) + { + // + // ** SF bug #1262106 ** + // + // We ran into some sort of trouble. Usually this will have + // been a buffer underflow. Whatever, end the decoding process + // and ensure this way that the next call has a chance to start + // from a clean state. + // + receivingXdr.endDecoding(); + throw (e); - } - // - // Free pending resources of buffer and exit the call loop, - // returning the reply to the caller through the result - // object. - // - receivingXdr.endDecoding(); - return; - } - catch (System.IO.IOException e) - { - // - // Argh. Trouble with the transport. Seems like we can't - // receive data. Gosh. Go away! - // - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTRECV - , e.Message)); - } - } - } - } - - // for ( refreshesLeft ) + } + // + // Free pending resources of buffer and exit the call loop, + // returning the reply to the caller through the result + // object. + // + receivingXdr.endDecoding(); + return; + } + catch (System.IO.IOException e) + { + // + // Argh. Trouble with the transport. Seems like we can't + // receive data. Gosh. Go away! + // + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTRECV + , e.Message)); + } + } + } + } + + // for ( refreshesLeft ) /// Issues a batched call for a remote procedure to an ONC/RPC server. /// /// Issues a batched call for a remote procedure to an ONC/RPC server. @@ -533,43 +533,43 @@ public override void call(int procedureNumber, int versionNumber, org.acplt.oncr /// /// if an ONC/RPC error occurs. /// - public virtual void batchCall(int procedureNumber, org.acplt.oncrpc.XdrAble @params - , bool flush) - { - lock (this) - { - // - // First, build the ONC/RPC call header. Then put the sending - // stream into a known state and encode the parameters to be - // sent. Finally tell the encoding stream to send all its data - // to the server. We don't then need to wait for an answer. And - // we don't need to take care of credential refreshes either. - // - nextXid(); - org.acplt.oncrpc.OncRpcClientCallMessage callHeader = new org.acplt.oncrpc.OncRpcClientCallMessage - (xid, program, version, procedureNumber, auth); - // - // Send call message to server. If we receive an IOException, - // then we'll throw the appropriate ONC/RPC (client) exception. - // Note that we use a connected stream, so we don't need to - // specify a destination when beginning serialization. - // - try - { - socket.SendTimeout = transmissionTimeout; - sendingXdr.beginEncoding(null, 0); - callHeader.xdrEncode(sendingXdr); - @params.xdrEncode(sendingXdr); - sendingXdr.endEncoding(flush); - } - catch (System.IO.IOException e) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTSEND - , e.Message)); - } - } - } - + public virtual void batchCall(int procedureNumber, org.acplt.oncrpc.XdrAble @params + , bool flush) + { + lock (this) + { + // + // First, build the ONC/RPC call header. Then put the sending + // stream into a known state and encode the parameters to be + // sent. Finally tell the encoding stream to send all its data + // to the server. We don't then need to wait for an answer. And + // we don't need to take care of credential refreshes either. + // + nextXid(); + org.acplt.oncrpc.OncRpcClientCallMessage callHeader = new org.acplt.oncrpc.OncRpcClientCallMessage + (xid, program, version, procedureNumber, auth); + // + // Send call message to server. If we receive an IOException, + // then we'll throw the appropriate ONC/RPC (client) exception. + // Note that we use a connected stream, so we don't need to + // specify a destination when beginning serialization. + // + try + { + socket.SendTimeout = transmissionTimeout; + sendingXdr.beginEncoding(null, 0); + callHeader.xdrEncode(sendingXdr); + @params.xdrEncode(sendingXdr); + sendingXdr.endEncoding(flush); + } + catch (System.IO.IOException e) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTSEND + , e.Message)); + } + } + } + /// /// Set the timout for remote procedure calls to wait for an answer from /// the ONC/RPC server. @@ -590,11 +590,11 @@ public virtual void batchCall(int procedureNumber, org.acplt.oncrpc.XdrAble @par /// Timeout in milliseconds. A timeout of zero indicates /// batched calls. /// - public override void setTimeout(int milliseconds) - { - base.setTimeout(milliseconds); - } - + public override void setTimeout(int milliseconds) + { + base.setTimeout(milliseconds); + } + /// Set the timeout used during transmission of data. /// /// Set the timeout used during transmission of data. If the flow of data @@ -602,15 +602,15 @@ public override void setTimeout(int milliseconds) /// timeout, an exception is thrown. The timeout must be > 0. /// /// Transmission timeout in milliseconds. - public virtual void setTransmissionTimeout(int milliseconds) - { - if (milliseconds <= 0) - { - throw (new System.ArgumentException("transmission timeout must be > 0")); - } - transmissionTimeout = milliseconds; - } - + public virtual void setTransmissionTimeout(int milliseconds) + { + if (milliseconds <= 0) + { + throw (new System.ArgumentException("transmission timeout must be > 0")); + } + transmissionTimeout = milliseconds; + } + /// /// Retrieve the current timeout used during transmission phases (call and /// reply phases). @@ -620,34 +620,34 @@ public virtual void setTransmissionTimeout(int milliseconds) /// reply phases). /// /// Current transmission timeout. - public virtual int getTransmissionTimeout() - { - return transmissionTimeout; - } - + public virtual int getTransmissionTimeout() + { + return transmissionTimeout; + } + /// Set the character encoding for (de-)serializing strings. /// Set the character encoding for (de-)serializing strings. /// /// the encoding to use for (de-)serializing strings. /// If null, the system's default encoding is to be used. /// - public override void setCharacterEncoding(string characterEncoding) - { - receivingXdr.setCharacterEncoding(characterEncoding); - sendingXdr.setCharacterEncoding(characterEncoding); - } - + public override void setCharacterEncoding(string characterEncoding) + { + receivingXdr.setCharacterEncoding(characterEncoding); + sendingXdr.setCharacterEncoding(characterEncoding); + } + /// Get the character encoding for (de-)serializing strings. /// Get the character encoding for (de-)serializing strings. /// /// the encoding currently used for (de-)serializing strings. /// If null, then the system's default encoding is used. /// - public override string getCharacterEncoding() - { - return receivingXdr.getCharacterEncoding(); - } - + public override string getCharacterEncoding() + { + return receivingXdr.getCharacterEncoding(); + } + /// /// TCP socket used for stream-oriented communication with an ONC/RPC /// server. @@ -656,8 +656,8 @@ public override string getCharacterEncoding() /// TCP socket used for stream-oriented communication with an ONC/RPC /// server. /// - private Socket socket; - + private Socket socket; + /// /// XDR encoding stream used for sending requests via TCP/IP to an ONC/RPC /// server. @@ -666,8 +666,8 @@ public override string getCharacterEncoding() /// XDR encoding stream used for sending requests via TCP/IP to an ONC/RPC /// server. /// - internal org.acplt.oncrpc.XdrTcpEncodingStream sendingXdr; - + internal org.acplt.oncrpc.XdrTcpEncodingStream sendingXdr; + /// /// XDR decoding stream used when receiving replies via TCP/IP from an /// ONC/RPC server. @@ -676,8 +676,8 @@ public override string getCharacterEncoding() /// XDR decoding stream used when receiving replies via TCP/IP from an /// ONC/RPC server. /// - internal org.acplt.oncrpc.XdrTcpDecodingStream receivingXdr; - + internal org.acplt.oncrpc.XdrTcpDecodingStream receivingXdr; + /// /// Timeout during the phase where data is sent within calls, or data is /// received within replies. @@ -686,6 +686,6 @@ public override string getCharacterEncoding() /// Timeout during the phase where data is sent within calls, or data is /// received within replies. /// - internal int transmissionTimeout = 30000; + internal int transmissionTimeout = 30000; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTimeoutException.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTimeoutException.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTimeoutException.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTimeoutException.cs index 00f4d13..1f958f1 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTimeoutException.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcTimeoutException.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The class OncRpcTimeoutException indicates a timed out /// call exception. @@ -36,21 +36,21 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2005/11/11 21:05:00 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - [System.Serializable] - public class OncRpcTimeoutException : OncRpcException - { + [System.Serializable] + public class OncRpcTimeoutException : OncRpcException + { /// Defines the serial version UID for OncRpcTimeoutException. /// Defines the serial version UID for OncRpcTimeoutException. - private const long serialVersionUID = 2777518173161399732L; - + private const long serialVersionUID = 2777518173161399732L; + /// /// Initializes an OncRpcTimeoutException /// with a detail of /// OncRpcException.RPC_TIMEDOUT /// . /// - public OncRpcTimeoutException() : base(RPC_TIMEDOUT) - { - } + public OncRpcTimeoutException() : base(RPC_TIMEDOUT) + { + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpClient.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpClient.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpClient.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpClient.cs index ba5e56a..e27f43b 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpClient.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpClient.cs @@ -27,9 +27,9 @@ using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; - + namespace org.acplt.oncrpc -{ +{ /// /// ONC/RPC client which communicates with ONC/RPC servers over the network /// using the datagram-oriented protocol UDP/IP. @@ -42,8 +42,8 @@ namespace org.acplt.oncrpc /// $Revision: 1.6 $ $Date: 2007/05/29 18:48:27 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class OncRpcUdpClient : OncRpcClient - { + public class OncRpcUdpClient : OncRpcClient + { /// /// Constructs a new OncRpcUdpClient object, which connects /// to the ONC/RPC server at host for calling remote procedures @@ -69,11 +69,11 @@ public class OncRpcUdpClient : OncRpcClient /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public OncRpcUdpClient(IPAddress host, int program, int version, int port, - bool useSecurePort) : this(host, program, version, port, 8192, useSecurePort) - { - } - + public OncRpcUdpClient(IPAddress host, int program, int version, int port, + bool useSecurePort) : this(host, program, version, port, 8192, useSecurePort) + { + } + /// /// Constructs a new OncRpcUdpClient object, which connects /// to the ONC/RPC server at host for calling remote procedures @@ -102,57 +102,57 @@ public OncRpcUdpClient(IPAddress host, int program, int version, int port, /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public OncRpcUdpClient(IPAddress host, int program, int version, int port - , int bufferSize, bool useSecurePort) : base(host, program, version, port, OncRpcProtocols - .ONCRPC_UDP) + public OncRpcUdpClient(IPAddress host, int program, int version, int port + , int bufferSize, bool useSecurePort) : base(host, program, version, port, OncRpcProtocols + .ONCRPC_UDP) { - retransmissionTimeout = base.getTimeout(); - - // - // Construct the inherited part of our object. This will also try to - // lookup the port of the desired ONC/RPC server, if no port number - // was specified (port = 0). - // - // - // Let the host operating system choose which port (and network - // interface) to use. Then set the buffer sizes for sending and - // receiving UDP datagrams. Finally set the destination of packets. - // - if (bufferSize < 1024) - { - bufferSize = 1024; - } + retransmissionTimeout = base.getTimeout(); + + // + // Construct the inherited part of our object. This will also try to + // lookup the port of the desired ONC/RPC server, if no port number + // was specified (port = 0). + // + // + // Let the host operating system choose which port (and network + // interface) to use. Then set the buffer sizes for sending and + // receiving UDP datagrams. Finally set the destination of packets. + // + if (bufferSize < 1024) + { + bufferSize = 1024; + } socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); if (useSecurePort) { var localEp = new IPEndPoint(IPAddress.Any, GetLocalPort()); socket.Bind(localEp); - } - - if (socket.SendBufferSize < bufferSize) - { - socket.SendBufferSize = bufferSize; - } - if (socket.ReceiveBufferSize < bufferSize) - { - socket.ReceiveBufferSize = bufferSize; - } - // - // Note: we don't do a - // socket.connect(host, this.port); - // here anymore. XdrUdpEncodingStream long since then supported - // specifying the destination of an ONC/RPC UDP packet when - // start serialization. In addition, connecting a UDP socket disables - // the socket's ability to receive broadcasts. Without connecting you - // can send an ONC/RPC call to the broadcast address of the network - // and receive multiple replies. - // - // Create the necessary encoding and decoding streams, so we can - // communicate at all. - // - sendingXdr = new XdrUdpEncodingStream(socket, bufferSize); - receivingXdr = new XdrUdpDecodingStream(socket, bufferSize); + } + + if (socket.SendBufferSize < bufferSize) + { + socket.SendBufferSize = bufferSize; + } + if (socket.ReceiveBufferSize < bufferSize) + { + socket.ReceiveBufferSize = bufferSize; + } + // + // Note: we don't do a + // socket.connect(host, this.port); + // here anymore. XdrUdpEncodingStream long since then supported + // specifying the destination of an ONC/RPC UDP packet when + // start serialization. In addition, connecting a UDP socket disables + // the socket's ability to receive broadcasts. Without connecting you + // can send an ONC/RPC call to the broadcast address of the network + // and receive multiple replies. + // + // Create the necessary encoding and decoding streams, so we can + // communicate at all. + // + sendingXdr = new XdrUdpEncodingStream(socket, bufferSize); + receivingXdr = new XdrUdpDecodingStream(socket, bufferSize); } private int GetLocalPort() @@ -188,37 +188,37 @@ private int GetLocalPort() /// /// if an ONC/RPC error occurs. /// - public override void close() - { - if (socket != null) - { - socket.Close(); - socket = null; - } - if (sendingXdr != null) - { - try - { - sendingXdr.Close(); - } - catch (System.IO.IOException) - { - } - sendingXdr = null; - } - if (receivingXdr != null) - { - try - { - receivingXdr.Close(); - } - catch (System.IO.IOException) - { - } - receivingXdr = null; - } - } - + public override void close() + { + if (socket != null) + { + socket.Close(); + socket = null; + } + if (sendingXdr != null) + { + try + { + sendingXdr.Close(); + } + catch (System.IO.IOException) + { + } + sendingXdr = null; + } + if (receivingXdr != null) + { + try + { + receivingXdr.Close(); + } + catch (System.IO.IOException) + { + } + receivingXdr = null; + } + } + /// Calls a remote procedure on an ONC/RPC server. /// /// Calls a remote procedure on an ONC/RPC server. @@ -242,328 +242,328 @@ public override void close() /// The object receiving the result of the procedure call. /// if an ONC/RPC error occurs. /// - public override void call(int procedureNumber, int versionNumber, XdrAble - @params, XdrAble result) - { - lock (this) - { - //Refresh: - for (int refreshesLeft = 1; refreshesLeft >= 0; --refreshesLeft) - { - bool refreshFlag = false; - // - // First, build the ONC/RPC call header. Then put the sending - // stream into a known state and encode the parameters to be - // sent. Finally tell the encoding stream to send all its data - // to the server. Then wait for an answer, receive it and decode - // it. So that's the bottom line of what we do right here. - // - nextXid(); - // - // We only create our request message once and reuse it in case - // retransmission should be necessary -- with the exception being - // credential refresh. In this case we need to create a new - // request message. - // - OncRpcClientCallMessage callHeader = new OncRpcClientCallMessage - (xid, program, versionNumber, procedureNumber, auth); - OncRpcClientReplyMessage replyHeader = new OncRpcClientReplyMessage - (auth); - long stopTime = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) + timeout; - int resendTimeout = retransmissionTimeout; - do - { - // - // Now enter the great loop where we send calls out to the server - // and then sit there waiting for a reply. If none comes, we first - // resend our call after one second, then two seconds, four seconds, - // and so on, until we have reached the timeout for the call in total. - // Note that this setting only applies if exponential back-off - // retransmission has been selected. Per default we do not retransmit - // any more, in order to be in line with the SUNRPC implementations. - // - try - { - // - // Send call message to server. Remember that we've already - // "connected" the datagram socket, so java.net knows whom - // to send the datagram packets. - // - sendingXdr.beginEncoding(host, port); - callHeader.xdrEncode(sendingXdr); - @params.xdrEncode(sendingXdr); - sendingXdr.endEncoding(); - } - catch (System.IO.IOException e) - { - throw (new OncRpcException(OncRpcException.RPC_CANTSEND - , e.Message)); - } - // - // Receive reply message from server -- at least try to do so... - // In case of batched calls we don't need no stinkin' answer, so - // we can do other, more interesting things. - // - if (timeout == 0) - { - return; - } - // - // Wait for an answer to arrive... - // - for (; ; ) - { - try + public override void call(int procedureNumber, int versionNumber, XdrAble + @params, XdrAble result) + { + lock (this) + { + //Refresh: + for (int refreshesLeft = 1; refreshesLeft >= 0; --refreshesLeft) + { + bool refreshFlag = false; + // + // First, build the ONC/RPC call header. Then put the sending + // stream into a known state and encode the parameters to be + // sent. Finally tell the encoding stream to send all its data + // to the server. Then wait for an answer, receive it and decode + // it. So that's the bottom line of what we do right here. + // + nextXid(); + // + // We only create our request message once and reuse it in case + // retransmission should be necessary -- with the exception being + // credential refresh. In this case we need to create a new + // request message. + // + OncRpcClientCallMessage callHeader = new OncRpcClientCallMessage + (xid, program, versionNumber, procedureNumber, auth); + OncRpcClientReplyMessage replyHeader = new OncRpcClientReplyMessage + (auth); + long stopTime = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) + timeout; + int resendTimeout = retransmissionTimeout; + do + { + // + // Now enter the great loop where we send calls out to the server + // and then sit there waiting for a reply. If none comes, we first + // resend our call after one second, then two seconds, four seconds, + // and so on, until we have reached the timeout for the call in total. + // Note that this setting only applies if exponential back-off + // retransmission has been selected. Per default we do not retransmit + // any more, in order to be in line with the SUNRPC implementations. + // + try + { + // + // Send call message to server. Remember that we've already + // "connected" the datagram socket, so java.net knows whom + // to send the datagram packets. + // + sendingXdr.beginEncoding(host, port); + callHeader.xdrEncode(sendingXdr); + @params.xdrEncode(sendingXdr); + sendingXdr.endEncoding(); + } + catch (System.IO.IOException e) + { + throw (new OncRpcException(OncRpcException.RPC_CANTSEND + , e.Message)); + } + // + // Receive reply message from server -- at least try to do so... + // In case of batched calls we don't need no stinkin' answer, so + // we can do other, more interesting things. + // + if (timeout == 0) + { + return; + } + // + // Wait for an answer to arrive... + // + for (; ; ) + { + try + { + long currentTimeout = stopTime - (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond); + if (currentTimeout > resendTimeout) + { + currentTimeout = resendTimeout; + } + else + { + if (currentTimeout < 1) + { + // + // as setSoTimeout interprets a timeout of zero as + // infinite (?§$@%&!!!) we need to ensure that we + // have a finite timeout, albeit maybe an infinitesimal + // finite one. + currentTimeout = 1; + } + } + socket.ReceiveTimeout = (int)currentTimeout; + receivingXdr.beginDecoding(); + // + // Only accept incomming reply if it comes from the same + // address we've sent the ONC/RPC call to. Otherwise throw + // away the datagram packet containing the reply and start + // over again, waiting for the next reply to arrive. + // + if (host.Equals(receivingXdr.getSenderAddress())) + { + // + // First, pull off the reply message header of the + // XDR stream. In case we also received a verifier + // from the server and this verifier was invalid, broken + // or tampered with, we will get an + // OncRpcAuthenticationException right here, which will + // propagate up to the caller. If the server reported + // an authentication problem itself, then this will + // be handled as any other rejected ONC/RPC call. + // + try + { + replyHeader.xdrDecode(receivingXdr); + } + catch (org.acplt.oncrpc.OncRpcException e) + { + // + // ** SF bug #1262106 ** + // + // We ran into some sort of trouble. Usually this will have + // been a buffer underflow. Whatever, end the decoding process + // and ensure this way that the next call has a chance to start + // from a clean state. + // + receivingXdr.endDecoding(); + throw (e); + } + // + // Only deserialize the result, if the reply matches the call + // and if the reply signals a successful call. In case of an + // unsuccessful call (which mathes our call nevertheless) throw + // an exception. + // + if (replyHeader.messageId == callHeader.messageId) + { + if (!replyHeader.successfullyAccepted()) + { + receivingXdr.endDecoding(); + // + // Check whether there was an authentication + // problem. In this case first try to refresh the + // credentials. + // + if ((refreshesLeft > 0) && (replyHeader.replyStatus == org.acplt.oncrpc.OncRpcReplyStatus + .ONCRPC_MSG_DENIED) && (replyHeader.rejectStatus == org.acplt.oncrpc.OncRpcRejectStatus + .ONCRPC_AUTH_ERROR) && (auth != null) && auth.canRefreshCred()) + { + // + // Think about using a TAB size of four ;) + // + // Another instance of "CONTINUE considered + // useful"... + // + refreshFlag = true; + break; + } + // continue Refresh; + // + // Nope. No chance. This gets tough. + // + throw (replyHeader.newException()); + } + // + // The reply header is okay and the call had been + // accepted by the ONC/RPC server, so we can now + // proceed to decode the outcome of the RPC. + // + try + { + result.xdrDecode(receivingXdr); + } + catch (OncRpcException e) + { + // + // ** SF bug #1262106 ** + // + // We ran into some sort of trouble. Usually this will have + // been a buffer underflow. Whatever, end the decoding process + // and ensure this way that the next call has a chance to start + // from a clean state. + // + receivingXdr.endDecoding(); + throw (e); + } + // + // Free pending resources of buffer and exit the call loop, + // returning the reply to the caller through the result + // object. + // + receivingXdr.endDecoding(); + return; + } + } + } + catch (SocketException) + { + // + // The message id did no match -- probably some + // old UDP datagram which just popped up from the + // middle of the Internet. + // + // Yet another case of "CONTINUE considered not + // harmful"... + // + // [Nothing to do here, just wait for the next datagram] + // + // IP address of received UDP datagram is not the same + // as the IP address of the ONC/RPC server. + // + // [Nothing to do here, just wait for the next datagram] + // + // Note that we only catch timeouts here, but no other + // exceptions. Those others will go up further until someone + // catches them. The timeouts are caught, so they can do no + // damage but instead we start another round of sending a + // request and waiting for a reply. Reminds me of NASA and + // their "Mars Polar Lander"... + // + // Note that we need to leave the inner waiting loop here, + // as we might need to resend the (lost) RPC request + // datagram. + // + //Console.Out.WriteLine("This is supposed to be ignored"); + //Console.Out.WriteLine(e.Message); + //Console.Out.WriteLine(e.StackTrace); + break; + } + catch (IOException e) + { + // + // Argh. Trouble with the transport. Seems like we can't + // receive data. Gosh. Go away! + // + try + { + receivingXdr.endDecoding(); + } + catch (IOException) + { + } + // skip UDP record + throw (new OncRpcException(OncRpcException.RPC_CANTRECV + , e.Message)); + } + catch (org.acplt.oncrpc.OncRpcException e) { - long currentTimeout = stopTime - (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond); - if (currentTimeout > resendTimeout) - { - currentTimeout = resendTimeout; - } - else - { - if (currentTimeout < 1) - { - // - // as setSoTimeout interprets a timeout of zero as - // infinite (?§$@%&!!!) we need to ensure that we - // have a finite timeout, albeit maybe an infinitesimal - // finite one. - currentTimeout = 1; - } - } - socket.ReceiveTimeout = (int)currentTimeout; - receivingXdr.beginDecoding(); - // - // Only accept incomming reply if it comes from the same - // address we've sent the ONC/RPC call to. Otherwise throw - // away the datagram packet containing the reply and start - // over again, waiting for the next reply to arrive. - // - if (host.Equals(receivingXdr.getSenderAddress())) - { - // - // First, pull off the reply message header of the - // XDR stream. In case we also received a verifier - // from the server and this verifier was invalid, broken - // or tampered with, we will get an - // OncRpcAuthenticationException right here, which will - // propagate up to the caller. If the server reported - // an authentication problem itself, then this will - // be handled as any other rejected ONC/RPC call. - // - try - { - replyHeader.xdrDecode(receivingXdr); - } - catch (org.acplt.oncrpc.OncRpcException e) - { - // - // ** SF bug #1262106 ** - // - // We ran into some sort of trouble. Usually this will have - // been a buffer underflow. Whatever, end the decoding process - // and ensure this way that the next call has a chance to start - // from a clean state. - // - receivingXdr.endDecoding(); - throw (e); - } - // - // Only deserialize the result, if the reply matches the call - // and if the reply signals a successful call. In case of an - // unsuccessful call (which mathes our call nevertheless) throw - // an exception. - // - if (replyHeader.messageId == callHeader.messageId) - { - if (!replyHeader.successfullyAccepted()) - { - receivingXdr.endDecoding(); - // - // Check whether there was an authentication - // problem. In this case first try to refresh the - // credentials. - // - if ((refreshesLeft > 0) && (replyHeader.replyStatus == org.acplt.oncrpc.OncRpcReplyStatus - .ONCRPC_MSG_DENIED) && (replyHeader.rejectStatus == org.acplt.oncrpc.OncRpcRejectStatus - .ONCRPC_AUTH_ERROR) && (auth != null) && auth.canRefreshCred()) - { - // - // Think about using a TAB size of four ;) - // - // Another instance of "CONTINUE considered - // useful"... - // - refreshFlag = true; - break; - } - // continue Refresh; - // - // Nope. No chance. This gets tough. - // - throw (replyHeader.newException()); - } - // - // The reply header is okay and the call had been - // accepted by the ONC/RPC server, so we can now - // proceed to decode the outcome of the RPC. - // - try - { - result.xdrDecode(receivingXdr); - } - catch (OncRpcException e) - { - // - // ** SF bug #1262106 ** - // - // We ran into some sort of trouble. Usually this will have - // been a buffer underflow. Whatever, end the decoding process - // and ensure this way that the next call has a chance to start - // from a clean state. - // - receivingXdr.endDecoding(); - throw (e); - } - // - // Free pending resources of buffer and exit the call loop, - // returning the reply to the caller through the result - // object. - // - receivingXdr.endDecoding(); - return; - } - } - } - catch (SocketException) - { - // - // The message id did no match -- probably some - // old UDP datagram which just popped up from the - // middle of the Internet. - // - // Yet another case of "CONTINUE considered not - // harmful"... - // - // [Nothing to do here, just wait for the next datagram] - // - // IP address of received UDP datagram is not the same - // as the IP address of the ONC/RPC server. - // - // [Nothing to do here, just wait for the next datagram] - // - // Note that we only catch timeouts here, but no other - // exceptions. Those others will go up further until someone - // catches them. The timeouts are caught, so they can do no - // damage but instead we start another round of sending a - // request and waiting for a reply. Reminds me of NASA and - // their "Mars Polar Lander"... - // - // Note that we need to leave the inner waiting loop here, - // as we might need to resend the (lost) RPC request - // datagram. - // - //Console.Out.WriteLine("This is supposed to be ignored"); - //Console.Out.WriteLine(e.Message); - //Console.Out.WriteLine(e.StackTrace); - break; - } - catch (IOException e) - { - // - // Argh. Trouble with the transport. Seems like we can't - // receive data. Gosh. Go away! - // - try - { - receivingXdr.endDecoding(); - } - catch (IOException) - { - } - // skip UDP record - throw (new OncRpcException(OncRpcException.RPC_CANTRECV - , e.Message)); - } - catch (org.acplt.oncrpc.OncRpcException e) - { - // - // Ooops. An ONC/RPC exception. Let us rethrow this one, - // as we won't have nothin' to do with it... - // - try - { - receivingXdr.endDecoding(); - } - catch (System.IO.IOException) - { - } - // skip UDP record - // - // Well, in case we got not a *reply* RPC message back, - // we keep listening for messages. - // - if (e.getReason() != org.acplt.oncrpc.OncRpcException.RPC_WRONGMESSAGE) - { - throw (e); - } - } - // - // We can not make use of the reply we just received, so - // we need to dump it. - // - // This should raise no exceptions, when skipping the UDP - // record. So if one is raised, we will rethrow an ONC/RPC - // exception instead. - // - try - { - receivingXdr.endDecoding(); - } - catch (System.IO.IOException e) - { - throw (new OncRpcException(OncRpcException.RPC_CANTRECV - , e.Message)); - } - } - // jmw 12/18/2009 fix for refresh/continue in Java code - if (refreshFlag) - { - break; - } - // - // We only reach this code part beyond the inner waiting - // loop if we run in a timeout and might need to retransmit - // - // According to the retransmission strategy choosen, update the - // current retransmission (resending) timeout. - // - if (retransmissionMode == org.acplt.oncrpc.OncRpcUdpRetransmissionMode.EXPONENTIAL) - { - resendTimeout *= 2; - } - } - while (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond < stopTime); - // jmw 12/18/2009 don't want to throw an exception here - if (refreshFlag) - { - continue; - } - // - // That's it -- this shitty server does not talk to us. Now, due to - // the indecent language used in the previous sentence, this software - // can not be exported any longer to some countries of the world. - // But this is surely not my problem, but rather theirs. So go away - // and hide yourself in the dark with all your zombies (or maybe - // kangaroos). - // - throw (new OncRpcTimeoutException()); - } - } - } - - // for ( refreshesLeft ) + // + // Ooops. An ONC/RPC exception. Let us rethrow this one, + // as we won't have nothin' to do with it... + // + try + { + receivingXdr.endDecoding(); + } + catch (System.IO.IOException) + { + } + // skip UDP record + // + // Well, in case we got not a *reply* RPC message back, + // we keep listening for messages. + // + if (e.getReason() != org.acplt.oncrpc.OncRpcException.RPC_WRONGMESSAGE) + { + throw (e); + } + } + // + // We can not make use of the reply we just received, so + // we need to dump it. + // + // This should raise no exceptions, when skipping the UDP + // record. So if one is raised, we will rethrow an ONC/RPC + // exception instead. + // + try + { + receivingXdr.endDecoding(); + } + catch (System.IO.IOException e) + { + throw (new OncRpcException(OncRpcException.RPC_CANTRECV + , e.Message)); + } + } + // jmw 12/18/2009 fix for refresh/continue in Java code + if (refreshFlag) + { + break; + } + // + // We only reach this code part beyond the inner waiting + // loop if we run in a timeout and might need to retransmit + // + // According to the retransmission strategy choosen, update the + // current retransmission (resending) timeout. + // + if (retransmissionMode == org.acplt.oncrpc.OncRpcUdpRetransmissionMode.EXPONENTIAL) + { + resendTimeout *= 2; + } + } + while (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond < stopTime); + // jmw 12/18/2009 don't want to throw an exception here + if (refreshFlag) + { + continue; + } + // + // That's it -- this shitty server does not talk to us. Now, due to + // the indecent language used in the previous sentence, this software + // can not be exported any longer to some countries of the world. + // But this is surely not my problem, but rather theirs. So go away + // and hide yourself in the dark with all your zombies (or maybe + // kangaroos). + // + throw (new OncRpcTimeoutException()); + } + } + } + + // for ( refreshesLeft ) /// Broadcast a remote procedure call to several ONC/RPC servers. /// /// Broadcast a remote procedure call to several ONC/RPC servers. For this @@ -609,146 +609,146 @@ public override void call(int procedureNumber, int versionNumber, XdrAble /// /// if an ONC/RPC error occurs. /// - public virtual void broadcastCall(int procedureNumber, org.acplt.oncrpc.XdrAble @params - , org.acplt.oncrpc.XdrAble result, org.acplt.oncrpc.OncRpcBroadcastListener listener - ) - { - lock (this) - { - // - // First, build the ONC/RPC call header. Then put the sending - // stream into a known state and encode the parameters to be - // sent. Finally tell the encoding stream to broadcast all its data. - // Then wait for answers, receive and decode them one at a time. - // - nextXid(); - org.acplt.oncrpc.OncRpcClientCallMessage callHeader = new org.acplt.oncrpc.OncRpcClientCallMessage - (xid, program, version, procedureNumber, auth); - org.acplt.oncrpc.OncRpcClientReplyMessage replyHeader = new org.acplt.oncrpc.OncRpcClientReplyMessage - (auth); - // - // Broadcast the call. Note that we send the call only once and will - // never resend it. - // - try - { - // - // Send call message to server. Remember that we've already - // "connected" the datagram socket, so java.net knows whom - // to send the datagram packets. - // - sendingXdr.beginEncoding(host, port); - callHeader.xdrEncode(sendingXdr); - @params.xdrEncode(sendingXdr); - sendingXdr.endEncoding(); - } - catch (System.IO.IOException e) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTSEND - , e.Message)); - } - // - // Now enter the great loop where sit waiting for replies to our - // broadcast call to come in. In every case, we wait until the - // (total) timeout expires. - // - DateTime stopTime = DateTime.Now + new TimeSpan(timeout); - do - { - try - { - // - // Calculate timeout until the total timeout is reached, so - // we can try to meet the overall deadline. - // - TimeSpan currentTimeout = (stopTime - DateTime.Now); - if (currentTimeout.Ticks < 0) + public virtual void broadcastCall(int procedureNumber, org.acplt.oncrpc.XdrAble @params + , org.acplt.oncrpc.XdrAble result, org.acplt.oncrpc.OncRpcBroadcastListener listener + ) + { + lock (this) + { + // + // First, build the ONC/RPC call header. Then put the sending + // stream into a known state and encode the parameters to be + // sent. Finally tell the encoding stream to broadcast all its data. + // Then wait for answers, receive and decode them one at a time. + // + nextXid(); + org.acplt.oncrpc.OncRpcClientCallMessage callHeader = new org.acplt.oncrpc.OncRpcClientCallMessage + (xid, program, version, procedureNumber, auth); + org.acplt.oncrpc.OncRpcClientReplyMessage replyHeader = new org.acplt.oncrpc.OncRpcClientReplyMessage + (auth); + // + // Broadcast the call. Note that we send the call only once and will + // never resend it. + // + try + { + // + // Send call message to server. Remember that we've already + // "connected" the datagram socket, so java.net knows whom + // to send the datagram packets. + // + sendingXdr.beginEncoding(host, port); + callHeader.xdrEncode(sendingXdr); + @params.xdrEncode(sendingXdr); + sendingXdr.endEncoding(); + } + catch (System.IO.IOException e) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTSEND + , e.Message)); + } + // + // Now enter the great loop where sit waiting for replies to our + // broadcast call to come in. In every case, we wait until the + // (total) timeout expires. + // + DateTime stopTime = DateTime.Now + new TimeSpan(timeout); + do + { + try + { + // + // Calculate timeout until the total timeout is reached, so + // we can try to meet the overall deadline. + // + TimeSpan currentTimeout = (stopTime - DateTime.Now); + if (currentTimeout.Ticks < 0) + { + currentTimeout = new TimeSpan(0); + } + socket.ReceiveTimeout = currentTimeout.Seconds; + // + // Then wait for datagrams to arrive... + // + receivingXdr.beginDecoding(); + replyHeader.xdrDecode(receivingXdr); + // + // Only deserialize the result, if the reply matches the call + // and if the reply signals a successful call. In case of an + // unsuccessful call (which mathes our call nevertheless) throw + // an exception. + // + if (replyHeader.messageId == callHeader.messageId) + { + if (!replyHeader.successfullyAccepted()) + { + // + // We got a notification of a rejected call. We silently + // ignore such replies and continue listening for other + // replies. + // + receivingXdr.endDecoding(); + } + result.xdrDecode(receivingXdr); + // + // Notify a potential listener of the reply. + // + if (listener != null) + { + org.acplt.oncrpc.OncRpcBroadcastEvent evt = new org.acplt.oncrpc.OncRpcBroadcastEvent + (this, receivingXdr.getSenderAddress(), procedureNumber, @params, result); + listener.replyReceived(evt); + } + // + // Free pending resources of buffer and exit the call loop, + // returning the reply to the caller through the result + // object. + // + receivingXdr.endDecoding(); + } + else { - currentTimeout = new TimeSpan(0); + // + // This should raise no exceptions, when skipping the UDP + // record. So if one is raised, we will rethrow an ONC/RPC + // exception instead. + // + try + { + receivingXdr.endDecoding(); + } + catch (System.IO.IOException e) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTRECV + , e.Message)); + } } - socket.ReceiveTimeout = currentTimeout.Seconds; - // - // Then wait for datagrams to arrive... - // - receivingXdr.beginDecoding(); - replyHeader.xdrDecode(receivingXdr); - // - // Only deserialize the result, if the reply matches the call - // and if the reply signals a successful call. In case of an - // unsuccessful call (which mathes our call nevertheless) throw - // an exception. - // - if (replyHeader.messageId == callHeader.messageId) - { - if (!replyHeader.successfullyAccepted()) - { - // - // We got a notification of a rejected call. We silently - // ignore such replies and continue listening for other - // replies. - // - receivingXdr.endDecoding(); - } - result.xdrDecode(receivingXdr); - // - // Notify a potential listener of the reply. - // - if (listener != null) - { - org.acplt.oncrpc.OncRpcBroadcastEvent evt = new org.acplt.oncrpc.OncRpcBroadcastEvent - (this, receivingXdr.getSenderAddress(), procedureNumber, @params, result); - listener.replyReceived(evt); - } - // - // Free pending resources of buffer and exit the call loop, - // returning the reply to the caller through the result - // object. - // - receivingXdr.endDecoding(); - } - else - { - // - // This should raise no exceptions, when skipping the UDP - // record. So if one is raised, we will rethrow an ONC/RPC - // exception instead. - // - try - { - receivingXdr.endDecoding(); - } - catch (System.IO.IOException e) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTRECV - , e.Message)); - } - } - } - catch (SocketException) - { - } - catch (System.IO.IOException e) - { - // - // Note that we only catch timeouts here, but no other - // exceptions. Those others will go up further until someone - // catches them. If we get the timeout we know that it - // could be time to leave the stage and so we fall through - // to the total timeout check. - // - // - // Argh. Trouble with the transport. Seems like we can't - // receive data. Gosh. Go away! - // - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTRECV - , e.Message)); - } - } - while (DateTime.Now < stopTime); - return; - } - } - + } + catch (SocketException) + { + } + catch (System.IO.IOException e) + { + // + // Note that we only catch timeouts here, but no other + // exceptions. Those others will go up further until someone + // catches them. If we get the timeout we know that it + // could be time to leave the stage and so we fall through + // to the total timeout check. + // + // + // Argh. Trouble with the transport. Seems like we can't + // receive data. Gosh. Go away! + // + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTRECV + , e.Message)); + } + } + while (DateTime.Now < stopTime); + return; + } + } + /// /// Set the /// retransmission mode @@ -758,11 +758,11 @@ public virtual void broadcastCall(int procedureNumber, org.acplt.oncrpc.XdrAble /// . /// /// Retransmission mode (either fixed or exponential). - public virtual void setRetransmissionMode(int mode) - { - retransmissionMode = mode; - } - + public virtual void setRetransmissionMode(int mode) + { + retransmissionMode = mode; + } + /// /// Retrieve the current /// retransmission mode @@ -770,11 +770,11 @@ public virtual void setRetransmissionMode(int mode) /// retransmission of lost ONC/RPC calls. /// /// Current retransmission mode. - public virtual int getRetransmissionMode() - { - return retransmissionMode; - } - + public virtual int getRetransmissionMode() + { + return retransmissionMode; + } + /// /// Set the retransmission timout for remote procedure calls to wait for /// an answer from the ONC/RPC server before resending the call. @@ -790,15 +790,15 @@ public virtual int getRetransmissionMode() /// Timeout in milliseconds. A timeout of zero indicates /// batched calls. /// - public virtual void setRetransmissionTimeout(int milliseconds) - { - if (milliseconds <= 0) - { - throw (new System.ArgumentException("timeouts must be positive.")); - } - retransmissionTimeout = milliseconds; - } - + public virtual void setRetransmissionTimeout(int milliseconds) + { + if (milliseconds <= 0) + { + throw (new System.ArgumentException("timeouts must be positive.")); + } + retransmissionTimeout = milliseconds; + } + /// /// Retrieve the current retransmission timeout set for remote procedure /// calls. @@ -808,34 +808,34 @@ public virtual void setRetransmissionTimeout(int milliseconds) /// calls. /// /// Current retransmission timeout. - public virtual int getRetransmissionTimeout() - { - return retransmissionTimeout; - } - + public virtual int getRetransmissionTimeout() + { + return retransmissionTimeout; + } + /// Set the character encoding for (de-)serializing strings. /// Set the character encoding for (de-)serializing strings. /// /// the encoding to use for (de-)serializing strings. /// If null, the system's default encoding is to be used. /// - public override void setCharacterEncoding(string characterEncoding) - { - receivingXdr.setCharacterEncoding(characterEncoding); - sendingXdr.setCharacterEncoding(characterEncoding); - } - + public override void setCharacterEncoding(string characterEncoding) + { + receivingXdr.setCharacterEncoding(characterEncoding); + sendingXdr.setCharacterEncoding(characterEncoding); + } + /// Get the character encoding for (de-)serializing strings. /// Get the character encoding for (de-)serializing strings. /// /// the encoding currently used for (de-)serializing strings. /// If null, then the system's default encoding is used. /// - public override string getCharacterEncoding() - { - return receivingXdr.getCharacterEncoding(); - } - + public override string getCharacterEncoding() + { + return receivingXdr.getCharacterEncoding(); + } + /// /// UDP socket used for datagram-based communication with an ONC/RPC /// server. @@ -844,8 +844,8 @@ public override string getCharacterEncoding() /// UDP socket used for datagram-based communication with an ONC/RPC /// server. /// - private Socket socket; - + private Socket socket; + /// /// XDR encoding stream used for sending requests via UDP/IP to an ONC/RPC /// server. @@ -854,8 +854,8 @@ public override string getCharacterEncoding() /// XDR encoding stream used for sending requests via UDP/IP to an ONC/RPC /// server. /// - internal org.acplt.oncrpc.XdrUdpEncodingStream sendingXdr; - + internal org.acplt.oncrpc.XdrUdpEncodingStream sendingXdr; + /// /// XDR decoding stream used when receiving replies via UDP/IP from an /// ONC/RPC server. @@ -864,8 +864,8 @@ public override string getCharacterEncoding() /// XDR decoding stream used when receiving replies via UDP/IP from an /// ONC/RPC server. /// - internal org.acplt.oncrpc.XdrUdpDecodingStream receivingXdr; - + internal org.acplt.oncrpc.XdrUdpDecodingStream receivingXdr; + /// /// Retransmission timeout used for resending ONC/RPC calls when an ONC/RPC /// server does not answer fast enough. @@ -878,8 +878,8 @@ public override string getCharacterEncoding() /// /// retransmissionMode /// OncRpcClient.setTimeout(int) - internal int retransmissionTimeout; - + internal int retransmissionTimeout; + /// Retransmission mode used when resending ONC/RPC calls. /// /// Retransmission mode used when resending ONC/RPC calls. Default mode is @@ -887,6 +887,6 @@ public override string getCharacterEncoding() /// . /// /// OncRpcUdpRetransmissionMode - internal int retransmissionMode = org.acplt.oncrpc.OncRpcUdpRetransmissionMode.FIXED; + internal int retransmissionMode = org.acplt.oncrpc.OncRpcUdpRetransmissionMode.FIXED; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpRetransmissionMode.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpRetransmissionMode.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpRetransmissionMode.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpRetransmissionMode.cs index 24b07b6..83e5665 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpRetransmissionMode.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/OncRpcUdpRetransmissionMode.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// A collection of constants used to identify the retransmission schemes /// when using @@ -35,8 +35,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class OncRpcUdpRetransmissionMode - { + public class OncRpcUdpRetransmissionMode + { /// /// In exponentional back-off retransmission mode, UDP/IP-based ONC/RPC /// clients first wait a given retransmission timeout period before @@ -48,8 +48,8 @@ public class OncRpcUdpRetransmissionMode /// sending the ONC/RPC call again. The retransmission timeout then is /// doubled on each try. /// - public const int EXPONENTIAL = 0; - + public const int EXPONENTIAL = 0; + /// /// In fixed retransmission mode, UDP/IP-based ONC/RPC clients wait a /// given retransmission timeout period before send the ONC/RPC call again. @@ -60,6 +60,6 @@ public class OncRpcUdpRetransmissionMode /// The retransmission timeout is not changed between consecutive tries /// but is fixed instead. /// - public const int FIXED = 1; + public const int FIXED = 1; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrAble.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrAble.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrAble.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrAble.cs index b8dc444..c4f14ea 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrAble.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrAble.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Defines the interface for all classes that should be able to be /// serialized into XDR streams, and deserialized or constructed from @@ -39,8 +39,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public interface XdrAble - { + public interface XdrAble + { /// /// Encodes -- that is: serializes -- an object into a XDR stream in /// compliance to RFC 1832. @@ -53,8 +53,8 @@ public interface XdrAble /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr); - + void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr); + /// /// Decodes -- that is: deserializes -- an object from a XDR stream in /// compliance to RFC 1832. @@ -67,6 +67,6 @@ public interface XdrAble /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr); + void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr); } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrBoolean.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBoolean.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrBoolean.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBoolean.cs index 86de5a5..d2988a5 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrBoolean.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBoolean.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrBoolean represent (de-)serializeable /// booleans, which are especially useful in cases where a result with only a @@ -45,21 +45,21 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrBoolean : org.acplt.oncrpc.XdrAble - { + public class XdrBoolean : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrBoolean object. /// Constructs and initializes a new XdrBoolean object. /// Boolean value. - public XdrBoolean(bool value) - { - this.value = value; - } - + public XdrBoolean(bool value) + { + this.value = value; + } + /// Constructs and initializes a new XdrBoolean object. /// Constructs and initializes a new XdrBoolean object. - public XdrBoolean() - { - this.value = false; + public XdrBoolean() + { + this.value = false; } /// @@ -101,11 +101,11 @@ public virtual bool boolValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeBoolean(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeBoolean(value); + } + /// /// Decodes -- that is: deserializes -- a XDR boolean from a XDR stream in /// compliance to RFC 1832. @@ -117,13 +117,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = xdr.xdrDecodeBoolean(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = xdr.xdrDecodeBoolean(); + } + /// The encapsulated boolean value itself. /// The encapsulated boolean value itself. - private bool value; + private bool value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferDecodingStream.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferDecodingStream.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferDecodingStream.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferDecodingStream.cs index 3350c9f..2b51dbf 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferDecodingStream.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferDecodingStream.cs @@ -23,9 +23,9 @@ */ using System.Net; - + namespace org.acplt.oncrpc -{ +{ /// /// The XdrBufferDecodingStream class provides the necessary /// functionality to @@ -37,8 +37,8 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2005/11/11 21:06:36 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class XdrBufferDecodingStream : XdrDecodingStream - { + public class XdrBufferDecodingStream : XdrDecodingStream + { /// /// Construct a new XdrUdpDecodingStream object and associate /// it with a buffer containing encoded XDR data. @@ -53,11 +53,11 @@ public class XdrBufferDecodingStream : XdrDecodingStream /// if encodedLength is not /// a multiple of four. /// - public XdrBufferDecodingStream(byte[] buffer, int encodedLength) - { - setXdrData(buffer, encodedLength); - } - + public XdrBufferDecodingStream(byte[] buffer, int encodedLength) + { + setXdrData(buffer, encodedLength); + } + /// /// Construct a new XdrUdpDecodingStream object and associate /// it with a buffer containing encoded XDR data. @@ -71,11 +71,11 @@ public XdrBufferDecodingStream(byte[] buffer, int encodedLength) /// if the size of the buffer is not /// a multiple of four. /// - public XdrBufferDecodingStream(byte[] buffer) - { - setXdrData(buffer, buffer.Length); - } - + public XdrBufferDecodingStream(byte[] buffer) + { + setXdrData(buffer, buffer.Length); + } + /// /// Sets the buffer containing encoded XDR data as well as the length of /// the encoded data. @@ -90,23 +90,23 @@ public XdrBufferDecodingStream(byte[] buffer) /// if encodedLength is not /// a multiple of four. /// - public virtual void setXdrData(byte[] buffer, int encodedLength) - { - // - // Make sure that the buffer size is a multiple of four, otherwise - // throw an exception. - // - if ((encodedLength < 0) || (encodedLength & 3) != 0) - { - throw (new System.ArgumentException("length of encoded data must be a multiple of four and must not be negative" - )); - } - this.buffer = buffer; - this.encodedLength = encodedLength; - bufferIndex = 0; - bufferHighmark = -4; - } - + public virtual void setXdrData(byte[] buffer, int encodedLength) + { + // + // Make sure that the buffer size is a multiple of four, otherwise + // throw an exception. + // + if ((encodedLength < 0) || (encodedLength & 3) != 0) + { + throw (new System.ArgumentException("length of encoded data must be a multiple of four and must not be negative" + )); + } + this.buffer = buffer; + this.encodedLength = encodedLength; + bufferIndex = 0; + bufferHighmark = -4; + } + /// Returns the Internet address of the sender of the current XDR data. /// /// Returns the Internet address of the sender of the current XDR data. @@ -116,11 +116,11 @@ public virtual void setXdrData(byte[] buffer, int encodedLength) /// otherwise it might return stale information. /// /// InetAddress of the sender of the current XDR data. - public override IPAddress getSenderAddress() - { - return null; - } - + public override IPAddress getSenderAddress() + { + return null; + } + /// Returns the port number of the sender of the current XDR data. /// /// Returns the port number of the sender of the current XDR data. @@ -130,22 +130,22 @@ public override IPAddress getSenderAddress() /// otherwise it might return stale information. /// /// Port number of the sender of the current XDR data. - public override int getSenderPort() - { - return 0; - } - + public override int getSenderPort() + { + return 0; + } + /// Initiates decoding of the next XDR record. /// Initiates decoding of the next XDR record. /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void beginDecoding() - { - bufferIndex = 0; - bufferHighmark = encodedLength - 4; - } - + public override void beginDecoding() + { + bufferIndex = 0; + bufferHighmark = encodedLength - 4; + } + /// End decoding of the current XDR record. /// /// End decoding of the current XDR record. The general contract of @@ -162,12 +162,12 @@ public override void beginDecoding() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void endDecoding() - { - bufferIndex = 0; - bufferHighmark = -4; - } - + public override void endDecoding() + { + bufferIndex = 0; + bufferHighmark = -4; + } + /// /// Closes this decoding XDR stream and releases any system resources /// associated with this stream. @@ -181,11 +181,11 @@ public override void endDecoding() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void Close() - { - buffer = null; - } - + public override void Close() + { + buffer = null; + } + /// /// Decodes (aka "deserializes") a "XDR int" value received from a /// XDR stream. @@ -199,32 +199,32 @@ public override void Close() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override int xdrDecodeInt() - { - if (bufferIndex <= bufferHighmark) - { - // - // There's enough space in the buffer to hold at least one - // XDR int. So let's retrieve it now. - // Note: buffer[...] gives a byte, which is signed. So if we - // add it to the value (which is int), it has to be widened - // to 32 bit, so its sign is propagated. To avoid this sign - // madness, we have to "and" it with 0xFF, so all unwanted - // bits are cut off after sign extension. Sigh. - // - int value = buffer[bufferIndex++]; - value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); - value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); - value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); - return value; - } - else - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW - )); - } - } - + public override int xdrDecodeInt() + { + if (bufferIndex <= bufferHighmark) + { + // + // There's enough space in the buffer to hold at least one + // XDR int. So let's retrieve it now. + // Note: buffer[...] gives a byte, which is signed. So if we + // add it to the value (which is int), it has to be widened + // to 32 bit, so its sign is propagated. To avoid this sign + // madness, we have to "and" it with 0xFF, so all unwanted + // bits are cut off after sign extension. Sigh. + // + int value = buffer[bufferIndex++]; + value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); + value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); + value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); + return value; + } + else + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW + )); + } + } + /// /// Decodes (aka "deserializes") an opaque value, which is nothing more /// than a series of octets (or 8 bits wide bytes). @@ -243,36 +243,36 @@ public override int xdrDecodeInt() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override byte[] xdrDecodeOpaque(int length) - { - // - // First make sure that the length is always a multiple of four. - // - int alignedLength = length; - if ((alignedLength & 3) != 0) - { - alignedLength = (alignedLength & ~3) + 4; - } - // - // Now allocate enough memory to hold the data to be retrieved. - // - byte[] bytes = new byte[length]; - if (length > 0) - { - if (bufferIndex <= bufferHighmark - alignedLength + 4) - { - System.Array.Copy(buffer, bufferIndex, bytes, 0, length); - } - else - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW - )); - } - } - bufferIndex += alignedLength; - return bytes; - } - + public override byte[] xdrDecodeOpaque(int length) + { + // + // First make sure that the length is always a multiple of four. + // + int alignedLength = length; + if ((alignedLength & 3) != 0) + { + alignedLength = (alignedLength & ~3) + 4; + } + // + // Now allocate enough memory to hold the data to be retrieved. + // + byte[] bytes = new byte[length]; + if (length > 0) + { + if (bufferIndex <= bufferHighmark - alignedLength + 4) + { + System.Array.Copy(buffer, bufferIndex, bytes, 0, length); + } + else + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW + )); + } + } + bufferIndex += alignedLength; + return bytes; + } + /// /// Decodes (aka "deserializes") a XDR opaque value, which is represented /// by a vector of byte values, and starts at offset with a @@ -292,34 +292,34 @@ public override byte[] xdrDecodeOpaque(int length) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void xdrDecodeOpaque(byte[] opaque, int offset, int length) - { - // - // First make sure that the length is always a multiple of four. - // - int alignedLength = length; - if ((alignedLength & 3) != 0) - { - alignedLength = (alignedLength & ~3) + 4; - } - // - // Now allocate enough memory to hold the data to be retrieved. - // - if (length > 0) - { - if (bufferIndex <= bufferHighmark - alignedLength + 4) - { - System.Array.Copy(buffer, bufferIndex, opaque, offset, length); - } - else - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW - )); - } - } - bufferIndex += alignedLength; - } - + public override void xdrDecodeOpaque(byte[] opaque, int offset, int length) + { + // + // First make sure that the length is always a multiple of four. + // + int alignedLength = length; + if ((alignedLength & 3) != 0) + { + alignedLength = (alignedLength & ~3) + 4; + } + // + // Now allocate enough memory to hold the data to be retrieved. + // + if (length > 0) + { + if (bufferIndex <= bufferHighmark - alignedLength + 4) + { + System.Array.Copy(buffer, bufferIndex, opaque, offset, length); + } + else + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW + )); + } + } + bufferIndex += alignedLength; + } + /// /// The buffer which will be filled from the datagram socket and then /// be used to supply the information when decoding data. @@ -328,16 +328,16 @@ public override void xdrDecodeOpaque(byte[] opaque, int offset, int length) /// The buffer which will be filled from the datagram socket and then /// be used to supply the information when decoding data. /// - private byte[] buffer; - + private byte[] buffer; + /// Length of encoded data in buffer. /// Length of encoded data in buffer. - private int encodedLength; - + private int encodedLength; + /// The read pointer is an index into the buffer. /// The read pointer is an index into the buffer. - private int bufferIndex; - + private int bufferIndex; + /// /// Index of the last four byte word in the buffer, which has been read /// in from the datagram socket. @@ -346,6 +346,6 @@ public override void xdrDecodeOpaque(byte[] opaque, int offset, int length) /// Index of the last four byte word in the buffer, which has been read /// in from the datagram socket. /// - private int bufferHighmark; + private int bufferHighmark; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferEncodingStream.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferEncodingStream.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferEncodingStream.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferEncodingStream.cs index cf0b041..085049a 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferEncodingStream.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBufferEncodingStream.cs @@ -23,9 +23,9 @@ */ using System.Net; - + namespace org.acplt.oncrpc -{ +{ /// /// The XdrBufferEncodingStream class provides a buffer-based /// XDR stream. @@ -38,8 +38,8 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2003/08/14 11:26:50 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class XdrBufferEncodingStream : XdrEncodingStream - { + public class XdrBufferEncodingStream : XdrEncodingStream + { /// /// Constructs a new XdrBufferEncodingStream with a buffer /// to encode data into of the given size. @@ -49,18 +49,18 @@ public class XdrBufferEncodingStream : XdrEncodingStream /// to encode data into of the given size. /// /// Size of buffer to store encoded data in. - public XdrBufferEncodingStream(int bufferSize) - { - if ((bufferSize < 0) || (bufferSize & 3) != 0) - { - throw (new System.ArgumentException("size of buffer must be a multiple of four and must not be negative" - )); - } - this.buffer = new byte[bufferSize]; - bufferIndex = 0; - bufferHighmark = buffer.Length - 4; - } - + public XdrBufferEncodingStream(int bufferSize) + { + if ((bufferSize < 0) || (bufferSize & 3) != 0) + { + throw (new System.ArgumentException("size of buffer must be a multiple of four and must not be negative" + )); + } + this.buffer = new byte[bufferSize]; + bufferIndex = 0; + bufferHighmark = buffer.Length - 4; + } + /// /// Constructs a new XdrBufferEncodingStream with a given /// buffer. @@ -74,37 +74,37 @@ public XdrBufferEncodingStream(int bufferSize) /// if encodedLength is not /// a multiple of four. /// - public XdrBufferEncodingStream(byte[] buffer) - { - // - // Make sure that the buffer size is a multiple of four, otherwise - // throw an exception. - // - if ((buffer.Length & 3) != 0) - { - throw (new System.ArgumentException("size of buffer must be a multiple of four")); - } - this.buffer = buffer; - bufferIndex = 0; - bufferHighmark = buffer.Length - 4; - } - + public XdrBufferEncodingStream(byte[] buffer) + { + // + // Make sure that the buffer size is a multiple of four, otherwise + // throw an exception. + // + if ((buffer.Length & 3) != 0) + { + throw (new System.ArgumentException("size of buffer must be a multiple of four")); + } + this.buffer = buffer; + bufferIndex = 0; + bufferHighmark = buffer.Length - 4; + } + /// Returns the amount of encoded data in the buffer. /// Returns the amount of encoded data in the buffer. /// length of data encoded in buffer. - public virtual int getXdrLength() - { - return bufferIndex; - } - + public virtual int getXdrLength() + { + return bufferIndex; + } + /// Returns the buffer holding encoded data. /// Returns the buffer holding encoded data. /// Buffer with encoded data. - public virtual byte[] getXdrData() - { - return buffer; - } - + public virtual byte[] getXdrData() + { + return buffer; + } + /// Begins encoding a new XDR record. /// /// Begins encoding a new XDR record. This involves resetting this @@ -119,12 +119,12 @@ public virtual byte[] getXdrData() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void beginEncoding(IPAddress receiverAddress, int receiverPort - ) - { - bufferIndex = 0; - } - + public override void beginEncoding(IPAddress receiverAddress, int receiverPort + ) + { + bufferIndex = 0; + } + /// /// Flushes this encoding XDR stream and forces any buffered output bytes /// to be written out. @@ -139,10 +139,10 @@ public override void beginEncoding(IPAddress receiverAddress, int receiverPort /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void endEncoding() - { - } - + public override void endEncoding() + { + } + /// /// Closes this encoding XDR stream and releases any system resources /// associated with this stream. @@ -156,11 +156,11 @@ public override void endEncoding() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void Close() - { - buffer = null; - } - + public override void Close() + { + buffer = null; + } + /// /// Encodes (aka "serializes") a "XDR int" value and writes it down a /// XDR stream. @@ -174,27 +174,27 @@ public override void Close() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void xdrEncodeInt(int value) - { - if (bufferIndex <= bufferHighmark) - { - // - // There's enough space in the buffer, so encode this int as - // four bytes (french octets) in big endian order (that is, the - // most significant byte comes first. - // - buffer[bufferIndex++] = (byte)((value) >> (24 & 0x1f)); - buffer[bufferIndex++] = (byte)((value) >> (16 & 0x1f)); - buffer[bufferIndex++] = (byte)((value) >> (8 & 0x1f)); - buffer[bufferIndex++] = (byte)value; - } - else - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFEROVERFLOW - )); - } - } - + public override void xdrEncodeInt(int value) + { + if (bufferIndex <= bufferHighmark) + { + // + // There's enough space in the buffer, so encode this int as + // four bytes (french octets) in big endian order (that is, the + // most significant byte comes first. + // + buffer[bufferIndex++] = (byte)((value) >> (24 & 0x1f)); + buffer[bufferIndex++] = (byte)((value) >> (16 & 0x1f)); + buffer[bufferIndex++] = (byte)((value) >> (8 & 0x1f)); + buffer[bufferIndex++] = (byte)value; + } + else + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFEROVERFLOW + )); + } + } + /// /// Encodes (aka "serializes") a XDR opaque value, which is represented /// by a vector of byte values, and starts at offset with a @@ -212,35 +212,35 @@ public override void xdrEncodeInt(int value) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void xdrEncodeOpaque(byte[] value, int offset, int length) - { - // - // First calculate the number of bytes needed for padding. - // - int padding = (4 - (length & 3)) & 3; - if (bufferIndex <= bufferHighmark - (length + padding)) - { - System.Array.Copy(value, offset, buffer, bufferIndex, length); - bufferIndex += length; - if (padding != 0) - { - // - // If the length of the opaque data was not a multiple, then - // pad with zeros, so the write pointer (argh! how comes Java - // has a pointer...?!) points to a byte, which has an index - // of a multiple of four. - // - System.Array.Copy(paddingZeros, 0, buffer, bufferIndex, padding); - bufferIndex += padding; - } - } - else - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFEROVERFLOW - )); - } - } - + public override void xdrEncodeOpaque(byte[] value, int offset, int length) + { + // + // First calculate the number of bytes needed for padding. + // + int padding = (4 - (length & 3)) & 3; + if (bufferIndex <= bufferHighmark - (length + padding)) + { + System.Array.Copy(value, offset, buffer, bufferIndex, length); + bufferIndex += length; + if (padding != 0) + { + // + // If the length of the opaque data was not a multiple, then + // pad with zeros, so the write pointer (argh! how comes Java + // has a pointer...?!) points to a byte, which has an index + // of a multiple of four. + // + System.Array.Copy(paddingZeros, 0, buffer, bufferIndex, padding); + bufferIndex += padding; + } + } + else + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFEROVERFLOW + )); + } + } + /// /// The buffer which will receive the encoded information, before it /// is sent via a datagram socket. @@ -249,18 +249,18 @@ public override void xdrEncodeOpaque(byte[] value, int offset, int length) /// The buffer which will receive the encoded information, before it /// is sent via a datagram socket. /// - private byte[] buffer; - + private byte[] buffer; + /// The write pointer is an index into the buffer. /// The write pointer is an index into the buffer. - private int bufferIndex; - + private int bufferIndex; + /// Index of the last four byte word in the buffer. /// Index of the last four byte word in the buffer. - private int bufferHighmark; - + private int bufferHighmark; + /// Some zeros, only needed for padding -- like in real life. /// Some zeros, only needed for padding -- like in real life. - private static readonly byte[] paddingZeros = new byte[] { 0, 0, 0, 0 }; + private static readonly byte[] paddingZeros = new byte[] { 0, 0, 0, 0 }; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrByte.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrByte.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrByte.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrByte.cs index 7d2b7b5..74fba9e 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrByte.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrByte.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrByte represent (de-)serializeable /// bytes, which are especially useful in cases where a result with only a @@ -45,23 +45,23 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrByte : org.acplt.oncrpc.XdrAble - { + public class XdrByte : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrByte object. /// Constructs and initializes a new XdrByte object. /// Byte value. - public XdrByte(byte value) - { - this.value = value; - } - + public XdrByte(byte value) + { + this.value = value; + } + /// Constructs and initializes a new XdrByte object. /// Constructs and initializes a new XdrByte object. - public XdrByte() - { - this.value = 0; - } - + public XdrByte() + { + this.value = 0; + } + /// /// Returns the value of this XdrByte object as a byte /// primitive. @@ -71,11 +71,11 @@ public XdrByte() /// primitive. /// /// The primitive byte value of this object. - public virtual byte byteValue() - { - return this.value; - } - + public virtual byte byteValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR byte into a XDR stream in /// compliance to RFC 1832. @@ -87,11 +87,11 @@ public virtual byte byteValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeByte(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeByte(value); + } + /// /// Decodes -- that is: deserializes -- a XDR byte from a XDR stream in /// compliance to RFC 1832. @@ -103,13 +103,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = xdr.xdrDecodeByte(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = xdr.xdrDecodeByte(); + } + /// The encapsulated byte value itself. /// The encapsulated byte value itself. - private byte value; + private byte value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrBytes.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBytes.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrBytes.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBytes.cs index 23c268d..ac92890 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrBytes.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrBytes.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrBytes represent (de-)serializeable /// bytes values, which are especially useful in cases where a result with only a @@ -45,23 +45,23 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrBytes : org.acplt.oncrpc.XdrAble - { + public class XdrBytes : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrBytes object. /// Constructs and initializes a new XdrBytes object. /// bytes vector - public XdrBytes(byte[] value) - { - this.value = value; - } - + public XdrBytes(byte[] value) + { + this.value = value; + } + /// Constructs and initializes a new XdrBytes object. /// Constructs and initializes a new XdrBytes object. - public XdrBytes() - { - this.value = null; - } - + public XdrBytes() + { + this.value = null; + } + /// /// Returns the value of this XdrBytes object as a byte /// vector. @@ -71,11 +71,11 @@ public XdrBytes() /// vector. /// /// The primitive byte[] value of this object. - public virtual byte[] bytesValue() - { - return this.value; - } - + public virtual byte[] bytesValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR bytes value into a XDR stream in /// compliance to RFC 1832. @@ -87,11 +87,11 @@ public virtual byte[] bytesValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeByteVector(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeByteVector(value); + } + /// /// Decodes -- that is: deserializes -- a XDR bytes value from a XDR stream in /// compliance to RFC 1832. @@ -103,13 +103,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = xdr.xdrDecodeByteVector(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = xdr.xdrDecodeByteVector(); + } + /// The encapsulated bytes value itself. /// The encapsulated bytes value itself. - private byte[] value; + private byte[] value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrChar.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrChar.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrChar.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrChar.cs index 3f287ca..90eaa03 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrChar.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrChar.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrChar represent (de-)serializeable /// chars, which are especially useful in cases where a result with only a @@ -45,23 +45,23 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrChar : org.acplt.oncrpc.XdrAble - { + public class XdrChar : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrChar object. /// Constructs and initializes a new XdrChar object. /// Char value. - public XdrChar(char value) - { - this.value = value; - } - + public XdrChar(char value) + { + this.value = value; + } + /// Constructs and initializes a new XdrChar object. /// Constructs and initializes a new XdrChar object. - public XdrChar() - { - this.value = (char)0; - } - + public XdrChar() + { + this.value = (char)0; + } + /// /// Returns the value of this XdrChar object as a char /// primitive. @@ -71,11 +71,11 @@ public XdrChar() /// primitive. /// /// The primitive char value of this object. - public virtual char charValue() - { - return this.value; - } - + public virtual char charValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR char into a XDR stream in /// compliance to RFC 1832. @@ -87,11 +87,11 @@ public virtual char charValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeByte((byte)value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeByte((byte)value); + } + /// /// Decodes -- that is: deserializes -- a XDR char from a XDR stream in /// compliance to RFC 1832. @@ -103,13 +103,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = (char)xdr.xdrDecodeByte(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = (char)xdr.xdrDecodeByte(); + } + /// The encapsulated char value itself. /// The encapsulated char value itself. - private char value; + private char value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrDecodingStream.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrDecodingStream.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrDecodingStream.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrDecodingStream.cs index 96b753c..53e99ad 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrDecodingStream.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrDecodingStream.cs @@ -25,7 +25,7 @@ using System; using System.Net; using System.Text; - + namespace org.acplt.oncrpc { /// Defines the abstract base class for all decoding XDR streams. diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrDouble.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrDouble.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrDouble.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrDouble.cs index eafec11..1882ddb 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrDouble.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrDouble.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrDouble represent (de-)serializeable /// doubles, which are especially useful in cases where a result with only a @@ -45,23 +45,23 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrDouble : org.acplt.oncrpc.XdrAble - { + public class XdrDouble : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrDouble object. /// Constructs and initializes a new XdrDouble object. /// Double value. - public XdrDouble(double value) - { - this.value = value; - } - + public XdrDouble(double value) + { + this.value = value; + } + /// Constructs and initializes a new XdrDouble object. /// Constructs and initializes a new XdrDouble object. - public XdrDouble() - { - this.value = 0; - } - + public XdrDouble() + { + this.value = 0; + } + /// /// Returns the value of this XdrDouble object as a double /// primitive. @@ -71,11 +71,11 @@ public XdrDouble() /// primitive. /// /// The primitive double value of this object. - public virtual double doubleValue() - { - return this.value; - } - + public virtual double doubleValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR double into a XDR stream in /// compliance to RFC 1832. @@ -87,11 +87,11 @@ public virtual double doubleValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeDouble(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeDouble(value); + } + /// /// Decodes -- that is: deserializes -- a XDR double from a XDR stream in /// compliance to RFC 1832. @@ -103,13 +103,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = xdr.xdrDecodeDouble(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = xdr.xdrDecodeDouble(); + } + /// The encapsulated double value itself. /// The encapsulated double value itself. - private double value; + private double value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrDynamicOpaque.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrDynamicOpaque.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrDynamicOpaque.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrDynamicOpaque.cs index 336bd33..af414e9 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrDynamicOpaque.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrDynamicOpaque.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrDynamicOpaque represent (de-)serializeable /// dynamic-size opaque values, which are especially useful in cases where a result with only a @@ -45,22 +45,22 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrDynamicOpaque : XdrAble - { + public class XdrDynamicOpaque : XdrAble + { /// Constructs and initializes a new XdrDynamicOpaque object. /// Constructs and initializes a new XdrDynamicOpaque object. - public XdrDynamicOpaque() - { - this.value = null; - } - + public XdrDynamicOpaque() + { + this.value = null; + } + /// Constructs and initializes a new XdrDynamicOpaque object. /// Constructs and initializes a new XdrDynamicOpaque object. - public XdrDynamicOpaque(byte[] value) - { - this.value = value; - } - + public XdrDynamicOpaque(byte[] value) + { + this.value = value; + } + /// /// Returns the value of this XdrDynamicOpaque object as a byte /// vector. @@ -70,11 +70,11 @@ public XdrDynamicOpaque(byte[] value) /// vector. /// /// The primitive byte[] value of this object. - public virtual byte[] dynamicOpaqueValue() - { - return this.value; - } - + public virtual byte[] dynamicOpaqueValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR opaque into a XDR stream in /// compliance to RFC 1832. @@ -86,11 +86,11 @@ public virtual byte[] dynamicOpaqueValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeDynamicOpaque(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeDynamicOpaque(value); + } + /// /// Decodes -- that is: deserializes -- a XDR opaque from a XDR stream in /// compliance to RFC 1832. @@ -102,13 +102,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = xdr.xdrDecodeDynamicOpaque(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = xdr.xdrDecodeDynamicOpaque(); + } + /// The encapsulated opaque value itself. /// The encapsulated opaque value itself. - private byte[] value; + private byte[] value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrEncodingStream.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrEncodingStream.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrEncodingStream.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrEncodingStream.cs index a5e8d98..00c9635 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrEncodingStream.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrEncodingStream.cs @@ -25,9 +25,9 @@ using System; using System.Net; using System.Text; - + namespace org.acplt.oncrpc -{ +{ /// Defines the abstract base class for all encoding XDR streams. /// /// Defines the abstract base class for all encoding XDR streams. An encoding @@ -47,8 +47,8 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2003/08/14 13:48:33 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public abstract class XdrEncodingStream - { + public abstract class XdrEncodingStream + { /// Begins encoding a new XDR record. /// /// Begins encoding a new XDR record. This typically involves resetting this @@ -63,11 +63,11 @@ public abstract class XdrEncodingStream /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void beginEncoding(IPAddress receiverAddress, int receiverPort - ) - { - } - + public virtual void beginEncoding(IPAddress receiverAddress, int receiverPort + ) + { + } + /// /// Flushes this encoding XDR stream and forces any buffered output bytes /// to be written out. @@ -84,10 +84,10 @@ public virtual void beginEncoding(IPAddress receiverAddress, int receiverPort /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void endEncoding() - { - } - + public virtual void endEncoding() + { + } + /// /// Closes this encoding XDR stream and releases any system resources /// associated with this stream. @@ -103,10 +103,10 @@ public virtual void endEncoding() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void Close() - { - } - + public virtual void Close() + { + } + /// /// Encodes (aka "serializes") a "XDR int" value and writes it down a /// XDR stream. @@ -122,8 +122,8 @@ public virtual void Close() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public abstract void xdrEncodeInt(int value); - + public abstract void xdrEncodeInt(int value); + /// /// Encodes (aka "serializes") a XDR opaque value, which is represented /// by a vector of byte values, and starts at offset with a @@ -148,8 +148,8 @@ public virtual void Close() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public abstract void xdrEncodeOpaque(byte[] value, int offset, int length); - + public abstract void xdrEncodeOpaque(byte[] value, int offset, int length); + /// /// Encodes (aka "serializes") a XDR opaque value, which is represented /// by a vector of byte values. @@ -168,12 +168,12 @@ public virtual void Close() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeDynamicOpaque(byte[] value) - { - xdrEncodeInt(value.Length); - xdrEncodeOpaque(value); - } - + public void xdrEncodeDynamicOpaque(byte[] value) + { + xdrEncodeInt(value.Length); + xdrEncodeOpaque(value); + } + /// /// Encodes (aka "serializes") a XDR opaque value, which is represented /// by a vector of byte values. @@ -193,11 +193,11 @@ public void xdrEncodeDynamicOpaque(byte[] value) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeOpaque(byte[] value) - { - xdrEncodeOpaque(value, 0, value.Length); - } - + public void xdrEncodeOpaque(byte[] value) + { + xdrEncodeOpaque(value, 0, value.Length); + } + /// /// Encodes (aka "serializes") a XDR opaque value, which is represented /// by a vector of byte values. @@ -225,16 +225,16 @@ public void xdrEncodeOpaque(byte[] value) /// match the specified length. /// /// - public void xdrEncodeOpaque(byte[] value, int length) - { - if (value.Length != length) - { - throw (new System.ArgumentException("array size does not match protocol specification" - )); - } - xdrEncodeOpaque(value, 0, value.Length); - } - + public void xdrEncodeOpaque(byte[] value, int length) + { + if (value.Length != length) + { + throw (new System.ArgumentException("array size does not match protocol specification" + )); + } + xdrEncodeOpaque(value, 0, value.Length); + } + /// /// Encodes (aka "serializes") a vector of bytes, which is nothing more /// than a series of octets (or 8 bits wide bytes), each packed into its @@ -251,24 +251,24 @@ public void xdrEncodeOpaque(byte[] value, int length) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeByteVector(byte[] value) - { - int length = value.Length; - // well, silly optimizations appear here... - xdrEncodeInt(length); - if (length != 0) - { - // - // For speed reasons, we do sign extension here, but the higher bits - // will be removed again when deserializing. - // - for (int i = 0; i < length; ++i) - { - xdrEncodeInt((int)value[i]); - } - } - } - + public void xdrEncodeByteVector(byte[] value) + { + int length = value.Length; + // well, silly optimizations appear here... + xdrEncodeInt(length); + if (length != 0) + { + // + // For speed reasons, we do sign extension here, but the higher bits + // will be removed again when deserializing. + // + for (int i = 0; i < length; ++i) + { + xdrEncodeInt((int)value[i]); + } + } + } + /// /// Encodes (aka "serializes") a vector of bytes, which is nothing more /// than a series of octets (or 8 bits wide bytes), each packed into its @@ -291,41 +291,41 @@ public void xdrEncodeByteVector(byte[] value) /// match the specified length. /// /// - public void xdrEncodeByteFixedVector(byte[] value, int length) - { - if (value.Length != length) - { - throw (new System.ArgumentException("array size does not match protocol specification" - )); - } - if (length != 0) - { - // - // For speed reasons, we do sign extension here, but the higher bits - // will be removed again when deserializing. - // - for (int i = 0; i < length; ++i) - { - xdrEncodeInt((int)value[i]); - } - } - } - + public void xdrEncodeByteFixedVector(byte[] value, int length) + { + if (value.Length != length) + { + throw (new System.ArgumentException("array size does not match protocol specification" + )); + } + if (length != 0) + { + // + // For speed reasons, we do sign extension here, but the higher bits + // will be removed again when deserializing. + // + for (int i = 0; i < length; ++i) + { + xdrEncodeInt((int)value[i]); + } + } + } + /// Encodes (aka "serializes") a byte and write it down this XDR stream. /// Encodes (aka "serializes") a byte and write it down this XDR stream. /// Byte value to encode. /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeByte(byte value) - { - // - // For speed reasons, we do sign extension here, but the higher bits - // will be removed again when deserializing. - // - xdrEncodeInt((int)value); - } - + public void xdrEncodeByte(byte value) + { + // + // For speed reasons, we do sign extension here, but the higher bits + // will be removed again when deserializing. + // + xdrEncodeInt((int)value); + } + /// /// Encodes (aka "serializes") a short (which is a 16 bits wide quantity) /// and write it down this XDR stream. @@ -338,11 +338,11 @@ public void xdrEncodeByte(byte value) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeShort(short value) - { - xdrEncodeInt((int)value); - } - + public void xdrEncodeShort(short value) + { + xdrEncodeInt((int)value); + } + /// /// Encodes (aka "serializes") a long (which is called a "hyper" in XDR /// babble and is 64 bits wide) and write it down this XDR stream. @@ -355,17 +355,17 @@ public void xdrEncodeShort(short value) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeLong(long value) - { - // - // Just encode the long (which is called a "hyper" in XDR babble) as - // two ints in network order, that is: big endian with the high int - // comming first. - // - xdrEncodeInt((int)((value) >> 32) & unchecked((int)(0xffffffff))); - xdrEncodeInt((int)(value & unchecked((int)(0xffffffff)))); - } - + public void xdrEncodeLong(long value) + { + // + // Just encode the long (which is called a "hyper" in XDR babble) as + // two ints in network order, that is: big endian with the high int + // comming first. + // + xdrEncodeInt((int)((value) >> 32) & unchecked((int)(0xffffffff))); + xdrEncodeInt((int)(value & unchecked((int)(0xffffffff)))); + } + /// /// Encodes (aka "serializes") a float (which is a 32 bits wide floating /// point quantity) and write it down this XDR stream. @@ -378,11 +378,11 @@ public void xdrEncodeLong(long value) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeFloat(float value) - { - xdrEncodeInt(BitConverter.ToInt32(BitConverter.GetBytes(value), 0)); - } - + public void xdrEncodeFloat(float value) + { + xdrEncodeInt(BitConverter.ToInt32(BitConverter.GetBytes(value), 0)); + } + /// /// Encodes (aka "serializes") a double (which is a 64 bits wide floating /// point quantity) and write it down this XDR stream. @@ -395,11 +395,11 @@ public void xdrEncodeFloat(float value) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeDouble(double value) - { - xdrEncodeLong(BitConverter.DoubleToInt64Bits(value)); - } - + public void xdrEncodeDouble(double value) + { + xdrEncodeLong(BitConverter.DoubleToInt64Bits(value)); + } + /// Encodes (aka "serializes") a boolean and writes it down this XDR stream. /// /// Encodes (aka "serializes") a boolean and writes it down this XDR stream. @@ -408,9 +408,9 @@ public void xdrEncodeDouble(double value) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeBoolean(bool value) - { - xdrEncodeInt(value ? 1 : 0); + public void xdrEncodeBoolean(bool value) + { + xdrEncodeInt(value ? 1 : 0); } internal byte[] StrToByteArray(string str) @@ -430,19 +430,19 @@ internal byte[] StrToByteArray(string str, Encoding encoding) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeString(string value) - { - if (characterEncoding != null) - { - xdrEncodeDynamicOpaque(StrToByteArray(value, Encoding.GetEncoding(characterEncoding) - )); - } - else - { - xdrEncodeDynamicOpaque(StrToByteArray(value)); - } - } - + public void xdrEncodeString(string value) + { + if (characterEncoding != null) + { + xdrEncodeDynamicOpaque(StrToByteArray(value, Encoding.GetEncoding(characterEncoding) + )); + } + else + { + xdrEncodeDynamicOpaque(StrToByteArray(value)); + } + } + /// /// Encodes (aka "serializes") a vector of short integers and writes it down /// this XDR stream. @@ -455,16 +455,16 @@ public void xdrEncodeString(string value) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeShortVector(short[] value) - { - int size = value.Length; - xdrEncodeInt(size); - for (int i = 0; i < size; i++) - { - xdrEncodeShort(value[i]); - } - } - + public void xdrEncodeShortVector(short[] value) + { + int size = value.Length; + xdrEncodeInt(size); + for (int i = 0; i < size; i++) + { + xdrEncodeShort(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of short integers and writes it down /// this XDR stream. @@ -485,19 +485,19 @@ public void xdrEncodeShortVector(short[] value) /// match the specified length. /// /// - public void xdrEncodeShortFixedVector(short[] value, int length) - { - if (value.Length != length) - { - throw (new System.ArgumentException("array size does not match protocol specification" - )); - } - for (int i = 0; i < length; i++) - { - xdrEncodeShort(value[i]); - } - } - + public void xdrEncodeShortFixedVector(short[] value, int length) + { + if (value.Length != length) + { + throw (new System.ArgumentException("array size does not match protocol specification" + )); + } + for (int i = 0; i < length; i++) + { + xdrEncodeShort(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of ints and writes it down /// this XDR stream. @@ -510,16 +510,16 @@ public void xdrEncodeShortFixedVector(short[] value, int length) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeIntVector(int[] value) - { - int size = value.Length; - xdrEncodeInt(size); - for (int i = 0; i < size; i++) - { - xdrEncodeInt(value[i]); - } - } - + public void xdrEncodeIntVector(int[] value) + { + int size = value.Length; + xdrEncodeInt(size); + for (int i = 0; i < size; i++) + { + xdrEncodeInt(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of ints and writes it down /// this XDR stream. @@ -540,19 +540,19 @@ public void xdrEncodeIntVector(int[] value) /// match the specified length. /// /// - public void xdrEncodeIntFixedVector(int[] value, int length) - { - if (value.Length != length) - { - throw (new System.ArgumentException("array size does not match protocol specification" - )); - } - for (int i = 0; i < length; i++) - { - xdrEncodeInt(value[i]); - } - } - + public void xdrEncodeIntFixedVector(int[] value, int length) + { + if (value.Length != length) + { + throw (new System.ArgumentException("array size does not match protocol specification" + )); + } + for (int i = 0; i < length; i++) + { + xdrEncodeInt(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of long integers and writes it down /// this XDR stream. @@ -565,16 +565,16 @@ public void xdrEncodeIntFixedVector(int[] value, int length) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeLongVector(long[] value) - { - int size = value.Length; - xdrEncodeInt(size); - for (int i = 0; i < size; i++) - { - xdrEncodeLong(value[i]); - } - } - + public void xdrEncodeLongVector(long[] value) + { + int size = value.Length; + xdrEncodeInt(size); + for (int i = 0; i < size; i++) + { + xdrEncodeLong(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of long integers and writes it down /// this XDR stream. @@ -595,19 +595,19 @@ public void xdrEncodeLongVector(long[] value) /// match the specified length. /// /// - public void xdrEncodeLongFixedVector(long[] value, int length) - { - if (value.Length != length) - { - throw (new System.ArgumentException("array size does not match protocol specification" - )); - } - for (int i = 0; i < length; i++) - { - xdrEncodeLong(value[i]); - } - } - + public void xdrEncodeLongFixedVector(long[] value, int length) + { + if (value.Length != length) + { + throw (new System.ArgumentException("array size does not match protocol specification" + )); + } + for (int i = 0; i < length; i++) + { + xdrEncodeLong(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of floats and writes it down /// this XDR stream. @@ -620,16 +620,16 @@ public void xdrEncodeLongFixedVector(long[] value, int length) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeFloatVector(float[] value) - { - int size = value.Length; - xdrEncodeInt(size); - for (int i = 0; i < size; i++) - { - xdrEncodeFloat(value[i]); - } - } - + public void xdrEncodeFloatVector(float[] value) + { + int size = value.Length; + xdrEncodeInt(size); + for (int i = 0; i < size; i++) + { + xdrEncodeFloat(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of floats and writes it down /// this XDR stream. @@ -650,19 +650,19 @@ public void xdrEncodeFloatVector(float[] value) /// match the specified length. /// /// - public void xdrEncodeFloatFixedVector(float[] value, int length) - { - if (value.Length != length) - { - throw (new System.ArgumentException("array size does not match protocol specification" - )); - } - for (int i = 0; i < length; i++) - { - xdrEncodeFloat(value[i]); - } - } - + public void xdrEncodeFloatFixedVector(float[] value, int length) + { + if (value.Length != length) + { + throw (new System.ArgumentException("array size does not match protocol specification" + )); + } + for (int i = 0; i < length; i++) + { + xdrEncodeFloat(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of doubles and writes it down /// this XDR stream. @@ -675,16 +675,16 @@ public void xdrEncodeFloatFixedVector(float[] value, int length) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeDoubleVector(double[] value) - { - int size = value.Length; - xdrEncodeInt(size); - for (int i = 0; i < size; i++) - { - xdrEncodeDouble(value[i]); - } - } - + public void xdrEncodeDoubleVector(double[] value) + { + int size = value.Length; + xdrEncodeInt(size); + for (int i = 0; i < size; i++) + { + xdrEncodeDouble(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of doubles and writes it down /// this XDR stream. @@ -705,19 +705,19 @@ public void xdrEncodeDoubleVector(double[] value) /// match the specified length. /// /// - public void xdrEncodeDoubleFixedVector(double[] value, int length) - { - if (value.Length != length) - { - throw (new System.ArgumentException("array size does not match protocol specification" - )); - } - for (int i = 0; i < length; i++) - { - xdrEncodeDouble(value[i]); - } - } - + public void xdrEncodeDoubleFixedVector(double[] value, int length) + { + if (value.Length != length) + { + throw (new System.ArgumentException("array size does not match protocol specification" + )); + } + for (int i = 0; i < length; i++) + { + xdrEncodeDouble(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of booleans and writes it down /// this XDR stream. @@ -730,16 +730,16 @@ public void xdrEncodeDoubleFixedVector(double[] value, int length) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeBooleanVector(bool[] value) - { - int size = value.Length; - xdrEncodeInt(size); - for (int i = 0; i < size; i++) - { - xdrEncodeBoolean(value[i]); - } - } - + public void xdrEncodeBooleanVector(bool[] value) + { + int size = value.Length; + xdrEncodeInt(size); + for (int i = 0; i < size; i++) + { + xdrEncodeBoolean(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of booleans and writes it down /// this XDR stream. @@ -760,19 +760,19 @@ public void xdrEncodeBooleanVector(bool[] value) /// match the specified length. /// /// - public void xdrEncodeBooleanFixedVector(bool[] value, int length) - { - if (value.Length != length) - { - throw (new System.ArgumentException("array size does not match protocol specification" - )); - } - for (int i = 0; i < length; i++) - { - xdrEncodeBoolean(value[i]); - } - } - + public void xdrEncodeBooleanFixedVector(bool[] value, int length) + { + if (value.Length != length) + { + throw (new System.ArgumentException("array size does not match protocol specification" + )); + } + for (int i = 0; i < length; i++) + { + xdrEncodeBoolean(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of strings and writes it down /// this XDR stream. @@ -785,16 +785,16 @@ public void xdrEncodeBooleanFixedVector(bool[] value, int length) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public void xdrEncodeStringVector(string[] value) - { - int size = value.Length; - xdrEncodeInt(size); - for (int i = 0; i < size; i++) - { - xdrEncodeString(value[i]); - } - } - + public void xdrEncodeStringVector(string[] value) + { + int size = value.Length; + xdrEncodeInt(size); + for (int i = 0; i < size; i++) + { + xdrEncodeString(value[i]); + } + } + /// /// Encodes (aka "serializes") a vector of strings and writes it down /// this XDR stream. @@ -815,41 +815,41 @@ public void xdrEncodeStringVector(string[] value) /// match the specified length. /// /// - public void xdrEncodeStringFixedVector(string[] value, int length) - { - if (value.Length != length) - { - throw (new System.ArgumentException("array size does not match protocol specification" - )); - } - for (int i = 0; i < length; i++) - { - xdrEncodeString(value[i]); - } - } - + public void xdrEncodeStringFixedVector(string[] value, int length) + { + if (value.Length != length) + { + throw (new System.ArgumentException("array size does not match protocol specification" + )); + } + for (int i = 0; i < length; i++) + { + xdrEncodeString(value[i]); + } + } + /// Set the character encoding for serializing strings. /// Set the character encoding for serializing strings. /// /// the encoding to use for serializing strings. /// If null, the system's default encoding is to be used. /// - public virtual void setCharacterEncoding(string characterEncoding) - { - this.characterEncoding = characterEncoding; - } - + public virtual void setCharacterEncoding(string characterEncoding) + { + this.characterEncoding = characterEncoding; + } + /// Get the character encoding for serializing strings. /// Get the character encoding for serializing strings. /// /// the encoding currently used for serializing strings. /// If null, then the system's default encoding is used. /// - public virtual string getCharacterEncoding() - { - return characterEncoding; - } - + public virtual string getCharacterEncoding() + { + return characterEncoding; + } + /// /// Encoding to use when serializing strings or null if /// the system's default encoding should be used. @@ -858,6 +858,6 @@ public virtual string getCharacterEncoding() /// Encoding to use when serializing strings or null if /// the system's default encoding should be used. /// - private string characterEncoding = null; + private string characterEncoding = null; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrFloat.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrFloat.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrFloat.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrFloat.cs index 7b73a06..8d4f107 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrFloat.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrFloat.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrFloat represent (de-)serializeable /// floats, which are especially useful in cases where a result with only a @@ -45,23 +45,23 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrFloat : org.acplt.oncrpc.XdrAble - { + public class XdrFloat : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrFloat object. /// Constructs and initializes a new XdrFloat object. /// Float value. - public XdrFloat(float value) - { - this.value = value; - } - + public XdrFloat(float value) + { + this.value = value; + } + /// Constructs and initializes a new XdrFloat object. /// Constructs and initializes a new XdrFloat object. - public XdrFloat() - { - this.value = 0; - } - + public XdrFloat() + { + this.value = 0; + } + /// /// Returns the value of this XdrFloat object as a float /// primitive. @@ -71,11 +71,11 @@ public XdrFloat() /// primitive. /// /// The primitive float value of this object. - public virtual float floatValue() - { - return this.value; - } - + public virtual float floatValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR float into a XDR stream in /// compliance to RFC 1832. @@ -87,11 +87,11 @@ public virtual float floatValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeFloat(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeFloat(value); + } + /// /// Decodes -- that is: deserializes -- a XDR float from a XDR stream in /// compliance to RFC 1832. @@ -103,13 +103,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = xdr.xdrDecodeFloat(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = xdr.xdrDecodeFloat(); + } + /// The encapsulated float value itself. /// The encapsulated float value itself. - private float value; + private float value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrInt.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrInt.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrInt.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrInt.cs index 1af7e3d..010606e 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrInt.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrInt.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrInt represent (de-)serializeable /// integers, which are especially useful in cases where a result with only a @@ -45,23 +45,23 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrInt : org.acplt.oncrpc.XdrAble - { + public class XdrInt : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrInt object. /// Constructs and initializes a new XdrInt object. /// Int value. - public XdrInt(int value) - { - this.value = value; - } - + public XdrInt(int value) + { + this.value = value; + } + /// Constructs and initializes a new XdrInt object. /// Constructs and initializes a new XdrInt object. - public XdrInt() - { - this.value = 0; - } - + public XdrInt() + { + this.value = 0; + } + /// /// Returns the value of this XdrInt object as a int /// primitive. @@ -71,11 +71,11 @@ public XdrInt() /// primitive. /// /// The primitive int value of this object. - public virtual int intValue() - { - return this.value; - } - + public virtual int intValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR int into a XDR stream in /// compliance to RFC 1832. @@ -87,11 +87,11 @@ public virtual int intValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeInt(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeInt(value); + } + /// /// Decodes -- that is: deserializes -- a XDR int from a XDR stream in /// compliance to RFC 1832. @@ -103,13 +103,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = xdr.xdrDecodeInt(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = xdr.xdrDecodeInt(); + } + /// The encapsulated int value itself. /// The encapsulated int value itself. - private int value; + private int value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrLong.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrLong.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrLong.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrLong.cs index 9d035b0..aff9fef 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrLong.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrLong.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrLong represent (de-)serializeable /// longs (64 bit), which are especially useful in cases where a result with only a @@ -45,23 +45,23 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrLong : org.acplt.oncrpc.XdrAble - { + public class XdrLong : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrLong object. /// Constructs and initializes a new XdrLong object. /// Long value. - public XdrLong(long value) - { - this.value = value; - } - + public XdrLong(long value) + { + this.value = value; + } + /// Constructs and initializes a new XdrLong object. /// Constructs and initializes a new XdrLong object. - public XdrLong() - { - this.value = 0; - } - + public XdrLong() + { + this.value = 0; + } + /// /// Returns the value of this XdrLong object as a long /// primitive. @@ -71,11 +71,11 @@ public XdrLong() /// primitive. /// /// The primitive long value of this object. - public virtual long longValue() - { - return this.value; - } - + public virtual long longValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR long into a XDR stream in /// compliance to RFC 1832. @@ -87,11 +87,11 @@ public virtual long longValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeLong(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeLong(value); + } + /// /// Decodes -- that is: deserializes -- a XDR long from a XDR stream in /// compliance to RFC 1832. @@ -103,13 +103,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = xdr.xdrDecodeLong(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = xdr.xdrDecodeLong(); + } + /// The encapsulated long value itself. /// The encapsulated long value itself. - private long value; + private long value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrOpaque.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrOpaque.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrOpaque.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrOpaque.cs index c416d7f..0a577aa 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrOpaque.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrOpaque.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrOpaque represent (de-)serializeable /// fixed-size opaque values, which are especially useful in cases where a result with only a @@ -45,15 +45,15 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrOpaque : org.acplt.oncrpc.XdrAble - { + public class XdrOpaque : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrOpaque object. /// Constructs and initializes a new XdrOpaque object. - public XdrOpaque(byte[] value) - { - this.value = value; - } - + public XdrOpaque(byte[] value) + { + this.value = value; + } + /// /// Constructs and initializes a new XdrOpaque object given /// only the size of the opaque value. @@ -63,11 +63,11 @@ public XdrOpaque(byte[] value) /// only the size of the opaque value. /// /// size of opaque value. - public XdrOpaque(int length) - { - this.value = new byte[length]; - } - + public XdrOpaque(int length) + { + this.value = new byte[length]; + } + /// /// Returns the value of this XdrOpaque object as a byte /// vector. @@ -77,11 +77,11 @@ public XdrOpaque(int length) /// vector. /// /// The primitive byte[] value of this object. - public virtual byte[] opaqueValue() - { - return this.value; - } - + public virtual byte[] opaqueValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR opaque into a XDR stream in /// compliance to RFC 1832. @@ -93,11 +93,11 @@ public virtual byte[] opaqueValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeOpaque(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeOpaque(value); + } + /// /// Decodes -- that is: deserializes -- a XDR opaque from a XDR stream in /// compliance to RFC 1832. @@ -109,13 +109,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - xdr.xdrDecodeOpaque(value); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + xdr.xdrDecodeOpaque(value); + } + /// The encapsulated opaque value itself. /// The encapsulated opaque value itself. - private byte[] value; + private byte[] value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrShort.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrShort.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrShort.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrShort.cs index 139e42e..3144602 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrShort.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrShort.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrShort represent (de-)serializeable /// shorts, which are especially useful in cases where a result with only a @@ -45,23 +45,23 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrShort : org.acplt.oncrpc.XdrAble - { + public class XdrShort : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrShort object. /// Constructs and initializes a new XdrShort object. /// Short value. - public XdrShort(short value) - { - this.value = value; - } - + public XdrShort(short value) + { + this.value = value; + } + /// Constructs and initializes a new XdrShort object. /// Constructs and initializes a new XdrShort object. - public XdrShort() - { - this.value = 0; - } - + public XdrShort() + { + this.value = 0; + } + /// /// Returns the value of this XdrShort object as a short /// primitive. @@ -71,11 +71,11 @@ public XdrShort() /// primitive. /// /// The primitive short value of this object. - public virtual short shortValue() - { - return this.value; - } - + public virtual short shortValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR short into a XDR stream in /// compliance to RFC 1832. @@ -87,11 +87,11 @@ public virtual short shortValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeShort(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeShort(value); + } + /// /// Decodes -- that is: deserializes -- a XDR short from a XDR stream in /// compliance to RFC 1832. @@ -103,13 +103,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = xdr.xdrDecodeShort(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = xdr.xdrDecodeShort(); + } + /// The encapsulated short value itself. /// The encapsulated short value itself. - private short value; + private short value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrString.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrString.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrString.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrString.cs index b45df1c..f13dbad 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrString.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrString.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrString represent (de-)serializeable /// strings, which are especially useful in cases where a result with only a @@ -45,23 +45,23 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrString : org.acplt.oncrpc.XdrAble - { + public class XdrString : org.acplt.oncrpc.XdrAble + { /// Constructs and initializes a new XdrString object. /// Constructs and initializes a new XdrString object. /// String value. - public XdrString(string value) - { - this.value = value; - } - + public XdrString(string value) + { + this.value = value; + } + /// Constructs and initializes a new XdrString object. /// Constructs and initializes a new XdrString object. - public XdrString() - { - this.value = null; - } - + public XdrString() + { + this.value = null; + } + /// /// Returns the value of this XdrString object as a string /// primitive. @@ -71,11 +71,11 @@ public XdrString() /// primitive. /// /// The primitive String value of this object. - public virtual string stringValue() - { - return this.value; - } - + public virtual string stringValue() + { + return this.value; + } + /// /// Encodes -- that is: serializes -- a XDR string into a XDR stream in /// compliance to RFC 1832. @@ -87,11 +87,11 @@ public virtual string stringValue() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeString(value); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeString(value); + } + /// /// Decodes -- that is: deserializes -- a XDR string from a XDR stream in /// compliance to RFC 1832. @@ -103,13 +103,13 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - value = xdr.xdrDecodeString(); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + value = xdr.xdrDecodeString(); + } + /// The encapsulated string value itself. /// The encapsulated string value itself. - private string value; + private string value; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpDecodingStream.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpDecodingStream.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpDecodingStream.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpDecodingStream.cs index 90c7c99..29364b4 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpDecodingStream.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpDecodingStream.cs @@ -25,9 +25,9 @@ using System.IO; using System.Net; using System.Net.Sockets; - + namespace org.acplt.oncrpc -{ +{ /// /// The XdrTcpDecodingStream class provides the necessary /// functionality to @@ -39,8 +39,8 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2005/11/11 21:07:27 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class XdrTcpDecodingStream : XdrDecodingStream - { + public class XdrTcpDecodingStream : XdrDecodingStream + { /// /// Construct a new XdrTcpDecodingStream object and associate /// it with the given networkStream for TCP/IP-based @@ -57,34 +57,34 @@ public class XdrTcpDecodingStream : XdrDecodingStream /// data. /// /// - public XdrTcpDecodingStream(Socket socket, int bufferSize) + public XdrTcpDecodingStream(Socket socket, int bufferSize) { this.socket = socket; - stream = new NetworkStream(socket); - // - // If the given buffer size is too small, start with a more sensible - // size. Next, if bufferSize is not a multiple of four, round it up to - // the next multiple of four. - // - if (bufferSize < 1024) - { - bufferSize = 1024; - } - if ((bufferSize & 3) != 0) - { - bufferSize = (bufferSize + 4) & ~3; - } - // - // Set up the buffer and the buffer pointers (no, this is still - // Java). - // - buffer = new byte[bufferSize]; - bufferIndex = 0; - bufferHighmark = -4; - lastFragment = false; - fragmentLength = 0; - } - + stream = new NetworkStream(socket); + // + // If the given buffer size is too small, start with a more sensible + // size. Next, if bufferSize is not a multiple of four, round it up to + // the next multiple of four. + // + if (bufferSize < 1024) + { + bufferSize = 1024; + } + if ((bufferSize & 3) != 0) + { + bufferSize = (bufferSize + 4) & ~3; + } + // + // Set up the buffer and the buffer pointers (no, this is still + // Java). + // + buffer = new byte[bufferSize]; + bufferIndex = 0; + bufferHighmark = -4; + lastFragment = false; + fragmentLength = 0; + } + /// Returns the Internet address of the sender of the current XDR data. /// /// Returns the Internet address of the sender of the current XDR data. @@ -94,11 +94,11 @@ public XdrTcpDecodingStream(Socket socket, int bufferSize) /// it might return stale information. /// /// InetAddress of the sender of the current XDR data. - public override IPAddress getSenderAddress() + public override IPAddress getSenderAddress() { return ((IPEndPoint)(socket.RemoteEndPoint)).Address; - } - + } + /// Returns the port number of the sender of the current XDR data. /// /// Returns the port number of the sender of the current XDR data. @@ -108,11 +108,11 @@ public override IPAddress getSenderAddress() /// it might return stale information. /// /// Port number of the sender of the current XDR data. - public override int getSenderPort() + public override int getSenderPort() { return ((IPEndPoint)(socket.RemoteEndPoint)).Port; - } - + } + /// Initiates decoding of the next XDR record. /// /// Initiates decoding of the next XDR record. For TCP-based XDR decoding @@ -128,11 +128,11 @@ public override int getSenderPort() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void beginDecoding() - { - fill(); - } - + public override void beginDecoding() + { + fill(); + } + /// Read into buffer exactly the amound of bytes specified. /// Read into buffer exactly the amound of bytes specified. /// Input stream to read byte data from. @@ -144,28 +144,28 @@ public override void beginDecoding() /// /// if an I/O error occurs. /// - private void readBuffer(Stream stream, byte[] bytes, int bytesToRead - ) - { - int bytesRead; - int byteOffset = 0; - while (bytesToRead > 0) - { - bytesRead = stream.Read(bytes, byteOffset, bytesToRead); - if (bytesRead <= 0) - { - // - // Stream is at EOF -- note that bytesRead is not allowed - // to be zero here, as we asked for at least one byte... - // - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTRECV - )); - } - bytesToRead -= bytesRead; - byteOffset += bytesRead; - } - } - + private void readBuffer(Stream stream, byte[] bytes, int bytesToRead + ) + { + int bytesRead; + int byteOffset = 0; + while (bytesToRead > 0) + { + bytesRead = stream.Read(bytes, byteOffset, bytesToRead); + if (bytesRead <= 0) + { + // + // Stream is at EOF -- note that bytesRead is not allowed + // to be zero here, as we asked for at least one byte... + // + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANTRECV + )); + } + bytesToRead -= bytesRead; + byteOffset += bytesRead; + } + } + /// Fills the internal buffer with the next chunk of data. /// /// Fills the internal buffer with the next chunk of data. The chunk is @@ -180,96 +180,96 @@ private void readBuffer(Stream stream, byte[] bytes, int bytesToRead /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - private void fill() - { - // - // If the buffer is empty but there are still bytes left to read, - // refill the buffer. We have also to take care of the record marking - // within the stream. - // - // Remember that lastFragment is reset by the endDecoding() method. - // This once used to be a while loop, but it has been dropped since - // we do not accept empty records any more -- with the only exception - // being a final trailing empty XDR record. - // - // Did we already read in all data belonging to the current XDR - // record, or are there bytes left to be read? - // - if (fragmentLength <= 0) - { - if (lastFragment) - { - // - // In case there is no more data in the current XDR record - // (as we already saw the last fragment), throw an exception. - // - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW - )); - } - // - // First read in the header of the next fragment. - // - byte[] bytes = new byte[4]; - readBuffer(stream, bytes, 4); - // - // Watch the sign bit! - // - fragmentLength = bytes[0] & unchecked((int)(0xFF)); - fragmentLength = (fragmentLength << 8) + (bytes[1] & unchecked((int)(0xFF))); - fragmentLength = (fragmentLength << 8) + (bytes[2] & unchecked((int)(0xFF))); - fragmentLength = (fragmentLength << 8) + (bytes[3] & unchecked((int)(0xFF))); - if ((fragmentLength & unchecked((int)(0x80000000))) != 0) - { - fragmentLength &= unchecked((int)(0x7FFFFFFF)); - lastFragment = true; - } - else - { - lastFragment = false; - } - // - // Sanity check on incomming fragment length: the length must - // be at least four bytes long, otherwise this fragment does - // not make sense. There are ONC/RPC implementations that send - // empty trailing fragments, so we accept them here. - // Also check for fragment lengths which are not a multiple of - // four -- and thus are invalid. - // - if ((fragmentLength & 3) != 0) - { - throw (new System.IO.IOException("ONC/RPC XDR fragment length is not a multiple of four" - )); - } - if ((fragmentLength == 0) && !lastFragment) - { - throw (new System.IO.IOException("empty ONC/RPC XDR fragment which is not a trailing fragment" - )); - } - } - // - // When the reach this stage, there is (still) data to be read for the - // current XDR record *fragment*. - // - // Now read in the next buffer. Depending on how much bytes are still - // to read within this frame, we either fill the buffer not completely - // (with still some bytes to read in from the next round) or - // completely. - // - bufferIndex = 0; - if (fragmentLength < buffer.Length) - { - readBuffer(stream, buffer, fragmentLength); - bufferHighmark = fragmentLength - 4; - fragmentLength = 0; - } - else - { - readBuffer(stream, buffer, buffer.Length); - bufferHighmark = buffer.Length - 4; - fragmentLength -= buffer.Length; - } - } - + private void fill() + { + // + // If the buffer is empty but there are still bytes left to read, + // refill the buffer. We have also to take care of the record marking + // within the stream. + // + // Remember that lastFragment is reset by the endDecoding() method. + // This once used to be a while loop, but it has been dropped since + // we do not accept empty records any more -- with the only exception + // being a final trailing empty XDR record. + // + // Did we already read in all data belonging to the current XDR + // record, or are there bytes left to be read? + // + if (fragmentLength <= 0) + { + if (lastFragment) + { + // + // In case there is no more data in the current XDR record + // (as we already saw the last fragment), throw an exception. + // + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW + )); + } + // + // First read in the header of the next fragment. + // + byte[] bytes = new byte[4]; + readBuffer(stream, bytes, 4); + // + // Watch the sign bit! + // + fragmentLength = bytes[0] & unchecked((int)(0xFF)); + fragmentLength = (fragmentLength << 8) + (bytes[1] & unchecked((int)(0xFF))); + fragmentLength = (fragmentLength << 8) + (bytes[2] & unchecked((int)(0xFF))); + fragmentLength = (fragmentLength << 8) + (bytes[3] & unchecked((int)(0xFF))); + if ((fragmentLength & unchecked((int)(0x80000000))) != 0) + { + fragmentLength &= unchecked((int)(0x7FFFFFFF)); + lastFragment = true; + } + else + { + lastFragment = false; + } + // + // Sanity check on incomming fragment length: the length must + // be at least four bytes long, otherwise this fragment does + // not make sense. There are ONC/RPC implementations that send + // empty trailing fragments, so we accept them here. + // Also check for fragment lengths which are not a multiple of + // four -- and thus are invalid. + // + if ((fragmentLength & 3) != 0) + { + throw (new System.IO.IOException("ONC/RPC XDR fragment length is not a multiple of four" + )); + } + if ((fragmentLength == 0) && !lastFragment) + { + throw (new System.IO.IOException("empty ONC/RPC XDR fragment which is not a trailing fragment" + )); + } + } + // + // When the reach this stage, there is (still) data to be read for the + // current XDR record *fragment*. + // + // Now read in the next buffer. Depending on how much bytes are still + // to read within this frame, we either fill the buffer not completely + // (with still some bytes to read in from the next round) or + // completely. + // + bufferIndex = 0; + if (fragmentLength < buffer.Length) + { + readBuffer(stream, buffer, fragmentLength); + bufferHighmark = fragmentLength - 4; + fragmentLength = 0; + } + else + { + readBuffer(stream, buffer, buffer.Length); + bufferHighmark = buffer.Length - 4; + fragmentLength -= buffer.Length; + } + } + /// End decoding of the current XDR record. /// /// End decoding of the current XDR record. The general contract of @@ -284,31 +284,31 @@ private void fill() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void endDecoding() - { - try - { - // - // Drain the stream until we reach the end of the current record. - // - while (!lastFragment || (fragmentLength != 0)) - { - fill(); - } - } - finally - { - // - // Try to reach a sane state, although this is rather questionable - // in case of timeouts in the middle of a record. - // - bufferIndex = 0; - bufferHighmark = -4; - lastFragment = false; - fragmentLength = 0; - } - } - + public override void endDecoding() + { + try + { + // + // Drain the stream until we reach the end of the current record. + // + while (!lastFragment || (fragmentLength != 0)) + { + fill(); + } + } + finally + { + // + // Try to reach a sane state, although this is rather questionable + // in case of timeouts in the middle of a record. + // + bufferIndex = 0; + bufferHighmark = -4; + lastFragment = false; + fragmentLength = 0; + } + } + /// /// Closes this decoding XDR stream and releases any system resources /// associated with this stream. @@ -324,13 +324,13 @@ public override void endDecoding() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void Close() - { - buffer = null; - stream = null; - socket = null; - } - + public override void Close() + { + buffer = null; + stream = null; + socket = null; + } + /// /// Decodes (aka "deserializes") a "XDR int" value received from a /// XDR stream. @@ -344,34 +344,34 @@ public override void Close() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override int xdrDecodeInt() - { - // - // This might look funny in the first place, but this way we can - // properly handle trailing empty XDR record fragments. In this - // case fill() will return without any now data the first time - // and on the second time a buffer underflow exception is thrown. - // - while (bufferIndex > bufferHighmark) - { - fill(); - } - // - // There's enough space in the buffer to hold at least one - // XDR int. So let's retrieve it now. - // Note: buffer[...] gives a byte, which is signed. So if we - // add it to the value (which is int), it has to be widened - // to 32 bit, so its sign is propagated. To avoid this sign - // madness, we have to "and" it with 0xFF, so all unwanted - // bits are cut off after sign extension. Sigh. - // - int value = buffer[bufferIndex++] & unchecked((int)(0xFF)); - value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); - value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); - value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); - return value; - } - + public override int xdrDecodeInt() + { + // + // This might look funny in the first place, but this way we can + // properly handle trailing empty XDR record fragments. In this + // case fill() will return without any now data the first time + // and on the second time a buffer underflow exception is thrown. + // + while (bufferIndex > bufferHighmark) + { + fill(); + } + // + // There's enough space in the buffer to hold at least one + // XDR int. So let's retrieve it now. + // Note: buffer[...] gives a byte, which is signed. So if we + // add it to the value (which is int), it has to be widened + // to 32 bit, so its sign is propagated. To avoid this sign + // madness, we have to "and" it with 0xFF, so all unwanted + // bits are cut off after sign extension. Sigh. + // + int value = buffer[bufferIndex++] & unchecked((int)(0xFF)); + value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); + value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); + value = (value << 8) + (buffer[bufferIndex++] & unchecked((int)(0xFF))); + return value; + } + /// /// Decodes (aka "deserializes") an opaque value, which is nothing more /// than a series of octets (or 8 bits wide bytes). @@ -390,58 +390,58 @@ public override int xdrDecodeInt() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override byte[] xdrDecodeOpaque(int length) - { - int padding = (4 - (length & 3)) & 3; - int offset = 0; - // current offset into bytes vector - int toCopy; - // - // Now allocate enough memory to hold the data to be retrieved and - // get part after part from the buffer. - // - byte[] bytes = new byte[length]; - // - // As for the while loop, see the comment in xdrDecodeInt(). - // - while (bufferIndex > bufferHighmark) - { - fill(); - } - while (length > 0) - { - toCopy = bufferHighmark - bufferIndex + 4; - if (toCopy >= length) - { - // - // The buffer holds more data than we need. So copy the bytes - // and leave the stage. - // - System.Array.Copy(buffer, bufferIndex, bytes, offset, length); - bufferIndex += length; - // No need to adjust "offset", because this is the last round. - break; - } - else - { - // - // We need to copy more data than currently available from our - // buffer, so we copy all we can get our hands on, then fill - // the buffer again and repeat this until we got all we want. - // - System.Array.Copy(buffer, bufferIndex, bytes, offset, toCopy); - bufferIndex += toCopy; - offset += toCopy; - length -= toCopy; - // NB: no problems with trailing empty fragments, so we skip - // the while loop here. - fill(); - } - } - bufferIndex += padding; - return bytes; - } - + public override byte[] xdrDecodeOpaque(int length) + { + int padding = (4 - (length & 3)) & 3; + int offset = 0; + // current offset into bytes vector + int toCopy; + // + // Now allocate enough memory to hold the data to be retrieved and + // get part after part from the buffer. + // + byte[] bytes = new byte[length]; + // + // As for the while loop, see the comment in xdrDecodeInt(). + // + while (bufferIndex > bufferHighmark) + { + fill(); + } + while (length > 0) + { + toCopy = bufferHighmark - bufferIndex + 4; + if (toCopy >= length) + { + // + // The buffer holds more data than we need. So copy the bytes + // and leave the stage. + // + System.Array.Copy(buffer, bufferIndex, bytes, offset, length); + bufferIndex += length; + // No need to adjust "offset", because this is the last round. + break; + } + else + { + // + // We need to copy more data than currently available from our + // buffer, so we copy all we can get our hands on, then fill + // the buffer again and repeat this until we got all we want. + // + System.Array.Copy(buffer, bufferIndex, bytes, offset, toCopy); + bufferIndex += toCopy; + offset += toCopy; + length -= toCopy; + // NB: no problems with trailing empty fragments, so we skip + // the while loop here. + fill(); + } + } + bufferIndex += padding; + return bytes; + } + /// /// Decodes (aka "deserializes") a XDR opaque value, which is represented /// by a vector of byte values, and starts at offset with a @@ -461,48 +461,48 @@ public override byte[] xdrDecodeOpaque(int length) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void xdrDecodeOpaque(byte[] opaque, int offset, int length) - { - int padding = (4 - (length & 3)) & 3; - int toCopy; - // - // Now get part after part and fill the byte vector. - // - if (bufferIndex > bufferHighmark) - { - fill(); - } - while (length > 0) - { - toCopy = bufferHighmark - bufferIndex + 4; - if (toCopy >= length) - { - // - // The buffer holds more data than we need. So copy the bytes - // and leave the stage. - // - System.Array.Copy(buffer, bufferIndex, opaque, offset, length); - bufferIndex += length; - // No need to adjust "offset", because this is the last round. - break; - } - else - { - // - // We need to copy more data than currently available from our - // buffer, so we copy all we can get our hands on, then fill - // the buffer again and repeat this until we got all we want. - // - System.Array.Copy(buffer, bufferIndex, opaque, offset, toCopy); - bufferIndex += toCopy; - offset += toCopy; - length -= toCopy; - fill(); - } - } - bufferIndex += padding; - } - + public override void xdrDecodeOpaque(byte[] opaque, int offset, int length) + { + int padding = (4 - (length & 3)) & 3; + int toCopy; + // + // Now get part after part and fill the byte vector. + // + if (bufferIndex > bufferHighmark) + { + fill(); + } + while (length > 0) + { + toCopy = bufferHighmark - bufferIndex + 4; + if (toCopy >= length) + { + // + // The buffer holds more data than we need. So copy the bytes + // and leave the stage. + // + System.Array.Copy(buffer, bufferIndex, opaque, offset, length); + bufferIndex += length; + // No need to adjust "offset", because this is the last round. + break; + } + else + { + // + // We need to copy more data than currently available from our + // buffer, so we copy all we can get our hands on, then fill + // the buffer again and repeat this until we got all we want. + // + System.Array.Copy(buffer, bufferIndex, opaque, offset, toCopy); + bufferIndex += toCopy; + offset += toCopy; + length -= toCopy; + fill(); + } + } + bufferIndex += padding; + } + /// /// The streaming socket to be used when receiving this XDR stream's /// buffer contents. @@ -511,12 +511,12 @@ public override void xdrDecodeOpaque(byte[] opaque, int offset, int length) /// The streaming socket to be used when receiving this XDR stream's /// buffer contents. /// - private Socket socket; - + private Socket socket; + /// The input stream used to pull the bytes off the network. /// The input stream used to pull the bytes off the network. - internal Stream stream; - + internal Stream stream; + /// /// The buffer which will be filled from the datagram socket and then /// be used to supply the information when decoding data. @@ -525,12 +525,12 @@ public override void xdrDecodeOpaque(byte[] opaque, int offset, int length) /// The buffer which will be filled from the datagram socket and then /// be used to supply the information when decoding data. /// - private byte[] buffer; - + private byte[] buffer; + /// The read pointer is an index into the buffer. /// The read pointer is an index into the buffer. - private int bufferIndex; - + private int bufferIndex; + /// /// Index of the last four byte word in the buffer, which has been read /// in from the datagram socket. @@ -539,12 +539,12 @@ public override void xdrDecodeOpaque(byte[] opaque, int offset, int length) /// Index of the last four byte word in the buffer, which has been read /// in from the datagram socket. /// - private int bufferHighmark; - + private int bufferHighmark; + /// Remaining number of bytes in this fragment -- and still to read. /// Remaining number of bytes in this fragment -- and still to read. - private int fragmentLength; - + private int fragmentLength; + /// /// Flag indicating that we've read the last fragment and thus reached /// the end of the record. @@ -553,6 +553,6 @@ public override void xdrDecodeOpaque(byte[] opaque, int offset, int length) /// Flag indicating that we've read the last fragment and thus reached /// the end of the record. /// - private bool lastFragment; + private bool lastFragment; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpEncodingStream.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpEncodingStream.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpEncodingStream.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpEncodingStream.cs index 6caa5b8..82e6324 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpEncodingStream.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrTcpEncodingStream.cs @@ -25,9 +25,9 @@ using System.IO; using System.Net; using System.Net.Sockets; - + namespace org.acplt.oncrpc -{ +{ /// /// The XdrTcpEncodingStream class provides the necessary /// functionality to @@ -39,8 +39,8 @@ namespace org.acplt.oncrpc /// $Revision: 1.2 $ $Date: 2003/08/14 11:07:39 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class XdrTcpEncodingStream : XdrEncodingStream - { + public class XdrTcpEncodingStream : XdrEncodingStream + { /// /// Construct a new XdrTcpEncodingStream object and associate /// it with the given streamingSocket for TCP/IP-based @@ -57,33 +57,33 @@ public class XdrTcpEncodingStream : XdrEncodingStream /// outgoing XDR data. /// /// - public XdrTcpEncodingStream(Socket socket, int bufferSize) + public XdrTcpEncodingStream(Socket socket, int bufferSize) { this.socket = socket; - stream = new NetworkStream(socket); - // - // If the given buffer size is too small, start with a more sensible - // size. Next, if bufferSize is not a multiple of four, round it up to - // the next multiple of four. - // - if (bufferSize < 1024) - { - bufferSize = 1024; - } - if ((bufferSize & 3) != 0) - { - bufferSize = (bufferSize + 4) & ~3; - } - // - // Set up the buffer and the buffer pointers (no, this is still - // Java). - // - buffer = new byte[bufferSize]; - bufferFragmentHeaderIndex = 0; - bufferIndex = 4; - bufferHighmark = bufferSize - 4; - } - + stream = new NetworkStream(socket); + // + // If the given buffer size is too small, start with a more sensible + // size. Next, if bufferSize is not a multiple of four, round it up to + // the next multiple of four. + // + if (bufferSize < 1024) + { + bufferSize = 1024; + } + if ((bufferSize & 3) != 0) + { + bufferSize = (bufferSize + 4) & ~3; + } + // + // Set up the buffer and the buffer pointers (no, this is still + // Java). + // + buffer = new byte[bufferSize]; + bufferFragmentHeaderIndex = 0; + bufferIndex = 4; + bufferHighmark = bufferSize - 4; + } + /// Returns the Internet address of the sender of the current XDR data. /// /// Returns the Internet address of the sender of the current XDR data. @@ -94,11 +94,11 @@ public XdrTcpEncodingStream(Socket socket, int bufferSize) /// otherwise it might return stale information. /// /// InetAddress of the sender of the current XDR data. - public virtual IPAddress getSenderAddress() + public virtual IPAddress getSenderAddress() { return ((IPEndPoint)(socket.RemoteEndPoint)).Address; - } - + } + /// Returns the port number of the sender of the current XDR data. /// /// Returns the port number of the sender of the current XDR data. @@ -109,11 +109,11 @@ public virtual IPAddress getSenderAddress() /// otherwise it might return stale information. /// /// Port number of the sender of the current XDR data. - public virtual int getSenderPort() + public virtual int getSenderPort() { return ((IPEndPoint)(socket.RemoteEndPoint)).Port; - } - + } + /// Begins encoding a new XDR record. /// /// Begins encoding a new XDR record. This typically involves resetting this @@ -128,20 +128,20 @@ public virtual int getSenderPort() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void beginEncoding(IPAddress receiverAddress, int receiverPort - ) - { - } - - // - // Begin encoding with the four byte word after the fragment header, - // which also four bytes wide. We have to remember where we can find - // the fragment header as we support batching/pipelining calls, so - // several requests (each in its own fragment) can be simultaneously - // in the write buffer. - // - //bufferFragmentHeaderIndex = bufferIndex; - //bufferIndex += 4; + public override void beginEncoding(IPAddress receiverAddress, int receiverPort + ) + { + } + + // + // Begin encoding with the four byte word after the fragment header, + // which also four bytes wide. We have to remember where we can find + // the fragment header as we support batching/pipelining calls, so + // several requests (each in its own fragment) can be simultaneously + // in the write buffer. + // + //bufferFragmentHeaderIndex = bufferIndex; + //bufferIndex += 4; /// /// Flushes this encoding XDR stream and forces any buffered output bytes /// to be written out. @@ -156,11 +156,11 @@ public override void beginEncoding(IPAddress receiverAddress, int receiverPort /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void endEncoding() - { - flush(true, false); - } - + public override void endEncoding() + { + flush(true, false); + } + /// Ends the current record fort this encoding XDR stream. /// /// Ends the current record fort this encoding XDR stream. If the parameter @@ -175,11 +175,11 @@ public override void endEncoding() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void endEncoding(bool flush) - { - this.flush(true, !flush); - } - + public virtual void endEncoding(bool flush) + { + this.flush(true, !flush); + } + /// /// Flushes the current contents of the buffer as one fragment to the /// network. @@ -200,57 +200,57 @@ public virtual void endEncoding(bool flush) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - private void flush(bool lastFragment, bool batch) - { - // - // Encode the fragment header. We have to take batching/pipelining - // into account, so multiple complete fragments may be waiting in - // the same write buffer. The variable bufferFragmentHeaderIndex - // points to the place where we should store this fragment's header. - // - int fragmentLength = bufferIndex - bufferFragmentHeaderIndex - 4; - if (lastFragment) - { - fragmentLength |= unchecked((int)(0x80000000)); - } - buffer[bufferFragmentHeaderIndex] = (byte)((fragmentLength) >> (24 & 0x1f)); - buffer[bufferFragmentHeaderIndex + 1] = (byte)((fragmentLength) >> (16 & 0x1f)); - buffer[bufferFragmentHeaderIndex + 2] = (byte)((fragmentLength) >> (8 & 0x1f)); - buffer[bufferFragmentHeaderIndex + 3] = (byte)fragmentLength; - if (!lastFragment || !batch || (bufferIndex >= bufferHighmark)) - { - // buffer is full, so we have to flush - // buffer not full, but last fragment and not in batch - // not enough space for next - // fragment header and one int - // - // Finally write the buffer's contents into the vastness of - // network space. This has to be done when we do not need to - // pipeline calls and if there is still enough space left in - // the buffer for the fragment header and at least a single - // int. - // + private void flush(bool lastFragment, bool batch) + { + // + // Encode the fragment header. We have to take batching/pipelining + // into account, so multiple complete fragments may be waiting in + // the same write buffer. The variable bufferFragmentHeaderIndex + // points to the place where we should store this fragment's header. + // + int fragmentLength = bufferIndex - bufferFragmentHeaderIndex - 4; + if (lastFragment) + { + fragmentLength |= unchecked((int)(0x80000000)); + } + buffer[bufferFragmentHeaderIndex] = (byte)((fragmentLength) >> (24 & 0x1f)); + buffer[bufferFragmentHeaderIndex + 1] = (byte)((fragmentLength) >> (16 & 0x1f)); + buffer[bufferFragmentHeaderIndex + 2] = (byte)((fragmentLength) >> (8 & 0x1f)); + buffer[bufferFragmentHeaderIndex + 3] = (byte)fragmentLength; + if (!lastFragment || !batch || (bufferIndex >= bufferHighmark)) + { + // buffer is full, so we have to flush + // buffer not full, but last fragment and not in batch + // not enough space for next + // fragment header and one int + // + // Finally write the buffer's contents into the vastness of + // network space. This has to be done when we do not need to + // pipeline calls and if there is still enough space left in + // the buffer for the fragment header and at least a single + // int. + // stream.Write(buffer, 0, bufferIndex); - stream.Flush(); - // - // Reset write pointer after the fragment header int within - // buffer, so the next bunch of data can be encoded. - // - bufferFragmentHeaderIndex = 0; - bufferIndex = 4; - } - else - { - // - // Batch/pipeline several consecuting XDR records. So do not - // flush the buffer yet to the network but instead wait for more - // data. - // - bufferFragmentHeaderIndex = bufferIndex; - bufferIndex += 4; - } - } - + stream.Flush(); + // + // Reset write pointer after the fragment header int within + // buffer, so the next bunch of data can be encoded. + // + bufferFragmentHeaderIndex = 0; + bufferIndex = 4; + } + else + { + // + // Batch/pipeline several consecuting XDR records. So do not + // flush the buffer yet to the network but instead wait for more + // data. + // + bufferFragmentHeaderIndex = bufferIndex; + bufferIndex += 4; + } + } + /// /// Closes this encoding XDR stream and releases any system resources /// associated with this stream. @@ -264,12 +264,12 @@ private void flush(bool lastFragment, bool batch) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void Close() - { - buffer = null; - socket = null; - } - + public override void Close() + { + buffer = null; + socket = null; + } + /// /// Encodes (aka "serializes") a "XDR int" value and writes it down a /// XDR stream. @@ -283,23 +283,23 @@ public override void Close() /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void xdrEncodeInt(int value) - { - if (bufferIndex > bufferHighmark) - { - flush(false, false); - } - // - // There's enough space in the buffer, so encode this int as - // four bytes (french octets) in big endian order (that is, the - // most significant byte comes first. - // - buffer[bufferIndex++] = (byte)((value) >> (24 & 0x1f)); - buffer[bufferIndex++] = (byte)((value) >> (16 & 0x1f)); - buffer[bufferIndex++] = (byte)((value) >> (8 & 0x1f)); - buffer[bufferIndex++] = (byte)value; - } - + public override void xdrEncodeInt(int value) + { + if (bufferIndex > bufferHighmark) + { + flush(false, false); + } + // + // There's enough space in the buffer, so encode this int as + // four bytes (french octets) in big endian order (that is, the + // most significant byte comes first. + // + buffer[bufferIndex++] = (byte)((value) >> (24 & 0x1f)); + buffer[bufferIndex++] = (byte)((value) >> (16 & 0x1f)); + buffer[bufferIndex++] = (byte)((value) >> (8 & 0x1f)); + buffer[bufferIndex++] = (byte)value; + } + /// /// Encodes (aka "serializes") a XDR opaque value, which is represented /// by a vector of byte values, and starts at offset with a @@ -317,42 +317,42 @@ public override void xdrEncodeInt(int value) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public override void xdrEncodeOpaque(byte[] value, int offset, int length) - { - int padding = (4 - (length & 3)) & 3; - int toCopy; - while (length > 0) - { - toCopy = bufferHighmark - bufferIndex + 4; - if (toCopy >= length) - { - // - // The buffer has more free space than we need. So copy the - // bytes and leave the stage. - // - System.Array.Copy(value, offset, buffer, bufferIndex, length); - bufferIndex += length; - // No need to adjust "offset", because this is the last round. - break; - } - else - { - // - // We need to copy more data than currently available from our - // buffer, so we copy all we can get our hands on, then fill - // the buffer again and repeat this until we got all we want. - // - System.Array.Copy(value, offset, buffer, bufferIndex, toCopy); - bufferIndex += toCopy; - offset += toCopy; - length -= toCopy; - flush(false, false); - } - } - System.Array.Copy(paddingZeros, 0, buffer, bufferIndex, padding); - bufferIndex += padding; - } - + public override void xdrEncodeOpaque(byte[] value, int offset, int length) + { + int padding = (4 - (length & 3)) & 3; + int toCopy; + while (length > 0) + { + toCopy = bufferHighmark - bufferIndex + 4; + if (toCopy >= length) + { + // + // The buffer has more free space than we need. So copy the + // bytes and leave the stage. + // + System.Array.Copy(value, offset, buffer, bufferIndex, length); + bufferIndex += length; + // No need to adjust "offset", because this is the last round. + break; + } + else + { + // + // We need to copy more data than currently available from our + // buffer, so we copy all we can get our hands on, then fill + // the buffer again and repeat this until we got all we want. + // + System.Array.Copy(value, offset, buffer, bufferIndex, toCopy); + bufferIndex += toCopy; + offset += toCopy; + length -= toCopy; + flush(false, false); + } + } + System.Array.Copy(paddingZeros, 0, buffer, bufferIndex, padding); + bufferIndex += padding; + } + /// /// The streaming socket to be used when receiving this XDR stream's /// buffer contents. @@ -361,12 +361,12 @@ public override void xdrEncodeOpaque(byte[] value, int offset, int length) /// The streaming socket to be used when receiving this XDR stream's /// buffer contents. /// - private Socket socket; - + private Socket socket; + /// The output stream used to get rid of bytes going off to the network. /// The output stream used to get rid of bytes going off to the network. - internal Stream stream; - + internal Stream stream; + /// /// The buffer which will be filled from the datagram socket and then /// be used to supply the information when decoding data. @@ -375,22 +375,22 @@ public override void xdrEncodeOpaque(byte[] value, int offset, int length) /// The buffer which will be filled from the datagram socket and then /// be used to supply the information when decoding data. /// - private byte[] buffer; - + private byte[] buffer; + /// The write pointer is an index into the buffer. /// The write pointer is an index into the buffer. - private int bufferIndex; - + private int bufferIndex; + /// Index of the last four byte word in the buffer. /// Index of the last four byte word in the buffer. - private int bufferHighmark; - + private int bufferHighmark; + /// Index of fragment header within buffer. /// Index of fragment header within buffer. - private int bufferFragmentHeaderIndex; - + private int bufferFragmentHeaderIndex; + /// Some zeros, only needed for padding -- like in real life. /// Some zeros, only needed for padding -- like in real life. - private static readonly byte[] paddingZeros = new byte[] { 0, 0, 0, 0 }; + private static readonly byte[] paddingZeros = new byte[] { 0, 0, 0, 0 }; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrUdpDecodingStream.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrUdpDecodingStream.cs similarity index 100% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrUdpDecodingStream.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrUdpDecodingStream.cs diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrUdpEncodingStream.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrUdpEncodingStream.cs similarity index 100% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrUdpEncodingStream.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrUdpEncodingStream.cs diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrUnion.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrUnion.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrUnion.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrUnion.cs index 9abd059..e693ce9 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrUnion.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrUnion.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// The abstract base class XdrUnion helps (de-)serializing /// polymorphic classes. @@ -69,8 +69,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public abstract class XdrUnion : org.acplt.oncrpc.XdrAble - { + public abstract class XdrUnion : org.acplt.oncrpc.XdrAble + { /// /// Returns the so-called type code which identifies a derived class when /// encoded or decoded. @@ -88,8 +88,8 @@ public abstract class XdrUnion : org.acplt.oncrpc.XdrAble /// Type code identifying an object's class when encoding or /// decoding the object into or from a XDR stream. /// - public abstract int getXdrTypeCode(); - + public abstract int getXdrTypeCode(); + /// /// Encodes -- that is: serializes -- an object into a XDR stream in /// compliance to RFC 1832. @@ -101,19 +101,19 @@ public abstract class XdrUnion : org.acplt.oncrpc.XdrAble /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - // - // For historial reasons (read: "for dumb and pure idiotic reasons") - // and compatibility with the ACPLT/KS C++ Communication Library we - // encode/decode the variant part *first* before encoding/decoding - // the common part. - // - xdr.xdrEncodeInt(getXdrTypeCode()); - xdrEncodeVariant(xdr); - xdrEncodeCommon(xdr); - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + // + // For historial reasons (read: "for dumb and pure idiotic reasons") + // and compatibility with the ACPLT/KS C++ Communication Library we + // encode/decode the variant part *first* before encoding/decoding + // the common part. + // + xdr.xdrEncodeInt(getXdrTypeCode()); + xdrEncodeVariant(xdr); + xdrEncodeCommon(xdr); + } + /// /// Decodes -- that is: deserializes -- an object from a XDR stream in /// compliance to RFC 1832. @@ -125,28 +125,28 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - // - // Make sure that when deserializing this object's state that - // the stream provides state information indeed intended for this - // particular class. - // - int xdrTypeCode = xdr.xdrDecodeInt(); - if (xdrTypeCode != getXdrTypeCode()) - { - throw (new System.Exception(this.GetType().Name + "non-matching XDR type code received.")); - } - // - // For historial reasons (read: "for dumb and pure idiotic reasons") - // and compatibility with the ACPLT/KS C++ Communication Library we - // encode/decode the variant part *first* before encoding/decoding - // the common part. - // - xdrDecodeVariant(xdr); - xdrDecodeCommon(xdr); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + // + // Make sure that when deserializing this object's state that + // the stream provides state information indeed intended for this + // particular class. + // + int xdrTypeCode = xdr.xdrDecodeInt(); + if (xdrTypeCode != getXdrTypeCode()) + { + throw (new System.Exception(this.GetType().Name + "non-matching XDR type code received.")); + } + // + // For historial reasons (read: "for dumb and pure idiotic reasons") + // and compatibility with the ACPLT/KS C++ Communication Library we + // encode/decode the variant part *first* before encoding/decoding + // the common part. + // + xdrDecodeVariant(xdr); + xdrDecodeCommon(xdr); + } + /// /// Encodes -- that is: serializes -- the common part of an object into /// a XDR stream in compliance to RFC 1832. @@ -159,8 +159,8 @@ public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public abstract void xdrEncodeCommon(org.acplt.oncrpc.XdrEncodingStream xdr); - + public abstract void xdrEncodeCommon(org.acplt.oncrpc.XdrEncodingStream xdr); + /// /// Decodes -- that is: deserializes -- the common part of an object from /// a XDR stream in compliance to RFC 1832. @@ -173,8 +173,8 @@ public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public abstract void xdrDecodeCommon(org.acplt.oncrpc.XdrDecodingStream xdr); - + public abstract void xdrDecodeCommon(org.acplt.oncrpc.XdrDecodingStream xdr); + /// /// Encodes -- that is: serializes -- the variant part of an object into /// a XDR stream in compliance to RFC 1832. @@ -187,8 +187,8 @@ public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public abstract void xdrEncodeVariant(org.acplt.oncrpc.XdrEncodingStream xdr); - + public abstract void xdrEncodeVariant(org.acplt.oncrpc.XdrEncodingStream xdr); + /// /// Decodes -- that is: deserializes -- the variant part of an object from /// a XDR stream in compliance to RFC 1832. @@ -201,6 +201,6 @@ public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public abstract void xdrDecodeVariant(org.acplt.oncrpc.XdrDecodingStream xdr); + public abstract void xdrDecodeVariant(org.acplt.oncrpc.XdrDecodingStream xdr); } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/XdrVoid.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrVoid.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/XdrVoid.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/XdrVoid.cs index 23e5460..baaace9 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/XdrVoid.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/XdrVoid.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc -{ +{ /// /// Instances of the class XdrVoid represent (de-)serializeable /// voids, which are especially useful in cases where no result is expected @@ -43,8 +43,8 @@ namespace org.acplt.oncrpc /// /// Harald Albrecht /// Jay Walters - public class XdrVoid : org.acplt.oncrpc.XdrAble - { + public class XdrVoid : org.acplt.oncrpc.XdrAble + { /// /// Encodes -- that is: serializes -- a void into a XDR stream in /// compliance to RFC 1832. @@ -56,10 +56,10 @@ public class XdrVoid : org.acplt.oncrpc.XdrAble /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + } + /// /// Decodes -- that is: deserializes -- a void from a XDR stream in /// compliance to RFC 1832. @@ -71,10 +71,10 @@ public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) /// if an ONC/RPC error occurs. /// if an I/O error occurs. /// - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + } + /// /// Static XdrVoid instance, which can be used in cases /// where no data is to be serialized or deserialized but some ONC/RPC @@ -85,7 +85,7 @@ public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) /// where no data is to be serialized or deserialized but some ONC/RPC /// function expects a reference to a XDR-able object. /// - public static readonly org.acplt.oncrpc.XdrVoid XDR_VOID = new org.acplt.oncrpc.XdrVoid - (); + public static readonly org.acplt.oncrpc.XdrVoid XDR_VOID = new org.acplt.oncrpc.XdrVoid + (); } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/OncRpcEmbeddedPortmap.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/OncRpcEmbeddedPortmap.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/OncRpcEmbeddedPortmap.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/OncRpcEmbeddedPortmap.cs index ffa0f8b..c2f106b 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/OncRpcEmbeddedPortmap.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/OncRpcEmbeddedPortmap.cs @@ -27,9 +27,9 @@ using System.IO; using System.Net; using System.Threading; - + namespace org.acplt.oncrpc.apps.jportmap -{ +{ /// /// The class OncRpcEmbeddedPortmap provides an embeddable /// portmap service, which is automatically started in its own thread if @@ -46,8 +46,8 @@ namespace org.acplt.oncrpc.apps.jportmap /// $Revision: 1.2 $ $Date: 2003/08/14 08:00:08 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class OncRpcEmbeddedPortmap - { + public class OncRpcEmbeddedPortmap + { /// /// Constructs an embeddable portmap service of class /// OncRpcEmbeddedPortmap and starts the service if no @@ -65,10 +65,10 @@ public class OncRpcEmbeddedPortmap /// embeddedPortmapInUse() /// /// - public OncRpcEmbeddedPortmap() : this(3000) - { - } - + public OncRpcEmbeddedPortmap() : this(3000) + { + } + /// /// Constructs an embeddable portmap service of class /// OncRpcEmbeddedPortmap and starts the service if no @@ -88,20 +88,20 @@ public OncRpcEmbeddedPortmap() : this(3000) /// embeddedPortmapInUse() /// /// - public OncRpcEmbeddedPortmap(int checkTimeout) - { - if (!isPortmapRunning(checkTimeout)) - { - embeddedPortmap = new OncRpcEmbeddedPortmap.embeddedjportmap - (this); - embeddedPortmapThread = new OncRpcEmbeddedPortmap.OncRpcEmbeddedPortmapThread + public OncRpcEmbeddedPortmap(int checkTimeout) + { + if (!isPortmapRunning(checkTimeout)) + { + embeddedPortmap = new OncRpcEmbeddedPortmap.embeddedjportmap + (this); + embeddedPortmapThread = new OncRpcEmbeddedPortmap.OncRpcEmbeddedPortmapThread (this, embeddedPortmap); embeddedPortmap.serviceThread = new Thread(new ThreadStart(embeddedPortmapThread.run)); embeddedPortmap.serviceThread.Name = "Embedded Portmap Service Thread"; - embeddedPortmap.serviceThread.Start(); - } - } - + embeddedPortmap.serviceThread.Start(); + } + } + /// /// Indicates whether a portmap service (regardless whether it's supplied /// by the operating system or an embedded portmap service) is currently @@ -117,11 +117,11 @@ public OncRpcEmbeddedPortmap(int checkTimeout) /// true, if a portmap service (either external or /// embedded) is running and can be contacted. /// - public static bool isPortmapRunning() - { - return isPortmapRunning(3000); - } - + public static bool isPortmapRunning() + { + return isPortmapRunning(3000); + } + /// /// Indicates whether a portmap service (regardless whether it's supplied /// by the operating system or an embedded portmap service) is currently @@ -140,64 +140,64 @@ public static bool isPortmapRunning() /// true, if a portmap service (either external or /// embedded) is running and can be contacted. /// - public static bool isPortmapRunning(int checkTimeout) - { - bool available = false; - try - { - OncRpcPortmapClient portmap = new OncRpcPortmapClient(IPAddress.Loopback); - portmap.getOncRpcClient().setTimeout(checkTimeout); - portmap.ping(); - available = true; - } - catch (OncRpcException) + public static bool isPortmapRunning(int checkTimeout) + { + bool available = false; + try + { + OncRpcPortmapClient portmap = new OncRpcPortmapClient(IPAddress.Loopback); + portmap.getOncRpcClient().setTimeout(checkTimeout); + portmap.ping(); + available = true; + } + catch (OncRpcException) { // We get noise from here if the portmapper is down //Console.Out.WriteLine(e.Message); //Console.Out.WriteLine(e.StackTrace); - } - catch (IOException) + } + catch (IOException) { // We get noise from here if the portmapper is down //Console.Out.WriteLine(e.Message); //Console.Out.WriteLine(e.StackTrace); - } - return available; - } - + } + return available; + } + /// Indicates whether the embedded portmap service is in use. /// Indicates whether the embedded portmap service is in use. /// /// true, if embedded portmap service is currently /// used. /// - public virtual bool embeddedPortmapInUse() - { - return embeddedPortmap.serviceThread != null; - } - + public virtual bool embeddedPortmapInUse() + { + return embeddedPortmap.serviceThread != null; + } + /// Returns the thread object running the embedded portmap service. /// Returns the thread object running the embedded portmap service. /// /// Thread object or null if no embedded portmap /// service has been started. /// - public virtual Thread getEmbeddedPortmapServiceThread() - { - return embeddedPortmap.serviceThread; - } - + public virtual Thread getEmbeddedPortmapServiceThread() + { + return embeddedPortmap.serviceThread; + } + /// Returns object implementing the embedded portmap service. /// Returns object implementing the embedded portmap service. /// /// Embedded portmap object or null if no /// embedded portmap service has been started. /// - public virtual jportmap getEmbeddedPortmap() - { - return embeddedPortmap; - } - + public virtual jportmap getEmbeddedPortmap() + { + return embeddedPortmap; + } + /// Stop the embedded portmap service if it is running. /// /// Stop the embedded portmap service if it is running. Normaly you should @@ -209,15 +209,15 @@ public virtual jportmap getEmbeddedPortmap() /// just signals the portmap thread to stop processing ONC/RPC portmap /// calls and to terminate itself after it has cleaned up after itself. /// - public virtual void shutdown() - { - OncRpcServerStub portmap = embeddedPortmap; - if (portmap != null) - { - portmap.stopRpcProcessing(); - } - } - + public virtual void shutdown() + { + OncRpcServerStub portmap = embeddedPortmap; + if (portmap != null) + { + portmap.stopRpcProcessing(); + } + } + /// /// Portmap object acting as embedded portmap service or null /// if no embedded portmap service is necessary because the operating @@ -228,12 +228,12 @@ public virtual void shutdown() /// if no embedded portmap service is necessary because the operating /// system already supplies one or another portmapper is already running. /// - internal OncRpcEmbeddedPortmap.embeddedjportmap embeddedPortmap; - + internal OncRpcEmbeddedPortmap.embeddedjportmap embeddedPortmap; + /// References thread object running the embedded portmap service. /// References thread object running the embedded portmap service. - internal OncRpcEmbeddedPortmapThread embeddedPortmapThread; - + internal OncRpcEmbeddedPortmapThread embeddedPortmapThread; + /// /// Extend the portmap service so that it automatically takes itself out /// of service when the last ONC/RPC programs is deregistered. @@ -242,21 +242,21 @@ public virtual void shutdown() /// Extend the portmap service so that it automatically takes itself out /// of service when the last ONC/RPC programs is deregistered. /// - public class embeddedjportmap : org.acplt.oncrpc.apps.jportmap.jportmap - { + public class embeddedjportmap : org.acplt.oncrpc.apps.jportmap.jportmap + { /// Creates a new instance of an embeddable portmap service. /// Creates a new instance of an embeddable portmap service. /// /// - public embeddedjportmap(OncRpcEmbeddedPortmap _enclosing) - { - this._enclosing = _enclosing; - } - + public embeddedjportmap(OncRpcEmbeddedPortmap _enclosing) + { + this._enclosing = _enclosing; + } + /// Thread running the embedded portmap service. /// Thread running the embedded portmap service. - public Thread serviceThread; - + public Thread serviceThread; + /// /// Deregister all port settings for a particular (program, version) for /// all transports (TCP, UDP, ...). @@ -273,39 +273,39 @@ public embeddedjportmap(OncRpcEmbeddedPortmap _enclosing) /// fields are not used. /// /// true if deregistration succeeded. - internal override XdrBoolean unsetPort(OncRpcServerIdent @params) - { - XdrBoolean ok = base.unsetPort(@params); - if (ok.booleanValue()) - { - // - // Check for registered programs other than PMAP_PROGRAM. - // - bool onlyPmap = true; - int size = this.servers.Count; - for (int idx = 0; idx < size; ++idx) - { - if (((OncRpcServerIdent)this.servers[idx]).program != jportmap.PMAP_PROGRAM) - { - onlyPmap = false; - break; - } - } - // - // If only portmap-related entries are left, then shut down this - // portmap service. - // - if (onlyPmap && (this.serviceThread != null)) - { - this.stopRpcProcessing(); - } - } - return ok; - } - - private readonly OncRpcEmbeddedPortmap _enclosing; - } - + internal override XdrBoolean unsetPort(OncRpcServerIdent @params) + { + XdrBoolean ok = base.unsetPort(@params); + if (ok.booleanValue()) + { + // + // Check for registered programs other than PMAP_PROGRAM. + // + bool onlyPmap = true; + int size = this.servers.Count; + for (int idx = 0; idx < size; ++idx) + { + if (((OncRpcServerIdent)this.servers[idx]).program != jportmap.PMAP_PROGRAM) + { + onlyPmap = false; + break; + } + } + // + // If only portmap-related entries are left, then shut down this + // portmap service. + // + if (onlyPmap && (this.serviceThread != null)) + { + this.stopRpcProcessing(); + } + } + return ok; + } + + private readonly OncRpcEmbeddedPortmap _enclosing; + } + /// /// The class OncRpcEmbeddedPortmapThread implements a thread /// which will run an embedded portmap service. @@ -314,8 +314,8 @@ internal override XdrBoolean unsetPort(OncRpcServerIdent @params) /// The class OncRpcEmbeddedPortmapThread implements a thread /// which will run an embedded portmap service. /// - public class OncRpcEmbeddedPortmapThread - { + public class OncRpcEmbeddedPortmapThread + { /// /// Construct a new embedded portmap service thread and associate /// it with the portmap object to be used as the service. @@ -325,13 +325,13 @@ public class OncRpcEmbeddedPortmapThread /// it with the portmap object to be used as the service. The service /// is not started yet. /// - public OncRpcEmbeddedPortmapThread(OncRpcEmbeddedPortmap _enclosing, OncRpcEmbeddedPortmap.embeddedjportmap - portmap) - { - this._enclosing = _enclosing; - this.portmap = portmap; - } - + public OncRpcEmbeddedPortmapThread(OncRpcEmbeddedPortmap _enclosing, OncRpcEmbeddedPortmap.embeddedjportmap + portmap) + { + this._enclosing = _enclosing; + this.portmap = portmap; + } + /// /// Run the embedded portmap service thread, starting dispatching /// of all portmap transports until we get the signal to shut down. @@ -340,10 +340,10 @@ public OncRpcEmbeddedPortmapThread(OncRpcEmbeddedPortmap _enclosing, OncRpcEmbed /// Run the embedded portmap service thread, starting dispatching /// of all portmap transports until we get the signal to shut down. /// - public void run() - { - try - { + public void run() + { + try + { this.portmap.run(this.portmap.transports); // This is not optimal but we need enough time after we remove the entry // from the portmap to respond ok to the client and I haven't figured out @@ -351,23 +351,23 @@ public void run() Thread.Sleep(1000); this.portmap.Close(this.portmap.transports); this.portmap.serviceThread = null; - } - catch (Exception e) + } + catch (Exception e) { Console.Out.WriteLine(e.Message); - Console.Out.WriteLine(e.StackTrace); - } - } - + Console.Out.WriteLine(e.StackTrace); + } + } + /// The embedded portmap service object this thread belongs to. /// /// The embedded portmap service object this thread belongs to. The /// service object implements the ONC/RPC dispatcher and the individual /// remote procedures for a portmapper). /// - private OncRpcEmbeddedPortmap.embeddedjportmap portmap; - - private readonly OncRpcEmbeddedPortmap _enclosing; - } + private OncRpcEmbeddedPortmap.embeddedjportmap portmap; + + private readonly OncRpcEmbeddedPortmap _enclosing; + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/jportmap.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/jportmap.cs similarity index 97% rename from NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/jportmap.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/jportmap.cs index bcada70..150e482 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/jportmap.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/apps/jportmap/jportmap.cs @@ -1,456 +1,456 @@ -/* - * $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/XdrVoid.java,v 1.1.1.1 2003/08/13 12:03:41 haraldalbrecht Exp $ - * - * Copyright (c) 1999, 2000 - * Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen - * D-52064 Aachen, Germany. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this program (see the file COPYING.LIB for more - * details); if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -using org.acplt.oncrpc.server; -using System.Net; -using System.Net.Sockets; - -namespace org.acplt.oncrpc.apps.jportmap -{ - /// - /// The class jportmap implements a Java-based ONC/RPC port mapper, - /// speaking the widely deployed protocol version 2. - /// - /// - /// The class jportmap implements a Java-based ONC/RPC port mapper, - /// speaking the widely deployed protocol version 2. - ///

This class can be either used stand-alone (a static main is - /// provided for this purpose) or as part of an application. In this case you - /// should check first for another portmap already running before starting your - /// own one. - /// Converted to C# using the db4o Sharpen tool. - /// - /// $Revision: 1.2 $ $Date: 2003/08/14 11:26:50 $ $State: Exp $ $Locker: $ - /// Harald Albrecht - /// Jay Walters - public class jportmap : OncRpcServerStub, OncRpcDispatchable - { - ///

- /// Create a new portmap instance, create the transport registration - /// information and UDP and TCP-based transports, which will be bound - /// later to port 111. - /// - /// - /// Create a new portmap instance, create the transport registration - /// information and UDP and TCP-based transports, which will be bound - /// later to port 111. The constructor does not start the dispatcher loop. - /// - /// - /// - public jportmap() - { - // - // We only need to register one {progam, version}. - // - info = new org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] { new - org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo(PMAP_PROGRAM, PMAP_VERSION - ) }; - // - // We support both UDP and TCP-based transports for ONC/RPC portmap - // calls, and these transports are bound to the well-known port 111. - // - transports = new org.acplt.oncrpc.server.OncRpcServerTransport[] { new org.acplt.oncrpc.server.OncRpcUdpServerTransport - (this, PMAP_PORT, info, 32768), new org.acplt.oncrpc.server.OncRpcTcpServerTransport - (this, PMAP_PORT, info, 32768) }; - // - // Finally, we add ourself to the list of registered ONC/RPC servers. - // This is just a convenience. - // - servers.Add(new org.acplt.oncrpc.OncRpcServerIdent(PMAP_PROGRAM, PMAP_VERSION, org.acplt.oncrpc.OncRpcProtocols - .ONCRPC_TCP, PMAP_PORT)); - servers.Add(new org.acplt.oncrpc.OncRpcServerIdent(PMAP_PROGRAM, PMAP_VERSION, org.acplt.oncrpc.OncRpcProtocols - .ONCRPC_UDP, PMAP_PORT)); - // - // Determine all local IP addresses assigned to this host. - // Once again, take care of broken JDKs, which can not handle - // InetAdress.getLocalHost() properly. Sigh. - // - try - { - IPAddress loopback = IPAddress.Loopback; - - // Get host name - string strHostName = Dns.GetHostName(); - IPAddress[] addrs = Dns.GetHostAddresses(strHostName); - // - // Check whether the loopback address is already included in - // the address list for this host. If not, add it to the list. - // - bool loopbackIncluded = false; - for (int idx = 0; idx < addrs.Length; ++idx) - { - if (addrs[idx].Equals(loopback)) - { - loopbackIncluded = true; - break; - } - } - if (loopbackIncluded) - { - locals = addrs; - } - else - { - locals = new IPAddress[addrs.Length + 1]; - locals[0] = loopback; - System.Array.Copy(addrs, 0, locals, 1, addrs.Length); - } - } - catch (SocketException) - { - // jmw need to debug this and see if it's the right exception to catch here - // - // Trouble getting all addresses for this host (which might - // have been caused by some dumb security manager -- yeah, as - // if managers were not dumb by definition), so fall back to - // allowing only the loopback address. - // - locals = new IPAddress[1]; - locals[0] = IPAddress.Loopback; - } - } - - /// Lookup port for (program, version, protocol). - /// - /// Lookup port for (program, version, protocol). If no suitable - /// registration entry if found and an entry with another version, but the - /// same program and version number is found, this is returned instead. - /// This is compatible with the way Sun's portmap implementation works. - /// - /// - /// server identification (program, version, protocol) to - /// look up. The port field is not used. - /// - /// - /// port number where server listens for incomming ONC/RPC calls, - /// or 0, if no server is registered for (program, protocol). - /// - internal virtual OncRpcGetPortResult getPort(org.acplt.oncrpc.OncRpcServerIdent - @params) - { - org.acplt.oncrpc.OncRpcServerIdent ident = null; - org.acplt.oncrpc.OncRpcGetPortResult result = new org.acplt.oncrpc.OncRpcGetPortResult - (); - int size = servers.Count; - for (int idx = 0; idx < size; ++idx) - { - org.acplt.oncrpc.OncRpcServerIdent svr = (org.acplt.oncrpc.OncRpcServerIdent)servers - [idx]; - if ((svr.program == @params.program) && (svr.protocol == @params.protocol)) - { - // - // (program, protocol) already matches. If it has the same - // version, then we're done. Otherwise we remember this - // entry for possible later usage and search further through - // the list. - // - if (svr.version == @params.version) - { - result.port = svr.port; - return result; - } - ident = svr; - } - } - // - // Return port of "best" match, if one was found at all, otherwise - // just return 0, which indicates an invalid UDP/TCP port. - // - if (ident == null) - { - result.port = 0; - } - else - { - result.port = ident.port; - } - return result; - } - - /// Register a port number for a particular (program, version, protocol). - /// - /// Register a port number for a particular (program, version, protocol). - /// Note that a caller can not register the same (program, version, - /// protocol) for another port. In this case we return false. Thus, a - /// caller first needs to deregister any old entries which it whishes to - /// update. Always add new registration entries to the end of the list - /// (vector). - /// - /// (program, version, protocol, port) to register. - /// true if registration succeeded. - internal virtual XdrBoolean setPort(org.acplt.oncrpc.OncRpcServerIdent - @params) - { - if (@params.program != PMAP_PROGRAM) - { - // - // Only accept registration attempts for anything other than - // the portmapper. We do not want clients to play tricks on us. - // - int size = servers.Count; - for (int idx = 0; idx < size; ++idx) - { - org.acplt.oncrpc.OncRpcServerIdent svr = (org.acplt.oncrpc.OncRpcServerIdent)servers - [idx]; - if ((svr.program == @params.program) && (svr.version == @params.version) && (svr. - protocol == @params.protocol)) - { - // - // In case (program, version, protocol) is already - // registered only accept, if the port stays the same. - // This will silently accept double registrations (i.e., - // due to duplicated UDP calls). - // - return new org.acplt.oncrpc.XdrBoolean(svr.port == @params.port); - } - } - // - // Add new registration entry to end of the list. - // - servers.Add(@params); - return new org.acplt.oncrpc.XdrBoolean(true); - } - return new org.acplt.oncrpc.XdrBoolean(false); - } - - /// - /// Deregister all port settings for a particular (program, version) for - /// all transports (TCP, UDP, ...). - /// - /// - /// Deregister all port settings for a particular (program, version) for - /// all transports (TCP, UDP, ...). While these are strange semantics, - /// they are compatible with Sun's portmap implementation. - /// - /// - /// (program, version) to deregister. The protocol and port - /// fields are not used. - /// - /// true if deregistration succeeded. - internal virtual XdrBoolean unsetPort(org.acplt.oncrpc.OncRpcServerIdent - @params) - { - bool ok = false; - if (@params.program != PMAP_PROGRAM) - { - // - // Only allow clients to deregister ONC/RPC servers other than - // the portmap entries. - // - int size = servers.Count; - for (int idx = size - 1; idx >= 0; --idx) - { - org.acplt.oncrpc.OncRpcServerIdent svr = (org.acplt.oncrpc.OncRpcServerIdent)servers - [idx]; - if ((svr.program == @params.program) && (svr.version == @params.version)) - { - servers.RemoveAt(idx); - ok = true; - } - } - } - return new org.acplt.oncrpc.XdrBoolean(ok); - } - - /// Return list of registered ONC/RPC servers. - /// Return list of registered ONC/RPC servers. - /// - /// list of ONC/RPC server descriptions (program, version, - /// protocol, port). - /// - internal virtual OncRpcDumpResult listServers() - { - org.acplt.oncrpc.OncRpcDumpResult result = new org.acplt.oncrpc.OncRpcDumpResult( - ); - result.servers = servers; - return result; - } - - /// - /// Checks whether the address given belongs to one of the local - /// addresses of this host. - /// - /// - /// Checks whether the address given belongs to one of the local - /// addresses of this host. - /// - /// IP address to check. - /// - /// true if address specified belongs to one of the - /// local addresses of this host. - /// - internal virtual bool isLocalAddress(IPAddress addr) - { - int size = locals.Length; - for (int idx = 0; idx < size; ++idx) - { - if (addr.Equals(locals[idx])) - { - return true; - } - } - return false; - } - - /// Dispatch incomming ONC/RPC calls to the individual handler functions. - /// - /// Dispatch incomming ONC/RPC calls to the individual handler functions. - /// The CALLIT method is currently unimplemented. - /// - /// - /// The ONC/RPC call, with references to the transport and - /// XDR streams to use for retrieving parameters and sending replies. - /// - /// the portmap's program number, 100000 - /// the portmap's protocol version, 2 - /// the procedure to call. - /// if an ONC/RPC error occurs. - /// if an I/O error occurs. - public virtual void dispatchOncRpcCall(org.acplt.oncrpc.server.OncRpcCallInformation - call, int program, int version, int procedure) - { - // - // Make sure it's the right program and version that we can handle. - // (defensive programming) - // - if (program == PMAP_PROGRAM) - { - if (version == PMAP_VERSION) - { - switch (procedure) - { - case 0: - { - // handle NULL call. - call.retrieveCall(org.acplt.oncrpc.XdrVoid.XDR_VOID); - call.reply(org.acplt.oncrpc.XdrVoid.XDR_VOID); - break; - } - - case OncRpcPortmapServices.PMAP_GETPORT: - { - // handle port query - org.acplt.oncrpc.OncRpcServerIdent @params = new org.acplt.oncrpc.OncRpcServerIdent - (); - call.retrieveCall(@params); - org.acplt.oncrpc.OncRpcGetPortResult result = getPort(@params); - call.reply(result); - break; - } - - case OncRpcPortmapServices.PMAP_SET: - { - // handle port registration - // - // ensure that no remote client tries to register - // - OncRpcServerIdent @params = new OncRpcServerIdent - (); - call.retrieveCall(@params); - org.acplt.oncrpc.XdrBoolean result; - if (isLocalAddress(call.peerAddress)) - { - result = setPort(@params); - } - else - { - result = new XdrBoolean(false); - } - call.reply(result); - break; - } - - case OncRpcPortmapServices.PMAP_UNSET: - { - // handle port deregistration - OncRpcServerIdent @params = new OncRpcServerIdent - (); - call.retrieveCall(@params); - org.acplt.oncrpc.XdrBoolean result; - if (isLocalAddress(call.peerAddress)) - { - result = unsetPort(@params); - } - else - { - result = new XdrBoolean(false); - } - call.reply(result); - break; - } - - case OncRpcPortmapServices.PMAP_DUMP: - { - // list all registrations - call.retrieveCall(org.acplt.oncrpc.XdrVoid.XDR_VOID); - org.acplt.oncrpc.OncRpcDumpResult result = listServers(); - call.reply(result); - break; - } - - default: - { - // unknown/unimplemented procedure - call.failProcedureUnavailable(); - break; - } - } - } - else - { - call.failProgramMismatch(PMAP_VERSION, PMAP_VERSION); - } - } - else - { - call.failProgramUnavailable(); - } - } - - /// List of IP addresses assigned to this host. - /// - /// List of IP addresses assigned to this host. Will be filled later - /// by constructor. - /// - public IPAddress[] locals = null; - - /// The list of registrated servers. - /// The list of registrated servers. - public System.Collections.ArrayList servers = new System.Collections.ArrayList(); - - /// Well-known port where the portmap process can be found on Internet hosts. - /// - /// Well-known port where the portmap process can be found on Internet hosts. - /// - public const int PMAP_PORT = 111; - - /// Program number of the portmapper as defined in RFC 1832. - /// Program number of the portmapper as defined in RFC 1832. - public const int PMAP_PROGRAM = 100000; - - /// Program version number of the portmapper as defined in RFC 1832. - /// Program version number of the portmapper as defined in RFC 1832. - public const int PMAP_VERSION = 2; - } +/* + * $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/XdrVoid.java,v 1.1.1.1 2003/08/13 12:03:41 haraldalbrecht Exp $ + * + * Copyright (c) 1999, 2000 + * Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen + * D-52064 Aachen, Germany. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this program (see the file COPYING.LIB for more + * details); if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +using org.acplt.oncrpc.server; +using System.Net; +using System.Net.Sockets; + +namespace org.acplt.oncrpc.apps.jportmap +{ + /// + /// The class jportmap implements a Java-based ONC/RPC port mapper, + /// speaking the widely deployed protocol version 2. + /// + /// + /// The class jportmap implements a Java-based ONC/RPC port mapper, + /// speaking the widely deployed protocol version 2. + ///

This class can be either used stand-alone (a static main is + /// provided for this purpose) or as part of an application. In this case you + /// should check first for another portmap already running before starting your + /// own one. + /// Converted to C# using the db4o Sharpen tool. + /// + /// $Revision: 1.2 $ $Date: 2003/08/14 11:26:50 $ $State: Exp $ $Locker: $ + /// Harald Albrecht + /// Jay Walters + public class jportmap : OncRpcServerStub, OncRpcDispatchable + { + ///

+ /// Create a new portmap instance, create the transport registration + /// information and UDP and TCP-based transports, which will be bound + /// later to port 111. + /// + /// + /// Create a new portmap instance, create the transport registration + /// information and UDP and TCP-based transports, which will be bound + /// later to port 111. The constructor does not start the dispatcher loop. + /// + /// + /// + public jportmap() + { + // + // We only need to register one {progam, version}. + // + info = new org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] { new + org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo(PMAP_PROGRAM, PMAP_VERSION + ) }; + // + // We support both UDP and TCP-based transports for ONC/RPC portmap + // calls, and these transports are bound to the well-known port 111. + // + transports = new org.acplt.oncrpc.server.OncRpcServerTransport[] { new org.acplt.oncrpc.server.OncRpcUdpServerTransport + (this, PMAP_PORT, info, 32768), new org.acplt.oncrpc.server.OncRpcTcpServerTransport + (this, PMAP_PORT, info, 32768) }; + // + // Finally, we add ourself to the list of registered ONC/RPC servers. + // This is just a convenience. + // + servers.Add(new org.acplt.oncrpc.OncRpcServerIdent(PMAP_PROGRAM, PMAP_VERSION, org.acplt.oncrpc.OncRpcProtocols + .ONCRPC_TCP, PMAP_PORT)); + servers.Add(new org.acplt.oncrpc.OncRpcServerIdent(PMAP_PROGRAM, PMAP_VERSION, org.acplt.oncrpc.OncRpcProtocols + .ONCRPC_UDP, PMAP_PORT)); + // + // Determine all local IP addresses assigned to this host. + // Once again, take care of broken JDKs, which can not handle + // InetAdress.getLocalHost() properly. Sigh. + // + try + { + IPAddress loopback = IPAddress.Loopback; + + // Get host name + string strHostName = Dns.GetHostName(); + IPAddress[] addrs = Dns.GetHostAddresses(strHostName); + // + // Check whether the loopback address is already included in + // the address list for this host. If not, add it to the list. + // + bool loopbackIncluded = false; + for (int idx = 0; idx < addrs.Length; ++idx) + { + if (addrs[idx].Equals(loopback)) + { + loopbackIncluded = true; + break; + } + } + if (loopbackIncluded) + { + locals = addrs; + } + else + { + locals = new IPAddress[addrs.Length + 1]; + locals[0] = loopback; + System.Array.Copy(addrs, 0, locals, 1, addrs.Length); + } + } + catch (SocketException) + { + // jmw need to debug this and see if it's the right exception to catch here + // + // Trouble getting all addresses for this host (which might + // have been caused by some dumb security manager -- yeah, as + // if managers were not dumb by definition), so fall back to + // allowing only the loopback address. + // + locals = new IPAddress[1]; + locals[0] = IPAddress.Loopback; + } + } + + /// Lookup port for (program, version, protocol). + /// + /// Lookup port for (program, version, protocol). If no suitable + /// registration entry if found and an entry with another version, but the + /// same program and version number is found, this is returned instead. + /// This is compatible with the way Sun's portmap implementation works. + /// + /// + /// server identification (program, version, protocol) to + /// look up. The port field is not used. + /// + /// + /// port number where server listens for incomming ONC/RPC calls, + /// or 0, if no server is registered for (program, protocol). + /// + internal virtual OncRpcGetPortResult getPort(org.acplt.oncrpc.OncRpcServerIdent + @params) + { + org.acplt.oncrpc.OncRpcServerIdent ident = null; + org.acplt.oncrpc.OncRpcGetPortResult result = new org.acplt.oncrpc.OncRpcGetPortResult + (); + int size = servers.Count; + for (int idx = 0; idx < size; ++idx) + { + org.acplt.oncrpc.OncRpcServerIdent svr = (org.acplt.oncrpc.OncRpcServerIdent)servers + [idx]; + if ((svr.program == @params.program) && (svr.protocol == @params.protocol)) + { + // + // (program, protocol) already matches. If it has the same + // version, then we're done. Otherwise we remember this + // entry for possible later usage and search further through + // the list. + // + if (svr.version == @params.version) + { + result.port = svr.port; + return result; + } + ident = svr; + } + } + // + // Return port of "best" match, if one was found at all, otherwise + // just return 0, which indicates an invalid UDP/TCP port. + // + if (ident == null) + { + result.port = 0; + } + else + { + result.port = ident.port; + } + return result; + } + + /// Register a port number for a particular (program, version, protocol). + /// + /// Register a port number for a particular (program, version, protocol). + /// Note that a caller can not register the same (program, version, + /// protocol) for another port. In this case we return false. Thus, a + /// caller first needs to deregister any old entries which it whishes to + /// update. Always add new registration entries to the end of the list + /// (vector). + /// + /// (program, version, protocol, port) to register. + /// true if registration succeeded. + internal virtual XdrBoolean setPort(org.acplt.oncrpc.OncRpcServerIdent + @params) + { + if (@params.program != PMAP_PROGRAM) + { + // + // Only accept registration attempts for anything other than + // the portmapper. We do not want clients to play tricks on us. + // + int size = servers.Count; + for (int idx = 0; idx < size; ++idx) + { + org.acplt.oncrpc.OncRpcServerIdent svr = (org.acplt.oncrpc.OncRpcServerIdent)servers + [idx]; + if ((svr.program == @params.program) && (svr.version == @params.version) && (svr. + protocol == @params.protocol)) + { + // + // In case (program, version, protocol) is already + // registered only accept, if the port stays the same. + // This will silently accept double registrations (i.e., + // due to duplicated UDP calls). + // + return new org.acplt.oncrpc.XdrBoolean(svr.port == @params.port); + } + } + // + // Add new registration entry to end of the list. + // + servers.Add(@params); + return new org.acplt.oncrpc.XdrBoolean(true); + } + return new org.acplt.oncrpc.XdrBoolean(false); + } + + /// + /// Deregister all port settings for a particular (program, version) for + /// all transports (TCP, UDP, ...). + /// + /// + /// Deregister all port settings for a particular (program, version) for + /// all transports (TCP, UDP, ...). While these are strange semantics, + /// they are compatible with Sun's portmap implementation. + /// + /// + /// (program, version) to deregister. The protocol and port + /// fields are not used. + /// + /// true if deregistration succeeded. + internal virtual XdrBoolean unsetPort(org.acplt.oncrpc.OncRpcServerIdent + @params) + { + bool ok = false; + if (@params.program != PMAP_PROGRAM) + { + // + // Only allow clients to deregister ONC/RPC servers other than + // the portmap entries. + // + int size = servers.Count; + for (int idx = size - 1; idx >= 0; --idx) + { + org.acplt.oncrpc.OncRpcServerIdent svr = (org.acplt.oncrpc.OncRpcServerIdent)servers + [idx]; + if ((svr.program == @params.program) && (svr.version == @params.version)) + { + servers.RemoveAt(idx); + ok = true; + } + } + } + return new org.acplt.oncrpc.XdrBoolean(ok); + } + + /// Return list of registered ONC/RPC servers. + /// Return list of registered ONC/RPC servers. + /// + /// list of ONC/RPC server descriptions (program, version, + /// protocol, port). + /// + internal virtual OncRpcDumpResult listServers() + { + org.acplt.oncrpc.OncRpcDumpResult result = new org.acplt.oncrpc.OncRpcDumpResult( + ); + result.servers = servers; + return result; + } + + /// + /// Checks whether the address given belongs to one of the local + /// addresses of this host. + /// + /// + /// Checks whether the address given belongs to one of the local + /// addresses of this host. + /// + /// IP address to check. + /// + /// true if address specified belongs to one of the + /// local addresses of this host. + /// + internal virtual bool isLocalAddress(IPAddress addr) + { + int size = locals.Length; + for (int idx = 0; idx < size; ++idx) + { + if (addr.Equals(locals[idx])) + { + return true; + } + } + return false; + } + + /// Dispatch incomming ONC/RPC calls to the individual handler functions. + /// + /// Dispatch incomming ONC/RPC calls to the individual handler functions. + /// The CALLIT method is currently unimplemented. + /// + /// + /// The ONC/RPC call, with references to the transport and + /// XDR streams to use for retrieving parameters and sending replies. + /// + /// the portmap's program number, 100000 + /// the portmap's protocol version, 2 + /// the procedure to call. + /// if an ONC/RPC error occurs. + /// if an I/O error occurs. + public virtual void dispatchOncRpcCall(org.acplt.oncrpc.server.OncRpcCallInformation + call, int program, int version, int procedure) + { + // + // Make sure it's the right program and version that we can handle. + // (defensive programming) + // + if (program == PMAP_PROGRAM) + { + if (version == PMAP_VERSION) + { + switch (procedure) + { + case 0: + { + // handle NULL call. + call.retrieveCall(org.acplt.oncrpc.XdrVoid.XDR_VOID); + call.reply(org.acplt.oncrpc.XdrVoid.XDR_VOID); + break; + } + + case OncRpcPortmapServices.PMAP_GETPORT: + { + // handle port query + org.acplt.oncrpc.OncRpcServerIdent @params = new org.acplt.oncrpc.OncRpcServerIdent + (); + call.retrieveCall(@params); + org.acplt.oncrpc.OncRpcGetPortResult result = getPort(@params); + call.reply(result); + break; + } + + case OncRpcPortmapServices.PMAP_SET: + { + // handle port registration + // + // ensure that no remote client tries to register + // + OncRpcServerIdent @params = new OncRpcServerIdent + (); + call.retrieveCall(@params); + org.acplt.oncrpc.XdrBoolean result; + if (isLocalAddress(call.peerAddress)) + { + result = setPort(@params); + } + else + { + result = new XdrBoolean(false); + } + call.reply(result); + break; + } + + case OncRpcPortmapServices.PMAP_UNSET: + { + // handle port deregistration + OncRpcServerIdent @params = new OncRpcServerIdent + (); + call.retrieveCall(@params); + org.acplt.oncrpc.XdrBoolean result; + if (isLocalAddress(call.peerAddress)) + { + result = unsetPort(@params); + } + else + { + result = new XdrBoolean(false); + } + call.reply(result); + break; + } + + case OncRpcPortmapServices.PMAP_DUMP: + { + // list all registrations + call.retrieveCall(org.acplt.oncrpc.XdrVoid.XDR_VOID); + org.acplt.oncrpc.OncRpcDumpResult result = listServers(); + call.reply(result); + break; + } + + default: + { + // unknown/unimplemented procedure + call.failProcedureUnavailable(); + break; + } + } + } + else + { + call.failProgramMismatch(PMAP_VERSION, PMAP_VERSION); + } + } + else + { + call.failProgramUnavailable(); + } + } + + /// List of IP addresses assigned to this host. + /// + /// List of IP addresses assigned to this host. Will be filled later + /// by constructor. + /// + public IPAddress[] locals = null; + + /// The list of registrated servers. + /// The list of registrated servers. + public System.Collections.ArrayList servers = new System.Collections.ArrayList(); + + /// Well-known port where the portmap process can be found on Internet hosts. + /// + /// Well-known port where the portmap process can be found on Internet hosts. + /// + public const int PMAP_PORT = 111; + + /// Program number of the portmapper as defined in RFC 1832. + /// Program number of the portmapper as defined in RFC 1832. + public const int PMAP_PROGRAM = 100000; + + /// Program version number of the portmapper as defined in RFC 1832. + /// Program version number of the portmapper as defined in RFC 1832. + public const int PMAP_VERSION = 2; + } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcCallInformation.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcCallInformation.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcCallInformation.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcCallInformation.cs index 77a7bd9..496cdda 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcCallInformation.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcCallInformation.cs @@ -23,9 +23,9 @@ */ using System.Net; - + namespace org.acplt.oncrpc.server -{ +{ /// /// Objects of class OncRpcCallInformation contain information /// about individual ONC/RPC calls. @@ -84,8 +84,8 @@ namespace org.acplt.oncrpc.server /// $Revision: 1.3 $ $Date: 2003/08/14 11:26:50 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class OncRpcCallInformation - { + public class OncRpcCallInformation + { /// /// Create an OncRpcCallInformation object and associate it /// with a ONC/RPC server transport. @@ -99,12 +99,12 @@ public class OncRpcCallInformation /// the transport is already divided from the call info. /// /// ONC/RPC server transport. - internal OncRpcCallInformation(org.acplt.oncrpc.server.OncRpcServerTransport transport - ) - { - this.transport = transport; - } - + internal OncRpcCallInformation(org.acplt.oncrpc.server.OncRpcServerTransport transport + ) + { + this.transport = transport; + } + /// /// Contains the call message header from ONC/RPC identifying this /// particular call. @@ -113,9 +113,9 @@ internal OncRpcCallInformation(org.acplt.oncrpc.server.OncRpcServerTransport tra /// Contains the call message header from ONC/RPC identifying this /// particular call. /// - public org.acplt.oncrpc.server.OncRpcServerCallMessage callMessage = new org.acplt.oncrpc.server.OncRpcServerCallMessage - (); - + public org.acplt.oncrpc.server.OncRpcServerCallMessage callMessage = new org.acplt.oncrpc.server.OncRpcServerCallMessage + (); + /// /// Internet address of the peer from which we received an ONC/RPC call /// or whom we intend to call. @@ -124,8 +124,8 @@ internal OncRpcCallInformation(org.acplt.oncrpc.server.OncRpcServerTransport tra /// Internet address of the peer from which we received an ONC/RPC call /// or whom we intend to call. /// - public IPAddress peerAddress = null; - + public IPAddress peerAddress = null; + /// /// Port number of the peer from which we received an ONC/RPC call or /// whom we intend to call. @@ -134,8 +134,8 @@ internal OncRpcCallInformation(org.acplt.oncrpc.server.OncRpcServerTransport tra /// Port number of the peer from which we received an ONC/RPC call or /// whom we intend to call. /// - public int peerPort = 0; - + public int peerPort = 0; + /// /// Associated transport from which we receive the ONC/RPC call parameters /// and to which we serialize the ONC/RPC reply. @@ -146,8 +146,8 @@ internal OncRpcCallInformation(org.acplt.oncrpc.server.OncRpcServerTransport tra /// member or you might break all future extensions horribly -- but this /// warning probably only stimulates you... /// - internal org.acplt.oncrpc.server.OncRpcServerTransport transport; - + internal org.acplt.oncrpc.server.OncRpcServerTransport transport; + /// Retrieves the parameters sent within an ONC/RPC call message. /// /// Retrieves the parameters sent within an ONC/RPC call message. It also @@ -162,11 +162,11 @@ internal OncRpcCallInformation(org.acplt.oncrpc.server.OncRpcServerTransport tra /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void retrieveCall(org.acplt.oncrpc.XdrAble call) - { - transport.retrieveCall(call); - } - + public virtual void retrieveCall(org.acplt.oncrpc.XdrAble call) + { + transport.retrieveCall(call); + } + /// /// Returns XDR stream which can be used for deserializing the parameters /// of this ONC/RPC call. @@ -177,11 +177,11 @@ public virtual void retrieveCall(org.acplt.oncrpc.XdrAble call) /// pattern when handling ONC/RPC calls. /// /// Reference to decoding XDR stream. - public virtual org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream() - { - return transport.getXdrDecodingStream(); - } - + public virtual org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream() + { + return transport.getXdrDecodingStream(); + } + /// Finishes call parameter deserialization. /// /// Finishes call parameter deserialization. Afterwards the XDR stream @@ -199,11 +199,11 @@ public virtual org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void endDecoding() - { - transport.endDecoding(); - } - + public virtual void endDecoding() + { + transport.endDecoding(); + } + /// Begins the sending phase for ONC/RPC replies. /// /// Begins the sending phase for ONC/RPC replies. After beginning sending @@ -226,12 +226,12 @@ public virtual void endDecoding() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void beginEncoding(org.acplt.oncrpc.server.OncRpcServerReplyMessage - state) - { - transport.beginEncoding(this, state); - } - + public virtual void beginEncoding(org.acplt.oncrpc.server.OncRpcServerReplyMessage + state) + { + transport.beginEncoding(this, state); + } + /// Begins the sending phase for accepted ONC/RPC replies. /// /// Begins the sending phase for accepted ONC/RPC replies. After beginning @@ -250,15 +250,15 @@ public virtual void beginEncoding(org.acplt.oncrpc.server.OncRpcServerReplyMessa /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void beginEncoding() - { - transport.beginEncoding(this, new org.acplt.oncrpc.server.OncRpcServerReplyMessage - (callMessage, org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus - .ONCRPC_SUCCESS, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER)); - } - + public virtual void beginEncoding() + { + transport.beginEncoding(this, new org.acplt.oncrpc.server.OncRpcServerReplyMessage + (callMessage, org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus + .ONCRPC_SUCCESS, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER)); + } + /// /// Returns XDR stream which can be used for eserializing the reply /// to this ONC/RPC call. @@ -269,11 +269,11 @@ public virtual void beginEncoding() /// pattern when handling ONC/RPC calls. /// /// Reference to enecoding XDR stream. - public virtual org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream() - { - return transport.getXdrEncodingStream(); - } - + public virtual org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream() + { + return transport.getXdrEncodingStream(); + } + /// Finishes encoding the reply to this ONC/RPC call. /// /// Finishes encoding the reply to this ONC/RPC call. Afterwards you must @@ -290,11 +290,11 @@ public virtual org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void endEncoding() - { - transport.endEncoding(); - } - + public virtual void endEncoding() + { + transport.endEncoding(); + } + /// Send back an ONC/RPC reply to the caller who sent in this call. /// /// Send back an ONC/RPC reply to the caller who sent in this call. This is @@ -322,12 +322,12 @@ public virtual void endEncoding() /// org.acplt.oncrpc.OncRpcReplyMessage /// /// OncRpcDispatchable - public virtual void reply(org.acplt.oncrpc.server.OncRpcServerReplyMessage state, - org.acplt.oncrpc.XdrAble reply) - { - transport.reply(this, state, reply); - } - + public virtual void reply(org.acplt.oncrpc.server.OncRpcServerReplyMessage state, + org.acplt.oncrpc.XdrAble reply) + { + transport.reply(this, state, reply); + } + /// Send back an ONC/RPC reply to the caller who sent in this call. /// /// Send back an ONC/RPC reply to the caller who sent in this call. This @@ -343,14 +343,14 @@ public virtual void reply(org.acplt.oncrpc.server.OncRpcServerReplyMessage state /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void reply(org.acplt.oncrpc.XdrAble rply) - { - reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus - .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SUCCESS, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), rply); - } - + public virtual void reply(org.acplt.oncrpc.XdrAble rply) + { + reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus + .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SUCCESS, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), rply); + } + /// /// Send back an ONC/RPC failure indication about invalid arguments to the /// caller who sent in this call. @@ -367,14 +367,14 @@ public virtual void reply(org.acplt.oncrpc.XdrAble rply) /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void failArgumentGarbage() - { - reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus - .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_GARBAGE_ARGS, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), null); - } - + public virtual void failArgumentGarbage() + { + reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus + .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_GARBAGE_ARGS, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), null); + } + /// /// Send back an ONC/RPC failure indication about an unavailable procedure /// call to the caller who sent in this call. @@ -391,14 +391,14 @@ public virtual void failArgumentGarbage() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void failProcedureUnavailable() - { - reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus - .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROC_UNAVAIL, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), null); - } - + public virtual void failProcedureUnavailable() + { + reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus + .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROC_UNAVAIL, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), null); + } + /// /// Send back an ONC/RPC failure indication about an unavailable program /// to the caller who sent in this call. @@ -415,14 +415,14 @@ public virtual void failProcedureUnavailable() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void failProgramUnavailable() - { - reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus - .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_UNAVAIL, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), null); - } - + public virtual void failProgramUnavailable() + { + reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus + .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_UNAVAIL, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), null); + } + /// /// Send back an ONC/RPC failure indication about a program version mismatch /// to the caller who sent in this call. @@ -441,14 +441,14 @@ public virtual void failProgramUnavailable() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void failProgramMismatch(int lowVersion, int highVersion) - { - reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus - .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_MISMATCH, - org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, lowVersion, highVersion, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER), null); - } - + public virtual void failProgramMismatch(int lowVersion, int highVersion) + { + reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus + .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_MISMATCH, + org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, lowVersion, highVersion, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER), null); + } + /// /// Send back an ONC/RPC failure indication about a system error /// to the caller who sent in this call. @@ -465,14 +465,14 @@ public virtual void failProgramMismatch(int lowVersion, int highVersion) /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void failSystemError() - { - reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus - .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SYSTEM_ERR, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), null); - } - + public virtual void failSystemError() + { + reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus + .ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_SYSTEM_ERR, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), null); + } + /// /// Send back an ONC/RPC failure indication about a ONC/RPC version mismatch /// call to the caller who sent in this call. @@ -489,14 +489,14 @@ public virtual void failSystemError() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void failOncRpcVersionMismatch() - { - reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus - .ONCRPC_MSG_DENIED, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcRejectStatus - .ONCRPC_RPC_MISMATCH, org.acplt.oncrpc.OncRpcCallMessage.ONCRPC_VERSION, org.acplt.oncrpc.OncRpcCallMessage - .ONCRPC_VERSION, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), null); - } - + public virtual void failOncRpcVersionMismatch() + { + reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus + .ONCRPC_MSG_DENIED, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcRejectStatus + .ONCRPC_RPC_MISMATCH, org.acplt.oncrpc.OncRpcCallMessage.ONCRPC_VERSION, org.acplt.oncrpc.OncRpcCallMessage + .ONCRPC_VERSION, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER), null); + } + /// /// Send back an ONC/RPC failure indication about a failed authentication /// to the caller who sent in this call. @@ -519,12 +519,12 @@ public virtual void failOncRpcVersionMismatch() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - public virtual void failAuthenticationFailed(int authStatus) - { - reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus - .ONCRPC_MSG_DENIED, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcRejectStatus - .ONCRPC_AUTH_ERROR, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, authStatus), null); - } + public virtual void failAuthenticationFailed(int authStatus) + { + reply(new org.acplt.oncrpc.server.OncRpcServerReplyMessage(callMessage, org.acplt.oncrpc.OncRpcReplyStatus + .ONCRPC_MSG_DENIED, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcRejectStatus + .ONCRPC_AUTH_ERROR, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, authStatus), null); + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcDispatchable.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcDispatchable.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcDispatchable.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcDispatchable.cs index 7d83ea4..be16447 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcDispatchable.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcDispatchable.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc.server -{ +{ /// /// Tags classes as being able to dispatch and handle ONC/RPC requests from /// clients. @@ -119,8 +119,8 @@ namespace org.acplt.oncrpc.server /// /// Harald Albrecht /// Jay Walters - public interface OncRpcDispatchable - { + public interface OncRpcDispatchable + { /// Dispatch (handle) an ONC/RPC request from a client. /// /// Dispatch (handle) an ONC/RPC request from a client. This interface has @@ -141,7 +141,7 @@ public interface OncRpcDispatchable /// OncRpcCallInformation /// /// - void dispatchOncRpcCall(org.acplt.oncrpc.server.OncRpcCallInformation call, int program - , int version, int procedure); + void dispatchOncRpcCall(org.acplt.oncrpc.server.OncRpcCallInformation call, int program + , int version, int procedure); } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAcceptedCallMessage.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAcceptedCallMessage.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAcceptedCallMessage.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAcceptedCallMessage.cs index 0c0448d..c7827e1 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAcceptedCallMessage.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAcceptedCallMessage.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc.server -{ +{ /// /// The OncRpcServerAcceptedCallMessage class represents (on the /// sender's side) an accepted ONC/RPC call. @@ -41,8 +41,8 @@ namespace org.acplt.oncrpc.server /// $Revision: 1.2 $ $Date: 2003/08/14 08:10:59 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class OncRpcServerAcceptedCallMessage : OncRpcServerReplyMessage - { + public class OncRpcServerAcceptedCallMessage : OncRpcServerReplyMessage + { /// /// Constructs an OncRpcServerAcceptedCallMessage object which /// represents an accepted call, which was also successfully executed, @@ -57,14 +57,14 @@ public class OncRpcServerAcceptedCallMessage : OncRpcServerReplyMessage /// The call message header, which is used to construct the /// matching reply message header from. /// - public OncRpcServerAcceptedCallMessage(org.acplt.oncrpc.server.OncRpcServerCallMessage - call) : base(call, org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus - .ONCRPC_SUCCESS, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_OK) - { - } - + public OncRpcServerAcceptedCallMessage(org.acplt.oncrpc.server.OncRpcServerCallMessage + call) : base(call, org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED, org.acplt.oncrpc.OncRpcAcceptStatus + .ONCRPC_SUCCESS, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_OK) + { + } + /// /// Constructs an OncRpcAcceptedCallMessage object which /// represents an accepted call, which was not necessarily successfully @@ -87,14 +87,14 @@ public OncRpcServerAcceptedCallMessage(org.acplt.oncrpc.server.OncRpcServerCallM /// /// interface. /// - public OncRpcServerAcceptedCallMessage(org.acplt.oncrpc.server.OncRpcServerCallMessage - call, int acceptStatus) : base(call, org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED - , acceptStatus, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_OK) - { - } - + public OncRpcServerAcceptedCallMessage(org.acplt.oncrpc.server.OncRpcServerCallMessage + call, int acceptStatus) : base(call, org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED + , acceptStatus, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcReplyMessage.UNUSED_PARAMETER, org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_OK) + { + } + /// /// Constructs an OncRpcAcceptedCallMessage object for an /// accepted call with an unsupported version. @@ -110,11 +110,11 @@ public OncRpcServerAcceptedCallMessage(org.acplt.oncrpc.server.OncRpcServerCallM /// /// Lowest program version supported by this ONC/RPC server. /// Highest program version supported by this ONC/RPC server. - public OncRpcServerAcceptedCallMessage(org.acplt.oncrpc.server.OncRpcServerCallMessage - call, int low, int high) : base(call, org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED - , org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_MISMATCH, org.acplt.oncrpc.OncRpcReplyMessage - .UNUSED_PARAMETER, low, high, org.acplt.oncrpc.OncRpcAuthStatus.ONCRPC_AUTH_OK) - { - } + public OncRpcServerAcceptedCallMessage(org.acplt.oncrpc.server.OncRpcServerCallMessage + call, int low, int high) : base(call, org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED + , org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_MISMATCH, org.acplt.oncrpc.OncRpcReplyMessage + .UNUSED_PARAMETER, low, high, org.acplt.oncrpc.OncRpcAuthStatus.ONCRPC_AUTH_OK) + { + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuth.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuth.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuth.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuth.cs index 0c620be..4e10179 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuth.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuth.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc.server -{ +{ /// /// The OncRpcServerAuth class is the base class and factory /// for handling all protocol issues of ONC/RPC authentication on the server @@ -39,16 +39,16 @@ namespace org.acplt.oncrpc.server /// /// Harald Albrecht /// Jay Walters - public abstract class OncRpcServerAuth - { + public abstract class OncRpcServerAuth + { /// /// Returns the type (flavor) of /// authentication /// used. /// /// Authentication type used by this authentication object. - public abstract int getAuthenticationType(); - + public abstract int getAuthenticationType(); + /// Restores (deserializes) an authentication object from an XDR stream. /// Restores (deserializes) an authentication object from an XDR stream. /// @@ -66,68 +66,68 @@ public abstract class OncRpcServerAuth /// /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public static org.acplt.oncrpc.server.OncRpcServerAuth xdrNew(org.acplt.oncrpc.XdrDecodingStream - xdr, org.acplt.oncrpc.server.OncRpcServerAuth recycle) - { - org.acplt.oncrpc.server.OncRpcServerAuth auth; - // - // In case we got an old authentication object and we are just about - // to receive an authentication with the same type, we reuse the old - // object. - // - int authType = xdr.xdrDecodeInt(); - if ((recycle != null) && (recycle.getAuthenticationType() == authType)) - { - // - // Simply recycle authentication object and pull its new state - // of the XDR stream. - // - auth = recycle; - auth.xdrDecodeCredVerf(xdr); - } - else - { - switch (authType) - { - case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE: - { - // - // Create a new authentication object and pull its state off - // the XDR stream. - // - auth = org.acplt.oncrpc.server.OncRpcServerAuthNone.AUTH_NONE; - auth.xdrDecodeCredVerf(xdr); - break; - } - - case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT: - { - auth = new org.acplt.oncrpc.server.OncRpcServerAuthShort(xdr); - break; - } - - case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_UNIX: - { - auth = new org.acplt.oncrpc.server.OncRpcServerAuthUnix(xdr); - break; - } - - default: - { - // - // In case of an unknown or unsupported type, throw an exception. - // Note: using AUTH_REJECTEDCRED is in sync with the way Sun's - // ONC/RPC implementation does it. But don't ask me why they do - // it this way...! - // - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_REJECTEDCRED)); - } - } - } - return auth; - } - + public static org.acplt.oncrpc.server.OncRpcServerAuth xdrNew(org.acplt.oncrpc.XdrDecodingStream + xdr, org.acplt.oncrpc.server.OncRpcServerAuth recycle) + { + org.acplt.oncrpc.server.OncRpcServerAuth auth; + // + // In case we got an old authentication object and we are just about + // to receive an authentication with the same type, we reuse the old + // object. + // + int authType = xdr.xdrDecodeInt(); + if ((recycle != null) && (recycle.getAuthenticationType() == authType)) + { + // + // Simply recycle authentication object and pull its new state + // of the XDR stream. + // + auth = recycle; + auth.xdrDecodeCredVerf(xdr); + } + else + { + switch (authType) + { + case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE: + { + // + // Create a new authentication object and pull its state off + // the XDR stream. + // + auth = org.acplt.oncrpc.server.OncRpcServerAuthNone.AUTH_NONE; + auth.xdrDecodeCredVerf(xdr); + break; + } + + case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT: + { + auth = new org.acplt.oncrpc.server.OncRpcServerAuthShort(xdr); + break; + } + + case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_UNIX: + { + auth = new org.acplt.oncrpc.server.OncRpcServerAuthUnix(xdr); + break; + } + + default: + { + // + // In case of an unknown or unsupported type, throw an exception. + // Note: using AUTH_REJECTEDCRED is in sync with the way Sun's + // ONC/RPC implementation does it. But don't ask me why they do + // it this way...! + // + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_REJECTEDCRED)); + } + } + } + return auth; + } + /// /// Decodes -- that is: deserializes -- an ONC/RPC authentication object /// (credential & verifier) on the server side. @@ -138,8 +138,8 @@ public static org.acplt.oncrpc.server.OncRpcServerAuth xdrNew(org.acplt.oncrpc.X /// /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public abstract void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream xdr); - + public abstract void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream xdr); + /// /// Encodes -- that is: serializes -- an ONC/RPC authentication object /// (its verifier) on the server side. @@ -150,6 +150,6 @@ public static org.acplt.oncrpc.server.OncRpcServerAuth xdrNew(org.acplt.oncrpc.X /// /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public abstract void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr); + public abstract void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr); } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthNone.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthNone.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthNone.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthNone.cs index a04e0ec..4fd48fa 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthNone.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthNone.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc.server -{ +{ /// /// The OncRpcServerAuthNone class handles all protocol issues /// of the ONC/RPC authentication AUTH_NONE on the server @@ -39,19 +39,19 @@ namespace org.acplt.oncrpc.server /// /// Harald Albrecht /// Jay Walters - public sealed class OncRpcServerAuthNone : OncRpcServerAuth - { + public sealed class OncRpcServerAuthNone : OncRpcServerAuth + { /// /// Returns the type (flavor) of /// authentication /// used. /// /// Authentication type used by this authentication object. - public sealed override int getAuthenticationType() - { - return org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE; - } - + public sealed override int getAuthenticationType() + { + return org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE; + } + /// /// Decodes -- that is: deserializes -- an ONC/RPC authentication object /// (credential & verifier) on the server side. @@ -62,32 +62,32 @@ public sealed override int getAuthenticationType() /// /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream - xdr) - { - // - // As the authentication type has already been pulled off the XDR - // stream, we only need to make sure that really no opaque data follows. - // - if (xdr.xdrDecodeInt() != 0) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_BADCRED)); - } - // - // We also need to decode the verifier. This must be of type - // AUTH_NONE too. For some obscure historical reasons, we have to - // deal with credentials and verifiers, although they belong together, - // according to Sun's specification. - // - if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || ( - xdr.xdrDecodeInt() != 0)) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_BADVERF)); - } - } - + public sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream + xdr) + { + // + // As the authentication type has already been pulled off the XDR + // stream, we only need to make sure that really no opaque data follows. + // + if (xdr.xdrDecodeInt() != 0) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_BADCRED)); + } + // + // We also need to decode the verifier. This must be of type + // AUTH_NONE too. For some obscure historical reasons, we have to + // deal with credentials and verifiers, although they belong together, + // according to Sun's specification. + // + if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || ( + xdr.xdrDecodeInt() != 0)) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_BADVERF)); + } + } + /// /// Encodes -- that is: serializes -- an ONC/RPC authentication object /// (its verifier) on the server side. @@ -98,15 +98,15 @@ public sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream /// /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public sealed override void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr) - { - // - // Encode an AUTH_NONE verifier with zero length. - // - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); - xdr.xdrEncodeInt(0); - } - + public sealed override void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr) + { + // + // Encode an AUTH_NONE verifier with zero length. + // + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); + xdr.xdrEncodeInt(0); + } + /// /// Singleton to use when an authentication object for AUTH_NONE /// is needed. @@ -115,7 +115,7 @@ public sealed override void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr /// Singleton to use when an authentication object for AUTH_NONE /// is needed. /// - public static readonly org.acplt.oncrpc.server.OncRpcServerAuthNone AUTH_NONE = new - org.acplt.oncrpc.server.OncRpcServerAuthNone(); + public static readonly org.acplt.oncrpc.server.OncRpcServerAuthNone AUTH_NONE = new + org.acplt.oncrpc.server.OncRpcServerAuthNone(); } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthShort.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthShort.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthShort.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthShort.cs index 7f9cb1b..059b874 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthShort.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthShort.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc.server -{ +{ /// /// The OncRpcServerAuthShort class handles all protocol issues /// of the ONC/RPC authentication AUTH_SHORT on the server @@ -39,8 +39,8 @@ namespace org.acplt.oncrpc.server /// /// Harald Albrecht /// Jay Walters - public sealed class OncRpcServerAuthShort : OncRpcServerAuth - { + public sealed class OncRpcServerAuthShort : OncRpcServerAuth + { /// /// Constructs an OncRpcServerAuthShort object and pulls its /// state off an XDR stream. @@ -52,29 +52,29 @@ public sealed class OncRpcServerAuthShort : OncRpcServerAuth /// XDR stream to retrieve the object state from. /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public OncRpcServerAuthShort(org.acplt.oncrpc.XdrDecodingStream xdr) - { - xdrDecodeCredVerf(xdr); - } - + public OncRpcServerAuthShort(org.acplt.oncrpc.XdrDecodingStream xdr) + { + xdrDecodeCredVerf(xdr); + } + /// /// Returns the type (flavor) of /// authentication /// used. /// /// Authentication type used by this authentication object. - public sealed override int getAuthenticationType() - { - return org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT; - } - + public sealed override int getAuthenticationType() + { + return org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT; + } + /// Returns the shorthand credential sent by the caller. /// Returns the shorthand credential sent by the caller. - public byte[] getShorthandCred() - { - return shorthandCred; - } - + public byte[] getShorthandCred() + { + return shorthandCred; + } + /// Sets shorthand verifier to be sent back to the caller. /// /// Sets shorthand verifier to be sent back to the caller. The caller then @@ -83,18 +83,18 @@ public byte[] getShorthandCred() /// null, then the verifier returned to the caller will be /// of type AUTH_NONE. /// - public void setShorthandVerifier(byte[] shorthandVerf) - { - this.shorthandVerf = shorthandVerf; - } - + public void setShorthandVerifier(byte[] shorthandVerf) + { + this.shorthandVerf = shorthandVerf; + } + /// Returns the shorthand verifier to be sent back to the caller. /// Returns the shorthand verifier to be sent back to the caller. - public byte[] getShorthandVerifier() - { - return shorthandVerf; - } - + public byte[] getShorthandVerifier() + { + return shorthandVerf; + } + /// /// Decodes -- that is: deserializes -- an ONC/RPC authentication object /// (credential & verifier) on the server side. @@ -105,38 +105,38 @@ public byte[] getShorthandVerifier() /// /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream - xdr) - { - // - // Reset the authentication object's state properly... - // - shorthandCred = null; - shorthandVerf = null; - // - // Pull off the shorthand credential information (opaque date) of - // the XDR stream... - // - shorthandCred = xdr.xdrDecodeDynamicOpaque(); - if (shorthandCred.Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_AUTH_BYTES) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_BADCRED)); - } - // - // We also need to decode the verifier. This must be of type - // AUTH_NONE too. For some obscure historical reasons, we have to - // deal with credentials and verifiers, although they belong together, - // according to Sun's specification. - // - if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || ( - xdr.xdrDecodeInt() != 0)) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_BADVERF)); - } - } - + public sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream + xdr) + { + // + // Reset the authentication object's state properly... + // + shorthandCred = null; + shorthandVerf = null; + // + // Pull off the shorthand credential information (opaque date) of + // the XDR stream... + // + shorthandCred = xdr.xdrDecodeDynamicOpaque(); + if (shorthandCred.Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_AUTH_BYTES) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_BADCRED)); + } + // + // We also need to decode the verifier. This must be of type + // AUTH_NONE too. For some obscure historical reasons, we have to + // deal with credentials and verifiers, although they belong together, + // according to Sun's specification. + // + if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || ( + xdr.xdrDecodeInt() != 0)) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_BADVERF)); + } + } + /// /// Encodes -- that is: serializes -- an ONC/RPC authentication object /// (its verifier) on the server side. @@ -147,31 +147,31 @@ public sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream /// /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public sealed override void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr) - { - if (shorthandVerf != null) - { - // - // Encode AUTH_SHORT shorthand verifier (credential). - // - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT); - xdr.xdrEncodeDynamicOpaque(shorthandVerf); - } - else - { - // - // Encode an AUTH_NONE verifier with zero length, if no shorthand - // verifier (credential) has been supplied by now. - // - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); - xdr.xdrEncodeInt(0); - } - } - + public sealed override void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr) + { + if (shorthandVerf != null) + { + // + // Encode AUTH_SHORT shorthand verifier (credential). + // + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT); + xdr.xdrEncodeDynamicOpaque(shorthandVerf); + } + else + { + // + // Encode an AUTH_NONE verifier with zero length, if no shorthand + // verifier (credential) has been supplied by now. + // + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); + xdr.xdrEncodeInt(0); + } + } + /// Contains the shorthand credential sent by the caller. /// Contains the shorthand credential sent by the caller. - private byte[] shorthandCred; - + private byte[] shorthandCred; + /// /// Contains the shorthand authentication verifier (credential) to return /// to the caller to be used with the next ONC/RPC calls. @@ -180,6 +180,6 @@ public sealed override void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr /// Contains the shorthand authentication verifier (credential) to return /// to the caller to be used with the next ONC/RPC calls. /// - private byte[] shorthandVerf; + private byte[] shorthandVerf; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthUnix.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthUnix.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthUnix.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthUnix.cs index 522bee8..40adf30 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthUnix.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerAuthUnix.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc.server -{ +{ /// /// The OncRpcServerAuthNone class handles all protocol issues /// of the ONC/RPC authentication AUTH_UNIX on the server @@ -39,24 +39,24 @@ namespace org.acplt.oncrpc.server /// /// Harald Albrecht /// Jay Walters - public sealed class OncRpcServerAuthUnix : OncRpcServerAuth - { + public sealed class OncRpcServerAuthUnix : OncRpcServerAuth + { /// Contains timestamp as supplied through credential. /// Contains timestamp as supplied through credential. - public int stamp; - + public int stamp; + /// Contains the machine name of caller supplied through credential. /// Contains the machine name of caller supplied through credential. - public string machinename; - + public string machinename; + /// Contains the user ID of caller supplied through credential. /// Contains the user ID of caller supplied through credential. - public int uid; - + public int uid; + /// Contains the group ID of caller supplied through credential. /// Contains the group ID of caller supplied through credential. - public int gid; - + public int gid; + /// /// Contains a set of group IDs the caller belongs to, as supplied /// through credential. @@ -65,8 +65,8 @@ public sealed class OncRpcServerAuthUnix : OncRpcServerAuth /// Contains a set of group IDs the caller belongs to, as supplied /// through credential. /// - public int[] gids; - + public int[] gids; + /// /// Constructs an OncRpcServerAuthUnix object and pulls its /// state off an XDR stream. @@ -78,40 +78,40 @@ public sealed class OncRpcServerAuthUnix : OncRpcServerAuth /// XDR stream to retrieve the object state from. /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public OncRpcServerAuthUnix(org.acplt.oncrpc.XdrDecodingStream xdr) - { - xdrDecodeCredVerf(xdr); - } - + public OncRpcServerAuthUnix(org.acplt.oncrpc.XdrDecodingStream xdr) + { + xdrDecodeCredVerf(xdr); + } + /// /// Returns the type (flavor) of /// authentication /// used. /// /// Authentication type used by this authentication object. - public sealed override int getAuthenticationType() - { - return org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_UNIX; - } - + public sealed override int getAuthenticationType() + { + return org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_UNIX; + } + /// Sets shorthand verifier to be sent back to the caller. /// /// Sets shorthand verifier to be sent back to the caller. The caller then /// can use this shorthand verifier as the new credential with the next /// ONC/RPC calls to speed up things up (hopefully). /// - public void setShorthandVerifier(byte[] shorthandVerf) - { - this.shorthandVerf = shorthandVerf; - } - + public void setShorthandVerifier(byte[] shorthandVerf) + { + this.shorthandVerf = shorthandVerf; + } + /// Returns the shorthand verifier to be sent back to the caller. /// Returns the shorthand verifier to be sent back to the caller. - public byte[] getShorthandVerifier() - { - return shorthandVerf; - } - + public byte[] getShorthandVerifier() + { + return shorthandVerf; + } + /// /// Decodes -- that is: deserializes -- an ONC/RPC authentication object /// (credential & verifier) on the server side. @@ -122,59 +122,59 @@ public byte[] getShorthandVerifier() /// /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream - xdr) - { - // - // Reset some part of the object's state... - // - shorthandVerf = null; - // - // Now pull off the object state of the XDR stream... - // - int realLen = xdr.xdrDecodeInt(); - stamp = xdr.xdrDecodeInt(); - machinename = xdr.xdrDecodeString(); - uid = xdr.xdrDecodeInt(); - gid = xdr.xdrDecodeInt(); - gids = xdr.xdrDecodeIntVector(); - // - // Make sure that the indicated length of the opaque data is kosher. - // If not, throw an exception, as there is something strange going on! - // - int len = 4 + ((machinename.Length + 7) & ~3) + 4 + 4 + (gids.Length * 4) + 4; - // length of stamp - // len string incl. len - // length of uid - // length of gid - // length of vector of gids incl. len - if (realLen != len) - { - if (realLen < len) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW - )); - } - else - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_AUTHERROR - )); - } - } - // - // We also need to decode the verifier. This must be of type - // AUTH_NONE too. For some obscure historical reasons, we have to - // deal with credentials and verifiers, although they belong together, - // according to Sun's specification. - // - if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || ( - xdr.xdrDecodeInt() != 0)) - { - throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus - .ONCRPC_AUTH_BADVERF)); - } - } - + public sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream + xdr) + { + // + // Reset some part of the object's state... + // + shorthandVerf = null; + // + // Now pull off the object state of the XDR stream... + // + int realLen = xdr.xdrDecodeInt(); + stamp = xdr.xdrDecodeInt(); + machinename = xdr.xdrDecodeString(); + uid = xdr.xdrDecodeInt(); + gid = xdr.xdrDecodeInt(); + gids = xdr.xdrDecodeIntVector(); + // + // Make sure that the indicated length of the opaque data is kosher. + // If not, throw an exception, as there is something strange going on! + // + int len = 4 + ((machinename.Length + 7) & ~3) + 4 + 4 + (gids.Length * 4) + 4; + // length of stamp + // len string incl. len + // length of uid + // length of gid + // length of vector of gids incl. len + if (realLen != len) + { + if (realLen < len) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_BUFFERUNDERFLOW + )); + } + else + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_AUTHERROR + )); + } + } + // + // We also need to decode the verifier. This must be of type + // AUTH_NONE too. For some obscure historical reasons, we have to + // deal with credentials and verifiers, although they belong together, + // according to Sun's specification. + // + if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || ( + xdr.xdrDecodeInt() != 0)) + { + throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus + .ONCRPC_AUTH_BADVERF)); + } + } + /// /// Encodes -- that is: serializes -- an ONC/RPC authentication object /// (its verifier) on the server side. @@ -185,27 +185,27 @@ public sealed override void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream /// /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public sealed override void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr) - { - if (shorthandVerf != null) - { - // - // Encode AUTH_SHORT shorthand verifier (credential). - // - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT); - xdr.xdrEncodeDynamicOpaque(shorthandVerf); - } - else - { - // - // Encode an AUTH_NONE verifier with zero length, if no shorthand - // verifier (credential) has been supplied by now. - // - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); - xdr.xdrEncodeInt(0); - } - } - + public sealed override void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr) + { + if (shorthandVerf != null) + { + // + // Encode AUTH_SHORT shorthand verifier (credential). + // + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT); + xdr.xdrEncodeDynamicOpaque(shorthandVerf); + } + else + { + // + // Encode an AUTH_NONE verifier with zero length, if no shorthand + // verifier (credential) has been supplied by now. + // + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); + xdr.xdrEncodeInt(0); + } + } + /// /// Contains the shorthand authentication verifier (credential) to return /// to the caller to be used with the next ONC/RPC calls. @@ -214,6 +214,6 @@ public sealed override void xdrEncodeVerf(org.acplt.oncrpc.XdrEncodingStream xdr /// Contains the shorthand authentication verifier (credential) to return /// to the caller to be used with the next ONC/RPC calls. /// - private byte[] shorthandVerf; + private byte[] shorthandVerf; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerCallMessage.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerCallMessage.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerCallMessage.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerCallMessage.cs index d675bb8..1761d38 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerCallMessage.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerCallMessage.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc.server -{ +{ /// /// The OncRpcServerCallMessage class represents an ONC/RPC /// call message on the server side. @@ -44,8 +44,8 @@ namespace org.acplt.oncrpc.server /// /// Harald Albrecht /// Jay Walters - public class OncRpcServerCallMessage : OncRpcCallMessage - { + public class OncRpcServerCallMessage : OncRpcCallMessage + { /// /// Decodes -- that is: deserializes -- a ONC/RPC message header object /// from a XDR stream according to RFC 1831. @@ -57,44 +57,44 @@ public class OncRpcServerCallMessage : OncRpcCallMessage /// A decoding XDR stream from which to receive all the mess. /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) - { - messageId = xdr.xdrDecodeInt(); - // - // Make sure that we are really decoding an ONC/RPC message call - // header. Otherwise, throw the appropriate OncRpcException exception. - // - messageType = xdr.xdrDecodeInt(); - if (messageType != org.acplt.oncrpc.OncRpcMessageType.ONCRPC_CALL) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_WRONGMESSAGE - )); - } - // - // Make sure that the other side is talking the right slang -- - // we will only understand version 2 slang of ONC/RPC. - // - oncRpcVersion = xdr.xdrDecodeInt(); - if (oncRpcVersion != ONCRPC_VERSION) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_VERSMISMATCH - )); - } - // - // Now decode the remaining fields of the call header. - // - program = xdr.xdrDecodeInt(); - version = xdr.xdrDecodeInt(); - procedure = xdr.xdrDecodeInt(); - // - // Last comes the authentication data. Note that the "factory" hidden - // within xdrNew() will graciously recycle any old authentication - // protocol handling object if it is of the same authentication type - // as the new one just coming in from the XDR wire. - // - auth = org.acplt.oncrpc.server.OncRpcServerAuth.xdrNew(xdr, auth); - } - + public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) + { + messageId = xdr.xdrDecodeInt(); + // + // Make sure that we are really decoding an ONC/RPC message call + // header. Otherwise, throw the appropriate OncRpcException exception. + // + messageType = xdr.xdrDecodeInt(); + if (messageType != org.acplt.oncrpc.OncRpcMessageType.ONCRPC_CALL) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_WRONGMESSAGE + )); + } + // + // Make sure that the other side is talking the right slang -- + // we will only understand version 2 slang of ONC/RPC. + // + oncRpcVersion = xdr.xdrDecodeInt(); + if (oncRpcVersion != ONCRPC_VERSION) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_VERSMISMATCH + )); + } + // + // Now decode the remaining fields of the call header. + // + program = xdr.xdrDecodeInt(); + version = xdr.xdrDecodeInt(); + procedure = xdr.xdrDecodeInt(); + // + // Last comes the authentication data. Note that the "factory" hidden + // within xdrNew() will graciously recycle any old authentication + // protocol handling object if it is of the same authentication type + // as the new one just coming in from the XDR wire. + // + auth = org.acplt.oncrpc.server.OncRpcServerAuth.xdrNew(xdr, auth); + } + /// /// Contains the authentication protocol handling object retrieved together /// with the call message itself. @@ -103,6 +103,6 @@ public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr) /// Contains the authentication protocol handling object retrieved together /// with the call message itself. /// - public org.acplt.oncrpc.server.OncRpcServerAuth auth; + public org.acplt.oncrpc.server.OncRpcServerAuth auth; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerReplyMessage.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerReplyMessage.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerReplyMessage.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerReplyMessage.cs index 8fb1898..ecdcfc8 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerReplyMessage.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerReplyMessage.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc.server -{ +{ /// /// The OncRpcReplyMessage class represents an ONC/RPC reply /// message as defined by ONC/RPC in RFC 1831. @@ -45,8 +45,8 @@ namespace org.acplt.oncrpc.server /// /// Harald Albrecht /// Jay Walters - public class OncRpcServerReplyMessage : OncRpcReplyMessage - { + public class OncRpcServerReplyMessage : OncRpcReplyMessage + { /// /// Initializes a new OncRpcReplyMessage object and initializes /// its complete state from the given parameters. @@ -84,14 +84,14 @@ public class OncRpcServerReplyMessage : OncRpcReplyMessage /// org.acplt.oncrpc.OncRpcAuthStatus /// ). /// - public OncRpcServerReplyMessage(org.acplt.oncrpc.server.OncRpcServerCallMessage call - , int replyStatus, int acceptStatus, int rejectStatus, int lowVersion, int highVersion - , int authStatus) : base(call, replyStatus, acceptStatus, rejectStatus, lowVersion - , highVersion, authStatus) - { - this.auth = call.auth; - } - + public OncRpcServerReplyMessage(org.acplt.oncrpc.server.OncRpcServerCallMessage call + , int replyStatus, int acceptStatus, int rejectStatus, int lowVersion, int highVersion + , int authStatus) : base(call, replyStatus, acceptStatus, rejectStatus, lowVersion + , highVersion, authStatus) + { + this.auth = call.auth; + } + /// /// Encodes -- that is: serializes -- a ONC/RPC reply header object /// into a XDR stream. @@ -102,93 +102,93 @@ public OncRpcServerReplyMessage(org.acplt.oncrpc.server.OncRpcServerCallMessage /// /// if an ONC/RPC error occurs. /// if an I/O error occurs. - public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) - { - xdr.xdrEncodeInt(messageId); - xdr.xdrEncodeInt(messageType); - xdr.xdrEncodeInt(replyStatus); - switch (replyStatus) - { - case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED: - { - // - // Encode the information returned for accepted message calls. - // - // First encode the authentification data. If someone has - // nulled (nuked?) the authentication protocol handling object - // from the call information object, then we can still fall back - // to sending AUTH_NONE replies... - // - if (auth != null) - { - auth.xdrEncodeVerf(xdr); - } - else - { - xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); - xdr.xdrEncodeInt(0); - } - // - // Even if the call was accepted by the server, it can still - // indicate an error. Depending on the status of the accepted - // call we have to send back an indication about the range of - // versions we support of a particular program (server). - // - xdr.xdrEncodeInt(acceptStatus); - switch (acceptStatus) - { - case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_MISMATCH: - { - xdr.xdrEncodeInt(lowVersion); - xdr.xdrEncodeInt(highVersion); - break; - } - - default: - { - // - // Otherwise "open ended set of problem", like the author - // of Sun's ONC/RPC source once wrote... - // - break; - } - } - break; - } - - case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_DENIED: - { - // - // Encode the information returned for denied message calls. - // - xdr.xdrEncodeInt(rejectStatus); - switch (rejectStatus) - { - case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_RPC_MISMATCH: - { - xdr.xdrEncodeInt(lowVersion); - xdr.xdrEncodeInt(highVersion); - break; - } - - case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_AUTH_ERROR: - { - xdr.xdrEncodeInt(authStatus); - break; - } - - default: - { - break; - } - } - break; - } - } - } - + public virtual void xdrEncode(org.acplt.oncrpc.XdrEncodingStream xdr) + { + xdr.xdrEncodeInt(messageId); + xdr.xdrEncodeInt(messageType); + xdr.xdrEncodeInt(replyStatus); + switch (replyStatus) + { + case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_ACCEPTED: + { + // + // Encode the information returned for accepted message calls. + // + // First encode the authentification data. If someone has + // nulled (nuked?) the authentication protocol handling object + // from the call information object, then we can still fall back + // to sending AUTH_NONE replies... + // + if (auth != null) + { + auth.xdrEncodeVerf(xdr); + } + else + { + xdr.xdrEncodeInt(org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE); + xdr.xdrEncodeInt(0); + } + // + // Even if the call was accepted by the server, it can still + // indicate an error. Depending on the status of the accepted + // call we have to send back an indication about the range of + // versions we support of a particular program (server). + // + xdr.xdrEncodeInt(acceptStatus); + switch (acceptStatus) + { + case org.acplt.oncrpc.OncRpcAcceptStatus.ONCRPC_PROG_MISMATCH: + { + xdr.xdrEncodeInt(lowVersion); + xdr.xdrEncodeInt(highVersion); + break; + } + + default: + { + // + // Otherwise "open ended set of problem", like the author + // of Sun's ONC/RPC source once wrote... + // + break; + } + } + break; + } + + case org.acplt.oncrpc.OncRpcReplyStatus.ONCRPC_MSG_DENIED: + { + // + // Encode the information returned for denied message calls. + // + xdr.xdrEncodeInt(rejectStatus); + switch (rejectStatus) + { + case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_RPC_MISMATCH: + { + xdr.xdrEncodeInt(lowVersion); + xdr.xdrEncodeInt(highVersion); + break; + } + + case org.acplt.oncrpc.OncRpcRejectStatus.ONCRPC_AUTH_ERROR: + { + xdr.xdrEncodeInt(authStatus); + break; + } + + default: + { + break; + } + } + break; + } + } + } + /// Contains the authentication protocol handling object. /// Contains the authentication protocol handling object. - internal org.acplt.oncrpc.server.OncRpcServerAuth auth; + internal org.acplt.oncrpc.server.OncRpcServerAuth auth; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerStub.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerStub.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerStub.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerStub.cs index 094755c..bd638e9 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerStub.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerStub.cs @@ -23,9 +23,9 @@ */ using System.Threading; - + namespace org.acplt.oncrpc.server -{ +{ /// /// The abstract OncRpcServerStub class is the base class to /// build ONC/RPC-program specific servers upon. @@ -40,8 +40,8 @@ namespace org.acplt.oncrpc.server /// $Revision: 1.2 $ $Date: 2003/08/14 13:47:04 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public abstract class OncRpcServerStub - { + public abstract class OncRpcServerStub + { /// /// Array containing ONC/RPC server transport objects which describe what /// transports an ONC/RPC server offers for handling ONC/RPC calls. @@ -50,8 +50,8 @@ public abstract class OncRpcServerStub /// Array containing ONC/RPC server transport objects which describe what /// transports an ONC/RPC server offers for handling ONC/RPC calls. /// - public org.acplt.oncrpc.server.OncRpcServerTransport[] transports; - + public org.acplt.oncrpc.server.OncRpcServerTransport[] transports; + /// /// Array containing program and version numbers tuples this server is /// willing to handle. @@ -60,8 +60,8 @@ public abstract class OncRpcServerStub /// Array containing program and version numbers tuples this server is /// willing to handle. /// - public org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] info; - + public org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] info; + /// /// Notification flag for signalling the server to stop processing /// incomming remote procedure calls and to shut down. @@ -70,8 +70,8 @@ public abstract class OncRpcServerStub /// Notification flag for signalling the server to stop processing /// incomming remote procedure calls and to shut down. /// - internal object shutdownSignal = new object(); - + internal object shutdownSignal = new object(); + /// /// All inclusive convenience method: register server transports with /// portmapper, then run the call dispatcher until the server is signalled @@ -91,11 +91,11 @@ public abstract class OncRpcServerStub /// server from which it can not recover (like severe exceptions thrown /// when waiting for now connections on a server socket). /// - public virtual void run() - { - // - // Ignore all problems during unregistration. - // + public virtual void run() + { + // + // Ignore all problems during unregistration. + // try { try @@ -118,9 +118,9 @@ public virtual void run() finally { Close(transports); - } - } - + } + } + /// Register a set of server transports with the local portmapper. /// Register a set of server transports with the local portmapper. /// @@ -131,16 +131,16 @@ public virtual void run() /// if the portmapper could not be contacted /// successfully. /// - public virtual void register(org.acplt.oncrpc.server.OncRpcServerTransport[] transports - ) - { - int size = transports.Length; - for (int idx = 0; idx < size; ++idx) - { - transports[idx].register(); - } - } - + public virtual void register(org.acplt.oncrpc.server.OncRpcServerTransport[] transports + ) + { + int size = transports.Length; + for (int idx = 0; idx < size; ++idx) + { + transports[idx].register(); + } + } + /// /// Process incomming remote procedure call requests from all specified /// transports. @@ -158,36 +158,36 @@ public virtual void register(org.acplt.oncrpc.server.OncRpcServerTransport[] tra /// Array of server transport objects for which /// processing of remote procedure call requests should be done. /// - public virtual void run(OncRpcServerTransport[] transports - ) - { - int size = transports.Length; - for (int idx = 0; idx < size; ++idx) - { - transports[idx].listen(); - } - // - // Loop and wait for the shutdown flag to become signalled. If the - // server's main thread gets interrupted it will not shut itself - // down. It can only be stopped by signalling the shutdownSignal - // object. - // - for (; ; ) - { - lock (shutdownSignal) - { - try - { - Monitor.Wait(shutdownSignal); - break; - } - catch (System.Exception) - { - } - } - } - } - + public virtual void run(OncRpcServerTransport[] transports + ) + { + int size = transports.Length; + for (int idx = 0; idx < size; ++idx) + { + transports[idx].listen(); + } + // + // Loop and wait for the shutdown flag to become signalled. If the + // server's main thread gets interrupted it will not shut itself + // down. It can only be stopped by signalling the shutdownSignal + // object. + // + for (; ; ) + { + lock (shutdownSignal) + { + try + { + Monitor.Wait(shutdownSignal); + break; + } + catch (System.Exception) + { + } + } + } + } + /// /// Notify the RPC server to stop processing of remote procedure call /// requests as soon as possible. @@ -201,17 +201,17 @@ public virtual void run(OncRpcServerTransport[] transports /// /// method of the server. /// - public virtual void stopRpcProcessing() - { - if (shutdownSignal != null) - { - lock (shutdownSignal) - { - Monitor.Pulse(shutdownSignal); - } - } - } - + public virtual void stopRpcProcessing() + { + if (shutdownSignal != null) + { + lock (shutdownSignal) + { + Monitor.Pulse(shutdownSignal); + } + } + } + /// Unregister a set of server transports from the local portmapper. /// Unregister a set of server transports from the local portmapper. /// Array of server transport objects to unregister. @@ -224,16 +224,16 @@ public virtual void stopRpcProcessing() /// it is not considered an error to remove a non-existing entry from /// the portmapper. /// - public virtual void unregister(org.acplt.oncrpc.server.OncRpcServerTransport[] transports - ) - { - int size = transports.Length; - for (int idx = 0; idx < size; ++idx) - { - transports[idx].unregister(); - } - } - + public virtual void unregister(org.acplt.oncrpc.server.OncRpcServerTransport[] transports + ) + { + int size = transports.Length; + for (int idx = 0; idx < size; ++idx) + { + transports[idx].unregister(); + } + } + /// Close all transports listed in a set of server transports. /// /// Close all transports listed in a set of server transports. Only @@ -242,43 +242,43 @@ public virtual void unregister(org.acplt.oncrpc.server.OncRpcServerTransport[] t /// transport is handled by its own thread. /// /// Array of server transport objects to close. - public virtual void Close(OncRpcServerTransport[] transports - ) - { - int size = transports.Length; - for (int idx = 0; idx < size; ++idx) - { - transports[idx].Close(); - } - } - + public virtual void Close(OncRpcServerTransport[] transports + ) + { + int size = transports.Length; + for (int idx = 0; idx < size; ++idx) + { + transports[idx].Close(); + } + } + /// Set the character encoding for deserializing strings. /// Set the character encoding for deserializing strings. /// /// the encoding to use for deserializing strings. /// If null, the system's default encoding is to be used. /// - public virtual void setCharacterEncoding(string characterEncoding) - { - this.characterEncoding = characterEncoding; - int size = transports.Length; - for (int idx = 0; idx < size; ++idx) - { - transports[idx].setCharacterEncoding(characterEncoding); - } - } - + public virtual void setCharacterEncoding(string characterEncoding) + { + this.characterEncoding = characterEncoding; + int size = transports.Length; + for (int idx = 0; idx < size; ++idx) + { + transports[idx].setCharacterEncoding(characterEncoding); + } + } + /// Get the character encoding for deserializing strings. /// Get the character encoding for deserializing strings. /// /// the encoding currently used for deserializing strings. /// If null, then the system's default encoding is used. /// - public virtual string getCharacterEncoding() - { - return characterEncoding; - } - + public virtual string getCharacterEncoding() + { + return characterEncoding; + } + /// /// Encoding to use when deserializing strings or null if /// the system's default encoding should be used. @@ -287,6 +287,6 @@ public virtual string getCharacterEncoding() /// Encoding to use when deserializing strings or null if /// the system's default encoding should be used. /// - private string characterEncoding; + private string characterEncoding; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransport.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransport.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransport.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransport.cs index 3acb950..507b1a3 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransport.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransport.cs @@ -23,9 +23,9 @@ */ using System.Net; - + namespace org.acplt.oncrpc.server -{ +{ /// /// Instances of class OncRpcServerTransport encapsulate XDR /// streams of ONC/RPC servers. @@ -54,8 +54,8 @@ namespace org.acplt.oncrpc.server /// $Revision: 1.3 $ $Date: 2003/08/14 13:47:04 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public abstract class OncRpcServerTransport - { + public abstract class OncRpcServerTransport + { /// /// Create a new instance of a OncRpcServerTransport which /// encapsulates XDR streams of an ONC/RPC server. @@ -80,15 +80,15 @@ public abstract class OncRpcServerTransport /// Array of program and version number tuples of the ONC/RPC /// programs and versions handled by this transport. /// - internal OncRpcServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher - , int port, org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] info - ) - { - this.dispatcher = dispatcher; - this.port = port; - this.info = info; - } - + internal OncRpcServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher + , int port, org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] info + ) + { + this.dispatcher = dispatcher; + this.port = port; + this.info = info; + } + /// /// Register the port where this server transport waits for incoming /// requests with the ONC/RPC portmapper. @@ -105,8 +105,8 @@ internal OncRpcServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispat /// if the portmapper could not be contacted /// successfully. /// - public abstract void register(); - + public abstract void register(); + /// /// Unregisters the port where this server transport waits for incoming /// requests from the ONC/RPC portmapper. @@ -128,25 +128,25 @@ internal OncRpcServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispat /// it is not considered an error to remove a non-existing entry from /// the portmapper. /// - public virtual void unregister() - { - try - { - org.acplt.oncrpc.OncRpcPortmapClient portmapper = new org.acplt.oncrpc.OncRpcPortmapClient - (IPAddress.Loopback); - int size = info.Length; - for (int idx = 0; idx < size; ++idx) - { - portmapper.unsetPort(info[idx].program, info[idx].version); - } - } - catch (System.IO.IOException) - { - throw (new OncRpcException(OncRpcException.RPC_FAILED - )); - } - } - + public virtual void unregister() + { + try + { + org.acplt.oncrpc.OncRpcPortmapClient portmapper = new org.acplt.oncrpc.OncRpcPortmapClient + (IPAddress.Loopback); + int size = info.Length; + for (int idx = 0; idx < size; ++idx) + { + portmapper.unsetPort(info[idx].program, info[idx].version); + } + } + catch (System.IO.IOException) + { + throw (new OncRpcException(OncRpcException.RPC_FAILED + )); + } + } + /// Close the server transport and free any resources associated with it. /// /// Close the server transport and free any resources associated with it. @@ -164,8 +164,8 @@ public virtual void unregister() /// (with timeout), then close connections and kill the threads. /// /// - public abstract void Close(); - + public abstract void Close(); + /// /// Creates a new thread and uses this thread to listen to incoming /// ONC/RPC requests, then dispatches them and finally sends back the @@ -180,8 +180,8 @@ public virtual void unregister() /// thread to wait for incoming requests. The method has to return /// immediately for the calling thread. /// - public abstract void listen(); - + public abstract void listen(); + /// /// Returns port number of socket this server transport listens on for /// incoming ONC/RPC calls. @@ -191,27 +191,27 @@ public virtual void unregister() /// incoming ONC/RPC calls. /// /// Port number of socket listening for incoming calls. - public virtual int getPort() - { - return port; - } - + public virtual int getPort() + { + return port; + } + /// Set the character encoding for (de-)serializing strings. /// Set the character encoding for (de-)serializing strings. /// /// the encoding to use for (de-)serializing strings. /// If null, the system's default encoding is to be used. /// - public abstract void setCharacterEncoding(string characterEncoding); - + public abstract void setCharacterEncoding(string characterEncoding); + /// Get the character encoding for (de-)serializing strings. /// Get the character encoding for (de-)serializing strings. /// /// the encoding currently used for (de-)serializing strings. /// If null, then the system's default encoding is used. /// - public abstract string getCharacterEncoding(); - + public abstract string getCharacterEncoding(); + /// Retrieves the parameters sent within an ONC/RPC call message. /// /// Retrieves the parameters sent within an ONC/RPC call message. It also @@ -231,8 +231,8 @@ public virtual int getPort() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - internal abstract void retrieveCall(org.acplt.oncrpc.XdrAble call); - + internal abstract void retrieveCall(org.acplt.oncrpc.XdrAble call); + /// /// Returns XDR stream which can be used for deserializing the parameters /// of this ONC/RPC call. @@ -243,8 +243,8 @@ public virtual int getPort() /// pattern when handling ONC/RPC calls. /// /// Reference to decoding XDR stream. - internal abstract org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream(); - + internal abstract org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream(); + /// Finishes call parameter deserialization. /// /// Finishes call parameter deserialization. Afterwards the XDR stream @@ -262,8 +262,8 @@ public virtual int getPort() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - internal abstract void endDecoding(); - + internal abstract void endDecoding(); + /// /// Returns XDR stream which can be used for eserializing the reply /// to this ONC/RPC call. @@ -274,8 +274,8 @@ public virtual int getPort() /// pattern when handling ONC/RPC calls. /// /// Reference to enecoding XDR stream. - internal abstract org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream(); - + internal abstract org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream(); + /// Begins the sending phase for ONC/RPC replies. /// /// Begins the sending phase for ONC/RPC replies. @@ -293,9 +293,9 @@ public virtual int getPort() /// /// if an I/O exception occurs, like transmission /// - internal abstract void beginEncoding(org.acplt.oncrpc.server.OncRpcCallInformation - callInfo, org.acplt.oncrpc.server.OncRpcServerReplyMessage state); - + internal abstract void beginEncoding(org.acplt.oncrpc.server.OncRpcCallInformation + callInfo, org.acplt.oncrpc.server.OncRpcServerReplyMessage state); + /// Finishes encoding the reply to this ONC/RPC call. /// /// Finishes encoding the reply to this ONC/RPC call. Afterwards you must @@ -312,8 +312,8 @@ internal abstract void beginEncoding(org.acplt.oncrpc.server.OncRpcCallInformati /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - internal abstract void endEncoding(); - + internal abstract void endEncoding(); + /// Send back an ONC/RPC reply to the original caller. /// /// Send back an ONC/RPC reply to the original caller. This is rather a @@ -349,10 +349,10 @@ internal abstract void beginEncoding(org.acplt.oncrpc.server.OncRpcCallInformati /// /// OncRpcCallInformation /// OncRpcDispatchable - internal abstract void reply(org.acplt.oncrpc.server.OncRpcCallInformation callInfo - , org.acplt.oncrpc.server.OncRpcServerReplyMessage state, org.acplt.oncrpc.XdrAble - reply); - + internal abstract void reply(org.acplt.oncrpc.server.OncRpcCallInformation callInfo + , org.acplt.oncrpc.server.OncRpcServerReplyMessage state, org.acplt.oncrpc.XdrAble + reply); + /// /// Reference to interface of an object capable of handling/dispatching /// ONC/RPC requests. @@ -361,14 +361,14 @@ internal abstract void reply(org.acplt.oncrpc.server.OncRpcCallInformation callI /// Reference to interface of an object capable of handling/dispatching /// ONC/RPC requests. /// - internal org.acplt.oncrpc.server.OncRpcDispatchable dispatcher; - + internal org.acplt.oncrpc.server.OncRpcDispatchable dispatcher; + /// Port number where we're listening for incoming ONC/RPC requests. /// Port number where we're listening for incoming ONC/RPC requests. - internal int port; - + internal int port; + /// Program and version number tuples handled by this server transport. /// Program and version number tuples handled by this server transport. - internal org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] info; + internal org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] info; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransportRegistrationInfo.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransportRegistrationInfo.cs similarity index 99% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransportRegistrationInfo.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransportRegistrationInfo.cs index 63b3301..eb91f5d 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransportRegistrationInfo.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcServerTransportRegistrationInfo.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc.server -{ +{ /// /// The class OncRpcServerTransportRegistrationInfo holds /// information about (possibly multiple) registration of server transports @@ -38,25 +38,25 @@ namespace org.acplt.oncrpc.server /// $Revision: 1.1.1.1 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class OncRpcServerTransportRegistrationInfo - { + public class OncRpcServerTransportRegistrationInfo + { /// /// Number of ONC/RPC program handled by a server /// transport. /// /// Version number of ONC/RPC program handled. - public OncRpcServerTransportRegistrationInfo(int program, int version) - { - this.program = program; - this.version = version; - } - + public OncRpcServerTransportRegistrationInfo(int program, int version) + { + this.program = program; + this.version = version; + } + /// Number of ONC/RPC program handled. /// Number of ONC/RPC program handled. - public int program; - + public int program; + /// Version number of ONC/RPC program handled. /// Version number of ONC/RPC program handled. - public int version; + public int version; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpConnectionServerTransport.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpConnectionServerTransport.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpConnectionServerTransport.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpConnectionServerTransport.cs index dcb9a37..54dedd7 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpConnectionServerTransport.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpConnectionServerTransport.cs @@ -25,9 +25,9 @@ using System.Net; using System.Net.Sockets; using System.Threading; - + namespace org.acplt.oncrpc.server -{ +{ /// /// Instances of class OncRpcTcpServerTransport encapsulate /// TCP/IP-based XDR streams of ONC/RPC servers. @@ -44,8 +44,8 @@ namespace org.acplt.oncrpc.server /// $Revision: 1.5 $ $Date: 2008/01/02 15:13:35 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class OncRpcTcpConnectionServerTransport : OncRpcServerTransport - { + public class OncRpcTcpConnectionServerTransport : OncRpcServerTransport + { /// /// Create a new instance of a OncRpcTcpSConnectionerverTransport /// which encapsulates TCP/IP-based XDR streams of an ONC/RPC server. @@ -76,14 +76,14 @@ public class OncRpcTcpConnectionServerTransport : OncRpcServerTransport /// Inherited transmission timeout. /// /// - public OncRpcTcpConnectionServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable - dispatcher, Socket socket, int program, int version, int bufferSize, org.acplt.oncrpc.server.OncRpcTcpServerTransport - parent, int transmissionTimeout) : this(dispatcher, socket, new org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo - [] { new org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo(program, - version) }, bufferSize, parent, transmissionTimeout) - { - } - + public OncRpcTcpConnectionServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable + dispatcher, Socket socket, int program, int version, int bufferSize, org.acplt.oncrpc.server.OncRpcTcpServerTransport + parent, int transmissionTimeout) : this(dispatcher, socket, new org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo + [] { new org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo(program, + version) }, bufferSize, parent, transmissionTimeout) + { + } + /// /// Create a new instance of a OncRpcTcpSConnectionerverTransport /// which encapsulates TCP/IP-based XDR streams of an ONC/RPC server. @@ -112,44 +112,44 @@ public OncRpcTcpConnectionServerTransport(org.acplt.oncrpc.server.OncRpcDispatch /// Inherited transmission timeout. /// /// - public OncRpcTcpConnectionServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable - dispatcher, Socket socket, org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo - [] info, int bufferSize, org.acplt.oncrpc.server.OncRpcTcpServerTransport parent - , int transmissionTimeout) : base(dispatcher, 0, info) - { - this.parent = parent; - this.transmissionTimeout = transmissionTimeout; - // - // Make sure the buffer is large enough and resize system buffers - // accordingly, if possible. - // - if (bufferSize < 1024) - { - bufferSize = 1024; - } - this.socket = socket; - this.port = ((IPEndPoint)socket.RemoteEndPoint).Port; - if (socket.SendBufferSize < bufferSize) - { - socket.SendBufferSize = bufferSize; - } - if (socket.ReceiveBufferSize < bufferSize) - { - socket.ReceiveBufferSize = bufferSize; - } - // - // Create the necessary encoding and decoding streams, so we can - // communicate at all. - // - sendingXdr = new org.acplt.oncrpc.XdrTcpEncodingStream(socket, bufferSize); - receivingXdr = new org.acplt.oncrpc.XdrTcpDecodingStream(socket, bufferSize); - // - // Inherit the character encoding setting from the listening - // transport (parent transport). - // - setCharacterEncoding(parent.getCharacterEncoding()); - } - + public OncRpcTcpConnectionServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable + dispatcher, Socket socket, org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo + [] info, int bufferSize, org.acplt.oncrpc.server.OncRpcTcpServerTransport parent + , int transmissionTimeout) : base(dispatcher, 0, info) + { + this.parent = parent; + this.transmissionTimeout = transmissionTimeout; + // + // Make sure the buffer is large enough and resize system buffers + // accordingly, if possible. + // + if (bufferSize < 1024) + { + bufferSize = 1024; + } + this.socket = socket; + this.port = ((IPEndPoint)socket.RemoteEndPoint).Port; + if (socket.SendBufferSize < bufferSize) + { + socket.SendBufferSize = bufferSize; + } + if (socket.ReceiveBufferSize < bufferSize) + { + socket.ReceiveBufferSize = bufferSize; + } + // + // Create the necessary encoding and decoding streams, so we can + // communicate at all. + // + sendingXdr = new org.acplt.oncrpc.XdrTcpEncodingStream(socket, bufferSize); + receivingXdr = new org.acplt.oncrpc.XdrTcpDecodingStream(socket, bufferSize); + // + // Inherit the character encoding setting from the listening + // transport (parent transport). + // + setCharacterEncoding(parent.getCharacterEncoding()); + } + /// Close the server transport and free any resources associated with it. /// /// Close the server transport and free any resources associated with it. @@ -163,74 +163,74 @@ public OncRpcTcpConnectionServerTransport(org.acplt.oncrpc.server.OncRpcDispatch /// The handler thread will therefore either terminate directly or when /// it tries to sent back replies. /// - public override void Close() - { - if (socket != null) - { - // - // Since there is a non-zero chance of getting race conditions, - // we now first set the socket instance member to null, before - // we close the corresponding socket. This avoids null-pointer - // exceptions in the method which waits for new requests: it is - // possible that this method is awakened because the socket has - // been closed before we could set the socket instance member to - // null. Many thanks to Michael Smith for tracking down this one. - // - Socket deadSocket = socket; - socket = null; - try - { - deadSocket.Close(); - } - catch (System.IO.IOException) - { - } - } - if (sendingXdr != null) - { - org.acplt.oncrpc.XdrEncodingStream deadXdrStream = sendingXdr; - sendingXdr = null; - try - { - deadXdrStream.Close(); - } - catch (System.IO.IOException) - { - } - catch (org.acplt.oncrpc.OncRpcException) - { - } - } - if (receivingXdr != null) - { - org.acplt.oncrpc.XdrDecodingStream deadXdrStream = receivingXdr; - receivingXdr = null; - try - { - deadXdrStream.Close(); - } - catch (System.IO.IOException) - { - } - catch (org.acplt.oncrpc.OncRpcException) - { - } - } - if (parent != null) - { - parent.removeTransport(this); - parent = null; - } - } - - ~OncRpcTcpConnectionServerTransport() - { - if (parent != null) - { - parent.removeTransport(this); - } - } - + public override void Close() + { + if (socket != null) + { + // + // Since there is a non-zero chance of getting race conditions, + // we now first set the socket instance member to null, before + // we close the corresponding socket. This avoids null-pointer + // exceptions in the method which waits for new requests: it is + // possible that this method is awakened because the socket has + // been closed before we could set the socket instance member to + // null. Many thanks to Michael Smith for tracking down this one. + // + Socket deadSocket = socket; + socket = null; + try + { + deadSocket.Close(); + } + catch (System.IO.IOException) + { + } + } + if (sendingXdr != null) + { + org.acplt.oncrpc.XdrEncodingStream deadXdrStream = sendingXdr; + sendingXdr = null; + try + { + deadXdrStream.Close(); + } + catch (System.IO.IOException) + { + } + catch (org.acplt.oncrpc.OncRpcException) + { + } + } + if (receivingXdr != null) + { + org.acplt.oncrpc.XdrDecodingStream deadXdrStream = receivingXdr; + receivingXdr = null; + try + { + deadXdrStream.Close(); + } + catch (System.IO.IOException) + { + } + catch (org.acplt.oncrpc.OncRpcException) + { + } + } + if (parent != null) + { + parent.removeTransport(this); + parent = null; + } + } + + ~OncRpcTcpConnectionServerTransport() + { + if (parent != null) + { + parent.removeTransport(this); + } + } + /// Do not call. /// Do not call. /// @@ -238,12 +238,12 @@ public override void Close() /// individual TCP/IP-based server transport. /// /// - public override void register() - { - throw (new System.Exception("OncRpcTcpServerTransport.register() is abstract " + - "and can not be called.")); - } - + public override void register() + { + throw (new System.Exception("OncRpcTcpServerTransport.register() is abstract " + + "and can not be called.")); + } + /// Retrieves the parameters sent within an ONC/RPC call message. /// /// Retrieves the parameters sent within an ONC/RPC call message. It also @@ -263,16 +263,16 @@ public override void register() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - internal override void retrieveCall(org.acplt.oncrpc.XdrAble call) - { - call.xdrDecode(receivingXdr); - if (pendingDecoding) - { - pendingDecoding = false; - receivingXdr.endDecoding(); - } - } - + internal override void retrieveCall(org.acplt.oncrpc.XdrAble call) + { + call.xdrDecode(receivingXdr); + if (pendingDecoding) + { + pendingDecoding = false; + receivingXdr.endDecoding(); + } + } + /// /// Returns XDR stream which can be used for deserializing the parameters /// of this ONC/RPC call. @@ -282,11 +282,11 @@ internal override void retrieveCall(org.acplt.oncrpc.XdrAble call) /// of this ONC/RPC call. This method belongs to the lower-level access /// pattern when handling ONC/RPC calls. /// - internal override org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream() - { - return receivingXdr; - } - + internal override org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream() + { + return receivingXdr; + } + /// Finishes call parameter deserialization. /// /// Finishes call parameter deserialization. Afterwards the XDR stream @@ -304,15 +304,15 @@ internal override org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - internal override void endDecoding() - { - if (pendingDecoding) - { - pendingDecoding = false; - receivingXdr.endDecoding(); - } - } - + internal override void endDecoding() + { + if (pendingDecoding) + { + pendingDecoding = false; + receivingXdr.endDecoding(); + } + } + /// /// Returns XDR stream which can be used for eserializing the reply /// to this ONC/RPC call. @@ -323,11 +323,11 @@ internal override void endDecoding() /// pattern when handling ONC/RPC calls. /// /// Reference to enecoding XDR stream. - internal override org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream() - { - return sendingXdr; - } - + internal override org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream() + { + return sendingXdr; + } + /// Begins the sending phase for ONC/RPC replies. /// /// Begins the sending phase for ONC/RPC replies. @@ -345,26 +345,26 @@ internal override org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream() /// /// if an I/O exception occurs, like transmission /// - internal override void beginEncoding(org.acplt.oncrpc.server.OncRpcCallInformation - callInfo, org.acplt.oncrpc.server.OncRpcServerReplyMessage state) - { - // - // In case decoding has not been properly finished, do it now to - // free up pending resources, etc. - // - if (pendingDecoding) - { - pendingDecoding = false; - receivingXdr.endDecoding(); - } - // - // Now start encoding using the reply message header first... - // - pendingEncoding = true; - sendingXdr.beginEncoding(callInfo.peerAddress, callInfo.peerPort); - state.xdrEncode(sendingXdr); - } - + internal override void beginEncoding(org.acplt.oncrpc.server.OncRpcCallInformation + callInfo, org.acplt.oncrpc.server.OncRpcServerReplyMessage state) + { + // + // In case decoding has not been properly finished, do it now to + // free up pending resources, etc. + // + if (pendingDecoding) + { + pendingDecoding = false; + receivingXdr.endDecoding(); + } + // + // Now start encoding using the reply message header first... + // + pendingEncoding = true; + sendingXdr.beginEncoding(callInfo.peerAddress, callInfo.peerPort); + state.xdrEncode(sendingXdr); + } + /// Finishes encoding the reply to this ONC/RPC call. /// /// Finishes encoding the reply to this ONC/RPC call. Afterwards you must @@ -381,15 +381,15 @@ internal override void beginEncoding(org.acplt.oncrpc.server.OncRpcCallInformati /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - internal override void endEncoding() - { - // - // Close the case. Finito. - // - sendingXdr.endEncoding(); - pendingEncoding = false; - } - + internal override void endEncoding() + { + // + // Close the case. Finito. + // + sendingXdr.endEncoding(); + pendingEncoding = false; + } + /// Send back an ONC/RPC reply to the original caller. /// /// Send back an ONC/RPC reply to the original caller. This is rather a @@ -422,18 +422,18 @@ internal override void endEncoding() /// /// OncRpcCallInformation /// OncRpcDispatchable - internal override void reply(org.acplt.oncrpc.server.OncRpcCallInformation callInfo - , org.acplt.oncrpc.server.OncRpcServerReplyMessage state, org.acplt.oncrpc.XdrAble - reply) - { - beginEncoding(callInfo, state); - if (reply != null) - { - reply.xdrEncode(sendingXdr); - } - endEncoding(); - } - + internal override void reply(org.acplt.oncrpc.server.OncRpcCallInformation callInfo + , org.acplt.oncrpc.server.OncRpcServerReplyMessage state, org.acplt.oncrpc.XdrAble + reply) + { + beginEncoding(callInfo, state); + if (reply != null) + { + reply.xdrEncode(sendingXdr); + } + endEncoding(); + } + /// /// Creates a new thread and uses this thread to handle the new connection /// to receive ONC/RPC requests, then dispatching them and finally sending @@ -449,31 +449,31 @@ internal override void reply(org.acplt.oncrpc.server.OncRpcCallInformation callI /// calls have to wait for the current call to finish before they are /// handled. /// - public override void listen() + public override void listen() { _TransportHelper t = new _TransportHelper(this); Thread listener = new Thread(new ThreadStart(t.run)); - listener.Name = "TCP server transport connection thread"; - // Should be a Daemon thread if possible - //listener.setDaemon(true); - listener.Start(); - } - - private sealed class _TransportHelper - { - public _TransportHelper(OncRpcTcpConnectionServerTransport _enclosing) - { - this._enclosing = _enclosing; - } - - public void run() - { - this._enclosing._listen(); - } - - private readonly OncRpcTcpConnectionServerTransport _enclosing; - } - + listener.Name = "TCP server transport connection thread"; + // Should be a Daemon thread if possible + //listener.setDaemon(true); + listener.Start(); + } + + private sealed class _TransportHelper + { + public _TransportHelper(OncRpcTcpConnectionServerTransport _enclosing) + { + this._enclosing = _enclosing; + } + + public void run() + { + this._enclosing._listen(); + } + + private readonly OncRpcTcpConnectionServerTransport _enclosing; + } + /// /// The real workhorse handling incoming requests, dispatching them and /// sending back replies. @@ -482,190 +482,190 @@ public void run() /// The real workhorse handling incoming requests, dispatching them and /// sending back replies. /// - private void _listen() - { - org.acplt.oncrpc.server.OncRpcCallInformation callInfo = new org.acplt.oncrpc.server.OncRpcCallInformation - (this); - for (; ; ) - { - // - // Start decoding the incomming call. This involves remembering - // from whom we received the call so we can later send back the - // appropriate reply message. - // - try + private void _listen() + { + org.acplt.oncrpc.server.OncRpcCallInformation callInfo = new org.acplt.oncrpc.server.OncRpcCallInformation + (this); + for (; ; ) + { + // + // Start decoding the incomming call. This involves remembering + // from whom we received the call so we can later send back the + // appropriate reply message. + // + try + { + socket.ReceiveTimeout = 0; + pendingDecoding = true; + receivingXdr.beginDecoding(); + callInfo.peerAddress = receivingXdr.getSenderAddress(); + callInfo.peerPort = receivingXdr.getSenderPort(); + socket.ReceiveTimeout = transmissionTimeout; + } + catch (System.IO.IOException) + { + // + // In case of I/O Exceptions (especially socket exceptions) + // close the file and leave the stage. There's nothing we can + // do anymore. + // + Close(); + return; + } + catch (org.acplt.oncrpc.OncRpcException) + { + // + // In case of ONC/RPC exceptions at this stage kill the + // connection. + // + Close(); + return; + } + try + { + // + // Pull off the ONC/RPC call header of the XDR stream. + // + callInfo.callMessage.xdrDecode(receivingXdr); + } + catch (System.IO.IOException) { - socket.ReceiveTimeout = 0; - pendingDecoding = true; - receivingXdr.beginDecoding(); - callInfo.peerAddress = receivingXdr.getSenderAddress(); - callInfo.peerPort = receivingXdr.getSenderPort(); - socket.ReceiveTimeout = transmissionTimeout; - } - catch (System.IO.IOException) - { - // - // In case of I/O Exceptions (especially socket exceptions) - // close the file and leave the stage. There's nothing we can - // do anymore. - // - Close(); - return; - } - catch (org.acplt.oncrpc.OncRpcException) - { - // - // In case of ONC/RPC exceptions at this stage kill the - // connection. - // - Close(); - return; - } - try - { - // - // Pull off the ONC/RPC call header of the XDR stream. - // - callInfo.callMessage.xdrDecode(receivingXdr); - } - catch (System.IO.IOException) - { - // - // In case of I/O Exceptions (especially socket exceptions) - // close the file and leave the stage. There's nothing we can - // do anymore. - // - Close(); - return; - } - catch (org.acplt.oncrpc.OncRpcException) - { - // - // In case of ONC/RPC exceptions at this stage we're silently - // ignoring that there was some data coming in, as we're not - // sure we got enough information to send a matching reply - // message back to the caller. - // - if (pendingDecoding) - { - pendingDecoding = false; - try - { - receivingXdr.endDecoding(); - } - catch (System.IO.IOException) - { - Close(); - return; - } - catch (org.acplt.oncrpc.OncRpcException) - { - } - } - continue; - } - try - { - // - // Let the dispatcher retrieve the call parameters, work on - // it and send back the reply. - // To make it once again clear: the dispatch called has to - // pull off the parameters of the stream! - // - dispatcher.dispatchOncRpcCall(callInfo, callInfo.callMessage.program, callInfo.callMessage - .version, callInfo.callMessage.procedure); - } - catch (System.Exception e) - { - // - // In case of some other runtime exception, we report back to - // the caller a system error. We can not do this if we don't - // got the exception when serializing the reply, in this case - // all we can do is to drop the connection. If a reply was not - // yet started, we can safely send a system error reply. - // - if (pendingEncoding) - { - Close(); - // Drop the connection... - return; - } - // ...and kill the transport. - // - // Looks safe, so we try to send back an error reply. - // - if (pendingDecoding) - { - pendingDecoding = false; - try - { - receivingXdr.endDecoding(); - } - catch (System.IO.IOException) - { - Close(); - return; - } - catch (org.acplt.oncrpc.OncRpcException) - { - } - } - // - // Check for authentication exceptions, which are reported back - // as is. Otherwise, just report a system error - // -- very generic, indeed. - // - try - { - if (e is org.acplt.oncrpc.OncRpcAuthenticationException) - { - callInfo.failAuthenticationFailed(((org.acplt.oncrpc.OncRpcAuthenticationException - )e).getAuthStatus()); - } - else - { - callInfo.failSystemError(); - } - } - catch (System.IO.IOException) - { - Close(); - return; - } - catch (org.acplt.oncrpc.OncRpcException) - { - } - } - } - } - - // - // Phew. Done with the error reply. So let's wait for new - // incoming ONC/RPC calls... - // + // + // In case of I/O Exceptions (especially socket exceptions) + // close the file and leave the stage. There's nothing we can + // do anymore. + // + Close(); + return; + } + catch (org.acplt.oncrpc.OncRpcException) + { + // + // In case of ONC/RPC exceptions at this stage we're silently + // ignoring that there was some data coming in, as we're not + // sure we got enough information to send a matching reply + // message back to the caller. + // + if (pendingDecoding) + { + pendingDecoding = false; + try + { + receivingXdr.endDecoding(); + } + catch (System.IO.IOException) + { + Close(); + return; + } + catch (org.acplt.oncrpc.OncRpcException) + { + } + } + continue; + } + try + { + // + // Let the dispatcher retrieve the call parameters, work on + // it and send back the reply. + // To make it once again clear: the dispatch called has to + // pull off the parameters of the stream! + // + dispatcher.dispatchOncRpcCall(callInfo, callInfo.callMessage.program, callInfo.callMessage + .version, callInfo.callMessage.procedure); + } + catch (System.Exception e) + { + // + // In case of some other runtime exception, we report back to + // the caller a system error. We can not do this if we don't + // got the exception when serializing the reply, in this case + // all we can do is to drop the connection. If a reply was not + // yet started, we can safely send a system error reply. + // + if (pendingEncoding) + { + Close(); + // Drop the connection... + return; + } + // ...and kill the transport. + // + // Looks safe, so we try to send back an error reply. + // + if (pendingDecoding) + { + pendingDecoding = false; + try + { + receivingXdr.endDecoding(); + } + catch (System.IO.IOException) + { + Close(); + return; + } + catch (org.acplt.oncrpc.OncRpcException) + { + } + } + // + // Check for authentication exceptions, which are reported back + // as is. Otherwise, just report a system error + // -- very generic, indeed. + // + try + { + if (e is org.acplt.oncrpc.OncRpcAuthenticationException) + { + callInfo.failAuthenticationFailed(((org.acplt.oncrpc.OncRpcAuthenticationException + )e).getAuthStatus()); + } + else + { + callInfo.failSystemError(); + } + } + catch (System.IO.IOException) + { + Close(); + return; + } + catch (org.acplt.oncrpc.OncRpcException) + { + } + } + } + } + + // + // Phew. Done with the error reply. So let's wait for new + // incoming ONC/RPC calls... + // /// Set the character encoding for (de-)serializing strings. /// Set the character encoding for (de-)serializing strings. /// /// the encoding to use for (de-)serializing strings. /// If null, the system's default encoding is to be used. /// - public override void setCharacterEncoding(string characterEncoding) - { - sendingXdr.setCharacterEncoding(characterEncoding); - receivingXdr.setCharacterEncoding(characterEncoding); - } - + public override void setCharacterEncoding(string characterEncoding) + { + sendingXdr.setCharacterEncoding(characterEncoding); + receivingXdr.setCharacterEncoding(characterEncoding); + } + /// Get the character encoding for (de-)serializing strings. /// Get the character encoding for (de-)serializing strings. /// /// the encoding currently used for (de-)serializing strings. /// If null, then the system's default encoding is used. /// - public override string getCharacterEncoding() - { - return sendingXdr.getCharacterEncoding(); - } - + public override string getCharacterEncoding() + { + return sendingXdr.getCharacterEncoding(); + } + /// /// TCP socket used for stream-based communication with ONC/RPC /// clients. @@ -674,8 +674,8 @@ public override string getCharacterEncoding() /// TCP socket used for stream-based communication with ONC/RPC /// clients. /// - private Socket socket; - + private Socket socket; + /// /// XDR encoding stream used for sending replies via TCP/IP back to an /// ONC/RPC client. @@ -684,8 +684,8 @@ public override string getCharacterEncoding() /// XDR encoding stream used for sending replies via TCP/IP back to an /// ONC/RPC client. /// - private org.acplt.oncrpc.XdrTcpEncodingStream sendingXdr; - + private org.acplt.oncrpc.XdrTcpEncodingStream sendingXdr; + /// /// XDR decoding stream used when receiving requests via TCP/IP from /// ONC/RPC clients. @@ -694,8 +694,8 @@ public override string getCharacterEncoding() /// XDR decoding stream used when receiving requests via TCP/IP from /// ONC/RPC clients. /// - private org.acplt.oncrpc.XdrTcpDecodingStream receivingXdr; - + private org.acplt.oncrpc.XdrTcpDecodingStream receivingXdr; + /// /// Indicates that BeginDecoding has been called for the /// receiving XDR stream, so that it should be closed later using @@ -706,8 +706,8 @@ public override string getCharacterEncoding() /// receiving XDR stream, so that it should be closed later using /// EndDecoding. /// - private bool pendingDecoding = false; - + private bool pendingDecoding = false; + /// /// Indicates that BeginEncoding has been called for the /// sending XDR stream, so in face of exceptions we can not send an @@ -718,8 +718,8 @@ public override string getCharacterEncoding() /// sending XDR stream, so in face of exceptions we can not send an /// error reply to the client but only drop the connection. /// - private bool pendingEncoding = false; - + private bool pendingEncoding = false; + /// /// Reference to the TCP/IP transport which created us to handle a /// new ONC/RPC connection. @@ -728,8 +728,8 @@ public override string getCharacterEncoding() /// Reference to the TCP/IP transport which created us to handle a /// new ONC/RPC connection. /// - private org.acplt.oncrpc.server.OncRpcTcpServerTransport parent; - + private org.acplt.oncrpc.server.OncRpcTcpServerTransport parent; + /// /// Timeout during the phase where data is received within calls, or data is /// sent within replies. @@ -738,6 +738,6 @@ public override string getCharacterEncoding() /// Timeout during the phase where data is received within calls, or data is /// sent within replies. /// - internal int transmissionTimeout; + internal int transmissionTimeout; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpServerTransport.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpServerTransport.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpServerTransport.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpServerTransport.cs index 51ad396..884ec43 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpServerTransport.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcTcpServerTransport.cs @@ -26,9 +26,9 @@ using System.Net; using System.Net.Sockets; using System.Threading; - + namespace org.acplt.oncrpc.server -{ +{ /// /// Instances of class OncRpcTcpServerTransport encapsulate /// TCP/IP-based XDR streams of ONC/RPC servers. @@ -46,8 +46,8 @@ namespace org.acplt.oncrpc.server /// $Revision: 1.3 $ $Date: 2008/01/02 15:13:35 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class OncRpcTcpServerTransport : OncRpcServerTransport - { + public class OncRpcTcpServerTransport : OncRpcServerTransport + { /// /// Create a new instance of a OncRpcTcpServerTransport which /// encapsulates TCP/IP-based XDR streams of an ONC/RPC server. @@ -84,15 +84,15 @@ public class OncRpcTcpServerTransport : OncRpcServerTransport /// /// /// - public OncRpcTcpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher - , int port, int program, int version, int bufferSize) : this(dispatcher, port, new - org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] { new org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo - (program, version) }, bufferSize) - { - openTransports = new org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList - (this); - } - + public OncRpcTcpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher + , int port, int program, int version, int bufferSize) : this(dispatcher, port, new + org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] { new org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo + (program, version) }, bufferSize) + { + openTransports = new org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList + (this); + } + /// /// Create a new instance of a OncRpcTcpServerTransport which /// encapsulates TCP/IP-based XDR streams of an ONC/RPC server. @@ -126,14 +126,14 @@ public OncRpcTcpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispa /// /// /// - public OncRpcTcpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher - , int port, org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] info - , int bufferSize) : this(dispatcher, null, port, info, bufferSize) - { - openTransports = new org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList - (this); - } - + public OncRpcTcpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher + , int port, org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] info + , int bufferSize) : this(dispatcher, null, port, info, bufferSize) + { + openTransports = new org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList + (this); + } + /// /// Create a new instance of a OncRpcTcpServerTransport which /// encapsulates TCP/IP-based XDR streams of an ONC/RPC server. @@ -168,32 +168,32 @@ public OncRpcTcpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispa /// /// /// - public OncRpcTcpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher - , IPAddress bindAddr, int port, org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo - [] info, int bufferSize) : base(dispatcher, port, info) - { - openTransports = new org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList - (this); - // - // Make sure the buffer is large enough and resize system buffers - // accordingly, if possible. - // - if (bufferSize < 1024) - { - bufferSize = 1024; - } + public OncRpcTcpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher + , IPAddress bindAddr, int port, org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo + [] info, int bufferSize) : base(dispatcher, port, info) + { + openTransports = new org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList + (this); + // + // Make sure the buffer is large enough and resize system buffers + // accordingly, if possible. + // + if (bufferSize < 1024) + { + bufferSize = 1024; + } this.bufferSize = bufferSize; socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); if (bindAddr == null) bindAddr = IPAddress.Any; IPEndPoint localEP = new IPEndPoint(bindAddr, port); - socket.Bind(localEP); - if (port == 0) - { - this.port = ((IPEndPoint)socket.LocalEndPoint).Port; + socket.Bind(localEP); + if (port == 0) + { + this.port = ((IPEndPoint)socket.LocalEndPoint).Port; } socket.Listen(0); - } - + } + /// Close the server transport and free any resources associated with it. /// /// Close the server transport and free any resources associated with it. @@ -208,45 +208,45 @@ public OncRpcTcpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispa /// connections will also be closed. The handler threads will therefore /// either terminate directly or when they try to sent back replies. /// - public override void Close() - { - if (socket != null) - { - // - // Since there is a non-zero chance of getting race conditions, - // we now first set the socket instance member to null, before - // we close the corresponding socket. This avoids null-pointer - // exceptions in the method which waits for connections: it is - // possible that that method is awakened because the socket has - // been closed before we could set the socket instance member to - // null. Many thanks to Michael Smith for tracking down this one. - // - Socket deadSocket = socket; + public override void Close() + { + if (socket != null) + { + // + // Since there is a non-zero chance of getting race conditions, + // we now first set the socket instance member to null, before + // we close the corresponding socket. This avoids null-pointer + // exceptions in the method which waits for connections: it is + // possible that that method is awakened because the socket has + // been closed before we could set the socket instance member to + // null. Many thanks to Michael Smith for tracking down this one. + // + Socket deadSocket = socket; socket = null; - try - { - deadSocket.Close(); - } - catch (Exception e) + try + { + deadSocket.Close(); + } + catch (Exception e) { Console.Out.WriteLine(e.Message); - Console.Out.WriteLine(e.StackTrace); - } - } - // - // Now close all per-connection transports currently open... - // - lock (openTransports) - { - while (openTransports.size() > 0) - { - org.acplt.oncrpc.server.OncRpcTcpConnectionServerTransport transport = (org.acplt.oncrpc.server.OncRpcTcpConnectionServerTransport - )openTransports.removeFirst(); - transport.Close(); - } - } - } - + Console.Out.WriteLine(e.StackTrace); + } + } + // + // Now close all per-connection transports currently open... + // + lock (openTransports) + { + while (openTransports.size() > 0) + { + org.acplt.oncrpc.server.OncRpcTcpConnectionServerTransport transport = (org.acplt.oncrpc.server.OncRpcTcpConnectionServerTransport + )openTransports.removeFirst(); + transport.Close(); + } + } + } + /// /// Removes a TCP/IP server transport from the list of currently open /// transports. @@ -259,15 +259,15 @@ public override void Close() /// Server transport to remove from the list of currently /// open transports for this listening transport. /// - public virtual void removeTransport(org.acplt.oncrpc.server.OncRpcTcpConnectionServerTransport - transport) - { - lock (openTransports) - { - openTransports.remove((object)transport); - } - } - + public virtual void removeTransport(org.acplt.oncrpc.server.OncRpcTcpConnectionServerTransport + transport) + { + lock (openTransports) + { + openTransports.remove((object)transport); + } + } + /// /// Register the TCP/IP port where this server transport waits for incoming /// requests with the ONC/RPC portmapper. @@ -280,34 +280,34 @@ public virtual void removeTransport(org.acplt.oncrpc.server.OncRpcTcpConnectionS /// if the portmapper could not be contacted /// successfully of if the portmapper rejected port registration(s). /// - public override void register() - { - try - { - org.acplt.oncrpc.OncRpcPortmapClient portmapper = new org.acplt.oncrpc.OncRpcPortmapClient - (IPAddress.Loopback); - int size = info.Length; - for (int idx = 0; idx < size; ++idx) - { - // - // Try to register the port for our transport with the local ONC/RPC - // portmapper. If this fails, bail out with an exception. - // - if (!portmapper.setPort(info[idx].program, info[idx].version, org.acplt.oncrpc.OncRpcProtocols - .ONCRPC_TCP, port)) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANNOTREGISTER - )); - } - } - } - catch (System.IO.IOException) - { - throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_FAILED - )); - } - } - + public override void register() + { + try + { + org.acplt.oncrpc.OncRpcPortmapClient portmapper = new org.acplt.oncrpc.OncRpcPortmapClient + (IPAddress.Loopback); + int size = info.Length; + for (int idx = 0; idx < size; ++idx) + { + // + // Try to register the port for our transport with the local ONC/RPC + // portmapper. If this fails, bail out with an exception. + // + if (!portmapper.setPort(info[idx].program, info[idx].version, org.acplt.oncrpc.OncRpcProtocols + .ONCRPC_TCP, port)) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_CANNOTREGISTER + )); + } + } + } + catch (System.IO.IOException) + { + throw (new org.acplt.oncrpc.OncRpcException(org.acplt.oncrpc.OncRpcException.RPC_FAILED + )); + } + } + /// Do not call. /// Do not call. /// @@ -316,24 +316,24 @@ public override void register() /// /// /// - internal override void retrieveCall(org.acplt.oncrpc.XdrAble call) - { - throw (new System.Exception("OncRpcTcpServerTransport.retrieveCall() is abstract " - + "and can not be called.")); - } - + internal override void retrieveCall(org.acplt.oncrpc.XdrAble call) + { + throw (new System.Exception("OncRpcTcpServerTransport.retrieveCall() is abstract " + + "and can not be called.")); + } + /// Do not call. /// Do not call. /// /// because this method must not be called for a listening /// server transport. /// - internal override org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream() - { - throw (new System.Exception("OncRpcTcpServerTransport.getXdrDecodingStream() is abstract " - + "and can not be called.")); - } - + internal override org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream() + { + throw (new System.Exception("OncRpcTcpServerTransport.getXdrDecodingStream() is abstract " + + "and can not be called.")); + } + /// Do not call. /// Do not call. /// @@ -342,24 +342,24 @@ internal override org.acplt.oncrpc.XdrDecodingStream getXdrDecodingStream() /// /// /// - internal override void endDecoding() - { - throw (new System.Exception("OncRpcTcpServerTransport.endDecoding() is abstract " - + "and can not be called.")); - } - + internal override void endDecoding() + { + throw (new System.Exception("OncRpcTcpServerTransport.endDecoding() is abstract " + + "and can not be called.")); + } + /// Do not call. /// Do not call. /// /// because this method must not be called for a listening /// server transport. /// - internal override org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream() - { - throw (new System.Exception("OncRpcTcpServerTransport.getXdrEncodingStream() is abstract " - + "and can not be called.")); - } - + internal override org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream() + { + throw (new System.Exception("OncRpcTcpServerTransport.getXdrEncodingStream() is abstract " + + "and can not be called.")); + } + /// Do not call. /// Do not call. /// @@ -368,13 +368,13 @@ internal override org.acplt.oncrpc.XdrEncodingStream getXdrEncodingStream() /// /// /// - internal override void beginEncoding(org.acplt.oncrpc.server.OncRpcCallInformation - callInfo, org.acplt.oncrpc.server.OncRpcServerReplyMessage state) - { - throw (new System.Exception("OncRpcTcpServerTransport.beginEncoding() is abstract " - + "and can not be called.")); - } - + internal override void beginEncoding(org.acplt.oncrpc.server.OncRpcCallInformation + callInfo, org.acplt.oncrpc.server.OncRpcServerReplyMessage state) + { + throw (new System.Exception("OncRpcTcpServerTransport.beginEncoding() is abstract " + + "and can not be called.")); + } + /// Do not call. /// Do not call. /// @@ -383,12 +383,12 @@ internal override void beginEncoding(org.acplt.oncrpc.server.OncRpcCallInformati /// /// /// - internal override void endEncoding() - { - throw (new System.Exception("OncRpcTcpServerTransport.endEncoding() is abstract " - + "and can not be called.")); - } - + internal override void endEncoding() + { + throw (new System.Exception("OncRpcTcpServerTransport.endEncoding() is abstract " + + "and can not be called.")); + } + /// Do not call. /// Do not call. /// @@ -397,14 +397,14 @@ internal override void endEncoding() /// /// /// - internal override void reply(org.acplt.oncrpc.server.OncRpcCallInformation callInfo - , org.acplt.oncrpc.server.OncRpcServerReplyMessage state, org.acplt.oncrpc.XdrAble - reply) - { - throw (new System.Exception("OncRpcTcpServerTransport.reply() is abstract " + "and can not be called." - )); - } - + internal override void reply(org.acplt.oncrpc.server.OncRpcCallInformation callInfo + , org.acplt.oncrpc.server.OncRpcServerReplyMessage state, org.acplt.oncrpc.XdrAble + reply) + { + throw (new System.Exception("OncRpcTcpServerTransport.reply() is abstract " + "and can not be called." + )); + } + /// /// Creates a new thread and uses this thread to listen to incoming /// ONC/RPC requests, then dispatches them and finally sends back the @@ -418,81 +418,81 @@ internal override void reply(org.acplt.oncrpc.server.OncRpcCallInformation callI ///

For every incomming TCP/IP connection a handler thread is created /// to handle ONC/RPC calls on this particular connection. /// - public override void listen() - { - // - // Create a new (daemon) thread which will handle incoming connection - // requests. - // - _TransportHelper t = new _TransportHelper(this); + public override void listen() + { + // + // Create a new (daemon) thread which will handle incoming connection + // requests. + // + _TransportHelper t = new _TransportHelper(this); Thread listenThread = new Thread(new ThreadStart(t.run)); - listenThread.Name = "TCP server transport listener thread"; - // - // Now wait for (new) connection requests to come in. - // - // - // Let the newly created transport object handle this - // connection. Note that it will create its own - // thread for handling. - // - // - // We are just ignoring most of the IOExceptions as - // they might be thrown, for instance, if a client - // attempts a connection and resets it before it is - // pulled off by accept(). If the socket has been - // gone away after an IOException this means that the - // transport has been closed, so we end this thread - // gracefully. - // + listenThread.Name = "TCP server transport listener thread"; + // + // Now wait for (new) connection requests to come in. + // + // + // Let the newly created transport object handle this + // connection. Note that it will create its own + // thread for handling. + // + // + // We are just ignoring most of the IOExceptions as + // they might be thrown, for instance, if a client + // attempts a connection and resets it before it is + // pulled off by accept(). If the socket has been + // gone away after an IOException this means that the + // transport has been closed, so we end this thread + // gracefully. + // listenThread.Start(); - } - - private sealed class _TransportHelper - { - public _TransportHelper(OncRpcTcpServerTransport _enclosing) - { - this._enclosing = _enclosing; - } - - public void run() - { - for (; ; ) - { - try - { - Socket myServerSocket = this._enclosing.socket; - if (myServerSocket == null) - { - break; + } + + private sealed class _TransportHelper + { + public _TransportHelper(OncRpcTcpServerTransport _enclosing) + { + this._enclosing = _enclosing; + } + + public void run() + { + for (; ; ) + { + try + { + Socket myServerSocket = this._enclosing.socket; + if (myServerSocket == null) + { + break; + } + Socket newSocket = myServerSocket.Accept(); + OncRpcTcpConnectionServerTransport transport = new OncRpcTcpConnectionServerTransport + (this._enclosing.dispatcher, newSocket, this._enclosing.info, this._enclosing.bufferSize + , this._enclosing, this._enclosing.transmissionTimeout); + lock (this._enclosing.openTransports) + { + this._enclosing.openTransports.add((object)transport); } - Socket newSocket = myServerSocket.Accept(); - OncRpcTcpConnectionServerTransport transport = new OncRpcTcpConnectionServerTransport - (this._enclosing.dispatcher, newSocket, this._enclosing.info, this._enclosing.bufferSize - , this._enclosing, this._enclosing.transmissionTimeout); - lock (this._enclosing.openTransports) - { - this._enclosing.openTransports.add((object)transport); - } - transport.listen(); - } - catch (org.acplt.oncrpc.OncRpcException) - { - } - catch (SocketException) - { - // If the socket has been closed and set to null, don't bother - // notifying anybody because we're shutting down - if (this._enclosing.socket == null) - { - break; - } - } - } - } - - private readonly OncRpcTcpServerTransport _enclosing; - } - + transport.listen(); + } + catch (org.acplt.oncrpc.OncRpcException) + { + } + catch (SocketException) + { + // If the socket has been closed and set to null, don't bother + // notifying anybody because we're shutting down + if (this._enclosing.socket == null) + { + break; + } + } + } + } + + private readonly OncRpcTcpServerTransport _enclosing; + } + ///

Set the timeout used during transmission of data. /// /// Set the timeout used during transmission of data. If the flow of data @@ -500,15 +500,15 @@ public void run() /// timeout, an exception is thrown. The timeout must be > 0. /// /// Transmission timeout in milliseconds. - public virtual void setTransmissionTimeout(int milliseconds) - { - if (milliseconds <= 0) - { - throw (new System.ArgumentException("transmission timeout must be > 0")); - } - transmissionTimeout = milliseconds; - } - + public virtual void setTransmissionTimeout(int milliseconds) + { + if (milliseconds <= 0) + { + throw (new System.ArgumentException("transmission timeout must be > 0")); + } + transmissionTimeout = milliseconds; + } + /// /// Retrieve the current timeout used during transmission phases (call and /// reply phases). @@ -518,33 +518,33 @@ public virtual void setTransmissionTimeout(int milliseconds) /// reply phases). /// /// Current transmission timeout. - public virtual int getTransmissionTimeout() - { - return transmissionTimeout; - } - + public virtual int getTransmissionTimeout() + { + return transmissionTimeout; + } + /// Set the character encoding for (de-)serializing strings. /// Set the character encoding for (de-)serializing strings. /// /// the encoding to use for (de-)serializing strings. /// If null, the system's default encoding is to be used. /// - public override void setCharacterEncoding(string characterEncoding) - { - this.characterEncoding = characterEncoding; - } - + public override void setCharacterEncoding(string characterEncoding) + { + this.characterEncoding = characterEncoding; + } + /// Get the character encoding for (de-)serializing strings. /// Get the character encoding for (de-)serializing strings. /// /// the encoding currently used for (de-)serializing strings. /// If null, then the system's default encoding is used. /// - public override string getCharacterEncoding() - { - return characterEncoding; - } - + public override string getCharacterEncoding() + { + return characterEncoding; + } + /// /// TCP socket used for stream-based communication with ONC/RPC /// clients. @@ -553,16 +553,16 @@ public override string getCharacterEncoding() /// TCP socket used for stream-based communication with ONC/RPC /// clients. /// - private Socket socket; - + private Socket socket; + /// Size of send/receive buffers to use when encoding/decoding XDR data. /// Size of send/receive buffers to use when encoding/decoding XDR data. - private int bufferSize; - + private int bufferSize; + /// Collection containing currently open transports. /// Collection containing currently open transports. - private org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList openTransports; - + private org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList openTransports; + /// /// Timeout during the phase where data is received within calls, or data is /// sent within replies. @@ -571,8 +571,8 @@ public override string getCharacterEncoding() /// Timeout during the phase where data is received within calls, or data is /// sent within replies. /// - internal int transmissionTimeout = 30000; - + internal int transmissionTimeout = 30000; + /// /// Encoding to use when deserializing strings or null if /// the system's default encoding should be used. @@ -581,8 +581,8 @@ public override string getCharacterEncoding() /// Encoding to use when deserializing strings or null if /// the system's default encoding should be used. /// - private string characterEncoding = null; - + private string characterEncoding = null; + /// /// Minumum implementation of a double linked list which notices which /// transports are currently open and have to be shut down when this @@ -597,88 +597,88 @@ public override string getCharacterEncoding() ///

Note that the methods are not synchronized as we leave this up /// to the caller, who can thus optimize access during critical sections. /// - private class TransportList - { + private class TransportList + { ///

Create a new instance of a list of open transports. /// Create a new instance of a list of open transports. - public TransportList(OncRpcTcpServerTransport _enclosing) - { - this._enclosing = _enclosing; - head = new org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node(this - , null); - // - // Link header node with itself, so it is its own successor - // and predecessor. Using a header node excuses us from checking - // for the special cases of first and last node (or both at - // the same time). - // - this.head.next = this.head; - this.head.prev = this.head; - } - + public TransportList(OncRpcTcpServerTransport _enclosing) + { + this._enclosing = _enclosing; + head = new org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node(this + , null); + // + // Link header node with itself, so it is its own successor + // and predecessor. Using a header node excuses us from checking + // for the special cases of first and last node (or both at + // the same time). + // + this.head.next = this.head; + this.head.prev = this.head; + } + /// Add new transport to list of open transports. /// /// Add new transport to list of open transports. The new transport /// is always added immediately after the head of the linked list. /// - public virtual void add(object o) - { - org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node node = new org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node - (this, o); - node.next = this.head.next; - this.head.next = node; - node.prev = this.head; - node.next.prev = node; - ++this._size; - } - + public virtual void add(object o) + { + org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node node = new org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node + (this, o); + node.next = this.head.next; + this.head.next = node; + node.prev = this.head; + node.next.prev = node; + ++this._size; + } + /// Remove given transport from list of open transports. /// Remove given transport from list of open transports. - public virtual bool remove(object o) - { - org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node node = this.head - .next; - while (node != this.head) - { - if (node.item == o) - { - node.prev.next = node.next; - node.next.prev = node.prev; - --this._size; - return true; - } - node = node.next; - } - return false; - } - + public virtual bool remove(object o) + { + org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node node = this.head + .next; + while (node != this.head) + { + if (node.item == o) + { + node.prev.next = node.next; + node.next.prev = node.prev; + --this._size; + return true; + } + node = node.next; + } + return false; + } + /// Removes and returns the first open transport from list. /// Removes and returns the first open transport from list. - public virtual object removeFirst() - { - // - // Do not remove the header node. - // - if (this._size == 0) - { - throw (new System.ArgumentOutOfRangeException()); - } - org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node node = this.head - .next; - this.head.next = node.next; - node.next.prev = this.head; - --this._size; - return node.item; - } - + public virtual object removeFirst() + { + // + // Do not remove the header node. + // + if (this._size == 0) + { + throw (new System.ArgumentOutOfRangeException()); + } + org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node node = this.head + .next; + this.head.next = node.next; + node.next.prev = this.head; + --this._size; + return node.item; + } + /// Returns the number of (open) transports in this list. /// Returns the number of (open) transports in this list. /// the number of (open) transports. - public virtual int size() - { - return this._size; - } - + public virtual int size() + { + return this._size; + } + /// /// Head node for list of open transports which does not represent /// an open transport but instead excuses us of dealing with all @@ -689,8 +689,8 @@ public virtual int size() /// an open transport but instead excuses us of dealing with all /// the special cases of real nodes at the begin or end of the list. /// - private org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node head; - + private org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node head; + /// /// Number of (real) open transports currently registered in this /// list. @@ -699,8 +699,8 @@ public virtual int size() /// Number of (real) open transports currently registered in this /// list. /// - private int _size = 0; - + private int _size = 0; + /// /// Node class referencing an individual open transport and holding /// references to the previous and next open transports. @@ -709,8 +709,8 @@ public virtual int size() /// Node class referencing an individual open transport and holding /// references to the previous and next open transports. /// - private class Node - { + private class Node + { /// /// Create a new instance of a node object and let it reference /// an open transport. @@ -720,12 +720,12 @@ private class Node /// an open transport. The creator of this object is then /// responsible for adding this node to the circular list itself. /// - public Node(TransportList _enclosing, object item) - { - this._enclosing = _enclosing; - this.item = item; - } - + public Node(TransportList _enclosing, object item) + { + this._enclosing = _enclosing; + this.item = item; + } + /// /// Next item node (in other words: next open transport) /// in the list. @@ -736,8 +736,8 @@ public Node(TransportList _enclosing, object item) /// first item, but instead reference the last item. Thus, the /// list is circular. /// - internal org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node next; - + internal org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node next; + /// /// Previous item node (in other words: previous open transport) /// in the list. @@ -748,19 +748,19 @@ public Node(TransportList _enclosing, object item) /// last item, but instead reference the first item. Thus, the /// list is circular. /// - internal org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node prev; - + internal org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList.Node prev; + /// The item/object placed at this position in the list. /// /// The item/object placed at this position in the list. This /// currently always references an open transport. /// - internal object item; - - private readonly TransportList _enclosing; - } - - private readonly OncRpcTcpServerTransport _enclosing; - } + internal object item; + + private readonly TransportList _enclosing; + } + + private readonly OncRpcTcpServerTransport _enclosing; + } } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcUdpServerTransport.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcUdpServerTransport.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcUdpServerTransport.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcUdpServerTransport.cs index 4db2792..5295ab4 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcUdpServerTransport.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/server/OncRpcUdpServerTransport.cs @@ -27,9 +27,9 @@ using System.Net; using System.Net.Sockets; using System.Threading; - + namespace org.acplt.oncrpc.server -{ +{ /// /// Instances of class OncRpcUdpServerTransport encapsulate /// UDP/IP-based XDR streams of ONC/RPC servers. @@ -45,8 +45,8 @@ namespace org.acplt.oncrpc.server /// $Revision: 1.4 $ $Date: 2008/01/02 15:13:35 $ $State: Exp $ $Locker: $ /// Harald Albrecht /// Jay Walters - public class OncRpcUdpServerTransport : OncRpcServerTransport - { + public class OncRpcUdpServerTransport : OncRpcServerTransport + { /// /// Create a new instance of a OncRpcUdpServerTransport which /// encapsulates UDP/IP-based XDR streams of an ONC/RPC server. @@ -78,13 +78,13 @@ public class OncRpcUdpServerTransport : OncRpcServerTransport /// /// /// - public OncRpcUdpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher - , int port, int program, int version, int bufferSize) : this(dispatcher, port, new - org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] { new org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo - (program, version) }, bufferSize) - { - } - + public OncRpcUdpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher + , int port, int program, int version, int bufferSize) : this(dispatcher, port, new + org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo[] { new org.acplt.oncrpc.server.OncRpcServerTransportRegistrationInfo + (program, version) }, bufferSize) + { + } + /// /// Create a new instance of a OncRpcUdpServerTransport which /// encapsulates UDP/IP-based XDR streams of an ONC/RPC server. @@ -115,12 +115,12 @@ public OncRpcUdpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispa /// /// /// - public OncRpcUdpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher - , int port, OncRpcServerTransportRegistrationInfo[] info - , int bufferSize) : this(dispatcher, null, port, info, bufferSize) - { - } - + public OncRpcUdpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispatcher + , int port, OncRpcServerTransportRegistrationInfo[] info + , int bufferSize) : this(dispatcher, null, port, info, bufferSize) + { + } + /// /// Create a new instance of a OncRpcUdpServerTransport which /// encapsulates UDP/IP-based XDR streams of an ONC/RPC server. @@ -152,42 +152,42 @@ public OncRpcUdpServerTransport(org.acplt.oncrpc.server.OncRpcDispatchable dispa /// /// /// - public OncRpcUdpServerTransport(OncRpcDispatchable dispatcher - , IPAddress bindAddr, int port, OncRpcServerTransportRegistrationInfo - [] info, int bufferSize) : base(dispatcher, port, info) - { - // - // Make sure the buffer is large enough and resize system buffers - // accordingly, if possible. - // - if (bufferSize < 1024) - { - bufferSize = 1024; + public OncRpcUdpServerTransport(OncRpcDispatchable dispatcher + , IPAddress bindAddr, int port, OncRpcServerTransportRegistrationInfo + [] info, int bufferSize) : base(dispatcher, port, info) + { + // + // Make sure the buffer is large enough and resize system buffers + // accordingly, if possible. + // + if (bufferSize < 1024) + { + bufferSize = 1024; } socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); if (bindAddr == null) bindAddr = IPAddress.Any; IPEndPoint localEP = new IPEndPoint(bindAddr, port); socket.Bind(localEP); - if (port == 0) - { + if (port == 0) + { this.port = ((IPEndPoint)(socket.LocalEndPoint)).Port; - } - if (socket.SendBufferSize < bufferSize) + } + if (socket.SendBufferSize < bufferSize) { - socket.SendBufferSize = bufferSize; - } - if (socket.ReceiveBufferSize < bufferSize) + socket.SendBufferSize = bufferSize; + } + if (socket.ReceiveBufferSize < bufferSize) { - socket.ReceiveBufferSize = bufferSize; - } - // - // Create the necessary encoding and decoding streams, so we can - // communicate at all. - // - sendingXdr = new org.acplt.oncrpc.XdrUdpEncodingStream(socket, bufferSize); - receivingXdr = new org.acplt.oncrpc.XdrUdpDecodingStream(socket, bufferSize); - } - + socket.ReceiveBufferSize = bufferSize; + } + // + // Create the necessary encoding and decoding streams, so we can + // communicate at all. + // + sendingXdr = new org.acplt.oncrpc.XdrUdpEncodingStream(socket, bufferSize); + receivingXdr = new org.acplt.oncrpc.XdrUdpDecodingStream(socket, bufferSize); + } + /// Close the server transport and free any resources associated with it. /// /// Close the server transport and free any resources associated with it. @@ -202,56 +202,56 @@ public OncRpcUdpServerTransport(OncRpcDispatchable dispatcher /// tries to sent back a reply which it was about to handle at the time /// the close method was called. /// - public override void Close() - { - if (socket != null) - { - // - // Since there is a non-zero chance of getting race conditions, - // we now first set the socket instance member to null, before - // we close the corresponding socket. This avoids null-pointer - // exceptions in the method which waits for new requests: it is - // possible that this method is awakened because the socket has - // been closed before we could set the socket instance member to - // null. Many thanks to Michael Smith for tracking down this one. - // - socket.Shutdown(SocketShutdown.Both); - Socket deadSocket = socket; - socket = null; - deadSocket.Close(); - } - if (sendingXdr != null) - { - XdrEncodingStream deadXdrStream = sendingXdr; - sendingXdr = null; - try - { - deadXdrStream.Close(); - } - catch (System.IO.IOException) - { - } - catch (org.acplt.oncrpc.OncRpcException) - { - } - } - if (receivingXdr != null) - { - XdrDecodingStream deadXdrStream = receivingXdr; - receivingXdr = null; - try - { - deadXdrStream.Close(); - } - catch (IOException) - { - } - catch (OncRpcException) - { - } - } - } - + public override void Close() + { + if (socket != null) + { + // + // Since there is a non-zero chance of getting race conditions, + // we now first set the socket instance member to null, before + // we close the corresponding socket. This avoids null-pointer + // exceptions in the method which waits for new requests: it is + // possible that this method is awakened because the socket has + // been closed before we could set the socket instance member to + // null. Many thanks to Michael Smith for tracking down this one. + // + socket.Shutdown(SocketShutdown.Both); + Socket deadSocket = socket; + socket = null; + deadSocket.Close(); + } + if (sendingXdr != null) + { + XdrEncodingStream deadXdrStream = sendingXdr; + sendingXdr = null; + try + { + deadXdrStream.Close(); + } + catch (System.IO.IOException) + { + } + catch (org.acplt.oncrpc.OncRpcException) + { + } + } + if (receivingXdr != null) + { + XdrDecodingStream deadXdrStream = receivingXdr; + receivingXdr = null; + try + { + deadXdrStream.Close(); + } + catch (IOException) + { + } + catch (OncRpcException) + { + } + } + } + /// /// Register the UDP/IP port where this server transport waits for incoming /// requests with the ONC/RPC portmapper. @@ -311,16 +311,16 @@ public override void register() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - internal override void retrieveCall(org.acplt.oncrpc.XdrAble call) - { - call.xdrDecode(receivingXdr); - if (pendingDecoding) - { - pendingDecoding = false; - receivingXdr.endDecoding(); - } - } - + internal override void retrieveCall(org.acplt.oncrpc.XdrAble call) + { + call.xdrDecode(receivingXdr); + if (pendingDecoding) + { + pendingDecoding = false; + receivingXdr.endDecoding(); + } + } + /// /// Returns XDR stream which can be used for deserializing the parameters /// of this ONC/RPC call. @@ -331,11 +331,11 @@ internal override void retrieveCall(org.acplt.oncrpc.XdrAble call) /// pattern when handling ONC/RPC calls. /// /// Reference to decoding XDR stream. - internal override XdrDecodingStream getXdrDecodingStream() - { - return receivingXdr; - } - + internal override XdrDecodingStream getXdrDecodingStream() + { + return receivingXdr; + } + /// Finishes call parameter deserialization. /// /// Finishes call parameter deserialization. Afterwards the XDR stream @@ -353,15 +353,15 @@ internal override XdrDecodingStream getXdrDecodingStream() /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - internal override void endDecoding() - { - if (pendingDecoding) - { - pendingDecoding = false; - receivingXdr.endDecoding(); - } - } - + internal override void endDecoding() + { + if (pendingDecoding) + { + pendingDecoding = false; + receivingXdr.endDecoding(); + } + } + /// /// Returns XDR stream which can be used for eserializing the reply /// to this ONC/RPC call. @@ -372,11 +372,11 @@ internal override void endDecoding() /// pattern when handling ONC/RPC calls. /// /// Reference to enecoding XDR stream. - internal override XdrEncodingStream getXdrEncodingStream() - { - return sendingXdr; - } - + internal override XdrEncodingStream getXdrEncodingStream() + { + return sendingXdr; + } + /// Begins the sending phase for ONC/RPC replies. /// /// Begins the sending phase for ONC/RPC replies. @@ -394,25 +394,25 @@ internal override XdrEncodingStream getXdrEncodingStream() /// /// if an I/O exception occurs, like transmission /// - internal override void beginEncoding(OncRpcCallInformation - callInfo, OncRpcServerReplyMessage state) - { - // - // In case decoding has not been properly finished, do it now to - // free up pending resources, etc. - // - if (pendingDecoding) - { - pendingDecoding = false; - receivingXdr.endDecoding(); - } - // - // Now start encoding using the reply message header first... - // - sendingXdr.beginEncoding(callInfo.peerAddress, callInfo.peerPort); - state.xdrEncode(sendingXdr); - } - + internal override void beginEncoding(OncRpcCallInformation + callInfo, OncRpcServerReplyMessage state) + { + // + // In case decoding has not been properly finished, do it now to + // free up pending resources, etc. + // + if (pendingDecoding) + { + pendingDecoding = false; + receivingXdr.endDecoding(); + } + // + // Now start encoding using the reply message header first... + // + sendingXdr.beginEncoding(callInfo.peerAddress, callInfo.peerPort); + state.xdrEncode(sendingXdr); + } + /// Finishes encoding the reply to this ONC/RPC call. /// /// Finishes encoding the reply to this ONC/RPC call. Afterwards you must @@ -429,14 +429,14 @@ internal override void beginEncoding(OncRpcCallInformation /// if an I/O exception occurs, like transmission /// failures over the network, etc. /// - internal override void endEncoding() - { - // - // Close the case. Finito. - // - sendingXdr.endEncoding(); - } - + internal override void endEncoding() + { + // + // Close the case. Finito. + // + sendingXdr.endEncoding(); + } + /// Send back an ONC/RPC reply to the original caller. /// /// Send back an ONC/RPC reply to the original caller. This is rather a @@ -469,17 +469,17 @@ internal override void endEncoding() /// /// OncRpcCallInformation /// OncRpcDispatchable - internal override void reply(OncRpcCallInformation callInfo - , OncRpcServerReplyMessage state, XdrAble reply) - { - beginEncoding(callInfo, state); - if (reply != null) - { - reply.xdrEncode(sendingXdr); - } - endEncoding(); - } - + internal override void reply(OncRpcCallInformation callInfo + , OncRpcServerReplyMessage state, XdrAble reply) + { + beginEncoding(callInfo, state); + if (reply != null) + { + reply.xdrEncode(sendingXdr); + } + endEncoding(); + } + /// /// Creates a new thread and uses this thread to listen to incoming /// ONC/RPC requests, then dispatches them and finally sends back the @@ -495,31 +495,31 @@ internal override void reply(OncRpcCallInformation callInfo /// calls have to wait for the current call to finish before they are /// handled. /// - public override void listen() + public override void listen() { _TransportHelper t = new _TransportHelper(this); _listener = new Thread(new ThreadStart(t.run)); - _listener.Name = "UDP server transport listener thread"; - // Should be a Daemon - //listener.setDaemon(true); - _listener.Start(); - } - - private sealed class _TransportHelper - { - public _TransportHelper(OncRpcUdpServerTransport _enclosing) - { - this._enclosing = _enclosing; - } - - public void run() - { - this._enclosing._listen(); - } - - private readonly OncRpcUdpServerTransport _enclosing; - } - + _listener.Name = "UDP server transport listener thread"; + // Should be a Daemon + //listener.setDaemon(true); + _listener.Start(); + } + + private sealed class _TransportHelper + { + public _TransportHelper(OncRpcUdpServerTransport _enclosing) + { + this._enclosing = _enclosing; + } + + public void run() + { + this._enclosing._listen(); + } + + private readonly OncRpcUdpServerTransport _enclosing; + } + /// /// The real workhorse handling incoming requests, dispatching them and /// sending back replies. @@ -528,144 +528,144 @@ public void run() /// The real workhorse handling incoming requests, dispatching them and /// sending back replies. /// - public virtual void _listen() - { - OncRpcCallInformation callInfo = new OncRpcCallInformation - (this); - for (; ; ) - { - // - // Start decoding the incomming call. This involves remembering - // from whom we received the call so we can later send back the - // appropriate reply message. - // Note that for UDP-based communication we don't need to deal - // with timeouts. - // - try - { - pendingDecoding = true; - receivingXdr.beginDecoding(); - callInfo.peerAddress = receivingXdr.getSenderAddress(); - callInfo.peerPort = receivingXdr.getSenderPort(); - } - catch (SocketException) - { - // - // In case of I/O Exceptions (especially socket exceptions) - // close the file and leave the stage. There's nothing we can - // do anymore. - // - Close(); - return; - } - catch (org.acplt.oncrpc.OncRpcException) - { - // - // In case of ONC/RPC exceptions at this stage we're silently - // ignoring that there was some data coming in... - // - continue; - } - try - { - // - // Pull off the ONC/RPC call header of the XDR stream. - // - callInfo.callMessage.xdrDecode(receivingXdr); - } - catch (System.IO.IOException) - { - // - // In case of I/O Exceptions (especially socket exceptions) - // close the file and leave the stage. There's nothing we can - // do anymore. - // - Close(); - return; - } - catch (org.acplt.oncrpc.OncRpcException) - { - // - // In case of ONC/RPC exceptions at this stage we're silently - // ignoring that there was some data coming in, as we're not - // sure we got enough information to send a matching reply - // message back to the caller. - // - if (pendingDecoding) - { - pendingDecoding = false; - try - { - receivingXdr.endDecoding(); - } - catch (System.IO.IOException) - { - Close(); - return; - } - catch (org.acplt.oncrpc.OncRpcException) - { - } - } - continue; - } - try - { - // - // Let the dispatcher retrieve the call parameters, work on - // it and send back the reply. - // To make it once again clear: the dispatch called has to - // pull off the parameters of the stream! - // - dispatcher.dispatchOncRpcCall(callInfo, callInfo.callMessage.program, callInfo.callMessage - .version, callInfo.callMessage.procedure); - } - catch (System.Exception e) - { - // - // In case of some other runtime exception, we report back to - // the caller a system error. - // - // In case of UDP-bases transports we can do so, because we - // know that we can reset the buffer and serialize another - // reply message even in case we caught some OncRpcException. - // - // Note that we "kill" the transport by closing it when we - // got stuck with an I/O exception when trying to send back - // an error reply. - // - if (pendingDecoding) - { - pendingDecoding = false; - try - { - receivingXdr.endDecoding(); - } - catch (System.IO.IOException) - { - Close(); - return; - } - catch (org.acplt.oncrpc.OncRpcException) - { - } - } - // - // Check for authentication exceptions, which are reported back - // as is. Otherwise, just report a system error - // -- very generic, indeed. - // - try - { - if (e is OncRpcAuthenticationException) - { - callInfo.failAuthenticationFailed(((OncRpcAuthenticationException - )e).getAuthStatus()); - } - else - { - callInfo.failSystemError(); - } + public virtual void _listen() + { + OncRpcCallInformation callInfo = new OncRpcCallInformation + (this); + for (; ; ) + { + // + // Start decoding the incomming call. This involves remembering + // from whom we received the call so we can later send back the + // appropriate reply message. + // Note that for UDP-based communication we don't need to deal + // with timeouts. + // + try + { + pendingDecoding = true; + receivingXdr.beginDecoding(); + callInfo.peerAddress = receivingXdr.getSenderAddress(); + callInfo.peerPort = receivingXdr.getSenderPort(); + } + catch (SocketException) + { + // + // In case of I/O Exceptions (especially socket exceptions) + // close the file and leave the stage. There's nothing we can + // do anymore. + // + Close(); + return; + } + catch (org.acplt.oncrpc.OncRpcException) + { + // + // In case of ONC/RPC exceptions at this stage we're silently + // ignoring that there was some data coming in... + // + continue; + } + try + { + // + // Pull off the ONC/RPC call header of the XDR stream. + // + callInfo.callMessage.xdrDecode(receivingXdr); + } + catch (System.IO.IOException) + { + // + // In case of I/O Exceptions (especially socket exceptions) + // close the file and leave the stage. There's nothing we can + // do anymore. + // + Close(); + return; + } + catch (org.acplt.oncrpc.OncRpcException) + { + // + // In case of ONC/RPC exceptions at this stage we're silently + // ignoring that there was some data coming in, as we're not + // sure we got enough information to send a matching reply + // message back to the caller. + // + if (pendingDecoding) + { + pendingDecoding = false; + try + { + receivingXdr.endDecoding(); + } + catch (System.IO.IOException) + { + Close(); + return; + } + catch (org.acplt.oncrpc.OncRpcException) + { + } + } + continue; + } + try + { + // + // Let the dispatcher retrieve the call parameters, work on + // it and send back the reply. + // To make it once again clear: the dispatch called has to + // pull off the parameters of the stream! + // + dispatcher.dispatchOncRpcCall(callInfo, callInfo.callMessage.program, callInfo.callMessage + .version, callInfo.callMessage.procedure); + } + catch (System.Exception e) + { + // + // In case of some other runtime exception, we report back to + // the caller a system error. + // + // In case of UDP-bases transports we can do so, because we + // know that we can reset the buffer and serialize another + // reply message even in case we caught some OncRpcException. + // + // Note that we "kill" the transport by closing it when we + // got stuck with an I/O exception when trying to send back + // an error reply. + // + if (pendingDecoding) + { + pendingDecoding = false; + try + { + receivingXdr.endDecoding(); + } + catch (System.IO.IOException) + { + Close(); + return; + } + catch (org.acplt.oncrpc.OncRpcException) + { + } + } + // + // Check for authentication exceptions, which are reported back + // as is. Otherwise, just report a system error + // -- very generic, indeed. + // + try + { + if (e is OncRpcAuthenticationException) + { + callInfo.failAuthenticationFailed(((OncRpcAuthenticationException + )e).getAuthStatus()); + } + else + { + callInfo.failSystemError(); + } } catch (SocketException) { @@ -679,40 +679,40 @@ public virtual void _listen() Close(); return; } - catch (org.acplt.oncrpc.OncRpcException) - { - } - } - } - } - - // - // Phew. Done with the error reply. So let's wait for new - // incoming ONC/RPC calls... - // + catch (org.acplt.oncrpc.OncRpcException) + { + } + } + } + } + + // + // Phew. Done with the error reply. So let's wait for new + // incoming ONC/RPC calls... + // /// Set the character encoding for (de-)serializing strings. /// Set the character encoding for (de-)serializing strings. /// /// the encoding to use for (de-)serializing strings. /// If null, the system's default encoding is to be used. /// - public override void setCharacterEncoding(string characterEncoding) - { - sendingXdr.setCharacterEncoding(characterEncoding); - receivingXdr.setCharacterEncoding(characterEncoding); - } - + public override void setCharacterEncoding(string characterEncoding) + { + sendingXdr.setCharacterEncoding(characterEncoding); + receivingXdr.setCharacterEncoding(characterEncoding); + } + /// Get the character encoding for (de-)serializing strings. /// Get the character encoding for (de-)serializing strings. /// /// the encoding currently used for (de-)serializing strings. /// If null, then the system's default encoding is used. /// - public override string getCharacterEncoding() - { - return sendingXdr.getCharacterEncoding(); - } - + public override string getCharacterEncoding() + { + return sendingXdr.getCharacterEncoding(); + } + /// /// UDP socket used for datagram-based communication with ONC/RPC /// clients. @@ -726,8 +726,8 @@ public override string getCharacterEncoding() /// /// Thread which manages listening on the socket /// - private Thread _listener; - + private Thread _listener; + /// /// XDR encoding stream used for sending replies via UDP/IP back to an /// ONC/RPC client. @@ -736,8 +736,8 @@ public override string getCharacterEncoding() /// XDR encoding stream used for sending replies via UDP/IP back to an /// ONC/RPC client. /// - private XdrUdpEncodingStream sendingXdr; - + private XdrUdpEncodingStream sendingXdr; + /// /// XDR decoding stream used when receiving requests via UDP/IP from /// ONC/RPC clients. @@ -746,8 +746,8 @@ public override string getCharacterEncoding() /// XDR decoding stream used when receiving requests via UDP/IP from /// ONC/RPC clients. /// - private XdrUdpDecodingStream receivingXdr; - + private XdrUdpDecodingStream receivingXdr; + /// /// Indicates that BeginDecoding has been called for the /// receiving XDR stream, so that it should be closed later using @@ -758,6 +758,6 @@ public override string getCharacterEncoding() /// receiving XDR stream, so that it should be closed later using /// EndDecoding. /// - private bool pendingDecoding = false; + private bool pendingDecoding = false; } } \ No newline at end of file diff --git a/NFSLibrary/RPC/org/acplt/oncrpc/web/Base64.cs b/src/NFSLibrary/RPC/org/acplt/oncrpc/web/Base64.cs similarity index 98% rename from NFSLibrary/RPC/org/acplt/oncrpc/web/Base64.cs rename to src/NFSLibrary/RPC/org/acplt/oncrpc/web/Base64.cs index 0d9bec9..24e7c8d 100644 --- a/NFSLibrary/RPC/org/acplt/oncrpc/web/Base64.cs +++ b/src/NFSLibrary/RPC/org/acplt/oncrpc/web/Base64.cs @@ -23,7 +23,7 @@ */ namespace org.acplt.oncrpc.web -{ +{ /// /// The abstract Base64 class provides static methods to convert /// back and forth between binary and base64-encoded data. @@ -37,8 +37,8 @@ namespace org.acplt.oncrpc.web /// /// Harald Albrecht /// Jay Walters - public abstract class Base64 - { + public abstract class Base64 + { /// Converts binary data into base64 encoded data. /// Converts binary data into base64 encoded data. /// Binary data to be encoded. @@ -53,69 +53,69 @@ public abstract class Base64 /// store base64 encoded data. /// /// Length of encoded base64 data. - public static int encode(byte[] binaryData, int binaryOffset, int length, byte[] - encodedData, int encodedOffset) - { - // - // Calculate length of encoded data including optional padding. - // - int encodedLength = ((length + 2) / 3) * 4; - // - // Now do the encoding, thus inflating every three bytes of binary - // data to four ASCII characters. - // - int b1; - int b2; - int b3; - int endPos = binaryOffset + length - 1 - 2; - while (binaryOffset <= endPos) - { - b1 = binaryData[binaryOffset++]; - b2 = binaryData[binaryOffset++]; - b3 = binaryData[binaryOffset++]; - encodedData[encodedOffset++] = encodingBase64Alephbeth[((b1) >> (2 & 0x1f)) & unchecked( - (int)(0x3F))]; - encodedData[encodedOffset++] = encodingBase64Alephbeth[((b1 << 4) & unchecked((int - )(0x30))) | (((b2) >> (4 & 0x1f)) & unchecked((int)(0xF)))]; - encodedData[encodedOffset++] = encodingBase64Alephbeth[((b2 << 2) & unchecked((int - )(0x3C))) | (((b3) >> (6 & 0x1f)) & unchecked((int)(0x03)))]; - encodedData[encodedOffset++] = encodingBase64Alephbeth[b3 & unchecked((int)(0x3F) - )]; - } - // - // If one or two bytes are left (because we work on blocks of three - // bytes), convert them too and apply padding. - // - endPos += 2; - // now points to the last encodable byte - if (binaryOffset <= endPos) - { - b1 = binaryData[binaryOffset++]; - encodedData[encodedOffset++] = encodingBase64Alephbeth[((b1) >> (2 & 0x1f)) & unchecked( - (int)(0x3F))]; - if (binaryOffset <= endPos) - { - b2 = binaryData[binaryOffset++]; - encodedData[encodedOffset++] = encodingBase64Alephbeth[((b1 << 4) & unchecked((int - )(0x30))) | (((b2) >> (4 & 0x1f)) & unchecked((int)(0xF)))]; - encodedData[encodedOffset++] = encodingBase64Alephbeth[(b2 << 2) & unchecked((int - )(0x3C))]; - encodedData[encodedOffset] = (byte)'='; - } - else - { - encodedData[encodedOffset++] = encodingBase64Alephbeth[(b1 << 4) & unchecked((int - )(0x30))]; - encodedData[encodedOffset++] = (byte)'='; - encodedData[encodedOffset] = (byte)'='; - } - } - // - // Finally return length of encoded data - // - return encodedLength; - } - + public static int encode(byte[] binaryData, int binaryOffset, int length, byte[] + encodedData, int encodedOffset) + { + // + // Calculate length of encoded data including optional padding. + // + int encodedLength = ((length + 2) / 3) * 4; + // + // Now do the encoding, thus inflating every three bytes of binary + // data to four ASCII characters. + // + int b1; + int b2; + int b3; + int endPos = binaryOffset + length - 1 - 2; + while (binaryOffset <= endPos) + { + b1 = binaryData[binaryOffset++]; + b2 = binaryData[binaryOffset++]; + b3 = binaryData[binaryOffset++]; + encodedData[encodedOffset++] = encodingBase64Alephbeth[((b1) >> (2 & 0x1f)) & unchecked( + (int)(0x3F))]; + encodedData[encodedOffset++] = encodingBase64Alephbeth[((b1 << 4) & unchecked((int + )(0x30))) | (((b2) >> (4 & 0x1f)) & unchecked((int)(0xF)))]; + encodedData[encodedOffset++] = encodingBase64Alephbeth[((b2 << 2) & unchecked((int + )(0x3C))) | (((b3) >> (6 & 0x1f)) & unchecked((int)(0x03)))]; + encodedData[encodedOffset++] = encodingBase64Alephbeth[b3 & unchecked((int)(0x3F) + )]; + } + // + // If one or two bytes are left (because we work on blocks of three + // bytes), convert them too and apply padding. + // + endPos += 2; + // now points to the last encodable byte + if (binaryOffset <= endPos) + { + b1 = binaryData[binaryOffset++]; + encodedData[encodedOffset++] = encodingBase64Alephbeth[((b1) >> (2 & 0x1f)) & unchecked( + (int)(0x3F))]; + if (binaryOffset <= endPos) + { + b2 = binaryData[binaryOffset++]; + encodedData[encodedOffset++] = encodingBase64Alephbeth[((b1 << 4) & unchecked((int + )(0x30))) | (((b2) >> (4 & 0x1f)) & unchecked((int)(0xF)))]; + encodedData[encodedOffset++] = encodingBase64Alephbeth[(b2 << 2) & unchecked((int + )(0x3C))]; + encodedData[encodedOffset] = (byte)'='; + } + else + { + encodedData[encodedOffset++] = encodingBase64Alephbeth[(b1 << 4) & unchecked((int + )(0x30))]; + encodedData[encodedOffset++] = (byte)'='; + encodedData[encodedOffset] = (byte)'='; + } + } + // + // Finally return length of encoded data + // + return encodedLength; + } + /// Converts base64 encoded data into binary data. /// Converts base64 encoded data into binary data. /// Base64 encoded data. @@ -130,95 +130,95 @@ public static int encode(byte[] binaryData, int binaryOffset, int length, byte[] /// store the decoded binary data. /// /// Length of decoded binary data. - public static int decode(byte[] encodedData, int encodedOffset, int length, byte[] - binaryData, int binaryOffset) - { - // - // Determine the length of data to be decoded. Optional padding has - // to be removed first (of course). - // - int endPos = encodedOffset + length - 1; - while ((endPos >= 0) && (encodedData[endPos] == '=')) - { - --endPos; - } - // next line was: endPos - length / 4 + 1 - int binaryLength = endPos - encodedOffset - length / 4 + 1; - // - // Now do the four-to-three entities/letters/bytes/whatever - // conversion. We chew on as many four-letter groups as we can, - // converting them into three byte groups. - // - byte b1; - byte b2; - byte b3; - byte b4; - int stopPos = endPos - 3; - // now points to the last letter in the - // last four-letter group - while (encodedOffset <= stopPos) - { - b1 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; - b2 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; - b3 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; - b4 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; - binaryData[binaryOffset++] = (byte)(((b1 << 2) & unchecked((int)(0xFF))) | (((b2) - >> (4 & 0x1f)) & unchecked((int)(0x03)))); - binaryData[binaryOffset++] = (byte)(((b2 << 4) & unchecked((int)(0xFF))) | (((b3) - >> (2 & 0x1f)) & unchecked((int)(0x0F)))); - binaryData[binaryOffset++] = (byte)(((b3 << 6) & unchecked((int)(0xFF))) | (b4 & - unchecked((int)(0x3F)))); - } - // - // If one, two or three letters from the base64 encoded data are - // left, convert them too. - // Hack Note(tm): if the length of encoded data is not a multiple - // of four, then padding must occur ('='). As the decoding alphabet - // contains zeros everywhere with the exception of valid letters, - // indexing into the mapping is just fine and reliefs us of the - // pain to check everything and make thus makes the code better. - // - if (encodedOffset <= endPos) - { - b1 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; - b2 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; - binaryData[binaryOffset++] = (byte)(((b1 << 2) & unchecked((int)(0xFF))) | (((b2) - >> (4 & 0x1f)) & unchecked((int)(0x03)))); - if (encodedOffset <= endPos) - { - b3 = decodingBase64Alephbeth[encodedData[encodedOffset]]; - binaryData[binaryOffset++] = (byte)(((b2 << 4) & unchecked((int)(0xFF))) | (((b3) - >> (2 & 0x1f)) & unchecked((int)(0x0F)))); - } - } - // - // Okay. That's it for now. Just return the length of decoded data. - // - return binaryLength; - } - + public static int decode(byte[] encodedData, int encodedOffset, int length, byte[] + binaryData, int binaryOffset) + { + // + // Determine the length of data to be decoded. Optional padding has + // to be removed first (of course). + // + int endPos = encodedOffset + length - 1; + while ((endPos >= 0) && (encodedData[endPos] == '=')) + { + --endPos; + } + // next line was: endPos - length / 4 + 1 + int binaryLength = endPos - encodedOffset - length / 4 + 1; + // + // Now do the four-to-three entities/letters/bytes/whatever + // conversion. We chew on as many four-letter groups as we can, + // converting them into three byte groups. + // + byte b1; + byte b2; + byte b3; + byte b4; + int stopPos = endPos - 3; + // now points to the last letter in the + // last four-letter group + while (encodedOffset <= stopPos) + { + b1 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; + b2 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; + b3 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; + b4 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; + binaryData[binaryOffset++] = (byte)(((b1 << 2) & unchecked((int)(0xFF))) | (((b2) + >> (4 & 0x1f)) & unchecked((int)(0x03)))); + binaryData[binaryOffset++] = (byte)(((b2 << 4) & unchecked((int)(0xFF))) | (((b3) + >> (2 & 0x1f)) & unchecked((int)(0x0F)))); + binaryData[binaryOffset++] = (byte)(((b3 << 6) & unchecked((int)(0xFF))) | (b4 & + unchecked((int)(0x3F)))); + } + // + // If one, two or three letters from the base64 encoded data are + // left, convert them too. + // Hack Note(tm): if the length of encoded data is not a multiple + // of four, then padding must occur ('='). As the decoding alphabet + // contains zeros everywhere with the exception of valid letters, + // indexing into the mapping is just fine and reliefs us of the + // pain to check everything and make thus makes the code better. + // + if (encodedOffset <= endPos) + { + b1 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; + b2 = decodingBase64Alephbeth[encodedData[encodedOffset++]]; + binaryData[binaryOffset++] = (byte)(((b1 << 2) & unchecked((int)(0xFF))) | (((b2) + >> (4 & 0x1f)) & unchecked((int)(0x03)))); + if (encodedOffset <= endPos) + { + b3 = decodingBase64Alephbeth[encodedData[encodedOffset]]; + binaryData[binaryOffset++] = (byte)(((b2 << 4) & unchecked((int)(0xFF))) | (((b3) + >> (2 & 0x1f)) & unchecked((int)(0x0F)))); + } + } + // + // Okay. That's it for now. Just return the length of decoded data. + // + return binaryLength; + } + /// Mapping from binary 0-63 to base64 alphabet according to RFC 2045. /// /// Mapping from binary 0-63 to base64 alphabet according to RFC 2045. /// (Yes, I do know that the Hebrew alphabet has only 22 letters.) /// - private static readonly byte[] encodingBase64Alephbeth = new byte[] { (byte) 'A',(byte) 'B',(byte) 'C' - ,(byte) 'D',(byte) 'E',(byte) 'F',(byte) 'G',(byte) 'H',(byte) 'I',(byte) 'J',(byte) 'K', (byte) 'L',(byte) 'M',(byte) 'N',(byte) 'O',(byte) 'P',(byte) 'Q',(byte) 'R',(byte) 'S' - ,(byte) 'T',(byte) 'U',(byte) 'V',(byte) 'W',(byte) 'X',(byte) 'Y',(byte) 'Z',(byte) 'a',(byte) 'b',(byte) 'c',(byte) 'd',(byte) 'e',(byte) 'f',(byte) 'g',(byte) 'h',(byte) 'i' - ,(byte) 'j',(byte) 'k',(byte) 'l',(byte) 'm',(byte) 'n',(byte) 'o',(byte) 'p',(byte) 'q',(byte) 'r',(byte) 's',(byte) 't',(byte) 'u',(byte) 'v',(byte) 'w',(byte) 'x',(byte) 'y' - ,(byte) 'z',(byte) '0',(byte) '1',(byte) '2',(byte) '3',(byte) '4',(byte) '5',(byte) '6',(byte) '7',(byte) '8',(byte) '9',(byte) '+',(byte) '/' }; - + private static readonly byte[] encodingBase64Alephbeth = new byte[] { (byte) 'A',(byte) 'B',(byte) 'C' + ,(byte) 'D',(byte) 'E',(byte) 'F',(byte) 'G',(byte) 'H',(byte) 'I',(byte) 'J',(byte) 'K', (byte) 'L',(byte) 'M',(byte) 'N',(byte) 'O',(byte) 'P',(byte) 'Q',(byte) 'R',(byte) 'S' + ,(byte) 'T',(byte) 'U',(byte) 'V',(byte) 'W',(byte) 'X',(byte) 'Y',(byte) 'Z',(byte) 'a',(byte) 'b',(byte) 'c',(byte) 'd',(byte) 'e',(byte) 'f',(byte) 'g',(byte) 'h',(byte) 'i' + ,(byte) 'j',(byte) 'k',(byte) 'l',(byte) 'm',(byte) 'n',(byte) 'o',(byte) 'p',(byte) 'q',(byte) 'r',(byte) 's',(byte) 't',(byte) 'u',(byte) 'v',(byte) 'w',(byte) 'x',(byte) 'y' + ,(byte) 'z',(byte) '0',(byte) '1',(byte) '2',(byte) '3',(byte) '4',(byte) '5',(byte) '6',(byte) '7',(byte) '8',(byte) '9',(byte) '+',(byte) '/' }; + /// Mapping from base64 alphabet to binary 0-63. /// Mapping from base64 alphabet to binary 0-63. - private static readonly byte[] decodingBase64Alephbeth; - - static Base64() - { - decodingBase64Alephbeth = new byte[256]; - for (int i = 0; i < 64; ++i) - { - decodingBase64Alephbeth[encodingBase64Alephbeth[i]] = (byte)i; - } - } + private static readonly byte[] decodingBase64Alephbeth; + + static Base64() + { + decodingBase64Alephbeth = new byte[256]; + for (int i = 0; i < 64; ++i) + { + decodingBase64Alephbeth[encodingBase64Alephbeth[i]] = (byte)i; + } + } } } \ No newline at end of file diff --git a/src/Test.Client/Program.cs b/src/Test.Client/Program.cs new file mode 100644 index 0000000..f85d756 --- /dev/null +++ b/src/Test.Client/Program.cs @@ -0,0 +1,366 @@ +namespace Test.Client +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Net; + using System.Text; + using System.Threading; + using System.Threading.Tasks; + using GetSomeInput; + using NFSLibrary; + using NFSLibrary.Protocols.Commons; + + public static class Program + { +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously + + /* + * See https://www.dummies.com/article/technology/computers/operating-systems/linux/how-to-share-files-with-nfs-on-linux-systems-255851/ + * https://github.com/SonnyX/NFS-Client + * https://github.com/nekoni/nekodrive + * https://github.com/DeCoRawr/NFSClient + * https://code.google.com/archive/p/nekodrive/wikis/UseNFSDotNetLibrary.wiki + * https://ubuntu.com/server/docs/network-file-system-nfs + * https://www.hanewin.net/nfs-e.htm + * https://serverfault.com/questions/240897/how-to-properly-set-permissions-for-nfs-folder-permission-denied-on-mounting-en + * + */ + + private static bool _RunForever = true; + private static string _Hostname = "192.168.254.129"; + private static NfsClient.NfsVersion _Version = NfsClient.NfsVersion.V3; + private static string _Share = "/srv"; + + public static void Main(string[] args) + { + while (_RunForever) + { + string userInput = Inputty.GetString("Command [?/help]:", null, false); + + switch (userInput) + { + case "?": + Menu(); + break; + case "q": + _RunForever = false; + break; + case "cls": + Console.Clear(); + break; + + case "host": + _Hostname = Inputty.GetString("Host IP:", _Hostname, false); + break; + case "share": + _Share = Inputty.GetString("Share:", _Share, false); + break; + + case "shares": + ListShares().Wait(); + break; + case "enum": + ListFiles().Wait(); + break; + case "walk": + WalkDirectory().Wait(); + break; + case "read": + ReadFile().Wait(); + break; + case "write": + WriteFile().Wait(); + break; + case "delete": + DeleteFile().Wait(); + break; + } + } + } + + private static void Menu() + { + Console.WriteLine(""); + Console.WriteLine("Available commands:"); + Console.WriteLine(" ? Help, this menu"); + Console.WriteLine(" q Quit"); + Console.WriteLine(" cls Clear screen"); + Console.WriteLine(" host Set host IP"); + Console.WriteLine(" share Set share name"); + Console.WriteLine(""); + Console.WriteLine(" shares List shares"); + Console.WriteLine(" enum Enumerate a share"); + Console.WriteLine(" walk Walk the directory tree"); + Console.WriteLine(" read Read a file"); + Console.WriteLine(" write Write a file"); + Console.WriteLine(" delete Delete a file"); + Console.WriteLine(""); + } + + private static async Task ListShares() + { + NfsClient client = new NfsClient(_Version); + client.Connect(IPAddress.Parse(_Hostname)); + List exports = client.GetExportedDevices(); + if (exports != null && exports.Count > 0) + { + foreach (var share in exports) + { + Console.WriteLine(share); + } + } + client.Disconnect(); + } + + private static async Task> ListFilesInternal(string baseDir) + { + List files = new List(); + + if (String.IsNullOrEmpty(baseDir)) baseDir = "."; + else + { + if (!baseDir.EndsWith("/")) baseDir += "/"; + if (!baseDir.EndsWith(".")) baseDir += "."; + } + + try + { + NfsClient client = new NfsClient(_Version); + client.Connect(IPAddress.Parse(_Hostname)); + client.MountDevice(_Share); + + Console.WriteLine("Retrieving file list from base directory: " + baseDir); + + foreach (string item in client.GetItemList(baseDir)) + { + NFSAttributes attrib = client.GetItemAttributes(item); + if (attrib == null) continue; + + bool isDirectory = client.IsDirectory(item); + if (isDirectory) continue; + files.Add(item); + } + + client.UnMountDevice(); + client.Disconnect(); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + } + + return files; + } + + private static async Task> ListDirectoriesInternal(string baseDir) + { + List directories = new List(); + + if (String.IsNullOrEmpty(baseDir)) baseDir = "."; + else + { + if (!baseDir.EndsWith("/")) baseDir += "/"; + if (!baseDir.EndsWith(".")) baseDir += "."; + } + + try + { + NfsClient client = new NfsClient(_Version); + client.Connect(IPAddress.Parse(_Hostname)); + client.MountDevice(_Share); + + Console.WriteLine("Retrieving directory list from base directory: " + baseDir); + + foreach (string item in client.GetItemList(baseDir)) + { + NFSAttributes attrib = client.GetItemAttributes(item); + if (attrib == null) continue; + + bool isDirectory = client.IsDirectory(item); + if (!isDirectory) continue; + directories.Add(item); + } + + client.UnMountDevice(); + client.Disconnect(); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + } + + return directories; + } + + private static async Task ListFiles() + { + try + { + string baseDir = Inputty.GetString("Base directory:", null, true); + + List files = await ListFilesInternal(baseDir); + List directories = await ListDirectoriesInternal(baseDir); + + Console.WriteLine("Directories:"); + if (directories != null && directories.Count > 0) + foreach (string directory in directories) Console.WriteLine(" " + directory); + else + Console.WriteLine(" (none)"); + + Console.WriteLine("Files:"); + if (files != null && files.Count > 0) + { + foreach (string file in files) + Console.WriteLine(" " + file); + } + else + Console.WriteLine(" (none)"); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + } + } + + private static async Task WalkDirectory() + { + NfsClient client = new NfsClient(_Version); + client.Connect(IPAddress.Parse(_Hostname)); + client.MountDevice(_Share); + + await WalkDirectoryInternal(client, ".", "", 0); + + client.UnMountDevice(); + client.Disconnect(); + } + + private static async Task WalkDirectoryInternal(NfsClient client, string item, string path, int spacing) + { + try + { + string spaces = ""; + for (int i = 0; i < spacing; i++) spaces += " "; + Console.WriteLine(spaces + "| Walking directory " + item); + + string basePath = ""; + if (!String.IsNullOrEmpty(path)) basePath = path + "/"; + + List items = client.GetItemList(basePath + item, true); + Console.WriteLine(spaces + "| Read " + items.Count + " items"); + + foreach (string curr in items) + { + bool isDir = client.IsDirectory(curr); + + if (!isDir) + { + NFSAttributes attrib = client.GetItemAttributes(path + curr); + if (attrib == null) + { + Console.WriteLine(spaces + " | Unable to get attributes for " + curr); + continue; + } + + Console.WriteLine(spaces + " | " + (path + curr) + " " + attrib.Size + " bytes"); + } + else + { + Console.WriteLine(spaces + " | " + curr + " (dir)"); + // await WalkDirectoryInternal(client, (curr + "/."), (path + "/" + curr), spacing + 2); + } + } + + Console.WriteLine(""); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + } + } + + private static async Task ReadFile() + { + string file = Inputty.GetString("Filename:", null, true); + if (String.IsNullOrEmpty(file)) return; + + NfsClient client = new NfsClient(_Version); + client.Connect(IPAddress.Parse(_Hostname)); + client.MountDevice(_Share); + + Stream stream = new MemoryStream(); + client.Read(file, ref stream); + + if (stream != null) + { + stream.Seek(0, SeekOrigin.Begin); + + int read = 0; + byte[] buf = new byte[4096]; + + while (true) + { + read = await stream.ReadAsync(buf, 0, buf.Length); + if (read > 0) + { + byte[] segment = new byte[read]; + Buffer.BlockCopy(buf, 0, segment, 0, read); + Console.WriteLine(Encoding.UTF8.GetString(segment)); + } + else + { + break; + } + } + } + + client.UnMountDevice(); + + stream.Close(); + stream.Dispose(); + stream = null; + + client.Disconnect(); + } + + private static async Task WriteFile() + { + string file = Inputty.GetString("Filename:", null, true); + if (String.IsNullOrEmpty(file)) return; + + string data = Inputty.GetString("Data :", null, true); + if (String.IsNullOrEmpty(data)) return; + + NfsClient client = new NfsClient(_Version); + client.Connect(IPAddress.Parse(_Hostname)); + client.MountDevice(_Share); + + using (MemoryStream stream = new MemoryStream()) + { + await stream.WriteAsync(Encoding.UTF8.GetBytes(data)); + stream.Seek(0, SeekOrigin.Begin); + client.Write(file, stream); + } + + client.UnMountDevice(); + + client.Disconnect(); + } + + private static async Task DeleteFile() + { + string file = Inputty.GetString("Filename:", null, true); + if (String.IsNullOrEmpty(file)) return; + + NfsClient client = new NfsClient(_Version); + client.Connect(IPAddress.Parse(_Hostname)); + client.MountDevice(_Share); + client.DeleteFile(file); + client.UnMountDevice(); + + client.Disconnect(); + } + +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously + } +} \ No newline at end of file diff --git a/src/Test.Client/Test.Client.csproj b/src/Test.Client/Test.Client.csproj new file mode 100644 index 0000000..0f2e21b --- /dev/null +++ b/src/Test.Client/Test.Client.csproj @@ -0,0 +1,16 @@ + + + + Exe + net6.0;net7.0;net8.0 + + + + + + + + + + + diff --git a/src/Test.Nfs/Program.cs b/src/Test.Nfs/Program.cs new file mode 100644 index 0000000..5d576cc --- /dev/null +++ b/src/Test.Nfs/Program.cs @@ -0,0 +1,364 @@ +namespace Test.Nfs +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Net; + using System.Text; + using NFSLibrary; + using NFSLibrary.Protocols.Commons; + + public static class Program + { +#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. + + private static string _Hostname = "192.168.254.129"; + private static NfsClient.NfsVersion _Version = NfsClient.NfsVersion.V3; + private static string _Share = "/srv"; + + /* + + / + |-- root.txt + |-- dir1 + |-- 1.txt + |-- dir2 + |-- 2.txt + |-- dir3 + |-- 3.txt + + */ + + public static void Main(string[] args) + { + NfsClient client = null; + Stream stream = null; + string file = ""; + string folder = ""; + + try + { + #region Initialize-and-Mount + + Console.WriteLine(""); + Console.WriteLine("Initializing client"); + client = new NfsClient(_Version); + client.Connect(IPAddress.Parse(_Hostname)); + Console.WriteLine("Mounting device"); + client.MountDevice(_Share); + + #endregion + + #region List-Shares + + Console.WriteLine(""); + Console.WriteLine("Listing shares"); + List exports = client.GetExportedDevices(); + if (exports != null && exports.Count > 0) + foreach (var share in exports) + Console.WriteLine("| " + share); + + #endregion + + #region Enumerate-Root + + Console.WriteLine(""); + Console.WriteLine("Listing root directory"); + foreach (string item in client.GetItemList(".")) + { + NFSAttributes attrib = client.GetItemAttributes(item); + if (attrib == null) continue; + + bool isDirectory = client.IsDirectory(item); + Console.WriteLine("| " + item + " " + (isDirectory ? "(dir)" : null) + " " + attrib.Size + " bytes"); + } + + #endregion + + #region Read /root.txt + + Console.WriteLine(""); + // file = client.Combine("root.txt", null); + // file = ".\\root.txt"; + file = NormalizePath("/root.txt"); + Console.WriteLine("Reading file root.txt: " + file); + stream = new MemoryStream(); + client.Read("root.txt", ref stream); + if (stream != null) + { + stream.Seek(0, SeekOrigin.Begin); + + int read = 0; + byte[] buf = new byte[4096]; + + while (true) + { + read = stream.Read(buf, 0, buf.Length); + if (read > 0) + { + byte[] segment = new byte[read]; + Buffer.BlockCopy(buf, 0, segment, 0, read); + Console.WriteLine(Encoding.UTF8.GetString(segment)); + } + else + { + break; + } + } + } + + #endregion + + #region Enumerate /dir1 + + Console.WriteLine(""); + // folder = client.Combine("dir1", "."); + // folder = ".\\dir1"; + folder = NormalizePath("/dir1/"); + Console.WriteLine("Listing dir1 directory: " + folder); + foreach (string item in client.GetItemList(folder)) + { + NFSAttributes attrib = client.GetItemAttributes(client.Combine(item, "dir1")); + if (attrib == null) continue; + + bool isDirectory = client.IsDirectory(client.Combine(item, "dir1")); + Console.WriteLine("| " + item + " " + (isDirectory ? "(dir)" : null) + " " + attrib.Size + " bytes"); + } + + #endregion + + #region Read /dir1/1.txt + + Console.WriteLine(""); + // file = client.Combine("1.txt", "dir1"); + // file = ".\\dir1\\1.txt"; + file = NormalizePath("/dir1/1.txt"); + Console.WriteLine("Reading file 1.txt: " + file); + stream = new MemoryStream(); + client.Read(file, ref stream); + if (stream != null) + { + stream.Seek(0, SeekOrigin.Begin); + + int read = 0; + byte[] buf = new byte[4096]; + + while (true) + { + read = stream.Read(buf, 0, buf.Length); + if (read > 0) + { + byte[] segment = new byte[read]; + Buffer.BlockCopy(buf, 0, segment, 0, read); + Console.WriteLine(Encoding.UTF8.GetString(segment)); + } + else + { + break; + } + } + } + + #endregion + + #region Enumerate /dir2 + + Console.WriteLine(""); + // folder = client.Combine("dir2", "dir1"); + // folder = ".\\dir1\\dir2"; + folder = NormalizePath("/dir1/dir2/"); + Console.WriteLine("Listing dir2 directory: " + folder); + foreach (string item in client.GetItemList(folder)) + { + Console.WriteLine("Processing item " + item); + NFSAttributes attrib = client.GetItemAttributes(client.Combine(item, "dir1")); + if (attrib == null) continue; + + bool isDirectory = client.IsDirectory(client.Combine(item, "dir1")); + Console.WriteLine("| " + item + " " + (isDirectory ? "(dir)" : null) + " " + attrib.Size + " bytes"); + } + + #endregion + + #region Read /dir1/dir2/2.txt + + Console.WriteLine(""); + // file = client.Combine("2.txt", "dir1\\dir2"); + // file = ".\\dir1\\dir2\\2.txt"; + file = NormalizePath("/dir1/dir2/2.txt"); + Console.WriteLine("Reading file 2.txt: " + file); + stream = new MemoryStream(); + client.Read(file, ref stream); + if (stream != null) + { + stream.Seek(0, SeekOrigin.Begin); + + int read = 0; + byte[] buf = new byte[4096]; + + while (true) + { + read = stream.Read(buf, 0, buf.Length); + if (read > 0) + { + byte[] segment = new byte[read]; + Buffer.BlockCopy(buf, 0, segment, 0, read); + Console.WriteLine(Encoding.UTF8.GetString(segment)); + } + else + { + break; + } + } + } + + #endregion + + #region Enumerate /dir3 + + Console.WriteLine(""); + // folder = client.Combine("dir3", "dir1\\dir2"); + // folder = ".\\dir1\\dir2\\dir3"; + file = NormalizePath("/dir1/dir2/dir3"); + Console.WriteLine("Listing dir3 directory: " + folder); + foreach (string item in client.GetItemList(folder)) + { + Console.WriteLine("Processing item " + item); + NFSAttributes attrib = client.GetItemAttributes(folder); + if (attrib == null) continue; + + bool isDirectory = client.IsDirectory(client.Combine(item, "dir1\\dir2\\dir3")); + Console.WriteLine("| " + item + " " + (isDirectory ? "(dir)" : null) + " " + attrib.Size + " bytes"); + } + + #endregion + + #region Read /dir1/dir2/dir3/3.txt + + Console.WriteLine(""); + // file = client.Combine("3.txt", "dir1\\dir2\\dir3"); + // file = ".\\dir1\\dir2\\dir3\\3.txt"; + file = NormalizePath("/dir1/dir2/dir3/3.txt"); + Console.WriteLine("Reading file 3.txt: " + file); + stream = new MemoryStream(); + client.Read(file, ref stream); + if (stream != null) + { + stream.Seek(0, SeekOrigin.Begin); + + int read = 0; + byte[] buf = new byte[4096]; + + while (true) + { + read = stream.Read(buf, 0, buf.Length); + if (read > 0) + { + byte[] segment = new byte[read]; + Buffer.BlockCopy(buf, 0, segment, 0, read); + Console.WriteLine(Encoding.UTF8.GetString(segment)); + } + else + { + break; + } + } + } + + #endregion + + #region Fully-Enumerate + + Console.WriteLine(""); + Console.WriteLine("Fully enumerating"); + List fullEnumeration = FullyEnumerate(client, "."); + Console.WriteLine("Results:"); + foreach (string curr in fullEnumeration) + Console.WriteLine("| " + curr); + + #endregion + + #region Normalization-Test + + Console.WriteLine(""); + Console.WriteLine("Normalizing 10 times: /dir1/dir2/dir3/3.txt"); + string str = "/dir1/dir2/dir3/3.txt"; + for (int i = 0; i < 10; i++) + str = NormalizePath(str); + Console.WriteLine(str); + + #endregion + + Console.WriteLine(""); + Console.WriteLine("Finished"); + Console.WriteLine(""); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + } + finally + { + if (client != null) + { + if (client.IsMounted) + { + Console.WriteLine("Unmounting device"); + client.UnMountDevice(); + } + + Console.WriteLine("Disconnecting client"); + client.Disconnect(); + } + } + } + + private static List FullyEnumerate(NfsClient client, string rootDirectory, int spaceCount = 0) + { + string spaces = ""; + if (spaceCount > 0) for (int i = 0; i < spaceCount; i++) spaces += " "; + + List ret = new List(); + + Console.WriteLine(spaces + "Processing " + rootDirectory); + + foreach (string item in client.GetItemList(rootDirectory)) + { + string itemKey = NormalizePath(rootDirectory + "/" + item); + Console.WriteLine(spaces + "| Retrieved item " + itemKey); + + NFSAttributes attrib = client.GetItemAttributes(itemKey); + if (attrib == null) continue; + + bool isDirectory = client.IsDirectory(itemKey); + if (isDirectory) + { + ret.Add(itemKey + " (dir)"); + Console.WriteLine(spaces + "| Recursing into " + itemKey); + List children = FullyEnumerate(client, itemKey, spaceCount + 1); + if (children != null && children.Count > 0) + ret.AddRange(children); + } + else + { + ret.Add(itemKey); + } + } + + return ret; + } + + private static string NormalizePath(string path) + { + if (String.IsNullOrEmpty(path)) return "."; + path = path.Replace("/", "\\"); + while (path.EndsWith("\\")) path = path.Substring(0, path.Length - 1); + while (path.StartsWith(".")) path = path.Substring(1); + while (path.StartsWith("\\")) path = path.Substring(1); + string[] parts = path.Split("\\"); + return ".\\" + string.Join("\\", parts); + } + +#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type. + } +} \ No newline at end of file diff --git a/src/Test.Nfs/Test.Nfs.csproj b/src/Test.Nfs/Test.Nfs.csproj new file mode 100644 index 0000000..1559f20 --- /dev/null +++ b/src/Test.Nfs/Test.Nfs.csproj @@ -0,0 +1,14 @@ + + + + Exe + net8.0 + enable + enable + + + + + + +