%macro

########################################################
#
# Example 1 of "Aliases and Menus"
#
# Network Administrator's Guide, Release 7.0
#
# Book A, Configuring Hosts and Servers Chapter in the section on Macros
#
#
# Setup a macro for annex at <annex-address> 
#
#  This Macro sets up a menu for port 3 and all virtual 
#  ports on the specified annex.
#
#  Other examples of setups are:
#
#  keyin "1" 1-64@<annex-address>
#  ( 1-64@address = ports 1 through 64 for annex @ address)
#
#  keyin "2" v@<annex-address>
#  ( v@address   = all virtual ports for annex @ address)
#
#  keyin "3" v
#  ( v           = all virtual ports for any annex that 
#                  boots from this host)
#
#  keyin "4" 1-64
#  ( 1-64        = ports 1 through 64 for any annex that 
#                  boots from this host )
#
# The Menu will be:
#
#      Generic Macro Header
# 1- Connect to System1
# 2- Connect to System2
# 3- Who?
# 4- Exit
# Enter Number:
#
# The Menu will be displayed after clearing the screen,
# five lines down form the top of the screen and 27 
# spaces over.
#
# This macro will limit the possible commands at the
# annex prompt to only those listed on the menu.
#
# This macro file will not affect any other annex that 
# boots off this Unix host.
#
# All other ports on the annex will have full access to
# cli commands.
#
# Note: 
#      Replace "<annex-address>" with your annex's 
#      internet address:  e.g. 192.9.200.1
#
#      replace "<system-address>" with your systems 
#      name or internet address: e.g. fred or 192.9.200.2
#
##########################################################
#
# Rlogin to system1
#
alias "Connect to System1"
	keyin "1" 3,v@<annex-address>
{
<rlogin <system1-address>
}

#
# Rlogin to system2
#
alias "Connect to System2"
	keyin "2" 3,v@<annex-address>
{
<rlogin <system2-address>
}

#
# Issue a "who" command on annex to determine
# who is running on annex. Then pause till user
# enters <return>
#
alias "Who?"
	keyin "3" 3,v@<annex-address>
{
<who
>
<pause
}

#
# Do hangup from annex port. This will disconnect
# annex port.
#
alias "Exit"
	keyin "4" 3,v@<annex-address>
{
<hangup
}

#
# This section defines the actual menu.
#
menu |Generic Menu Header|
	init_cli 3,v@<annex-address>
	keyin "menu" 3,v@<annex-address>
	cmd_list 1,2,3,4
{
#
# The following control sequences assume a VT100-type
# ANSI terminal is being used. If the terminal is not
# VT100 compatible then these sequences will not work.
#
# The "[" sequence is the seven-bit (C0) code for an
# ANSI CSI (Command Sequence Introducer) C1 code.  This
# can also be given as a single C1 code; 9B hex.
#
# The command sequences used below are:
# "<CSI>2J"		Clear the terminal screen
# "<CSI>5;27H"		Go to line 5, column 27
# "<CSI>9;15H"		Go to line 9, column 15
# "<CSI>1m"		Turn on bold text
# "<CSI>0m"		Reset back to normal text
#
[2J
[5;27HGeneric Menu Header
[9;15H1)    Connect to System1
[11;15H2)    Connect to System2
[13;15H3)    Show Annex users
[15;15H4)    Exit
[17;15H[1mEnter Number:  [0m
}
