internal static RpcException ProcedureUnavalible(reply_body replyBody) { return(new ReplyException(replyBody, "program can't support procedure")); }
internal static ReplyException ProgramMismatch(reply_body replyBody, mismatch_info info) { return(new ReplyException(replyBody, string.Format("remote can't support program version (supported versions of between {0} and {1})", info.low, info.high))); }
internal static ReplyException ProgramUnavalible(reply_body replyBody) { return(new ReplyException(replyBody, "remote hasn't exported program")); }
/// <summary> /// Authenticate error /// </summary> /// <param name="replyBody"></param> public AuthenticateException(reply_body replyBody) : base(replyBody) { }
internal static ReplyException RpcVersionError(reply_body replyBody, mismatch_info info) { return(new ReplyException(replyBody, string.Format("unsupported RPC version number (supported versions of between {0} and {1})", info.low, info.high))); }
internal static ReplyException ProgramMismatch(reply_body replyBody, mismatch_info info) { return new ReplyException(replyBody, string.Format("remote can't support program version (supported versions of between {0} and {1})", info.low, info.high)); }
internal static ReplyException RpcVersionError(reply_body replyBody, mismatch_info info) { return new ReplyException(replyBody, string.Format("unsupported RPC version number (supported versions of between {0} and {1})", info.low, info.high)); }
/// <summary> /// Error received in response RPC message /// </summary> /// <param name="replyBody"></param> public ReplyException(reply_body replyBody) { ReplyBody = replyBody; }
/// <summary> /// Error received in response RPC message /// </summary> /// <param name="replyBody"></param> /// <param name="message"></param> public ReplyException(reply_body replyBody, string message) : base(message) { ReplyBody = replyBody; }
/// <summary> /// Authenticate error /// </summary> /// <param name="replyBody"></param> /// <param name="message"></param> public AuthenticateException(reply_body replyBody, string message) : base(replyBody, message) { }
/// <summary> /// Authenticate error /// </summary> /// <param name="replyBody"></param> /// <param name="message"></param> /// <param name="innerEx"></param> public AuthenticateException(reply_body replyBody, string message, Exception innerEx) : base(replyBody, message, innerEx) { }
internal static AuthenticateException AuthError(reply_body replyBody, auth_stat state) { return new AuthenticateException(replyBody, GetAuthDescription(state)); }
/// <summary> /// Error received in response RPC message /// </summary> /// <param name="replyBody"></param> /// <param name="message"></param> /// <param name="innerEx"></param> public ReplyException(reply_body replyBody, string message, Exception innerEx) : base(message, innerEx) { ReplyBody = replyBody; }
internal static RpcException ProcedureUnavalible(reply_body replyBody) { return new ReplyException(replyBody, "program can't support procedure"); }
internal static ReplyException SystemError(reply_body replyBody) { return(new ReplyException(replyBody, "system error in RPC-server")); }
internal static ReplyException ProgramUnavalible(reply_body replyBody) { return new ReplyException(replyBody, "remote hasn't exported program"); }
internal static AuthenticateException AuthError(reply_body replyBody, auth_stat state) { return(new AuthenticateException(replyBody, GetAuthDescription(state))); }
internal static ReplyException SystemError(reply_body replyBody) { return new ReplyException(replyBody, "system error in RPC-server"); }
/// <summary> /// returns the description of the RPC message /// </summary> /// <param name="msg"></param> /// <returns></returns> public static void ReplyMessageValidate(rpc_msg msg) { try { if (msg.body.mtype != msg_type.REPLY) { throw Exceptions.UnexpectedMessageType(msg.body.mtype); } reply_body replyBody = msg.body.rbody; if (replyBody.stat == reply_stat.MSG_ACCEPTED) { accepted_reply.reply_data_union du = replyBody.areply.reply_data; switch (du.stat) { case accept_stat.GARBAGE_ARGS: throw Exceptions.GarbageArgs(); case accept_stat.PROC_UNAVAIL: throw Exceptions.ProcedureUnavalible(replyBody); case accept_stat.PROG_MISMATCH: throw Exceptions.ProgramMismatch(replyBody, du.mismatch_info); case accept_stat.PROG_UNAVAIL: throw Exceptions.ProgramUnavalible(replyBody); case accept_stat.SUCCESS: return; case accept_stat.SYSTEM_ERR: throw Exceptions.SystemError(replyBody); default: throw Exceptions.NoRFC5531("msg"); } } if (replyBody.stat == reply_stat.MSG_DENIED) { if (replyBody.rreply.rstat == reject_stat.AUTH_ERROR) { throw Exceptions.AuthError(replyBody, replyBody.rreply.astat); } else if (replyBody.rreply.rstat == reject_stat.RPC_MISMATCH) { throw Exceptions.RpcVersionError(replyBody, replyBody.rreply.mismatch_info); } else { throw Exceptions.NoRFC5531("msg"); } } throw Exceptions.NoRFC5531("msg"); } catch (NullReferenceException) { throw Exceptions.NoRFC5531("msg"); } }