// // openmapi.org - CompactTeaSharp - OncRpcConsts.cs // // C# port Copyright 2008 by Topalis AG // // Author (C# port): mazurin, Johannes Roith // // This library is based on the RemoteTea java library: // // Author: Harald Albrecht // // 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 System; namespace CompactTeaSharp { /// /// Constants used to identify the acceptance status of ONC/RPC reply messages. /// public enum OncRpcAcceptStatus { /// /// The remote procedure was called and executed successfully. /// Success = 0, /// /// The program requested is not available. The remote host /// does not export this particular program and the ONC/RPC server /// which you tried to send a RPC call message doesn't know of this /// program either. /// ProgUnavail, /// /// A program version number mismatch occured. The remote ONC/RPC /// server does not support this particular version of the program. /// ProgMismatch, /// /// The procedure requested is not available on the remote ONC server. /// ProcedureUnavailable, /// /// The server could not decode the arguments sent within the ONC/RPC call message. /// GarbageArgs, /// /// The server encountered a system error and was not able to process /// the rpc call. Causes might be memory shortage, desinterest and sloth. /// SystemErr } /// /// Constants related to authentication and generally useful for ONC/RPC. /// public static class OncRpcAuthConstants { /// /// Maximum length of opaque authentication information. /// public const int ONCRPC_MAX_AUTH_BYTES = 400; /// /// Maximum length of machine name. /// public const int ONCRPC_MAX_MACHINE_NAME = 255; /// /// Maximum allowed number of groups. /// public const int ONCRPC_MAX_GROUPS = 16; } /// /// A collection of constants used to identify the authentication status /// (or errors) in ONC/RPC replies of the corresponding ONC/RPC calls. /// public enum OncRpcAuthStatus { /// /// There is no authentication problem or error. /// Ok = 0, /// /// The ONC/RPC server detected a bad credential. /// BadCred, /// /// The ONC/RPC server has rejected the credential and forces the caller to begin a new session. /// RejectedCred, /// /// The ONC/RPC server detected a bad verifier (that is, the seal was broken). /// BadVerifier, /// /// The ONC/RPC server detected an expired verifier (which can also happen if the verifier was replayed). /// RejectedVerifier, /// /// The ONC/RPC server rejected the authentication for security reasons. /// TooWeak, /// /// The ONC/RPC client detected a bogus response verifier. /// InvalidResponse, /// /// Authentication at the ONC/RPC client failed for an unknown reason. /// Failed } /// /// A collection of constants used to identify the authentication schemes /// available for ONC/RPC. Please note that currently only /// ONCRPC_AUTH_NONE is supported by this Java package. /// public enum OncRpcAuthType { /// /// No authentication scheme used for this remote procedure call. /// None = 0, /// /// The so-called "Unix" authentication scheme is not supported. This one /// only sends the users id as well as her/his group identifiers, so this /// is simply far too weak to use in typical situations where /// authentication is requested. /// Unix = 1, /// /// The so-called "short hand Unix style" is not supported. /// Short = 2, /// /// The DES authentication scheme (using encrypted time stamps) is not /// supported -- and besides, it's not a silver bullet either. /// AuthDES = 3 } /// /// A collection of constants used for ONC/RPC messages to identify the /// type of message. Currently, ONC/RPC messages can be either calls or /// replies. Calls are sent by ONC/RPC clients to servers to call a remote /// procedure (for you "ohohpies" that can be translated into the buzzword /// "method"). A server then will answer with a corresponding reply message /// (but not in the case of batched calls). /// public enum OncRpcMessageType { NoValue = -1, // Only used for initialization /// /// Identifies an ONC/RPC call. By a "call" a client request that a server /// carries out a particular remote procedure. /// Call = 0, /// /// 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. /// Reply } /// /// A collection of protocol constants used by the ONC/RPC package. Each /// constant defines one of the possible transport protocols, which can be /// used for communication between ONC/RPC clients and servers. /// public enum OncRpcProtocols { Udp = 17, Tcp = 6, /// /// Use the HTTP application protocol for tunneling ONC calls. /// Http = -42 } /// /// A collection of constants used to describe why a remote procedure call /// message was rejected. This constants are used in {@link OncRpcReplyMessage} /// objects, which represent rejected messages if their /// {@link OncRpcReplyMessage#replyStatus} field has the value /// {@link OncRpcReplyStatus#ONCRPC_MSG_DENIED}. /// public enum OncRpcRejectStatus { Unknown = -1, /// /// Wrong ONC/RPC protocol version used in call (it needs to be version 2). /// RpcMismatch = 0, /// /// The remote ONC/RPC server could not authenticate the caller. /// AuthenticationError } /// /// A collection of constants used to identify the (overall) status of an /// ONC/RPC reply message. /// public enum OncRpcReplyStatus { MsgAccepted = 0, MsgDenied } }