- The snmp_atm module implements a number of tables and
- scalars that enable
remote access to the ATM devices in the system. It also ex
- ports a number
of functions, that allow other modules to easily access ATM
- devices.
- The module maintains an extension to the interface structure
- exported by
snmp_mibII(3) for all ATM devices. This structure has the
- following
fields:
struct atmif {
struct mibif *ifp; /* common in
terface data */
struct atmif_mib *mib; /* ATM MIB */
enum atmif_carrier_state carrier;
enum atmif_suni_mode mode; /* SUNI mode
SDH or SONET */
- };
- The fields have the following meaning:
- ifp The field points to the snmp_mibII(3) interface struc
- ture.
- mib The special ATM interface MIB (see below).
- carrier
- The current state of the carrier. One of the following:
- ATMIF_CARRIER_ON
carrier detected,
- ATMIF_CARRIER_OFF
no carrier,
- ATMIF_CARRIER_UNKNOWN
the state of the carrier is unknown,
- ATMIF_CARRIER_NONE
the device has no notion of carrier or is not able
to sense it.
- mode
- For ATM devices with a SUNI chip this is the current
- mode of the
interface:
- ATMIF_SUNI_MODE_SONET
The interface is in SONET mode.
- ATMIF_SUNI_MODE_SDH
The interface is in SDH mode.
- ATMIF_SUNI_MODE_UNKNOWN
The interface either has no SUNI interface or the
mode is
unknown (for example, interface is down).
- An ATM interface can be found by name or by SNMP interface
- index (see
snmp_mibII(3) for a discussion of interface indexes). The
- function
atm_find_if_name() searches an interface given a name. The
- function
atm_find_if() searches an interface by its interface index.
- Both functions return NULL if an interface cannot be found.
- The ATM MIB contains the following fields:
struct atmif_mib {
u_int version; /* currently 0 */
u_int device; /* type of hardware
(system specific) */
u_int serial; /* card serial number
(device specific) */
u_int hw_version; /* card version (de
vice specific) */
u_int sw_version; /* firmware version
(device specific) */
u_int media; /* physical media (see
MIB) */
u_char esi[6]; /* end system identi
fier (MAC) */
u_int pcr; /* supported peak cell
rate */
u_int vpi_bits; /* number of used bits
in VPI field */
u_int vci_bits; /* number of used bits
in VCI field */
u_int max_vpcs; /* maximum number of
VPCs */
u_int max_vccs; /* maximum number of
VCCs */
- };
- NOTIFICATIONS
- An other module can register with atmif_event_f to receive
- notifications
when certain events happen on the ATM interface. The regis
- tration is
done with atm_notify_aif() which takes a pointer to the in
- terface, the
calling module pointer, a callback function and a user argu
- ment that is
passed to the callback function. The callback function is
- called with
the interface pointer, a notification code, a notification
- argument and
the user argument. The following notifications are defined:
- ATMIF_NOTIFY_DESTROY
The interface is destroyed. The notification argument
is not used.
- ATMIF_NOTIFY_CARRIER
The carrier state on the interface has changed. The ar
gument is the
old state of the carrier. The new state can be obtained
from the
interface structure.
- ATMIF_NOTIFY_VCC
A permanent VCC has been created or destroyed. The ar
gument is an
u_int that can be decoded as follows:
vpi = (arg >> 24) & 0xff;
vci = (arg >> 8) & 0xffff;
state = arg & 1;
state is 0 if the VCC was destroyed and 1 if it was
created.
- The registration for notification can be undone by passing
- the return
value from atm_notify_aif() to atm_unnotify_aif(). The reg
- istrations is
automatically removed if the interface is destroyed.
- MIB
- The MIB implemented by the module is defined in
- BEGEMOT-ATM.txt. In the
generic part there are two tables and one scalar, there is
- also a system
specific group:
- begemotAtmIfTable
This table is an extension of ifTable. It contains a
row for each
ATM interface and is index with ifIndex. All fields
are read-only
except the begemotAtmIfMode column.
- begemotAtmIfTableLastChange
Contains the tick when a row was created or destroyed
in the above
table or 0, if the table did not change since start of
the SNMP
agent.
- begemotAtmHWTable
Is also indexed by ifIndex and contains hardware spe
cific information. This table is read-only.