📄 rfc2167.txt
字号:
ok-response = "%ok" error-response = "%error" space error-code space error-text error-code = 3digit error-text = 1*any-char info-response = "%info" space "on" crlf *(*any-char crlf) "%info" space "off" crlfWilliamson, et. al. Informational [Page 19]RFC 2167 RWhois Protocol June 1997 Banner The server must send a banner to the client when the connection is opened. The banner contains the version(s) of the protocol the server supports and a capability ID of encoded bit flags that indicates which directives are implemented. If the server supports more than one version of the protocol, the lowest-numbered version must be specified first. The bits in extra-id are reserved for future use. The end of the banner should contain a free-form string indicating the name of the server implementation. A server must support at least one version of the protocol, and may accept more versions for compatibility reasons. rwhois-banner = "%rwhois" space version-list space host-name [space implementation] crlf version-list = version *("," version) version = version-number [":" capability-id] / "V-1.5" ":" capability-id version-number = "V-" 1*digit "." 1*digit capability-id = response-id ":" extra-id response-id = 6hex-digit extra-id = 2hex-digit implementation = 1*any-char Protocol The entire RWhois protocol can be defined as a series of directives, responses, queries, and results. rwhois-protocol = client-sends / server-returns client-sends = *(directives / rwhois-query) server-returns = *(responses / rwhois-query-result)3.2 Required Directives The server must implement the following directives.Williamson, et. al. Informational [Page 20]RFC 2167 RWhois Protocol June 19973.2.1 rwhois Description The "-rwhois" directive may be issued by the client at the start of every session . It tells the server which version of the protocol the client can handle. The server must respond with a banner containing the protocol version and directives it implements. This banner is the same banner that is sent by the server when the connection is opened, except that the server must indicate only one version number. The banner issued when opening a connection may contain more than one version number. The directive flags are encoded into three octets, which are described in Appendix D. ABNF rwhois-dir = "-rwhois" space version-number [space implementation] crlf rwhois-response = "%rwhois" space version space host-name [space implementation] crlf Errors 300 Not compatible with version 338 Invalid directive syntax Examples # When a connection is opened, the server issues the banner. S %rwhois V-1.0,V-1.5:00ffff:00 rs.internic.net (NSI Server 1.5.4) # The client sends the rwhois directive. C -rwhois V-1.5 NSI Client 1.2.3 S %rwhois V-1.5:00ffff:00 rs.internic.net (NSI Server 1.5.4) S %ok3.3 Optional Directives The server should implement the following directives.Williamson, et. al. Informational [Page 21]RFC 2167 RWhois Protocol June 19973.3.1 class Description The "-class" directive can be used by the client to get the meta- information for one or more classes in an authority area. The response must contain the description and version number of each specified class and may be expanded in the future with additional attributes. When no class name is given, the server must return the meta-information for all the classes in the authority area. Every class record must end with an empty "%class" line. ABNF class-dir = "-class" space authority-area *(space class-name) crlf class-response = *class-record response class-record = *class-line "%class" crlf class-line = "%class" space class-name ":" "description" ":" 1*any-char crlf / "%class" space class-name ":" "version" ":" time-stamp crlf / "%class" space class-name ":" meta-field ":" meta-value crlf meta-field = 1*id-char meta-value = 1*any-char The following fields are required. meta-field meta-value Description description 1*any-char Class description. Time/date stamp indicating version of class, version time-stamp must be updated after class definition is changed. Errors 338 Invalid directive syntax 340 Invalid authority area 341 Invalid class 400 Directive not available 401 Not authorized for directive Examples C -class rwhois.net domain host S %class domain:description:Domain information S %class domain:version:19970103101232000 S %classWilliamson, et. al. Informational [Page 22]RFC 2167 RWhois Protocol June 1997 S %class host:description:Host information S %class host:version:19970214213241000 S %class S %ok3.3.2 directive Description The "-directive" directive can be used by the client to get information about the directives that the server supports. The response must contain the name and description of each specified directive and may be expanded in the future with additional attributes. When no directive name is given, the server must return information about all the directives. Every directive record must end with an empty "%directive" line. ABNF directive-dir = "-directive" *(space directive-name) crlf directive-name = 1*id-char directive-response = *directive-record response directive-record = "%directive" space "directive" ":" directive-name crlf *directive-line "%directive" crlf directive-line = "%directive" space "description" ":" 1*any-char crlf / "%directive" space attribute-name ":" attribute-value crlf Errors 338 Invalid directive syntax 400 Directive not available 401 Not authorized for directive Examples Without parameters: C -directive S %directive directive:rwhois S %directive description:RWhois directive S %directive S %directive directive:quit S %directive description:Quit connection S %directive S %okWilliamson, et. al. Informational [Page 23]RFC 2167 RWhois Protocol June 1997 With parameters: C -directive quit S %directive directive:quit S %directive description:Quit connection S %directive S %ok3.3.3 display Description By default, the server uses the dump format for the output of a query result. The output format can be changed with the "-display" directive. When no parameter is given, the server must list all the display formats it supports. Every display record must end with an empty "%display" line. Currently, only the dump format is standard and must be supported by the server. Other output formats may be added in the future. See Section 3.4 for the definition of the dump format. ABNF display-dir = "-display" crlf / "-display" space display-name crlf display-name = 1*id-char display-response = *(display-record) response display-record = "%display" space "name" ":" display-name crlf *display-line "%display" crlf display-line = "%display" space attribute-name ":" attribute-value crlf Errors 338 Invalid directive syntax 400 Directive not available 401 Not authorized for directive 436 Invalid display format Examples # Get the available display formats. C -display S %display name:dump S %display S %okWilliamson, et. al. Informational [Page 24]RFC 2167 RWhois Protocol June 1997 # Change the active display format. C -display dump S %ok3.3.4 forward Description The "-forward" directive instructs the server to follow all the referrals and return the results to the client. This directive can be used to run an RWhois server as a proxy server. The default value must be "off". When the value is set to "on", the server must not return referrals. ABNF forward-dir = "-forward" space on-off crlf forward-response = response Errors 338 Invalid directive syntax 400 Directive not available 401 Not authorized for directive Examples C -forward on S %ok C -forward off S %ok3.3.5 holdconnect Description Normally, the server closes the connection after each query. This behavior is controlled by the holdconnect state, which can be changed with the "-holdconnect" directive. When the holdconnect state is set to "off", the server must close the connection after a query; when it is set to "on", the server must not close the connection after a query. By default, the holdconnect state must be set to "off" for each connection.Williamson, et. al. Informational [Page 25]RFC 2167 RWhois Protocol June 1997
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -