The User Registration Tool (URT) software development kit (SDK) is installed with and resides on the URT Administrative Server. The kit is located in the URT SDK folder (for example, C:\Program Files\urt\sdk).
The URT SDK contains the following tools:
An application programming interface (API) that allows applications to listen to a message bus for URT events.
A command-line tool to set and retrieve VLAN information based on MAC addresses.
The API and the command-line tool are described in this guide.
URT Event Bus Listener Interface
The URT event bus listener API (UrtEventBusListenerIf.java), located in the URT sdk\admin folder, allows an application to listen for URT events that are published by the URT VPS.
Using this API, your application can listen for one or all of the following types of URT events:
User event—Logon or logoff.
Client event—New MAC (logon).
Depending on the URT event type, appropriate URT data is returned.
Methods
onUrtEvent(UrtCommonEventevent)—This method is callback and allows a user to process the received events.
start(eventtype)—This method starts a listener for one or more URT event types.
UrtCommonEvent
The UrtCommonEvent class is responsible for URT events.
Class Member Variables
Name
Description
URT event type
URT user event (logon or logoff) or client event (logon).
URT event timestamp
Time of the event.
Methods
getEventType()—Returns the URT event type (either an instance of UrtCommonUderEvent or UrtCommonClientEvent).
getTimeStamp()—Returns the timestamp of the URT event.
UrtCommonUserEvent
The UrtCommonUserEvent class extends the UrtCommonEvent class and handles URT user type events.
Class Member Variables
Name
Description
Event type
URT event type.
Username
Name of the user initiating the event.
IP Address
IP address of the user's system.
MAC Address
MAC address for the network interface card (NIC) in the user's system.
Subnet
Subnet address of the user's system.
Gateway
IP address of the router (gateway) used by the user's system.
Switch address
Switch address to which the user's system is connected.
Switch port
Switch port to which the user's system is connected.
VPS Server IP Address
IP address of the URT VPS.
VTP Domain
VTP domain to which the user's system is connected.
VLAN
VLAN to which the user's system is connected.
Timestamp
Time the event occurred.
Methods
getUserName()—Returns the username.
getClientIpAddress()—Returns the client IP address.
getMacAddress()—Returns the MAC address.
getSubnetAddress()—Returns the subnet address.
getGatewayAddress()—Returns the gateway address.
getSwitchAddress()—Returns the switch address.
getSwitchPort()—Returns the switch port.
getUrtVpsServerIpAddress()—Returns the URT VPS IP address.
getVtp()—Returns the VTP domain name.
getVlan()—Returns the VLAN name.
UrtCommonClientEvent
The UrtCommonClientEvent class extends the UrtCommonEvent class and handles URT client type events.
Class Member Variables
Name
Description
Event type
URT event type.
MAC Address
MAC address for the network interface card (NIC) in the client.
Switch address
Switch address to which the client is connected.
Switch port
Switch port to which the client is connected.
VPS Server IP Address
IP address of the URT VPS.
VTP Domain
VTP domain to which the client is connected.
VLAN
VLAN to which the client is connected.
Timestamp
Time the event occurred.
Methods
getMacAddress()—Returns the MAC address.
getSwitchAddress()—Returns the switch address.
getSwitchPort()—Returns the switch port.
getUrtVpsServerIpAddress()—Returns the URT VPS IP address.
getVtp()—Returns the VTP domain name.
getVlan()—Returns the VLAN name.
Sample Code
Sample code is supplied in the URT sdk\admin folder.
Listener Program
ExampleUrtListener.java provides an example class for listening to URT events using a callback. This sample program continuously listens for all URT user and client events, then prints them to standard output.
Compile Script
The CompileExampleUrtListener.bat script compiles the sample program.
Class Information
The jar file urtadminsdk.jar contains class information used when compiling the sample program.
Run Script
The ExampleUrtListener.bat script starts the compiled sample program.
Assumptions and Restrictions
You must have a Java compiler. You must compile and run the listener program from the URT Administrative Server.
vlancmd Command-Line Tool
The vlancmdcommand-line tool sets and retrieves VLAN information based on the MAC address. This tool is located in the URT sdk\vlancmd folder.
This tool interacts with the URT Administrative Server to obtain and configure VLANs on the switches.
Note For more information about the URT Administrative Server, see the to User Guide
for the Cisco Secure User Registration Tool.
set—Sets the VLAN on the port that has the MAC address to the VLAN name.
set—Gets the VLAN and switch IP address on the port specified by the mac-address. The obtained information is displayed on the stdout as vlan=vlan9 switchip=10.10.10.7 port=2/6.
Input Parameters
MAC_address—The format of the client MAC address, expressed as xx-xx-xx-xx-xx-xx (for example, 00-60-B0-C3-35-C2 is a valid MAC address).
urt_server—The list of URT VPS IP addresses and UDP port numbers, expressed as ip-address.port;ip-address.port. (Use a semicolon to specify multiple URT VPSs.)
For example:
10.10.10.7.15001;10.10.12.5.15001 specifies two URT VPSs with IP addresses 10.10.10.7 and 10.10.12.5, and the UDP port to use is 15001.
vlan-name—Required only when using the set option, this is the VLAN name is set on the port that has the MAC address.
Note You can also enter vlancmd -help for usage information.
Examples
This command gets the VLAN information for the MAC address 00-90-20-32-fc-e9:
Vlancmd get 00-90-20-32-fc-e9 10.10.10.7.15001;10.10.12.5.15001