op_manfile

A utility that performs management operations related to the tracking and identification of model files, including file location, locks, security protection/registration, and header contents.

Description

The op_manfile program provides a number of operations for viewing and modifying the file header and comments of a model file, in addition to operations related to locating files.

Model files have three portions: (1) a file header; (2) file comments; (3) model data. The header portion of model files contains tracking and identification information for the file, such as the time at which the file was created. The comment portion of model files contains user-entered text descriptions of the file’s data contents and modification history. Model-derived object code files also contain embedded, non-modifiable file headers.

The header portion of model files contains the following information about the file:

  • model type
  • creation time and date
  • name and release of the creating OPNET application
  • earliest release of the creating OPNET application that is compatible with the file’s format
  • last modification time and date
  • version number of the file (i.e., the number of times the file has been written to disk)
  • user account name and host computer name associated with the last modification
  • status of the file’s edit lock (edit locks are automatically set by OPNET applications that are editing a model file, to prevent concurrent editing of the same file)
  • status of the file’s user lock (user locks are manually set by users to indicate temporary ownership and prevent other users from modifying the model during a development phase)
  • model security access information (status, number of registered sites, access level of the local site, and world access status)
  • model suite information (suite name and description, often including the model vendor’s name and contact information)

The above information can be very useful in establishing the background information of a model file. OPNET applications that manipulate model files can modify the above information, but the only way to view the above information is via op_manfile.

The op_manfile program provides the following operations; each operation is specified by the preference indicated within parentheses. Only one operation can be performed per op_manfile session.

  • find one or more models based on the file base name (-find
  • print the file header (-header_print)
  • repair the file header (-header_repair)
  • update the file header (-header_update)
  • set the file version number (-version_set)
  • add comments to a file (-comments_add))
  • delete comments from a file (-comments_del)
  • print file comments (-comments_print)
  • set or release the edit lock (-edit_lock and -edit_unlock, respectively)
  • set or release the user lock (-user_lock and -user_unlock, respectively)
  • display a file’s checksums (-checksum)
  • protect a model from unauthorized use (-protect)
  • register a model to gain or grant access (-register)

All op_manfile operations require a least one target model file, to which they are applied (some operations can support multiple target files). The target model file of op_manfile is specified by one of several preferences, including m, mf, and f. Some commands (such as register) also take an optional source model file, which is specified by the preferences from, from_f, or from_mf.

Preferences

This program supports the following preference sets:

This program also supports the following additional preferences.

all

Specifies that the selected operation be expanded in its scope, in an operation-specific manner. This flag serves as a operation modifier and can be used in conjunction with the following operations: -edit_lock, -edit_unlock, -find, -header_print, -user_lock, and -user_unlock.

For a lock-related operation, the -all modifier causes the operation to be applied to all model files located in the model directories (i.e., specific files do not need to be specified by the f, m, or mf preferences).

For the -find operation, the -all modifier causes all models with duplicate names in different model directories to be found (normally a model found in a higher-precedence model directory will override and effectively hide duplicate models found in lower-precedence model directories).

For the -print_header operation, the -all modifier causes the printing of multiple headers present within a file, instead of just the first header in the file (only simulations can contain multiple headers, due to the headers associated with each model-derived object code module in the simulation file).

Type Default Value
boolean FALSE

app_name

Specifies the name of the application identified in the target file header as the creator of the file. This preference’s value is used by op_manfile when a file header is created by the -header_add operation, or when a file header is updated by the -header_update operation.

Type Default Value
string “”

backup_max_count

Specifies the maximum quantity of numbered version backups kept for a given file. Each time you save a model with the same name, the overwritten file is stored in your op_admin/bk directory with a name of the form: <model_name>.v<vers_num>.<mdl_type>.m. The most recent file versions are kept; when the maximum count of backups would be exceeded by a new version, the earliest version is removed from the bk directory.

Type Default Value
integer 10

checksum

Specifies that the checksum numbers of the target file be computed and printed. This operation can be applied to any type of file via the f preference, including program executables. The output of the operation is two integer checksum numbers, identified as “Add” and “Xor” because of their respective computation methods. File checksum numbers are used to determine whether a release file has been corrupted. Users must contact technical support to compare their checksum values with the expected values.

Type Default Value
boolean FALSE

comments_add

Specifies that a single comment be added to the target file. The text of the comment is entered by the user after a prompt that appears on the standard output device. Comments are limited to one line of text; pressing the <Return> key completes the comment. Comments are tagged with the date, user account name, and file version associated with their addition to the file.

Type Default Value
boolean FALSE

comments_del

Specifies that all comments contained in the target file be deleted.

Type Default Value
boolean FALSE

comments_print

Specifies that all comments contained in the target file be printed to the standard output device. Each comment is separated by a line of underscores, and is tagged with the date, user account name, and file version number associated with the comment’s addition to the file.

Type Default Value
boolean FALSE

dir

Specifies that the requested security protection be applied to all files in the current directory. This argument is used by the author with the protect argument.

Type Default Value
boolean FALSE

edit_lock

Specifies that the target file’s edit lock be set, as if the file were being edited by the OPNET program. This tags the files as “read-only” and prevents all OPNET programs from modifying it. This operation is not typically used; instead, a user may temporarily lock a file using the -user_lock operation.

Type Default Value
boolean FALSE

edit_unlock

Specifies that the target file’s edit lock be reset, thus allowing modification by OPNET programs. If the OPNET program exits abnormally due to a program abort, files that were being edited by the program may retain edit locks. This situation can be rectified by the -edit_unlock operation.

Type Default Value
boolean FALSE

f

Specifies the full name and path of the target file on which operations will be performed. The file names must include file type suffixes, and absolute or relative paths.

Type Default Value
string “”

find

Specifies that the target file(s) be found within the model directories, and information on their location be printed on the standard output device. This operation does not request the selection of a single target file if multiple model files match a base name specified by the m preference, and it locates all model files that satisfy the target name. This operation is not compatible with the f preference. The location information includes the target file’s names (with suffix), types, and model directories.

Type Default Value
boolean FALSE

from

Specifies the base name of the source model from which to copy protection information (that is, the model name without the file suffix or path). The op_manfile program locates the specified model file in the model directories. If more than one model file is found with this base name and the specified operation requires a single source file, op_manfile will request the selection of a single file from a menu of options printed on the standard output device.

Type Default Value
string “”

from_f

Specifies the full name and path of the source model from which to copy protection information. The file name must include file suffix and absolute or relative path.

Type Default Value
string “”

from_mf

Specifies the full name and file suffix of the source model from which to copy protection information. The file name should not include a path (the specified model file will be located in the model directories).

Type Default Value
string “”

header_add

Specifies that header information be added to the target file. This operation is rarely used.

Type Default Value
boolean FALSE

header_print

Specifies that the header information of the target file be printed on the standard output device. The header information is printed in a tabular format.

Type Default Value
boolean FALSE

header_repair

Specifies that the header information of the target file be repaired. If the OPNET program issues an error message indicating that a model file is corrupted, this operation may be able to repair the damage if it is limited to the header.

Type Default Value
boolean FALSE

header_update

Specifies that the header information of the target file be updated. An update modifies all of the “last modification” fields of the header, including date, version number, user account name, and host computer name. The creating application name is also modified if the app_name preference is set.

Type Default Value
boolean FALSE

m

Specifies the base name of the target files on which operations will be performed (i.e., the model name without the file type suffix or path). The specified model file(s) are located in the model directories. If more than one model file is found with this base name, and the specified operation requires a single target file, op_manfile will request the selection of a single target file from a menu of options printed on the standard output device.

Type Default Value
string “”

mf

Specifies the full name of the target file on which operations will be performed (i.e., the model name with file type suffix). The file name should not include a path; the specified model file is located in the model directories.

Type Default Value
string “”

protect

Protects a model file from unauthorized access. The author specifies the pass phrase used as the encryption key. For more information see Chapter 4 “Security” on page 250.

Type Default Value
boolean FALSE

register

Registers a protected model file. Registration allows access to the model by users at a specified site (OPNET installation). For more information see Chapter 4 “Security” on page 250.

Type Default Value
boolean FALSE

suite

Specifies that all model files in the same suite as the specified model should be registered. The suite preference must be used with the register preference.

Type Default Value
boolean FALSE

user_lock

Specifies that the target file’s user lock be set. This tags the file as belonging to the user account that set the lock, and prevents OPNET programs being run by other user accounts from modifying the file.

Type Default Value
boolean FALSE

user_unlock

Specifies that the target file’s user lock be reset, thus allowing modification by OPNET programs run by any user account.

Type Default Value
boolean FALSE

version_set

Specifies that the target file’s version number be set to the specified integer value (the default value of -1 specifies that no change be made). This operation allows the version number of a file to a correlated to user-defined sequence.

Type Default Value
integer -1

world

Specifies that the model file be registered so that anyone can access it. This argument is used by the author and with the register argument.

Type Default Value
boolean FALSE

Example Usage

The following example illustrates using the op_manfile program to print out header information for a process model named “atm16_crossconn”. User-entered information is shown in bold typeface.

% op_manfile -m atm16_crossconn -header_print

|-------------------------------------------------------------------|
|file path : /riverbed/18.0/models/std/atm/atm16_crossconn.nd.d     |
|-------------------------------------------------------------------|
|file type : Derived Node Model                                     |
|-------------------------------------------------------------------|
|creation                                                           |
| date : Wed Feb 28 14:11:09 1996                                   |
| application : op_cvdlb2                                           |
| release : 10.0.A                                                  |
| file data v. : 8.5.A                                              |
|-------------------------------------------------------------------|
|last modification                                                  |
| date : Sun Jun 15 19:40:01 2003                                   |
| version : 25                                                      |
| user : a_user                                                     |
| host : bhornet                                                    |
|-------------------------------------------------------------------|
|edit lock                                                          |
| status : unlocked                                                 |
|-------------------------------------------------------------------|
|user lock                                                          |
| status : unlocked                                                 |
|-------------------------------------------------------------------|
|security                                                           |
| status : not protected                                            |
|-------------------------------------------------------------------|
|suite info : (none available)                                      |
|-------------------------------------------------------------------|

%

For examples of protecting and registering models, see Chapter 4 “Security” on page 250.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com