Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

baseobj(1) [centos man page]

BASEOBJ(1)							   baseobj 1.0.1							BASEOBJ(1)

NAME
baseobj - Base object DESCRIPTION
Base class so objects will inherit the methods which provide the string representation of the object and methods to change the verbosity of such string representation. It also includes a simple debug printing and logging mechanism including methods to change the debug verbosity level and methods to add debug levels. CLASSES
class BaseObj(__builtin__.object) Base class so objects will inherit the methods which provide the string representation of the object and a simple debug printing and log- ging mechanism. Methods defined here: --------------------- __init__(self, *kwts, **kwds) Constructor Initialize object's private data according to the arguments given Examples: # Named arguments x = BaseObj(a=1, b=2) # Dictionary argument x = BaseObj({'a':1, 'b':2}) # Tuple arguments: first for keys and second for the values x = BaseObj(['a', 'b'], [1, 2]) # All of the above will create an object having two attributes: x.a = 1 and x.b = 2 __repr__(self) String representation of object The representation depends on the verbose level set by debug_repr(). If set to 0 the generic object representation is returned, else the representation of the object includes all object attributes and their values with proper indentation. __str__ = __repr__(self) close_log(self) Close log file. debug_level(self, level=0) Set debug level mask. level: Level to set. This could be a number or a string expression of names defined by debug_map() Examples: # Set level x.debug_level(0xFF) # Set level using expression x.debug_level('all') x.debug_level('debug ^ 1') dprint(self, level, msg, indent=0) Print debug message if level is allowed by the verbose level given in debug_level(). open_log(self, logfile) Open log file. Static methods defined here: ---------------------------- debug_map(bitmap, name='', disp='') Add a debug mapping. Generic debug levels map <bitmap> <name> <disp prefix> 0x000 'none' 0x001 'info' 'INFO: ' # Display info messages only 0x0FF 'debug' 'DBG: ' # Display info and all debug messages (0x02-0x80) >0x100 user defined verbose levels debug_repr(level=None) Return or set verbose level of object's string representation. When setting the verbose level, return the verbose level before set- ting it. level: Level of verbosity to set dindent(indent) Set global indentation. write_log(data) Write data to log file. BUGS
No known bugs. AUTHOR
Jorge Mora (mora@netapp.com) NFStest 1.0.2 10 April 2013 BASEOBJ(1)

Check Out this Related Man Page

PACKET.PKT(1)							 packet.pkt 1.0.1						     PACKET.PKT(1)

NAME
packet.pkt - Pkt module DESCRIPTION
Provides the object for a packet and the string representation of the packet. This object has an attribute for each of the layers in the packet so each layer can be accessed directly instead of going through each layer. To access the nfs layer object you can use 'x.nfs' instead of using 'x.ethernet.ip.tcp.rpc.nfs' which would very cumbersome to use. Also, since NFS can be used with either TCP or UDP it would be harder to to access the nfs object independently or the protocol. Packet object attributes: Pkt( record = Record information (frame number, etc.) ethernet = ETHERNET II (RFC 894) object ip = IPv4 object tcp = TCP object rpc = RPC object nfs = NFS object ) CLASSES
class Pkt(baseobj.BaseObj) Packet object Usage: from packet.pkt import Pkt x = Pkt() Methods defined here: --------------------- __str__(self) String representation of object The representation depends on the verbose level set by debug_repr(). If set to 0 the generic object representation is returned. If set to 1 the representation of is condensed into a single line. It contains, the frame number, IP source and destination and/or the last layer: '1 0.386615 192.168.0.62 -> 192.168.0.17 TCP 2049 -> 708, seq: 3395733180, ack: 3294169773, ACK,SYN' '5 0.530957 00:0c:29:54:09:ef -> ff:ff:ff:ff:ff:ff, type: 0x806' '19 0.434370 192.168.0.17 -> 192.168.0.62 NFS v4 COMPOUND4 call SEQUENCE;PUTFH;GETATTR' If set to 2 the representation of the object is a line for each layer: 'Pkt( RECORD: frame 19 @ 0.434370 secs, 238 bytes on wire, 238 bytes captured ETHERNET: 00:0c:29:54:09:ef -> e4:ce:8f:58:9f:f4, type: 0x800(IPv4) IP: 192.168.0.17 -> 192.168.0.62, protocol: 6(TCP), len: 224 TCP: src port 708 -> dst port 2049, seq: 3294170673, ack: 3395734137, len: 172, flags: ACK,PSH RPC: CALL(0), program: 100003, version: 4, procedure: 1, xid: 0x1437d3d5 NFS: COMPOUND4args(tag='', minorversion=1, argarray=[nfs_argop4(argop=OP_SEQUENCE, ...), ...]) )' SEE ALSO
baseobj(1) BUGS
No known bugs. AUTHOR
Jorge Mora (mora@netapp.com) NFStest 1.0.2 10 April 2013 PACKET.PKT(1)
Man Page