|search rfc-index for the specified RFC and list its topic|
|-d rfc-number [ /path/ ]|
|Dumps plain text RFC. default is current dir|
|-h||displays summarized help|
|-i||Updates the $indexpath via the $viewer|
|-k||Keyword; same as -s|
|Spawns $viewer to the specified RFC|
|-m rfc-number firstname.lastname@example.org [opt subject]|
|Emails the RFC to given address|
|Local search for non-standard service/port nums (BO, Netbus, etc) This is essentially the same as a grep on /etc/services but with the additional info from NMAPs large known-ports database. This will have entries that INIs assigned numbers database will not.|
|Dumps RFC to STDOUT|
|-p||Connect to INIs assigned numbers database for protocol numbers or services/ports association. This is the standards based well known ports and protocols reference. Very handy if you are setting up firewalls or looking at logged output.|
|-r||Go wild with your own regexp on rfc-index|
|Search the index for specific string|
|Sets the base URL to the number listed with -w|
|-w||Lists the available webservers to display|
rfc will obey the $RFCVIEWER environment variable if it is set. If undefined it will look in your $PATH for w3m and then lynx. You can hard-code which one you want in the top portion of the script.
Under the @URLS array you can now have a URl start with an ! to have it be treated as html rather than text. Add as many URLs as you please. This is also where you would add your local repository of rfcs, like /home/user/rfcs/.
In order to make this utility available to all system users the default $indexpath and $servpath is set to /usr/local/etc/. If you do not have root abilities on this box then you can manually edit the script to specify an area that you do have permissions to write to.
$ rfc -k mpls.*ldp
3035 MPLS using LDP and ATM VC Switching. B. Davie, J.
Lawrence, K. McCloghrie, E. Rosen, G. Swallow, Y.
Rekhter, P. Doolan. January 2001. (Format:
TXT=46463 bytes) (Status: US:) (Status: PROPOSED
$ rfc -l 3035 would then use w3m or lynx to view the
$ rfc 822
0822 Standard for the format of ARPA Internet text
messages. D. Crocker. Aug-13-1982. (Format:
TXT=109200 bytes) (Obsoletes RFC0733) (Obsoleted
by RFC2822) (Updated by RFC1123, RFC1138, RFC1148,
RFC1327, RFC2156) (Also STD0011) (Status: US:)
$ rfc -p ip 8
Making connection to server....
8 EGP Exterior Gateway Protocol [RFC888,DLM1]
[RFC888] Seamonson, L., and E. Rosen, "STUB"
Exterior Gateway Protocol", RFC 888, BBN
Communications Corporation, January 1984.
[DLM1] David Mills <Mills@HUEY.UDEL.EDU>
$ netstat -an
tcp 0 0 0.0.0.0:7100 0.0.0.0:* LISTEN
We see port 7100 listening, what is it?
$ rfc -n 7100
Looking up service...
font-service 7100/tcp # X Font Service
font-service 7100/udp # X Font Service
/usr/local/etc/rfc-index This is the default $indexpath with all of the RFC numbers and brief descriptions of content. Installed with the rfc -i option. $HOME/.rfcrc Initialization file with your BaseURL for grabbing RFCs (set with -u) /usr/local/etc/nmap-services This is the default $servpath for the non-standard ports/services database from NMAP. This is installed with the rfc -n -i option.
The default base URL is http://www.ietf.org/rfc/
By default, the program will search your path for w3m or lynx and use the first one found as the viewer; if you want to change this, edit the source.
Please send comments/bugfixes mailto: email@example.com
Some sites have leading 0s on RFCs < 1000, ie, RFC0822 may be rfc822.txt or rfc0822.txt. I have yet to implement a feature to work around this. Most of the sub 1k RFCs have newer counter parts. Look for "obsoleted by" in the output from -k -s or -r to find the more up to date RFC. The real bug is the non-standardized rfc distibution. IETF.org has them with leading zeros, so Im sticking with that.
Let me know if you find any. This is a work in progress but Im really happy with how easy its made my life.