2 * Copyright (c) 2001-2002
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
5 * Copyright (c) 2003-2004
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.h,v 1.2 2004/08/06 17:30:40 brandt Exp $
34 #ifndef _BSNMP_SNMP_ATM_H
35 #define _BSNMP_SNMP_ATM_H
38 ATMIF_NOTIFY_DESTROY, /* interface has been destroyed */
39 ATMIF_NOTIFY_CARRIER, /* carriere change */
40 ATMIF_NOTIFY_VCC /* VCC change */
43 enum atmif_carrier_state {
45 ATMIF_CARRIER_OFF = 2,
46 ATMIF_CARRIER_UNKNOWN = 3,
47 ATMIF_CARRIER_NONE = 4
50 enum atmif_suni_mode {
51 ATMIF_SUNI_MODE_SONET = 1,
52 ATMIF_SUNI_MODE_SDH = 2,
53 ATMIF_SUNI_MODE_UNKNOWN = 3
56 /* forward declaration */
58 typedef void (*atmif_event_f)(struct atmif *, enum atmif_notify, uintptr_t,
62 u_int version; /* currently 0 */
64 u_int device; /* type of hardware (system specific) */
65 u_int serial; /* card serial number (device specific) */
66 u_int hw_version; /* card version (device specific) */
67 u_int sw_version; /* firmware version (device specific) */
68 u_int media; /* physical media (see MIB) */
70 u_char esi[6]; /* end system identifier (MAC) */
71 u_int pcr; /* supported peak cell rate */
72 u_int vpi_bits; /* number of used bits in VPI field */
73 u_int vci_bits; /* number of used bits in VCI field */
74 u_int max_vpcs; /* maximum number of VPCs */
75 u_int max_vccs; /* maximum number of VCCs */
79 struct mibif *ifp; /* common interface data */
80 struct atmif_mib *mib; /* ATM MIB */
81 enum atmif_carrier_state carrier;
82 enum atmif_suni_mode mode; /* SUNI mode SDH or SONET */
85 /* find an ATM interface by name */
86 struct atmif *atm_find_if_name(const char *);
88 /* get the interface from the interface index */
89 struct atmif *atm_find_if(u_int);
91 /* register for notifications */
92 void *atm_notify_aif(struct atmif *, const struct lmodule *mod,
93 atmif_event_f, void *);
94 void atm_unnotify_aif(void *);
96 /* return the If for a system-specific node number */
97 struct atmif *atm_node2if(u_int);
99 /* return the node id for the if */
100 u_int atm_if2node(struct atmif *);