158679Sbde/* 21590Srgrimes * Copyright (c) 2004 3156813Sru * Deutsches Zentrum fuer Luft- und Raumfahrt. 4156813Sru * All rights reserved. 5117675Smarkm * 6117675Smarkm * Author: Hartmut Brandt <harti@freebsd.org> 7117675Smarkm * 881964Smarkm * Redistribution and use in source and binary forms, with or without 91590Srgrimes * modification, are permitted provided that the following conditions 1087147Smarkm * are met: 1187147Smarkm * 1. Redistributions of source code must retain the above copyright 1287147Smarkm * notice, this list of conditions and the following disclaimer. 1381964Smarkm * 2. Redistributions in binary form must reproduce the above copyright 14117675Smarkm * notice, this list of conditions and the following disclaimer in the 1575042Sru * documentation and/or other materials provided with the distribution. 16160749Syar * 17160749Syar * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18160749Syar * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19160749Syar * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20201386Sed * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 21201386Sed * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2274928Sru * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2374928Sru * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2481964Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2581964Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 261590Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2756812Sshin * SUCH DAMAGE. 28171246Sbz * 2981964Smarkm * $Begemot: libunimsg/snmp_atm/atm.h,v 1.3 2005/05/23 11:46:46 brandt_h Exp $ 3081964Smarkm */ 3175042Sru 32117675Smarkm#include <sys/types.h> 3381964Smarkm#include <sys/queue.h> 3481964Smarkm#include <sys/socket.h> 3556812Sshin 3656812Sshin#include <net/if.h> 37117973Smarkm#include <net/if_mib.h> 38156813Sru 39117675Smarkm#include <bsnmp/snmpmod.h> 40171246Sbz#include <bsnmp/snmp_mibII.h> 41117675Smarkm#include <bsnmp/snmp_atm.h> 42117675Smarkm 43160854Syar/* 44160854Syar * Event registrations 45156813Sru */ 46117675Smarkmstruct atmif_reg { 47178828Sdfr TAILQ_ENTRY(atmif_reg) link; 48178828Sdfr void *data; 49117675Smarkm atmif_event_f func; 50117675Smarkm const struct lmodule *mod; 5187147Smarkm struct atmif_priv *aif; /* back pointer */ 521590Srgrimes}; 53TAILQ_HEAD(atmif_reg_list, atmif_reg); 54 55/* 56 * Interface data 57 */ 58struct atmif_priv { 59 struct atmif pub; /* public part, must be first */ 60 TAILQ_ENTRY(atmif_priv) link; 61 u_int index; /* if_index */ 62 void *ifpreg; 63 struct atmif_sys *sys; 64 struct atmif_reg_list notify; 65}; 66TAILQ_HEAD(atmif_list, atmif_priv); 67 68/* list of all (known) ATM interfaces */ 69extern struct atmif_list atmif_list; 70 71extern struct lmodule *module; 72 73/* Check the carrier state of the interface */ 74void atmif_check_carrier(struct atmif_priv *); 75 76/* Send notification to all listeners. */ 77void atmif_send_notification(struct atmif_priv *, enum atmif_notify, uintptr_t); 78 79/* Get the interface point for a table access */ 80int atmif_get_aif(struct snmp_value *, u_int, enum snmp_op, 81 struct atmif_priv **); 82 83/* Destroy system dependend stuff. */ 84void atmif_sys_destroy(struct atmif_priv *); 85 86/* Attach to an ATM interface */ 87int atmif_sys_attach_if(struct atmif_priv *); 88 89/* Get vendor string */ 90int atm_sys_get_hw_vendor(struct atmif_priv *, struct snmp_value *); 91 92/* Get device string */ 93int atm_sys_get_hw_device(struct atmif_priv *, struct snmp_value *); 94 95/* Extract the ATM MIB from the interface's private MIB */ 96void atmif_sys_fill_mib(struct atmif_priv *); 97