Writing Your Own Program; Structure Of An Attribute Lookup Program - 3Com Traffix Transcend Traffix Manager User Manual

For windows nt
Table of Contents

Advertisement

Writing your own
program
Structure of an
Attribute Lookup
Program
Then, when a device is discovered, dblookup does the following:
1 dblookup builds a SQL string with the device's key attributes values and
runs a query against the database to find a match.
2 If no match is found, it waits for the next device.
3 Otherwise it takes the best match, that is to say the one with as few stars
as possible.
4 If two full matches are returned, dblookup logs an error; otherwise, it
takes the result of the first partial match encountered.
If the standard attribute lookup programs fileattrs and dblookup
are not sufficient for your requirements, you can write your own attribute
lookup program.
In order to write your own user-defined attribute program, you need
Microsoft Visual C++ V5.0 or later, Microsoft Visual Basic or another tool
which allows you to compile a program. The rest of this section assumes
you are familiar with programming either C or Visual Basic.
All example programs are included in
<installdir>\TraffixServer\examples.
Every time Traffix Manager wants to find out attributes for a device, it
calls all the attribute lookup programs in the user-defined attribute
lookup configuration file (see
Configuration File"
the device.
When you write your own attribute lookup program, your program has
to respond to these requests from Traffix Manager and supply attributes
for a particular device. Communication with Traffix Manager is done
using the functions in the attripc.dll library which is in
<installdir>\TraffixServer. Even if you do not know much
about DLLs, these functions are designed to make writing your own
attribute lookup program as simple as possible.
The main three functions provided by the attripc.dll library are
GetNextLookup(), GetAttribute() and SetAttribute(). Below is
an example of the central loop of a simple attribute lookup program
"Contents of the User-defined Attributes
on
page
138) and asks them to provide attributes for

Writing your own program

145

Advertisement

Table of Contents
loading

This manual is also suitable for:

Transcend traffix manager 3.0

Table of Contents