perfSONAR_PS::Topology::ID - A module that provides various utility functions for Topology IDs.
This module contains a set of utility functions that are used to interact with Topology IDs.
Constructs an a fully-qualified id based on the specified fields. No sanity checking is performed to verify that the created ID makes sense. The $type parameters are values like 'domain', 'node', etc whereas the $field parameter is the ID for that element like "I2" or "HOPI". All values past the first blank ("") type or field are ignored.
Checks if the specified ID is a fully-qualified ID of the specified type. If it is not a fully-qualified id, the function returns 0. If it is an incorrect fully-qualified id(e.g. too many elements), it returns -1. If it is a correctly specified fully-qualified id, it returns 1.
Takes a fully-qualified id and adds a new level onto it. No sanity checking is done, it simply returns the ID created from the values requested.
Takes a fully-qualified id and returns the parent level for the id. If you'd like to know the type of the parent, you can add a reference to a variable for $ret_type and the function will fill it in with the type of the returned id. e.g. urn:ogf:network:domain=hopi:node=losa would return 'urn:ogf:network:domain=hopi' and $ret_type would be filled in with 'domain'
Returns the base level of the specified id. If you want to be informed fo the type of the base element, you can add a reference to a variable for $ret_type and the function will fill it in with the type of the element. e.g. urn:ogf:network:domain=hopi:node=losa would return 'losa' and $ret_type would be filled in with 'node'
Performs any necessary encoding of the specified element for inclusion in a fully-qualified id.
Decodes the specified element from a fully-qualified id.
Compares the given ids to see if they match up to the specified field. $compare_to can be any ID element type that the IDs have in common. It returns an array containing two values. The first is either 0 or -1 and tells whether the function failed or succeeded. If the function failed, the next element in the array is the error message.
Splits the specified fully-qualified id into its component elements. If $fq is 1, the returns components are all fully-qualified. The components are returned in an array. The first value of the array is the 0 or -1 specifying whether the function succeeded or failed. The next element is a string for the type of the ID. Each subsequent pair of elements corresponds to the type of the element followed by the element itself. If $top_down is 0, the order is the most specific element to least specific element. If $top_down is 1, however, the order is reversed.
To join the 'perfSONAR-PS' mailing list, please visit:
The perfSONAR-PS subversion repository is located at:
Questions and comments can be directed to the author, or the mailing list.
Aaron Brown, <firstname.lastname@example.org>
You should have received a copy of the Internet2 Intellectual Property Framework along with this software. If not, see <http://www.internet2.edu/membership/ip.html>
Copyright (c) 2004-2007, Internet2 and the University of Delaware
All rights reserved.