2 .\" Copyright (c) 2001-2002
3 .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 .\" All rights reserved.
5 .\" Copyright (c) 2003-2004
7 .\" All rights reserved.
9 .\" Author: Hartmut Brandt <harti@FreeBSD.org>
11 .\" Redistribution and use in source and binary forms, with or without
12 .\" modification, are permitted provided that the following conditions
14 .\" 1. Redistributions of source code must retain the above copyright
15 .\" notice, this list of conditions and the following disclaimer.
16 .\" 2. Redistributions in binary form must reproduce the above copyright
17 .\" notice, this list of conditions and the following disclaimer in the
18 .\" documentation and/or other materials provided with the distribution.
20 .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" $Begemot: libunimsg/snmp_atm/snmp_atm.3,v 1.2 2005/05/23 12:00:29 brandt_h Exp $
39 .Nm atm_find_if_name ,
43 .Nd "ATM driver module for snmpd.
45 .Pq begemotSnmpdModulePath."netgraph" = "@MODPATH@snmp_netgraph.so" (FreeBSD)
46 .Pq begemotSnmpdModulePath."mibII" = "@MODPATH@snmp_mibII.so"
47 .Pq begemotSnmpdModulePath."atm" = "@MODPATH@snmp_atm.so"
50 .In bsnmp/snmp_mibII.h
53 .Fn (*atmif_event_f) "struct atmif *aif" "enum atmif_notify event" "uintptr_t data" "void *uarg"
55 .Fn atm_find_if_name "const char *name"
57 .Fn atm_find_if "u_int ifindex"
59 .Fn atm_notify_aif "struct atmif *aif" "const struct lmodule *mod" "atmif_event_f func" "void *uarg"
61 .Fn atm_unnotify_aif "void *not"
65 module implements a number of tables and scalars that enable remote access to
66 the ATM devices in the system. It also exports a number of
67 functions, that allow other modules to easily access ATM devices.
69 The module maintains an extension to the interface structure exported by
71 for all ATM devices. This structure has the following fields:
72 .Bd -literal -offset indent
74 struct mibif *ifp; /* common interface data */
75 struct atmif_mib *mib; /* ATM MIB */
76 enum atmif_carrier_state carrier;
77 enum atmif_suni_mode mode; /* SUNI mode SDH or SONET */
81 The fields have the following meaning:
84 The field points to the
88 The special ATM interface MIB (see below).
90 The current state of the carrier. One of the following:
92 .It Dv ATMIF_CARRIER_ON
94 .It Dv ATMIF_CARRIER_OFF
96 .It Dv ATMIF_CARRIER_UNKNOWN
97 the state of the carrier is unknown,
98 .It Dv ATMIF_CARRIER_NONE
99 the device has no notion of carrier or is not able to sense it.
102 For ATM devices with a SUNI chip this is the current mode of the interface:
104 .It Dv ATMIF_SUNI_MODE_SONET
105 The interface is in SONET mode.
106 .It Dv ATMIF_SUNI_MODE_SDH
107 The interface is in SDH mode.
108 .It Dv ATMIF_SUNI_MODE_UNKNOWN
109 The interface either has no SUNI interface or the mode is unknown (for example,
114 An ATM interface can be found by name or by SNMP interface index (see
116 for a discussion of interface indexes).
119 searches an interface given a name.
122 searches an interface by its interface index.
123 Both functions return NULL if an interface cannot be found.
125 The ATM MIB contains the following fields:
126 .Bd -literal -offset indent
128 u_int version; /* currently 0 */
130 u_int device; /* type of hardware (system specific) */
131 u_int serial; /* card serial number (device specific) */
132 u_int hw_version; /* card version (device specific) */
133 u_int sw_version; /* firmware version (device specific) */
134 u_int media; /* physical media (see MIB) */
136 u_char esi[6]; /* end system identifier (MAC) */
137 u_int pcr; /* supported peak cell rate */
138 u_int vpi_bits; /* number of used bits in VPI field */
139 u_int vci_bits; /* number of used bits in VCI field */
140 u_int max_vpcs; /* maximum number of VPCs */
141 u_int max_vccs; /* maximum number of VCCs */
145 An other module can register with
147 to receive notifications when certain events happen on the ATM interface.
148 The registration is done with
150 which takes a pointer to the interface, the calling module pointer, a callback
151 function and a user argument that is passed to the callback function.
152 The callback function is called with the interface pointer, a notification
153 code, a notification argument and the user argument. The following
154 notifications are defined:
156 .It Dv ATMIF_NOTIFY_DESTROY
157 The interface is destroyed. The notification argument is not used.
158 .It Dv ATMIF_NOTIFY_CARRIER
159 The carrier state on the interface has changed. The argument is the
161 state of the carrier. The new state can be obtained from the interface
163 .It Dv ATMIF_NOTIFY_VCC
164 A permanent VCC has been created or destroyed. The argument is an u_int that
165 can be decoded as follows:
166 .Bd -literal -offset indent
167 vpi = (arg >> 24) & 0xff;
168 vci = (arg >> 8) & 0xffff;
173 is 0 if the VCC was destroyed and 1 if it was created.
175 The registration for notification can be undone by passing the return
179 .Fn atm_unnotify_aif .
180 The registrations is automatically removed if the interface is destroyed.
182 The MIB implemented by the module is defined in
183 .Pa BEGEMOT-ATM.txt .
184 In the generic part there are two tables and one scalar, there is also
185 a system specific group:
187 .It Va begemotAtmIfTable
188 This table is an extension of
190 It contains a row for each ATM interface and is index with
192 All fields are read-only except the
195 .It Va begemotAtmIfTableLastChange
196 Contains the tick when a row was created or destroyed in the above table or
197 0, if the table did not change since start of the SNMP agent.
198 .It Va begemotAtmHWTable
201 and contains hardware specific information. This table is read-only.
204 .Bl -tag -width "XXXXXXXXX"
205 .It Pa @DEFPATH@atm_tree.def
206 The description of the MIB tree implemented by
208 .It Pa @MIBSPATH@BEGEMOT-ATM.txt
209 This is the MIB that is implemented by this module.
218 .An Hartmut Brandt Aq harti@FreeBSD.org