rfc2593.txt
来自「著名的RFC文档,其中有一些文档是已经翻译成中文的的.」· 文本 代码 · 共 1,236 行 · 第 1/4 页
TXT
1,236 行
ExitCode =/ "5" ; smRunExitCode `languageError' ExitCode =/ "6" ; smRunExitCode `runtimeError' ExitCode =/ "7" ; smRunExitCode `invalidArgument' ExitCode =/ "8" ; smRunExitCode `securityViolation' ExitCode =/ "9" ; smRunExitCode `genericError' Cookie = HexString ; authentication cookie Version = "SMX/1.0" ; current version of the SMX protocol Argument = HexString / QuotedString ; see smRunArgument Result = HexString / QuotedString ; see smRunResult ErrorMsg = HexString / QuotedString ; see smRunError The definition of QuotedString requires further explanation. A quoted string may contain special character sequences, all starting with the backslash character (%x5C). The interpretation of these sequences is as follows:Schoenwaelder & Quittek Experimental [Page 6]RFC 2593 SMX Protocol 1.0 May 1999 `\\' backslash character (`%x5C') `\t' tab character (`HTAB') `\n' newline character (`LF') `\r' carriage-return character (`CR') `\"' quote character (`DQUOTE') In all other cases not listed above, the backslash is dropped and the following character is treated as an ordinary character. `Argument' and `Result' is either a QuotedString or a HexString. The Script MIB defines script arguments and results as arbitrary octet strings. The SMX protocol supports a binary and a human readable representation since it is likely that printable argument and result strings will be used frequently. However, an implementation must be able to handle both formats in order to be compliant with the Script MIB. The `Cookie' is a HexString which does not carry any semantics other than being a random sequence of bytes. It is therefore not necessary to have a human readable representation.5.2. Commands The following ABNF definitions define the set of SMX commands which can be sent from the SNMP agent to a runtime system. Command = "hello" WSP Id CRLF Command =/ "start" WSP Id WSP RunId WSP Script WSP Profile WSP Argument CRLF Command =/ "suspend" WSP Id WSP RunId CRLF Command =/ "resume" WSP Id WSP RunId CRLF Command =/ "abort" WSP Id WSP RunId CRLF Command =/ "status" WSP Id WSP RunId CRLF The `hello' command is always the first command sent over a SMX connection. It is used to identify and authenticate the runtime system. The `start' command starts the execution of a script. The `suspend', `resume' and `abort' commands can be used to change the status of a running script. The `status' command is used to retrieve status information for a running script. There is no compile command. It is the responsibility of the SNMP agent to perform any compilation steps as needed before using the SMX `start' command. There is no SMX command to shutdown a runtime system. Closing the connection must be interpreted as a request toSchoenwaelder & Quittek Experimental [Page 7]RFC 2593 SMX Protocol 1.0 May 1999 terminate all running scripts in that runtime system and to shutdown the runtime system.5.3. Replies Every reply message starts with a three digit reply code and ends with `CRLF'. The three digits in a reply code have a special meaning. The first digit identifies the class of a reply message. The following classes exist: 1yz transient positive response 2yz permanent positive response 3yz transient negative response 4yz permanent negative response 5yz asynchronous notification The classes 1yz and 3yz are currently not used by SMX version 1.0. They are defined only for future SMX extensions. The second digit encodes the specific category. The following categories exist: x0z syntax errors that don't fit any other category x1z replies for commands targeted at the whole runtime system x2z replies for commands targeted at scripts x3z replies for commands targeted at running instances of scripts The third digit gives a finer gradation of meaning in each category specified by the second digit. Below is the ABNF definition of all reply messages and codes: Reply = "211" WSP Id WSP Version WSP Cookie CRLF ; identification of the ; runtime system Reply =/ "231" WSP Id WSP RunState CRLF ; status of a running script Reply =/ "232" WSP Id CRLF ; abort of a running script Reply =/ "401" WSP Id CRLF ; syntax error in command Reply =/ "402" WSP Id CRLF ; unknown command Reply =/ "421" WSP Id CRLF ; unknown or illegal Script Reply =/ "431" WSP Id CRLF ; unknown or illegal RunIdSchoenwaelder & Quittek Experimental [Page 8]RFC 2593 SMX Protocol 1.0 May 1999 Reply =/ "432" WSP Id CRLF ; unknown or illegal Profile Reply =/ "433" WSP Id CRLF ; illegal Argument Reply =/ "434" WSP Id CRLF ; unable to change the status of ; a running script Reply =/ "511" WSP Zero WSP QuotedString CRLF ; an arbitrary message send from ; the runtime system Reply =/ "531" WSP Zero WSP RunId WSP RunState CRLF ; asynchronous running script ; status change Reply =/ "532" WSP Zero WSP RunId WSP RunState WSP Result CRLF ; intermediate script result Reply =/ "533" WSP Zero WSP RunId WSP RunState WSP Result CRLF ; intermediate script result that ; trigger an event report Reply =/ "534" WSP Zero WSP RunId WSP Result CRLF ; normal script termination Reply =/ "535" WSP Zero WSP RunId WSP ExitCode WSP ErrorMsg CRLF ; abnormal script termination.6. Elements of Procedure This section describes in detail the processing steps performed by the SNMP agent and the runtime system with regard to the SMX protocol.6.1. SMX Message Processing on the Runtime Systems This section describes the processing of SMX command messages by a runtime engine and the conditions under which asynchronous notifications are generated. When the runtime system receives a message, it first tries to recognize a command consisting of the command string and the transaction identifier. If the runtime system is not able to extract both the command string and the transaction identifier, then the message is discarded. An asynchronous `511' reply may be generated in this case. Otherwise, the command string is checked to be valid, i.e. to be one of the strings `hello', `start', `suspend', `resume', `abort', or `status'. If the string is invalid, a `402' reply isSchoenwaelder & Quittek Experimental [Page 9]RFC 2593 SMX Protocol 1.0 May 1999 sent and processing of the message stops. If a valid command has been detected, further processing of the message depends on the command as described below. The command specific processing describes several possible syntax errors for which specific reply messages are generated. If the runtime engine detects any syntax error which is not explicitely mentioned or which cannot be identified uniquely, a generic `401' reply is sent indicating that the command cannot be executed.6.1.1. Processing the `hello' Command When the runtime system receives a `hello' command, it processes it as follows: 1. The runtime system obtains the security cookie from its process environment. 2. The runtime system sends a `211' reply containing the security cookie.6.1.2. Processing the `start' Command When the runtime system receives a `start' command, it processes it as follows: 1. The syntax of the arguments of the `start' command is checked. The following four checks must be made: (a) The syntax of the `RunId' parameter is checked and a `431' reply is sent if any syntax error is detected. (b) The syntax of the `Script' parameter is checked and a `421' reply is sent if any syntax error is detected. (c) The syntax of the `Profile' parameter is checked and a `432' reply is sent if any syntax error is detected. (d) If syntax of the `Argument' parameter is checked and a `433' reply is sent if any syntax error is detected. 2. The runtime system checks whether the new `RunId' is already in use. If yes, a `431' reply is sent and processing stops. 3. The runtime system checks whether the `Script' parameter is the name of a file on the local storage device, that can be read. A `421' reply is sent and processing stops if the file does not exist or is not readable.Schoenwaelder & Quittek Experimental [Page 10]RFC 2593 SMX Protocol 1.0 May 1999 4. The runtime system checks whether the security profile is known and sends a `432' reply and stops processing if not. 5. The runtime engine starts the script given by the script name. When the script has been started, a `231' reply is sent including the current run state. Processing of the `start' command stops, when the script reaches the state `running'. For each asynchronous state change of the running script, a `531' reply is sent. Processing of the `start' command is also stopped if an error occurs before the state `running' is reached. In this case, the run is aborted and a `535' reply is generated. If an `abort' command or a `suspend' command for the running script is received before processing of the `start' command is complete, then the processing of the `start' command may be stopped before the state `running' is reached. In this case, the resulting status of the running script is given by the respective reply to the `abort' or `suspend' command, and no reply with the transaction identifier of the `start' command is generated.6.1.3. Processing the `suspend' Command When the runtime system receives a `suspend' command, it processes it as follows: 1. If there is a syntax error in the running script identifier or if there is no running script matching the identifier, a `431' reply is sent and processing of the command is stopped. 2. If the running script is already in the state `suspended', a '231' reply is sent and processing of the command is stopped. 3. If the running script is in the state `running', it is suspended and a `231' reply is sent after suspending. If suspending fails, a `434' reply is sent and processing of the command is stopped. 4. If the running script has not yet reached the state `running' (the `start' command still being processed), it may reach the state `suspended' without having been in the state `running'. After reaching the state `suspended', a `231' reply is sent. 5. If the running script is in any other state, a `434' reply is sent.Schoenwaelder & Quittek Experimental [Page 11]
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?