1.\" 2.\" Copyright (c) 2001-2003 3.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). 4.\" All rights reserved. 5.\" 6.\" Author: Harti Brandt <harti@freebsd.org> 7.\" 8.\" Redistribution of this software and documentation and use in source and 9.\" binary forms, with or without modification, are permitted provided that 10.\" the following conditions are met: 11.\" 12.\" 1. Redistributions of source code or documentation must retain the above 13.\" copyright notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 3. Neither the name of the Institute nor the names of its contributors 18.\" may be used to endorse or promote products derived from this software 19.\" without specific prior written permission. 20.\" 21.\" THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY FRAUNHOFER FOKUS 22.\" AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 23.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 24.\" FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 25.\" FRAUNHOFER FOKUS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 28.\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 29.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 30.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32.\"
| 1.\" 2.\" Copyright (c) 2001-2003 3.\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). 4.\" All rights reserved. 5.\" 6.\" Author: Harti Brandt <harti@freebsd.org> 7.\" 8.\" Redistribution of this software and documentation and use in source and 9.\" binary forms, with or without modification, are permitted provided that 10.\" the following conditions are met: 11.\" 12.\" 1. Redistributions of source code or documentation must retain the above 13.\" copyright notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 3. Neither the name of the Institute nor the names of its contributors 18.\" may be used to endorse or promote products derived from this software 19.\" without specific prior written permission. 20.\" 21.\" THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY FRAUNHOFER FOKUS 22.\" AND ITS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 23.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 24.\" FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 25.\" FRAUNHOFER FOKUS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 28.\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 29.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 30.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32.\"
|
33.\" $Begemot: bsnmp/snmp_mibII/snmp_mibII.3,v 1.2 2003/12/03 10:01:19 hbb Exp $
| 33.\" $Begemot: bsnmp/snmp_mibII/snmp_mibII.3,v 1.3 2004/04/13 17:01:31 novo Exp $
|
34.\" 35.Dd August 19, 2002 36.Dt snmp_mibII 3 37.Os 38.Sh NAME
| 34.\" 35.Dd August 19, 2002 36.Dt snmp_mibII 3 37.Os 38.Sh NAME
|
| 39.Nm mibII ,
|
39.Nm mibif_notify_f , 40.Nm mib_netsock , 41.Nm mib_if_set_dyn , 42.Nm mib_refresh_iflist , 43.Nm mib_find_if , 44.Nm mib_find_if_sys , 45.Nm mib_find_if_name , 46.Nm mib_first_if , 47.Nm mib_next_if , 48.Nm mib_register_newif , 49.Nm mib_unregister_newif , 50.Nm mib_fetch_ifmib , 51.Nm mib_if_admin , 52.Nm mib_find_ifa , 53.Nm mib_first_ififa , 54.Nm mib_next_ififa , 55.Nm mib_ifstack_create , 56.Nm mib_ifstack_delete , 57.Nm mib_find_rcvaddr , 58.Nm mib_rcvaddr_create , 59.Nm mib_rcvaddr_delete , 60.Nm mibif_notify , 61.Nm mibif_unnotify 62.Nd "mib-2 module for snmpd. 63.Sh LIBRARY
| 40.Nm mibif_notify_f , 41.Nm mib_netsock , 42.Nm mib_if_set_dyn , 43.Nm mib_refresh_iflist , 44.Nm mib_find_if , 45.Nm mib_find_if_sys , 46.Nm mib_find_if_name , 47.Nm mib_first_if , 48.Nm mib_next_if , 49.Nm mib_register_newif , 50.Nm mib_unregister_newif , 51.Nm mib_fetch_ifmib , 52.Nm mib_if_admin , 53.Nm mib_find_ifa , 54.Nm mib_first_ififa , 55.Nm mib_next_ififa , 56.Nm mib_ifstack_create , 57.Nm mib_ifstack_delete , 58.Nm mib_find_rcvaddr , 59.Nm mib_rcvaddr_create , 60.Nm mib_rcvaddr_delete , 61.Nm mibif_notify , 62.Nm mibif_unnotify 63.Nd "mib-2 module for snmpd. 64.Sh LIBRARY
|
64.Pq begemotSnmpdModulePath."mibII" = "/usr/local/lib/snmp_mibII.so"
| 65.Pq begemotSnmpdModulePath."mibII" = "@MODPATH@snmp_mibII.so"
|
65.Sh SYNOPSIS 66.In bsnmp/snmpmod.h 67.In bsnmp/snmp_mibII.h 68.Ft typedef void 69.Fn (*mibif_notify_f) "struct mibif *ifp" "enum mibif_notify event" "void *uarg" 70.Vt extern int mib_netsock ; 71.Ft void 72.Fn mib_if_set_dyn "const char *ifname" 73.Ft void 74.Fn mib_refresh_iflist "void" 75.Ft struct mibif * 76.Fn mib_find_if "u_int ifindex" 77.Ft struct mibif * 78.Fn mib_find_if_sys "u_int sysindex" 79.Ft struct mibif * 80.Fn mib_find_if_name "const char *ifname" 81.Ft struct mibif * 82.Fn mib_first_if "void" 83.Ft struct mibif * 84.Fn mib_next_if "const struct mibif *ifp" 85.Ft int 86.Fn mib_register_newif "int (*func)(struct mibif *)" "const struct lmodule *mod" 87.Ft void 88.Fn mib_unregister_newif "const struct lmodule *mod" 89.Ft int 90.Fn mib_fetch_ifmib "struct mibif *ifp" 91.Ft int 92.Fn mib_if_admin "struct mibif *ifp" "int up" 93.Ft struct mibifa * 94.Fn mib_find_ifa "struct in_addr ipa" 95.Ft struct mibifa * 96.Fn mib_first_ififa "const struct mibif *ifp" 97.Ft struct mibifa * 98.Fn mib_next_ififa "struct mibifa *ifa" 99.Ft int 100.Fn mib_ifstack_create "const struct mibif *lower" "const struct mibif *upper" 101.Ft void 102.Fn mib_ifstack_delete "const struct mibif *lower" "const struct mibif *upper" 103.Ft struct mibrcvaddr * 104.Fn mib_find_rcvaddr "u_int ifindex" "const u_char *addr" "size_t addrlen" 105.Ft struct mibrcvaddr * 106.Fn mib_rcvaddr_create "struct mibif *ifp" "const u_char *addr" "size_t addrlen" 107.Ft void 108.Fn mib_rcvaddr_delete "struct mibrcvaddr *addr" 109.Ft void * 110.Fn mibif_notify "struct mibif *ifp" "const struct lmodule *mod" "mibif_notify_f func" "void *uarg" 111.Ft void 112.Fn mibif_unnotify "void *reg" 113.Sh DESCRIPTION 114The 115.Nm snmp_mibII 116module implements parts of the internet standard MIB-2. Most of the relevant 117MIBs are implemented. Some of the tables are restricted to be read-only 118instead of read-write. The exact current implementation can be found in
| 66.Sh SYNOPSIS 67.In bsnmp/snmpmod.h 68.In bsnmp/snmp_mibII.h 69.Ft typedef void 70.Fn (*mibif_notify_f) "struct mibif *ifp" "enum mibif_notify event" "void *uarg" 71.Vt extern int mib_netsock ; 72.Ft void 73.Fn mib_if_set_dyn "const char *ifname" 74.Ft void 75.Fn mib_refresh_iflist "void" 76.Ft struct mibif * 77.Fn mib_find_if "u_int ifindex" 78.Ft struct mibif * 79.Fn mib_find_if_sys "u_int sysindex" 80.Ft struct mibif * 81.Fn mib_find_if_name "const char *ifname" 82.Ft struct mibif * 83.Fn mib_first_if "void" 84.Ft struct mibif * 85.Fn mib_next_if "const struct mibif *ifp" 86.Ft int 87.Fn mib_register_newif "int (*func)(struct mibif *)" "const struct lmodule *mod" 88.Ft void 89.Fn mib_unregister_newif "const struct lmodule *mod" 90.Ft int 91.Fn mib_fetch_ifmib "struct mibif *ifp" 92.Ft int 93.Fn mib_if_admin "struct mibif *ifp" "int up" 94.Ft struct mibifa * 95.Fn mib_find_ifa "struct in_addr ipa" 96.Ft struct mibifa * 97.Fn mib_first_ififa "const struct mibif *ifp" 98.Ft struct mibifa * 99.Fn mib_next_ififa "struct mibifa *ifa" 100.Ft int 101.Fn mib_ifstack_create "const struct mibif *lower" "const struct mibif *upper" 102.Ft void 103.Fn mib_ifstack_delete "const struct mibif *lower" "const struct mibif *upper" 104.Ft struct mibrcvaddr * 105.Fn mib_find_rcvaddr "u_int ifindex" "const u_char *addr" "size_t addrlen" 106.Ft struct mibrcvaddr * 107.Fn mib_rcvaddr_create "struct mibif *ifp" "const u_char *addr" "size_t addrlen" 108.Ft void 109.Fn mib_rcvaddr_delete "struct mibrcvaddr *addr" 110.Ft void * 111.Fn mibif_notify "struct mibif *ifp" "const struct lmodule *mod" "mibif_notify_f func" "void *uarg" 112.Ft void 113.Fn mibif_unnotify "void *reg" 114.Sh DESCRIPTION 115The 116.Nm snmp_mibII 117module implements parts of the internet standard MIB-2. Most of the relevant 118MIBs are implemented. Some of the tables are restricted to be read-only 119instead of read-write. The exact current implementation can be found in
|
119.Pa /usr/local/include/bsnmp/mibII_tree.def .
| 120.Pa @DEFPATH@mibII_tree.def .
|
120The module also exports a number of functions and global variables for use 121by other modules, that need to handle network interfaces. This man page describes 122these functions. 123.Ss DIRECT NETWORK ACCESS 124The 125.Nm 126module opens a socket that is used to execute all network related 127.Xr ioctl 2 128functions. This socket is globally available under the name 129.Va mib_netsock . 130.Ss NETWORK INTERFACES 131The 132.Nm 133module handles a list of all currently existing network interfaces. It allows 134other modules to handle their own interface lists with special information 135by providing a mechanism to register to events that change the interface list 136(see below). The basic data structure is the interface structure: 137.Bd -literal -offset indent 138struct mibif { 139 TAILQ_ENTRY(mibif) link; 140 u_int flags; 141 u_int index; /* logical ifindex */ 142 u_int sysindex; 143 char name[IFNAMSIZ]; 144 char descr[256]; 145 struct ifmibdata mib; 146 u_int32_t mibtick; 147 void *specmib; 148 size_t specmiblen; 149 u_char *physaddr; 150 u_int physaddrlen; 151 int has_connector; 152 int trap_enable; 153 u_int32_t counter_disc; 154 mibif_notify_f xnotify; 155 void *xnotify_data; 156 const struct lmodule *xnotify_mod; 157}; 158.Ed 159.Pp 160The 161.Nm 162module tries to implement the semantic if 163.Va ifIndex 164as described in RFC-2863. This RFC states, that an interface indexes may not 165be reused. That means, for example, if 166.Pa tun 167is a synthetic interface type and the system creates the interface 168.Pa tun0 , 169destroys this interfaces and again creates a 170.Pa tun 0 , 171then these interfaces must have different interface indexes, because in fact 172they are different interfaces. If, on the other hand, there is a hardware 173interface 174.Pa xl0 175and this interface disappears, because its driver is unloaded and appears 176again, because the driver is loaded again, the interface index must stay 177the same. 178.Nm 179implements this by differentiating between real and synthetic (dynamic) 180interfaces. An interface type can be declared dynamic by calling the function 181.Fn mib_if_set_dyn 182with the name if the interface type (for example 183.Qq tun ). 184For real interfaces, the module keeps the mapping between the interface name 185and its 186.Va ifIndex 187in a special list, if the interface is unloaded. For dynamic interfaces 188a new 189.Va ifIndex 190is generated each time the interface comes into existance. This 191means, that the interface index as seen by SNMP is not the same index 192as used by the system. The SNMP 193.Va ifIndex 194is held in field 195.Va index , 196the system's interface index is 197.Va sysindex . 198.Pp 199A call to 200.Nm mib_refresh_iflist 201causes the entire interface list to be re-created. 202.Pp 203The interface list can be traversed with the functions 204.Fn mib_first_if 205and 206.Fn mib_next_if . 207Be sure not to change the interface list while traversing the list with 208these two calls. 209.Pp 210There are three functions to find an interface by name or index. 211.Fn mib_find_if 212finds an interface by searching for an SNMP 213.Va ifIndex , 214.Fn mib_find_if_sys 215finds an interface by searching for a system interface index and 216.Fn mib_find_if_name 217finds an interface by looking for an interface name. Each of the 218function returns 219.Li NULL 220if the interface cannot be found. 221.Pp 222The function 223.Fn mib_fetch_ifmib 224causes the interface MIB to be refreshed from the kernel. 225.Pp 226The function 227.Fn mib_if_admin 228can be used to change the interface administrative state to up 229(argument is 1) or down (argument is 0). 230.Ss INTERFACE EVENTS 231A module can register itself to receive a notification when a new entry is 232created in the interface list. This is done by calling 233.Fn mib_register_newif . 234A module can register only one function, a second call to 235.Fn mib_register_newif 236causes the registration to be overwritten. The registration can be removed 237with a call to 238.Fn mib_unregister_newif . 239If is unregistered automatically, when the registering module is unloaded. 240.Pp 241A module can also register to events on a specific interface. This is done 242by calling 243.Fn mibif_notify . 244This causes the given callback 245.Fa func 246to be called with the interface pointer, a notification code and 247the user argument 248.Fa uarg 249when any of the following events occur: 250.Bl -tag -width "XXXXX" 251.It Li MIBIF_NOTIFY_DESTROY 252The interface is destroyed. 253.El 254.Pp 255This mechanism can be used to implement interface type specific MIB parts 256in other modules. The registration can be removed with 257.Fn mib_unnotify 258which the return value from 259.Fa mib_notify . 260Any notification registration is removed automatically when the interface 261is destroyed or the registering module is unloaded. 262.Em Note that only one module can register to any given interface . 263.Ss INTERFACE ADDRESSES 264The 265.Nm 266module handles a table of interface IP-addresses. These addresses are held 267in a 268.Bd -literal -offset indent 269struct mibifa { 270 TAILQ_ENTRY(mibifa) link; 271 struct in_addr inaddr; 272 struct in_addr inmask; 273 struct in_addr inbcast; 274 struct asn_oid index; 275 u_int ifindex; 276 u_int flags; 277}; 278.Ed 279.Pp 280The (ordered) list of IP-addresses on a given interface can be traversed by 281calling 282.Fn mib_first_ififa 283and 284.Fn mib_next_ififa . 285The list should not be considered read-only. 286.Ss INTERFACE RECEIVE ADDRESSES 287The internet MIB-2 contains a table of interface receive addresses. These 288addresses are handled in: 289.Bd -literal -offset indent 290struct mibrcvaddr { 291 TAILQ_ENTRY(mibrcvaddr) link; 292 struct asn_oid index; 293 u_int ifindex; 294 u_char addr[ASN_MAXOIDLEN]; 295 size_t addrlen; 296 u_int flags; 297}; 298enum { 299 MIBRCVADDR_VOLATILE = 0x00000001, 300 MIBRCVADDR_BCAST = 0x00000002, 301 MIBRCVADDR_HW = 0x00000004, 302}; 303.Ed 304.Pp 305Note, that the assignment of 306.Li MIBRCVADDR_BCAST 307is based on a list of known interface types. The flags should be handled 308by modules inplementing interface type specific MIBs. 309.Pp 310A receive address can be created with 311.Fn mib_rcvaddr_create 312and deleted with 313.Fn mib_rcvaddr_delete . 314This needs to be done only for addresses that are not automatically handled 315by the system. 316.Pp 317A receive address can be found with 318.Fn mib_find_rcvaddr . 319.Ss INTERFACE STACK TABLE 320The 321.Nm 322module maintains also the interface stack table. Because for complex stacks, 323there is no system supported generic way of getting this information, interface 324type specific modules need to help setting up stack entries. The 325.Nm 326module handles only the top and bottom entries. 327.Pp 328A table entry is created with 329.Fn mib_ifstack_create 330and deleted with 331.Fn mib_ifstack_delete . 332Both functions need the pointers to the interfaces. Entries are automatically 333deleted if any of the interfaces of the entry is destroyed. The functions handle 334both the stack table and the reverse stack table. 335.Sh FILES
| 121The module also exports a number of functions and global variables for use 122by other modules, that need to handle network interfaces. This man page describes 123these functions. 124.Ss DIRECT NETWORK ACCESS 125The 126.Nm 127module opens a socket that is used to execute all network related 128.Xr ioctl 2 129functions. This socket is globally available under the name 130.Va mib_netsock . 131.Ss NETWORK INTERFACES 132The 133.Nm 134module handles a list of all currently existing network interfaces. It allows 135other modules to handle their own interface lists with special information 136by providing a mechanism to register to events that change the interface list 137(see below). The basic data structure is the interface structure: 138.Bd -literal -offset indent 139struct mibif { 140 TAILQ_ENTRY(mibif) link; 141 u_int flags; 142 u_int index; /* logical ifindex */ 143 u_int sysindex; 144 char name[IFNAMSIZ]; 145 char descr[256]; 146 struct ifmibdata mib; 147 u_int32_t mibtick; 148 void *specmib; 149 size_t specmiblen; 150 u_char *physaddr; 151 u_int physaddrlen; 152 int has_connector; 153 int trap_enable; 154 u_int32_t counter_disc; 155 mibif_notify_f xnotify; 156 void *xnotify_data; 157 const struct lmodule *xnotify_mod; 158}; 159.Ed 160.Pp 161The 162.Nm 163module tries to implement the semantic if 164.Va ifIndex 165as described in RFC-2863. This RFC states, that an interface indexes may not 166be reused. That means, for example, if 167.Pa tun 168is a synthetic interface type and the system creates the interface 169.Pa tun0 , 170destroys this interfaces and again creates a 171.Pa tun 0 , 172then these interfaces must have different interface indexes, because in fact 173they are different interfaces. If, on the other hand, there is a hardware 174interface 175.Pa xl0 176and this interface disappears, because its driver is unloaded and appears 177again, because the driver is loaded again, the interface index must stay 178the same. 179.Nm 180implements this by differentiating between real and synthetic (dynamic) 181interfaces. An interface type can be declared dynamic by calling the function 182.Fn mib_if_set_dyn 183with the name if the interface type (for example 184.Qq tun ). 185For real interfaces, the module keeps the mapping between the interface name 186and its 187.Va ifIndex 188in a special list, if the interface is unloaded. For dynamic interfaces 189a new 190.Va ifIndex 191is generated each time the interface comes into existance. This 192means, that the interface index as seen by SNMP is not the same index 193as used by the system. The SNMP 194.Va ifIndex 195is held in field 196.Va index , 197the system's interface index is 198.Va sysindex . 199.Pp 200A call to 201.Nm mib_refresh_iflist 202causes the entire interface list to be re-created. 203.Pp 204The interface list can be traversed with the functions 205.Fn mib_first_if 206and 207.Fn mib_next_if . 208Be sure not to change the interface list while traversing the list with 209these two calls. 210.Pp 211There are three functions to find an interface by name or index. 212.Fn mib_find_if 213finds an interface by searching for an SNMP 214.Va ifIndex , 215.Fn mib_find_if_sys 216finds an interface by searching for a system interface index and 217.Fn mib_find_if_name 218finds an interface by looking for an interface name. Each of the 219function returns 220.Li NULL 221if the interface cannot be found. 222.Pp 223The function 224.Fn mib_fetch_ifmib 225causes the interface MIB to be refreshed from the kernel. 226.Pp 227The function 228.Fn mib_if_admin 229can be used to change the interface administrative state to up 230(argument is 1) or down (argument is 0). 231.Ss INTERFACE EVENTS 232A module can register itself to receive a notification when a new entry is 233created in the interface list. This is done by calling 234.Fn mib_register_newif . 235A module can register only one function, a second call to 236.Fn mib_register_newif 237causes the registration to be overwritten. The registration can be removed 238with a call to 239.Fn mib_unregister_newif . 240If is unregistered automatically, when the registering module is unloaded. 241.Pp 242A module can also register to events on a specific interface. This is done 243by calling 244.Fn mibif_notify . 245This causes the given callback 246.Fa func 247to be called with the interface pointer, a notification code and 248the user argument 249.Fa uarg 250when any of the following events occur: 251.Bl -tag -width "XXXXX" 252.It Li MIBIF_NOTIFY_DESTROY 253The interface is destroyed. 254.El 255.Pp 256This mechanism can be used to implement interface type specific MIB parts 257in other modules. The registration can be removed with 258.Fn mib_unnotify 259which the return value from 260.Fa mib_notify . 261Any notification registration is removed automatically when the interface 262is destroyed or the registering module is unloaded. 263.Em Note that only one module can register to any given interface . 264.Ss INTERFACE ADDRESSES 265The 266.Nm 267module handles a table of interface IP-addresses. These addresses are held 268in a 269.Bd -literal -offset indent 270struct mibifa { 271 TAILQ_ENTRY(mibifa) link; 272 struct in_addr inaddr; 273 struct in_addr inmask; 274 struct in_addr inbcast; 275 struct asn_oid index; 276 u_int ifindex; 277 u_int flags; 278}; 279.Ed 280.Pp 281The (ordered) list of IP-addresses on a given interface can be traversed by 282calling 283.Fn mib_first_ififa 284and 285.Fn mib_next_ififa . 286The list should not be considered read-only. 287.Ss INTERFACE RECEIVE ADDRESSES 288The internet MIB-2 contains a table of interface receive addresses. These 289addresses are handled in: 290.Bd -literal -offset indent 291struct mibrcvaddr { 292 TAILQ_ENTRY(mibrcvaddr) link; 293 struct asn_oid index; 294 u_int ifindex; 295 u_char addr[ASN_MAXOIDLEN]; 296 size_t addrlen; 297 u_int flags; 298}; 299enum { 300 MIBRCVADDR_VOLATILE = 0x00000001, 301 MIBRCVADDR_BCAST = 0x00000002, 302 MIBRCVADDR_HW = 0x00000004, 303}; 304.Ed 305.Pp 306Note, that the assignment of 307.Li MIBRCVADDR_BCAST 308is based on a list of known interface types. The flags should be handled 309by modules inplementing interface type specific MIBs. 310.Pp 311A receive address can be created with 312.Fn mib_rcvaddr_create 313and deleted with 314.Fn mib_rcvaddr_delete . 315This needs to be done only for addresses that are not automatically handled 316by the system. 317.Pp 318A receive address can be found with 319.Fn mib_find_rcvaddr . 320.Ss INTERFACE STACK TABLE 321The 322.Nm 323module maintains also the interface stack table. Because for complex stacks, 324there is no system supported generic way of getting this information, interface 325type specific modules need to help setting up stack entries. The 326.Nm 327module handles only the top and bottom entries. 328.Pp 329A table entry is created with 330.Fn mib_ifstack_create 331and deleted with 332.Fn mib_ifstack_delete . 333Both functions need the pointers to the interfaces. Entries are automatically 334deleted if any of the interfaces of the entry is destroyed. The functions handle 335both the stack table and the reverse stack table. 336.Sh FILES
|
336.Bl -tag -width ".It Pa /usr/local/include/bsnmp/mibII_tree.def" -compact 337.It Pa /usr/local/include/bsnmp/mibII_tree.def
| 337.Bl -tag -width ".It Pa @DEFPATH@mibII_tree.def" -compact 338.It Pa @DEFPATH@mibII_tree.def
|
338The description of the MIB tree implemented by 339.Nm . 340.It Pa /usr/local/share/snmp/mibs
| 339The description of the MIB tree implemented by 340.Nm . 341.It Pa /usr/local/share/snmp/mibs
|
| 342.It Pa @MIBSPATH@
|
341The various internet MIBs. 342.Sh SEE ALSO 343.Xr snmpmod 3 , 344.Xr gensnmptree 1 345.Sh STANDARDS 346This implementation conforms to the applicable IETF RFCs. 347.Sh AUTHORS
| 343The various internet MIBs. 344.Sh SEE ALSO 345.Xr snmpmod 3 , 346.Xr gensnmptree 1 347.Sh STANDARDS 348This implementation conforms to the applicable IETF RFCs. 349.Sh AUTHORS
|
348.An Hartmut Brandt Aq brandt@fokus.gmd.de
| 350.An Hartmut Brandt Aq harti@freebsd.org
|
| |