1.\" 2.\" Copyright (c) 2005,2008 3.\" Hartmut Brandt. 4.\" All rights reserved. 5.\" 6.\" Author: Hartmut Brandt <harti@FreeBSD.org> 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" SUCH DAMAGE. 28.\" 29.\" $FreeBSD$ 30.\" 31.Dd January 8, 2008 32.Dt BSD.SNMPMOD.MK 7 33.Os 34.Sh NAME 35.Nm bsd.snmpmod.mk 36.Nd building modules for 37.Xr bsnmpd 1 38.Sh SYNOPSIS 39.Fd ".include <bsd.snmpmod.mk>" 40.Sh DESCRIPTION 41The file 42.In bsd.snmpmod.mk 43simplifies the building of modules for the Begemot SNMP daemon, 44.Xr bsnmpd 1 . 45It provides some common functions for building a module and 46relies on 47.In bsd.lib.mk , 48which is included by 49.In bsd.snmpmod.mk 50to actually build the shared library. 51.Pp 52The following 53.Xr make 1 54variables control the special functions: 55.Bl -tag -width ".Va EXTRAMIBDEFS" 56.It Va MOD 57The short name of the module. 58The name of the shared library will be 59.Pa snmp_${MOD}.so . 60There must exist a file 61.Pa ${MOD}_tree.def 62for compilation with 63.Xr gensnmptree 1 64which contains the definition of the MIB tree implemented by the module. 65.It Va EXTRAMIBDEFS 66A list of extra MIB definition files for 67.Xr gensnmptree 1 . 68This is optional. 69This file list is given to both calls to 70.Xr gensnmptree 1 No \(em 71the one that extracts the symbols in 72.Va XSYM 73from the MIB definitions and the one that 74generates the table with OIDs served by this module. 75.It Va EXTRAMIBSYMS 76A list of extra MIB definition files for 77.Xr gensnmptree 1 . 78This is optional. 79This file list is given only to the call to 80.Xr gensnmptree 1 81that extracts symbols from MIB definition files. 82It is useful if there are dependencies on other MIBs or for extracting global 83definitions for enumeration constants. 84.It Va XSYM 85A list of symbols to be extracted from the MIB definition files by 86.Xr gensnmptree 1 . 87This is optional. 88.It Va DEFS 89A list of MIB definition files to be installed. 90This is optional. 91.It Va BMIBS 92A list of textual MIBs to be installed. 93This is optional. 94.El 95.Pp 96Three files are automatically created from the MIB definition files and 97the 98.Va XSYM 99variable: 100.Bl -tag -width ".Va EXTRAMIBDEFS" 101.It Pa ${MOD}_tree.c 102This contains a table with the tree implemented by the module. 103It is automatically included into the 104.Va SRCS 105variable. 106.It Pa ${MOD}_tree.h 107This contains preprocessor defines for all the OIDs defined by the module 108and can be included in the module's source code. 109.It Pa ${MOD}_oid.h 110OID preprocessor definitions for all the symbols listed in 111.Va XSYMS . 112This is to be included into the module's source code. 113.El 114.Sh SEE ALSO 115.Xr bsnmpd 1 , 116.Xr gensnmptree 1 , 117.Xr snmpmod 3 118