📄 mib_asy.c
字号:
/* * Copyright 2000-2005 Wind River Systems, Inc. * All rights reserved. Provided under license only. * Distribution or other use of this software is only * permitted pursuant to the terms of a license agreement * from Wind River Systems (and is otherwise prohibited). * Refer to that license agreement for terms of use. *//* * Copyright 1995-1997 Epilogue Technology Corporation. * Copyright 1998 Integrated Systems, Inc. * All rights reserved. *//* * $Log: mib_asy.c,v $ * Revision 1.2 2001/11/06 21:20:37 josh * revised new path hacking * * Revision 1.1.1.1 2001/11/05 17:47:45 tneale * Tornado shuffle * * Revision 9.1 2000/03/17 00:19:51 meister * Update copyright message * * Revision 9.0 1998/10/16 22:12:53 sar * Update version stamp to match release * * Revision 8.2 1998/06/05 18:53:29 sra * "#include <foo.h>" => "#include <envoy/h/foo.h>". * * Revision 8.1 1998/02/25 04:53:18 sra * Update copyrights. * * Revision 8.0 1997/11/18 00:57:11 sar * Updated revision to 8.0 * * Revision 7.3 1997/11/05 01:09:13 sar * Changed the access type macros from two characters to full names. * * Revision 7.2 1997/03/20 06:49:36 sra * DFARS-safe copyright text. Zap! * * Revision 7.1 1997/02/25 10:49:26 sra * Update copyright notice, dust under the bed. * * Revision 7.0 1996/03/18 20:24:05 sar * Updated rev to 7.0 and copyright to 96 * * Revision 6.2 1996/01/25 19:28:21 sar * Added a [0] to the test_string and test_ipaddr constructs to try * and get the construct to be more portable. * * Revision 6.1 1995/11/01 00:38:58 sar * Removed deprecated v2 types * * Revision 6.0 1995/05/31 21:49:21 sra * Release 6.0. * * Revision 1.1 1995/05/05 23:04:09 sar * Initial revision * * *//* [clearcase]modification history-------------------01b,19apr05,job update copyright notices01a,24nov03,job update copyright information*//**************************************************************************** * THIS MIB CORRESPONDS TO RFC1065 AND RFC1066 ****************************************************************************/#include <wrn/wm/snmp/engine/asn1.h>#include <wrn/wm/snmp/engine/snmp.h>#include <wrn/wm/snmp/engine/mib.h>#include "snmpvars.h"#define STATIC staticextern void it_exists_async();extern void null_set_async();extern void null_get_async();extern void std_next_async();extern void get_int_async(), get_uint_async(), set_int_async();extern void get_string_async();extern void get_ui64_async();extern void get_ip_address_async();extern void get_object_identifier_async();extern void no_next_async();extern void get_centasecs_async();extern void iftable_test_async();extern void iftable_get_async();extern void attable_test_async();extern void attable_get_async();extern int ip_addrtable_test_async();extern int ip_addrtable_get_async();extern int ip_routetable_test_async();extern int ip_routetable_get_async();extern int tcptable_test_async();extern int tcptable_get_async();/********************************************************************** Dummy string This string is used only in the distribution sources to provide an address for string and opaque leaf node cookies. This variable may be removed after porting once real pointers are placed in those leaves. **********************************************************************/static char dummystr[] = "DUMMY STRING";/********************************************************************** Dummy value This value is used only in the distribution sources to provide an value for numeric leaf node cookies. This variable may be removed after porting once real pointers are placed in those leaves. **********************************************************************/static unsigned long dummyval = 0;/****************************************************************************NAME: Mib_TreePURPOSE: The following data structure represents the Management Information Base (MIB) tree.****************************************************************************//********************************************************************** THE SYSTEM GROUP **********************************************************************/LEAF_ASYS(sysdescr_leaf, "sysDescr", VT_STRING, READ_ACCESS, 0, it_exists_async, get_string_async, null_set_async, std_next_async, snmp_system_description, 0, 0xff, 0xff);LEAF_ASYS(sysobjectid_leaf, "sysObjectID", VT_OBJECT, READ_ACCESS, 0, it_exists_async, get_object_identifier_async, null_set_async, std_next_async, &snmp_system_object_id, 0, 0xff, 0xff);LEAF_ASYS(sysuptime_leaf, "sysUpTime", VT_TIMETICKS, READ_ACCESS, 0, it_exists_async, get_centasecs_async, null_set_async, std_next_async, (char *)&system_clicks, 0, 0xff, 0xff);/* The SYSTEM node */MIBARC_T system_arcs[] = {ARC(1, sysdescr_leaf), ARC(2, sysobjectid_leaf), ARC(3, sysuptime_leaf), END_OF_ARC_LIST};STATICMIBNODE_T system_node = NODE("system", system_arcs);/********************************************************************** THE INTERFACES GROUP **********************************************************************//* The INTERFACES node */LEAF_ASYS(ifnumber_leaf, "ifNumber", VT_NUMBER, READ_ACCESS, 0, it_exists_async, get_int_async, null_set_async, std_next_async, &if_number, 0, 0xff, 0xff);/* The Interfaces Table */LEAF_ASYS(ifindex_leaf, "ifIndex", VT_NUMBER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifdescr_leaf, "ifDescr", VT_STRING, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, dummystr, 0, 0xff, 0xff);LEAF_ASYS(iftype_leaf, "ifType", VT_NUMBER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifmtu_leaf, "ifMtu", VT_NUMBER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifspeed_leaf, "ifSpeed", VT_GAUGE, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifphysaddress_leaf, "ifPhysAddress", VT_STRING, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, dummystr, 0, 0xff, 0xff);LEAF_ASYS(ifadminstatus_leaf, "ifAdminStatus", VT_NUMBER, READ_WRITE_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifoperstatus_leaf, "ifOperStatus", VT_NUMBER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(iflastchange_leaf, "ifLastChange", VT_TIMETICKS, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifinoctets_leaf, "ifInOctets", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifinucastpkts_leaf, "ifInUcastPkts", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifinnucastpkts_leaf, "ifInNUcastPkts", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifindiscards_leaf, "ifInDiscards", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifinerrors_leaf, "ifInErrors", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifinunknownprotos_leaf, "ifInUnknownProtos", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifoutoctets_leaf, "ifOutOctets", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifoutucastpkts_leaf, "ifOutUcastPkts", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifoutnucastpkts_leaf, "ifOutNUcastPkts", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifoutdiscards_leaf, "ifOutDiscards", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifouterrors_leaf, "ifOutErrors", VT_COUNTER, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(ifoutqlen_leaf, "ifOutQLen", VT_GAUGE, READ_ACCESS, 0, iftable_test_async, iftable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);STATICMIBARC_T ifentry_arcs[] = {ARC(1, ifindex_leaf), ARC(2, ifdescr_leaf), ARC(3, iftype_leaf), ARC(4, ifmtu_leaf), ARC(5, ifspeed_leaf), ARC(6, ifphysaddress_leaf), ARC(7, ifadminstatus_leaf), ARC(8, ifoperstatus_leaf), ARC(9, iflastchange_leaf), ARC(10, ifinoctets_leaf), ARC(11, ifinucastpkts_leaf), ARC(12, ifinnucastpkts_leaf), ARC(13, ifindiscards_leaf), ARC(14, ifinerrors_leaf), ARC(15, ifinunknownprotos_leaf), ARC(16, ifoutoctets_leaf), ARC(17, ifoutucastpkts_leaf), ARC(18, ifoutnucastpkts_leaf), ARC(19, ifoutdiscards_leaf), ARC(20, ifouterrors_leaf), ARC(21, ifoutqlen_leaf), END_OF_ARC_LIST};STATICMIBNODE_T ifentry_node = NODE("ifEntry", ifentry_arcs);STATICMIBARC_T iftable_arcs[] = {ARC(1, ifentry_node), END_OF_ARC_LIST};STATICMIBNODE_T iftable_node = NODE("ifTable", iftable_arcs);STATICMIBARC_T interfaces_arcs[] = {ARC(1, ifnumber_leaf), ARC(2, iftable_node), END_OF_ARC_LIST};STATICMIBNODE_T interfaces_node = NODE("interfaces", interfaces_arcs);/********************************************************************** THE ADDRESS TABLE (AT) GROUP **********************************************************************//* The AT (Address Table/ARP) node */LEAF_ASYS(atifindex_leaf, "atIfIndex", VT_NUMBER, READ_WRITE_ACCESS, 0, attable_test_async, attable_get_async, null_set_async, no_next_async, &dummyval, 0, 0xff, 0xff);LEAF_ASYS(atphysaddress_leaf, "atPhysAddress", VT_STRING, READ_WRITE_ACCESS, 0, attable_test_async, attable_get_async, null_set_async, no_next_async, dummystr, 0, 0xff, 0xff);LEAF_ASYS(atnetaddress_leaf, "atNetAddress", VT_IPADDRESS, READ_WRITE_ACCESS, 0, attable_test_async, attable_get_async, null_set_async, no_next_async, dummystr, 0, 0xff, 0xff);STATICMIBARC_T atentry_arcs[] = {ARC(1, atifindex_leaf), ARC(2, atphysaddress_leaf), ARC(3, atnetaddress_leaf), END_OF_ARC_LIST};STATICMIBNODE_T atentry_node = NODE("atEntry", atentry_arcs);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -