diff options
Diffstat (limited to 'usr.sbin')
49 files changed, 688 insertions, 220 deletions
diff --git a/usr.sbin/amd/amd/Makefile b/usr.sbin/amd/amd/Makefile index 7aa0c12..f335ef0 100644 --- a/usr.sbin/amd/amd/Makefile +++ b/usr.sbin/amd/amd/Makefile @@ -12,28 +12,52 @@ PROG= amd MAN= amd.8 -SRCS= conf_parse.y conf_tok.l -SRCS+= am_ops.c amd.c amfs_auto.c amfs_direct.c amfs_error.c amfs_generic.c +SRCS= am_ops.c amd.c amfs_auto.c amfs_direct.c amfs_error.c amfs_generic.c SRCS+= amfs_host.c amfs_link.c amfs_linkx.c amfs_nfsl.c SRCS+= amfs_nfsx.c amfs_program.c amfs_root.c amfs_toplvl.c SRCS+= amfs_union.c amq_subr.c amq_svc.c autil.c clock.c conf.c SRCS+= get_args.c info_exec.c info_file.c info_ndbm.c info_passwd.c +SRCS+= info_sun.c SRCS+= info_union.c map.c mapc.c mntfs.c nfs_prot_svc.c nfs_start.c -SRCS+= nfs_subr.c ops_cdfs.c ops_mfs.c ops_nfs.c ops_nfs3.c -SRCS+= ops_nullfs.c ops_pcfs.c ops_tfs.c ops_ufs.c ops_umapfs.c +SRCS+= nfs_subr.c ops_cdfs.c ops_lustre.c ops_mfs.c ops_nfs.c +SRCS+= ops_nfs3.c ops_nfs4.c +SRCS+= ops_nullfs.c ops_pcfs.c ops_tfs.c ops_tmpfs.c ops_udf.c ops_ufs.c +SRCS+= ops_umapfs.c SRCS+= ops_unionfs.c opts.c readdir.c restart.c rpc_fwd.c sched.c -SRCS+= srvr_amfs_auto.c srvr_nfs.c +SRCS+= srvr_amfs_auto.c srvr_nfs.c sun_map.c CFLAGS+= -I${.CURDIR}/../../../contrib/amd/amd \ + -I${SRCTOP}/contrib/amd/include \ -I${.OBJDIR}/../../../include/rpcsvc DPADD= ${LIBAMU} ${LIBWRAP} LDADD= ${LIBAMU} -lwrap +SRCS+= conf_parse.c conf_parse.h conf_tok.c +SRCS+= sun_map_parse.c sun_map_parse.h sun_map_tok.c CLEANFILES+= conf_parse.c conf_parse.h conf_tok.c +CLEANFILES+= sun_map_parse.c sun_map_parse.h sun_map_tok.c + +conf_tok.c: conf_tok.l + ${LEX} ${LFLAGS} -Pconf_ -o${.TARGET} ${.ALLSRC} + +.ORDER: conf_parse.c conf_parse.h +conf_parse.h: .NOMETA +conf_parse.c conf_parse.h: conf_parse.y + ${YACC} ${YFLAGS} -pconf_ -oconf_parse.c ${.ALLSRC} + +sun_map_tok.c: sun_map_tok.l + ${LEX} ${LFLAGS} -Psun_map_ -o${.TARGET} ${.ALLSRC} + +.ORDER: sun_map_parse.c sun_map_parse.h +sun_map_parse.h: .NOMETA +sun_map_parse.c sun_map_parse.h: sun_map_parse.y + ${YACC} ${YFLAGS} -psun_map_ -osun_map_parse.c ${.ALLSRC} conf_tok.o: conf_parse.h +sun_map_tok.o: sun_map_parse.h + # These are generated at compile time SRCS+= mount_xdr.c CLEANFILES+= mount_xdr.c diff --git a/usr.sbin/amd/fsinfo/Makefile b/usr.sbin/amd/fsinfo/Makefile index 1695a46..275313a 100644 --- a/usr.sbin/amd/fsinfo/Makefile +++ b/usr.sbin/amd/fsinfo/Makefile @@ -9,17 +9,38 @@ PROG= fsinfo MAN= fsinfo.8 -SRCS= fsi_gram.y fsi_lex.l -SRCS+= fsi_analyze.c fsi_dict.c fsi_util.c fsinfo.c wr_atab.c -SRCS+= wr_bparam.c wr_dumpset.c wr_exportfs.c wr_fstab.c +SRCS= fsi_analyze.c fsi_dict.c fsi_util.c fsinfo.c +SRCS+= wr_atab.c wr_bparam.c wr_dumpset.c wr_exportfs.c wr_fstab.c -CFLAGS+= -I${.CURDIR}/../../../contrib/amd/fsinfo +CFLAGS+= -I${.CURDIR}/../../../contrib/amd/fsinfo \ + -I${.CURDIR}/../../../contrib/amd/inculde DPADD= ${LIBAMU} LDADD= ${LIBAMU} +SRCS+= fsi_gram.c fsi_gram.h fsi_lex.c +SRCS+= null_gram.c null_gram.h null_lex.c CLEANFILES+= fsi_gram.c fsi_gram.h fsi_lex.c +CLEANFILES+= null_gram.c null_gram.h null_lex.c + +fsi_lex.c: fsi_lex.l + ${LEX} ${LFLAGS} -Pfsi_ -o${.TARGET} ${.ALLSRC} + +.ORDER: fsi_gram.c fsi_gram.h +fsi_gram.h: .NOMETA +fsi_gram.c fsi_gram.h: fsi_gram.y + ${YACC} ${YFLAGS} -pfsi_ -ofsi_gram.c ${.ALLSRC} + +null_lex.c: null_lex.l + ${LEX} ${LFLAGS} -Pnull_ -o${.TARGET} ${.ALLSRC} + +.ORDER: null_gram.c null_gram.h +null_gram.h: .NOMETA +null_gram.c null_gram.h: null_gram.y + ${YACC} ${YFLAGS} -pnull_ -onull_gram.c ${.ALLSRC} fsi_lex.o: fsi_gram.h +null_gram.o: null_gram.h + .include <bsd.prog.mk> diff --git a/usr.sbin/amd/include/config.h b/usr.sbin/amd/include/config.h index 5817a46..edae5fd 100644 --- a/usr.sbin/amd/include/config.h +++ b/usr.sbin/amd/include/config.h @@ -3,6 +3,9 @@ * * portions derived from * $NetBSD: config.h,v 1.11 1998/08/08 22:33:37 christos Exp $ + * + * Additional portions derived from ports/sysutils/am-utils r416941 + * make configure config.h output. */ #ifndef _CONFIG_H @@ -11,6 +14,9 @@ /* We [FREEBSD-NATIVE] pick some parameters from our local config file */ #include "config_local.h" +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + /* define name of am-utils' NFS protocol header */ #define AMU_NFS_PROTOCOL_HEADER "./conf/nfs_prot/nfs_prot_freebsd3.h" @@ -18,7 +24,7 @@ #define AUTH_CREATE_GIDLIST_TYPE gid_t /* Define configuration date */ -/* #define CONFIG_DATE "Tue Dec 4 21:39:00 PST 2007" */ +/* #define CONFIG_DATE "Mon Oct 3 21:58:39 PDT 2016" */ /* Turn off general debugging by default */ /* #undef DEBUG */ @@ -176,9 +182,15 @@ /* Define to 1 if `flags' is member of `efs_args_t'. */ /* #undef HAVE_EFS_ARGS_T_FLAGS */ +/* Define to 1 if `version' is member of `efs_args_t'. */ +/* #undef HAVE_EFS_ARGS_T_VERSION */ + /* Define to 1 if `fspec' is member of `efs_args_t'. */ /* #undef HAVE_EFS_ARGS_T_FSPEC */ +/* Define to 1 if `version' is member of `efs_args_t'. */ +/* #undef HAVE_EFS_ARGS_T_VERSION */ + /* Define to 1 if you have the <errno.h> header file. */ #define HAVE_ERRNO_H 1 @@ -320,6 +332,12 @@ /* Define if have EFS filesystem (irix) */ /* #undef HAVE_FS_EFS */ +/* Define to 1 if you have the <fs/efs/efs_mount.h> header file. */ +/* #undef HAVE_FS_EFS_EFS_MOUNT_H */ + +/* Define if have EXT{2,3,4} filesystem (linux) */ +/* #undef HAVE_FS_EXT */ + /* Define if have FFS filesystem */ /* #undef HAVE_FS_FFS */ @@ -329,8 +347,14 @@ /* Define if have LOFS filesystem */ /* #undef HAVE_FS_LOFS */ +/* Define if have LUSTRE filesystem */ +/* #undef HAVE_FS_LUSTRE */ + /* Define if have MFS filesystem */ -/* #undef HAVE_FS_MFS */ +#define HAVE_FS_MFS 1 + +/* Define to 1 if you have the <fs/msdosfs/msdosfsmount.h> header file. */ +/* #undef HAVE_FS_MSDOSFS_MSDOSFSMOUNT_H */ /* Define if have NFS filesystem */ #define HAVE_FS_NFS 1 @@ -338,6 +362,9 @@ /* Define if have NFS3 filesystem */ #define HAVE_FS_NFS3 1 +/* Define if have NFS4 filesystem */ +/* #undef HAVE_FS_NFS4 */ + /* Define if have NULLFS (loopback on bsd44) filesystem */ #define HAVE_FS_NULLFS 1 @@ -348,7 +375,16 @@ /* #undef HAVE_FS_TFS */ /* Define if have TMPFS filesystem */ -/* #undef HAVE_FS_TMPFS */ +#define HAVE_FS_TMPFS 1 + +/* Define to 1 if you have the <fs/tmpfs/tmpfs_args.h> header file. */ +/* #undef HAVE_FS_TMPFS_TMPFS_ARGS_H */ + +/* Define if have UDF filesystem */ +#define HAVE_FS_UDF 1 + +/* Define to 1 if you have the <fs/udf/udf_mount.h> header file. */ +#define HAVE_FS_UDF_UDF_MOUNT_H 1 /* Define if have UFS filesystem */ #define HAVE_FS_UFS 1 @@ -520,6 +556,9 @@ /* Define to 1 if you have the <linux/nfs2.h> header file. */ /* #undef HAVE_LINUX_NFS2_H */ +/* Define to 1 if you have the <linux/nfs4.h> header file. */ +/* #undef HAVE_LINUX_NFS4_H */ + /* Define to 1 if you have the <linux/nfs.h> header file. */ /* #undef HAVE_LINUX_NFS_H */ @@ -575,6 +614,9 @@ /* Define if have PASSWD maps */ #define HAVE_MAP_PASSWD 1 +/* Define if have Sun-syntax maps */ +#define HAVE_MAP_SUN 1 + /* Define if have UNION maps */ #define HAVE_MAP_UNION 1 @@ -695,6 +737,9 @@ /* Define to 1 if `bsize' is member of `nfs_args_t'. */ /* #undef HAVE_NFS_ARGS_T_BSIZE */ +/* Define to 1 if `context' is member of `nfs_args_t'. */ +/* #undef HAVE_NFS_ARGS_T_CONTEXT */ + /* Define to 1 if `fhsize' is member of `nfs_args_t'. */ #define HAVE_NFS_ARGS_T_FHSIZE 1 @@ -710,9 +755,15 @@ /* Define to 1 if `optstr' is member of `nfs_args_t'. */ /* #undef HAVE_NFS_ARGS_T_OPTSTR */ +/* Define to 1 if `pathconf' is member of `nfs_args_t'. */ +/* #undef HAVE_NFS_ARGS_T_PATHCONF */ + /* Define to 1 if `proto' is member of `nfs_args_t'. */ #define HAVE_NFS_ARGS_T_PROTO 1 +/* Define to 1 if `pseudoflavor' is member of `nfs_args_t'. */ +/* #undef HAVE_NFS_ARGS_T_PSEUDOFLAVOR */ + /* Define to 1 if `sotype' is member of `nfs_args_t'. */ #define HAVE_NFS_ARGS_T_SOTYPE 1 @@ -763,6 +814,7 @@ /* Define to 1 if you have the `opendir' function. */ #define HAVE_OPENDIR 1 + /* Define to 1 if `dsttime' is member of `pcfs_args_t'. */ /* #undef HAVE_PCFS_ARGS_T_DSTTIME */ @@ -833,6 +885,9 @@ /* Define to 1 if you have the <rpc/auth_des.h> header file. */ #define HAVE_RPC_AUTH_DES_H 1 +/* Define to 1 if you have the <rpc/auth.h> header file. */ +#define HAVE_RPC_AUTH_H 1 + /* Define to 1 if you have the <rpc/pmap_clnt.h> header file. */ #define HAVE_RPC_PMAP_CLNT_H 1 @@ -1160,6 +1215,24 @@ /* Define to 1 if you have the <tiuser.h> header file. */ /* #undef HAVE_TIUSER_H */ +/* Define to 1 if `ta_nodes_max' is member of `tmpfs_args_t'. */ +/* #undef HAVE_TMPFS_ARGS_T_TA_NODES_MAX */ + +/* Define to 1 if `ta_root_gid' is member of `tmpfs_args_t'. */ +/* #undef HAVE_TMPFS_ARGS_T_TA_ROOT_GID */ + +/* Define to 1 if `ta_root_mode' is member of `tmpfs_args_t'. */ +/* #undef HAVE_TMPFS_ARGS_T_TA_ROOT_MODE */ + +/* Define to 1 if `ta_root_uid' is member of `tmpfs_args_t'. */ +/* #undef HAVE_TMPFS_ARGS_T_TA_ROOT_UID */ + +/* Define to 1 if `ta_size_max' is member of `tmpfs_args_t'. */ +/* #undef HAVE_TMPFS_ARGS_T_TA_SIZE_MAX */ + +/* Define to 1 if `ta_version' is member of `tmpfs_args_t'. */ +/* #undef HAVE_TMPFS_ARGS_T_TA_VERSION */ + /* Define to 1 if you have the <tmpfs/tmp.h> header file. */ /* #undef HAVE_TMPFS_TMP_H */ @@ -1169,6 +1242,36 @@ /* Define to 1 if you have the `ualarm' function. */ #define HAVE_UALARM 1 +/* Define to 1 if `anon_gid' is member of `udf_args_t'. */ +/* #undef HAVE_UDF_ARGS_T_ANON_GID */ + +/* Define to 1 if `anon_uid' is member of `udf_args_t'. */ +/* #undef HAVE_UDF_ARGS_T_ANON_UID */ + +/* Define to 1 if `fspec' is member of `udf_args_t'. */ +/* #undef HAVE_UDF_ARGS_T_FSPEC */ + +/* Define to 1 if `gmtoff' is member of `udf_args_t'. */ +/* #undef HAVE_UDF_ARGS_T_GMTOFF */ + +/* Define to 1 if `nobody_gid' is member of `udf_args_t'. */ +/* #undef HAVE_UDF_ARGS_T_NOBODY_GID */ + +/* Define to 1 if `nobody_uid' is member of `udf_args_t'. */ +/* #undef HAVE_UDF_ARGS_T_NOBODY_UID */ + +/* Define to 1 if `sector_size' is member of `udf_args_t'. */ +/* #undef HAVE_UDF_ARGS_T_SECTOR_SIZE */ + +/* Define to 1 if `sessionnr' is member of `udf_args_t'. */ +/* #undef HAVE_UDF_ARGS_T_SESSIONNR */ + +/* Define to 1 if `udfmflags' is member of `udf_args_t'. */ +/* #undef HAVE_UDF_ARGS_T_UDFMFLAGS */ + +/* Define to 1 if `version' is member of `udf_args_t'. */ +/* #undef HAVE_UDF_ARGS_T_VERSION */ + /* Define to 1 if `flags' is member of `ufs_args_t'. */ /* #undef HAVE_UFS_ARGS_T_FLAGS */ @@ -1355,6 +1458,9 @@ /* Define to 1 if you have the `xdr_symlinkargs' function. */ #define HAVE_XDR_SYMLINKARGS 1 +/* Define to 1 if you have the `xdr_u_int64_t' function. */ +#define HAVE_XDR_U_INT64_T 1 + /* Define to 1 if you have the `xdr_writeargs' function. */ #define HAVE_XDR_WRITEARGS 1 @@ -1395,26 +1501,49 @@ /* #define HOST_NAME "trang.nuxi.org" */ /* Define name and version of host machine (eg. solaris2.5.1) */ -/* #define HOST_OS "freebsd8.0" */ +/* #define HOST_OS "freebsd12.0" */ /* Define only name of host machine OS (eg. solaris2) */ -/* #define HOST_OS_NAME "freebsd8" */ +/* #define HOST_OS_NAME "freebsd12" */ /* Define only version of host machine (eg. 2.5.1) */ -/* #define HOST_OS_VERSION "8.0" */ +/* #define HOST_OS_VERSION "12.0" */ /* Define name of host machine's vendor (eg. sun) */ #define HOST_VENDOR "undermydesk" +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + /* Ignore permission bits */ /* #undef MNT2_CDFS_OPT_DEFPERM */ +/* Enable external attributes */ +#define MNT2_CDFS_OPT_EXTATT 0x4 + +/* Show file generations */ +#define MNT2_CDFS_OPT_GENS 0x2 + +/* Disable filename case translation */ +/* #undef MNT2_CDFS_OPT_NOCASETRANS */ + /* Use on-disk permission bits */ /* #undef MNT2_CDFS_OPT_NODEFPERM */ +/* Disable Joliet extensions */ +#define MNT2_CDFS_OPT_NOJOLIET 0x8 + +/* Disable Rock Ridge Interchange Protocol (RRIP) extensions */ +#define MNT2_CDFS_OPT_NORRIP 0x1 + /* Strip off extension from version string */ /* #undef MNT2_CDFS_OPT_NOVERSION */ +/* Enable Rock Ridge Interchange Protocol (RRIP) case insensitive filename + extensions */ +/* #undef MNT2_CDFS_OPT_RRCASEINS */ + /* Use Rock Ridge Interchange Protocol (RRIP) extensions */ /* #undef MNT2_CDFS_OPT_RRIP */ @@ -1454,6 +1583,9 @@ /* journaling filesystem (AIX's UFS/FFS) */ /* #undef MNT2_GEN_OPT_JFS */ +/* honor mandatory locking requests */ +/* #undef MNT2_GEN_OPT_MANDLOCK */ + /* do multi-component lookup on files */ /* #undef MNT2_GEN_OPT_MULTI */ @@ -1463,12 +1595,18 @@ /* NFS mount */ /* #undef MNT2_GEN_OPT_NFS */ +/* don't update access times */ +#define MNT2_GEN_OPT_NOATIME 0x10000000 + /* nocache (what?) */ /* #undef MNT2_GEN_OPT_NOCACHE */ /* do not interpret special device files */ #define MNT2_GEN_OPT_NODEV 0x0 +/* don't update directory access times */ +/* #undef MNT2_GEN_OPT_NODIRATIME */ + /* no exec calls allowed */ #define MNT2_GEN_OPT_NOEXEC 0x4 @@ -1512,7 +1650,7 @@ /* #undef MNT2_GEN_OPT_SYS5 */ /* Union mount */ -/* #undef MNT2_GEN_OPT_UNION */ +#define MNT2_GEN_OPT_UNION 0x20 /* set max secs for dir attr cache */ #define MNT2_NFS_OPT_ACDIRMAX 0x200000 @@ -1532,6 +1670,9 @@ /* hide mount type from df(1) */ /* #undef MNT2_NFS_OPT_AUTO */ +/* Linux broken setuid */ +/* #undef MNT2_NFS_OPT_BROKEN_SUID */ + /* set dead server retry thresh */ #define MNT2_NFS_OPT_DEADTHRESH 0x4000 @@ -1598,11 +1739,14 @@ /* don't cache attributes */ /* #undef MNT2_NFS_OPT_NOAC */ +/* does not support Access Control Lists */ +/* #undef MNT2_NFS_OPT_NOACL */ + /* Don't Connect the socket */ #define MNT2_NFS_OPT_NOCONN 0x80 /* no close-to-open consistency */ -/* #undef MNT2_NFS_OPT_NOCTO */ +#define MNT2_NFS_OPT_NOCTO 0x20000000 /* disallow interrupts on hard mounts */ /* #undef MNT2_NFS_OPT_NOINT */ @@ -1610,6 +1754,9 @@ /* Don't use locking */ /* #undef MNT2_NFS_OPT_NONLM */ +/* does not support readdir+ */ +/* #undef MNT2_NFS_OPT_NORDIRPLUS */ + /* Get lease for lookup */ /* #undef MNT2_NFS_OPT_NQLOOKLEASE */ @@ -1670,6 +1817,9 @@ /* spongy mount */ /* #undef MNT2_NFS_OPT_SPONGY */ +/* Reserved for nfsv4 */ +/* #undef MNT2_NFS_OPT_STRICTLOCK */ + /* set symlink cache time-to-live */ /* #undef MNT2_NFS_OPT_SYMTTL */ @@ -1679,6 +1829,9 @@ /* set initial timeout */ #define MNT2_NFS_OPT_TIMEO 0x8 +/* do not use shared cache for all mountpoints */ +/* #undef MNT2_NFS_OPT_UNSHARED */ + /* linux NFSv3 */ /* #undef MNT2_NFS_OPT_VER3 */ @@ -1781,6 +1934,9 @@ /* Mount Table option string: Don't cache attributes at all */ /* #undef MNTTAB_OPT_NOAC */ +/* Access Control Lists are not supported */ +/* #undef MNTTAB_OPT_NOACL */ + /* Mount Table option string: No auto (what?) */ /* #undef MNTTAB_OPT_NOAUTO */ @@ -1901,20 +2057,35 @@ /* Mount-table entry name for EFS filesystem (irix) */ /* #undef MNTTAB_TYPE_EFS */ +/* Mount-table entry name for EXT2 filesystem (linux) */ +/* #undef MNTTAB_TYPE_EXT2 */ + +/* Mount-table entry name for EXT3 filesystem (linux) */ +/* #undef MNTTAB_TYPE_EXT3 */ + +/* Mount-table entry name for EXT4 filesystem (linux) */ +/* #undef MNTTAB_TYPE_EXT4 */ + /* Mount-table entry name for FFS filesystem */ /* #undef MNTTAB_TYPE_FFS */ /* Mount-table entry name for LOFS filesystem */ /* #undef MNTTAB_TYPE_LOFS */ +/* Mount-table entry name for LUSTRE filesystem */ +/* #undef MNTTAB_TYPE_LUSTRE */ + /* Mount-table entry name for MFS filesystem */ -/* #undef MNTTAB_TYPE_MFS */ +#define MNTTAB_TYPE_MFS "mfs" /* Mount-table entry name for NFS filesystem */ #define MNTTAB_TYPE_NFS "nfs" /* Mount-table entry name for NFS3 filesystem */ -#define MNTTAB_TYPE_NFS3 "nfs3" +#define MNTTAB_TYPE_NFS3 "nfs" + +/* Mount-table entry name for NFS4 filesystem */ +#define MNTTAB_TYPE_NFS4 "nfs" /* Mount-table entry name for NULLFS (loopback on bsd44) filesystem */ #define MNTTAB_TYPE_NULLFS "nullfs" @@ -1925,8 +2096,11 @@ /* Mount-table entry name for TFS filesystem */ /* #undef MNTTAB_TYPE_TFS */ -/* Mount-table entry name for TMPFS filesystem */ -/* #undef MNTTAB_TYPE_TMPFS */ +/* Mount(2) type/name for TMPFS filesystem */ +#define MNTTAB_TYPE_TMPFS "tmpfs" + +/* Mount(2) type/name for UDF filesystem */ +#define MNTTAB_TYPE_UDF "udf" /* Mount-table entry name for UFS filesystem */ #define MNTTAB_TYPE_UFS "ufs" @@ -1958,6 +2132,15 @@ /* Mount(2) type/name for EFS filesystem (irix) */ /* #undef MOUNT_TYPE_EFS */ +/* Mount(2) type/name for EXT2 filesystem (linux) */ +/* #undef MOUNT_TYPE_EXT2 */ + +/* Mount(2) type/name for EXT3 filesystem (linux) */ +/* #undef MOUNT_TYPE_EXT3 */ + +/* Mount(2) type/name for EXT4 filesystem (linux) */ +/* #undef MOUNT_TYPE_EXT4 */ + /* Mount(2) type/name for FFS filesystem */ /* #undef MOUNT_TYPE_FFS */ @@ -1968,7 +2151,7 @@ /* #undef MOUNT_TYPE_LOFS */ /* Mount(2) type/name for MFS filesystem */ -/* #undef MOUNT_TYPE_MFS */ +#define MOUNT_TYPE_MFS "mfs" /* Mount(2) type/name for NFS filesystem */ #define MOUNT_TYPE_NFS "nfs" @@ -1976,6 +2159,9 @@ /* Mount(2) type/name for NFS3 filesystem */ #define MOUNT_TYPE_NFS3 MOUNT_NFS3 +/* Mount(2) type/name for NFS4 filesystem */ +/* #undef MOUNT_TYPE_NFS4 */ + /* Mount(2) type/name for NULLFS (loopback on bsd44) filesystem */ #define MOUNT_TYPE_NULLFS "nullfs" @@ -1984,7 +2170,10 @@ #define MOUNT_TYPE_PCFS "msdosfs" /* Mount(2) type/name for TFS filesystem */ -/* #undef MOUNT_TYPE_TFS */ +#define MOUNT_TYPE_TMPFS "tmpfs" + +/* Mount(2) type/name for UDF filesystem */ +#define MOUNT_TYPE_UDF "udf" /* Mount(2) type/name for TMPFS filesystem */ /* #undef MOUNT_TYPE_TMPFS */ @@ -2030,16 +2219,19 @@ #define PACKAGE_NAME "am-utils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "am-utils 6.1.5" +#define PACKAGE_STRING "am-utils 6.2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "am-utils" +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + /* Define to the version of this package. */ -#define PACKAGE_VERSION "6.1.5" +#define PACKAGE_VERSION "6.2" /* Type of the 6th argument to recvfrom() */ -#define RECVFROM_FROMLEN_TYPE int +#define RECVFROM_FROMLEN_TYPE socklen_t /* should signal handlers be reinstalled? */ /* #undef REINSTALL_SIGNAL_HANDLER */ @@ -2066,20 +2258,49 @@ /* #undef TM_IN_SYS_TIME */ /* Define user name */ -/* #define USER_NAME "obrien" */ +/* #define USER_NAME "cy" */ /* define if must NOT use NFS "noconn" option */ #define USE_CONNECTED_NFS_SOCKETS 1 +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + /* define if must use NFS "noconn" option */ /* #undef USE_UNCONNECTED_NFS_SOCKETS */ /* Version number of package */ -#define VERSION "6.1.5" - -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ +#define VERSION "6.2" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif /* Define to the type of xdr procedure type */ #define XDRPROC_T_TYPE xdrproc_t @@ -2091,13 +2312,27 @@ `char[]'. */ #define YYTEXT_POINTER 1 -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -/* # undef _ALL_SOURCE */ +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 #endif +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define a type/structure for an NFS V2 filehandle */ #define am_nfs_fh nfs_fh @@ -2155,7 +2390,7 @@ /* Check if rpcvers_t is defined in <rpc/types.h> */ /* #undef rpcvers_t */ -/* Define to `unsigned' if <sys/types.h> does not define. */ +/* Define to `unsigned int' if <sys/types.h> does not define. */ /* #undef size_t */ /* Define to `long' if <sys/types.h> does not define. */ @@ -2164,6 +2399,9 @@ /* Define a type for the tmpfs_args structure */ /* #undef tmpfs_args_t */ +/* Define a type for the udf_args structure */ +/* #undef udf_args_t */ + /* Define a type for the ufs_args structure */ #define ufs_args_t struct ufs_args diff --git a/usr.sbin/bsnmpd/bsnmpd/Makefile b/usr.sbin/bsnmpd/bsnmpd/Makefile index 1724cea..b9e99a0 100644 --- a/usr.sbin/bsnmpd/bsnmpd/Makefile +++ b/usr.sbin/bsnmpd/bsnmpd/Makefile @@ -15,8 +15,107 @@ XSYM= snmpMIB begemotSnmpdModuleTable begemotSnmpd begemotTrapSinkTable \ begemotSnmpdTransUdp begemotSnmpdTransLsock begemotSnmpdLocalPortTable \ freeBSD freeBSDVersion CLEANFILES= oid.h tree.c tree.h + MAN= bsnmpd.1 snmpmod.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 FIND_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 FIND_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 INSERT_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT_LINK.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_INT_LINK_INDEX.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID_LINK.3 +MLINKS+= snmpmod.3 NEXT_OBJECT_OID_LINK_INDEX.3 +MLINKS+= snmpmod.3 bsnmpd_get_target_stats.3 +MLINKS+= snmpmod.3 bsnmpd_get_usm_stats.3 +MLINKS+= snmpmod.3 bsnmpd_reset_usm_stats.3 +MLINKS+= snmpmod.3 buf_alloc.3 +MLINKS+= snmpmod.3 buf_size.3 +MLINKS+= snmpmod.3 comm_define.3 +MLINKS+= snmpmod.3 community.3 +MLINKS+= snmpmod.3 fd_deselect.3 +MLINKS+= snmpmod.3 fd_resume.3 +MLINKS+= snmpmod.3 fd_select.3 +MLINKS+= snmpmod.3 fd_suspend.3 +MLINKS+= snmpmod.3 get_ticks.3 +MLINKS+= snmpmod.3 index_append.3 +MLINKS+= snmpmod.3 index_append_off.3 +MLINKS+= snmpmod.3 index_compare.3 +MLINKS+= snmpmod.3 index_compare_off.3 +MLINKS+= snmpmod.3 index_decode.3 +MLINKS+= snmpmod.3 ip_commit.3 +MLINKS+= snmpmod.3 ip_get.3 +MLINKS+= snmpmod.3 ip_rollback.3 +MLINKS+= snmpmod.3 ip_save.3 +MLINKS+= snmpmod.3 or_register.3 +MLINKS+= snmpmod.3 or_unregister.3 +MLINKS+= snmpmod.3 oid_commit.3 +MLINKS+= snmpmod.3 oid_get.3 +MLINKS+= snmpmod.3 oid_rollback.3 +MLINKS+= snmpmod.3 oid_save.3 +MLINKS+= snmpmod.3 oid_usmNotInTimeWindows.3 +MLINKS+= snmpmod.3 oid_usmUnknownEngineIDs.3 +MLINKS+= snmpmod.3 oid_zeroDotZero.3 +MLINKS+= snmpmod.3 reqid_allocate.3 +MLINKS+= snmpmod.3 reqid_base.3 +MLINKS+= snmpmod.3 reqid_istype.3 +MLINKS+= snmpmod.3 reqid_next.3 +MLINKS+= snmpmod.3 reqid_type.3 +MLINKS+= snmpmod.3 snmp_input_finish.3 +MLINKS+= snmpmod.3 snmp_input_start.3 +MLINKS+= snmpmod.3 snmp_output.3 +MLINKS+= snmpmod.3 snmp_pdu_auth_access.3 +MLINKS+= snmpmod.3 snmp_send_port.3 +MLINKS+= snmpmod.3 snmp_send_trap.3 +MLINKS+= snmpmod.3 snmpd_target_stat.3 +MLINKS+= snmpmod.3 snmpd_usmstats.3 +MLINKS+= snmpmod.3 start_tick.3 +MLINKS+= snmpmod.3 string_commit.3 +MLINKS+= snmpmod.3 string_free.3 +MLINKS+= snmpmod.3 string_get.3 +MLINKS+= snmpmod.3 string_get_max.3 +MLINKS+= snmpmod.3 string_rollback.3 +MLINKS+= snmpmod.3 string_save.3 +MLINKS+= snmpmod.3 systemg.3 +MLINKS+= snmpmod.3 this_tick.3 +MLINKS+= snmpmod.3 timer_start.3 +MLINKS+= snmpmod.3 timer_start_repeat.3 +MLINKS+= snmpmod.3 timer_stop.3 +MLINKS+= snmpmod.3 target_activate_address.3 +MLINKS+= snmpmod.3 target_address.3 +MLINKS+= snmpmod.3 target_delete_address.3 +MLINKS+= snmpmod.3 target_delete_notify.3 +MLINKS+= snmpmod.3 target_delete_param.3 +MLINKS+= snmpmod.3 target_first_address.3 +MLINKS+= snmpmod.3 target_first_notify.3 +MLINKS+= snmpmod.3 target_first_param.3 +MLINKS+= snmpmod.3 target_flush_all.3 +MLINKS+= snmpmod.3 target_next_address.3 +MLINKS+= snmpmod.3 target_next_notify.3 +MLINKS+= snmpmod.3 target_next_param.3 +MLINKS+= snmpmod.3 target_new_address.3 +MLINKS+= snmpmod.3 target_new_notify.3 +MLINKS+= snmpmod.3 target_new_param.3 +MLINKS+= snmpmod.3 target_notify.3 +MLINKS+= snmpmod.3 target_param.3 +MLINKS+= snmpmod.3 usm_delete_user.3 +MLINKS+= snmpmod.3 usm_find_user.3 +MLINKS+= snmpmod.3 usm_first_user.3 +MLINKS+= snmpmod.3 usm_flush_users.3 +MLINKS+= snmpmod.3 usm_next_user.3 +MLINKS+= snmpmod.3 usm_new_user.3 +MLINKS+= snmpmod.3 usm_user.3 + FILESGROUPS= BMIBS DEFS BMIBS= FOKUS-MIB.txt BEGEMOT-MIB.txt BEGEMOT-SNMPD.txt @@ -26,10 +125,9 @@ DEFSDIR= ${SHAREDIR}/snmp/defs CFLAGS+= -DSNMPTREE_TYPES CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -I. -DUSE_LIBBEGEMOT -CFLAGS+= -DUSE_TCPWRAPPERS CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_ERR_H -DHAVE_STRLCPY -DPADD= ${LIBBEGEMOT} ${LIBBSNMP} ${LIBWRAP} -LDADD= -lbegemot -lbsnmp -lwrap +DPADD= ${LIBBEGEMOT} ${LIBBSNMP} +LDADD= -lbegemot -lbsnmp LDFLAGS= -Wl,-export-dynamic @@ -37,6 +135,12 @@ LDFLAGS= -Wl,-export-dynamic CFLAGS+= -DHAVE_LIBCRYPTO .endif +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DUSE_TCPWRAPPERS +DPADD+= ${LIBWRAP} +LDADD+= -lwrap +.endif + oid.h: tree.def Makefile gensnmptree -e ${XSYM} < ${.ALLSRC:M*.def} > ${.TARGET} diff --git a/usr.sbin/bsnmpd/modules/Makefile b/usr.sbin/bsnmpd/modules/Makefile index 45558b7..09598b3 100644 --- a/usr.sbin/bsnmpd/modules/Makefile +++ b/usr.sbin/bsnmpd/modules/Makefile @@ -10,13 +10,15 @@ _snmp_atm= snmp_atm SUBDIR= ${_snmp_atm} \ snmp_bridge \ - snmp_hast \ snmp_hostres \ snmp_mibII \ snmp_target \ snmp_usm \ snmp_vacm \ - snmp_wlan + +.if ${MK_HAST} != "no" +SUBDIR+=snmp_hast +.endif .if ${MK_PF} != "no" SUBDIR+=snmp_pf @@ -26,6 +28,10 @@ SUBDIR+=snmp_pf SUBDIR+=snmp_netgraph .endif +.if ${MK_WIRELESS} != "no" +SUBDIR+=snmp_wlan +.endif + INCS= snmpmod.h INCSDIR= ${INCLUDEDIR}/bsnmp diff --git a/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt b/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt index 83c4e5c..85339a3 100644 --- a/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt +++ b/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt @@ -4,7 +4,7 @@ -- All rights reserved. -- -- Author: Hartmut Brandt <harti@freebsd.org> --- +-- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: @@ -13,7 +13,7 @@ -- 2. Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. --- +-- -- THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND -- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -25,7 +25,7 @@ -- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -- SUCH DAMAGE. --- +-- -- $FreeBSD$ -- -- Private Begemot MIB for ATM interfaces on FreeBSD diff --git a/usr.sbin/bsnmpd/modules/snmp_atm/atm_sys.c b/usr.sbin/bsnmpd/modules/snmp_atm/atm_sys.c index 525e805..c0699f7 100644 --- a/usr.sbin/bsnmpd/modules/snmp_atm/atm_sys.c +++ b/usr.sbin/bsnmpd/modules/snmp_atm/atm_sys.c @@ -7,7 +7,7 @@ * All rights reserved. * * Author: Hartmut Brandt <harti@freebsd.org> - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -215,7 +215,7 @@ atmif_sys_attach_if(struct atmif_priv *aif) return (0); } -/* +/* * Table of all ATM interfaces - Ng part */ int diff --git a/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt b/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt index d55ea3c..ba3ae49 100644 --- a/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt +++ b/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt @@ -41,7 +41,7 @@ IMPORTS FROM BEGEMOT-MIB; begemotBridge MODULE-IDENTITY - LAST-UPDATED "200708060000Z" + LAST-UPDATED "201612170000Z" ORGANIZATION "Sofia University St. Kliment Ohridski" CONTACT-INFO " Shteryana Shopova @@ -56,6 +56,9 @@ begemotBridge MODULE-IDENTITY E-Mail: syrinx@FreeBSD.org" DESCRIPTION "The Begemot MIB for managing bridge interfaces." + REVISION "201612170000Z" + DESCRIPTION + "Address some minor typos and grammar mistakes." REVISION "200708060000Z" DESCRIPTION "Third revision adds begemotBridgeBasePortPrivate @@ -108,7 +111,7 @@ begemotBridgePf OBJECT IDENTIFIER ::= { begemotBridge 4 } begemotBridgeConfigObjects OBJECT IDENTIFIER ::= { begemotBridge 5 } -- ---------------------------------------------------------- -- --- the base Bridge interface table +-- the base Bridge interface table -- ---------------------------------------------------------- -- begemotBridgeBaseTable OBJECT-TYPE @@ -177,7 +180,7 @@ begemotBridgeBaseType OBJECT-TYPE perform." ::= { begemotBridgeBaseEntry 4 } -begemotBridgeBaseStatus OBJECT-TYPE +begemotBridgeBaseStatus OBJECT-TYPE SYNTAX RowStatus MAX-ACCESS read-create STATUS current @@ -187,7 +190,7 @@ begemotBridgeBaseStatus OBJECT-TYPE ::= { begemotBridgeBaseEntry 5 } -- ---------------------------------------------------------- -- --- the base Bridge ports table +-- the base Bridge ports table -- ---------------------------------------------------------- -- begemotBridgeBasePortTable OBJECT-TYPE @@ -289,7 +292,7 @@ begemotBridgeBasePortPrivate OBJECT-TYPE ::= { begemotBridgeBasePortEntry 7 } -- ---------------------------------------------------------- -- --- the Bridge interface STP table +-- the Bridge interface STP table -- ---------------------------------------------------------- -- begemotBridgeStpTable OBJECT-TYPE @@ -526,7 +529,7 @@ begemotBridgeStpTxHoldCount OBJECT-TYPE ::= { begemotBridgeStpEntry 16 } -- ---------------------------------------------------------- -- --- the Bridge STP ports table +-- the Bridge STP ports table -- ---------------------------------------------------------- -- begemotBridgeStpPortTable OBJECT-TYPE @@ -821,7 +824,7 @@ begemotBridgeStpPortAdminPathCost OBJECT-TYPE ::= { begemotBridgeStpExtPortEntry 6 } -- ---------------------------------------------------------- -- --- the Bridge interface Transparent bridging table +-- the Bridge interface Transparent bridging table -- ---------------------------------------------------------- -- begemotBridgeTpTable OBJECT-TYPE @@ -856,7 +859,7 @@ begemotBridgeTpLearnedEntryDiscards OBJECT-TYPE DESCRIPTION "The total number of Forwarding Database entries that would have been learnt, but have been discarded due to Forwarding - Address Table having reached it's maximum entries limit." + Address Table having reached its maximum entries limit." ::= { begemotBridgeTpEntry 1 } begemotBridgeTpAgingTime OBJECT-TYPE @@ -874,7 +877,7 @@ begemotBridgeTpMaxAddresses OBJECT-TYPE MAX-ACCESS read-write STATUS current DESCRIPTION - "The maximum number of entires that this bridge can + "The maximum number of entries that this bridge can learn in it's Forwarding Address Table and use for making forwarding decisions." ::= { begemotBridgeTpEntry 3 } diff --git a/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c b/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c index 0daceec..33de19f 100644 --- a/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c +++ b/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c @@ -330,7 +330,7 @@ bridge_addrs_dump(struct bridge_if *bif) */ /* - * Construct the SNMP index from the address DST Mac. + * Construct the SNMP index from the address DST Mac. */ static void bridge_addrs_index_append(struct asn_oid *oid, uint sub, @@ -449,7 +449,7 @@ get: /* * Construct the SNMP index from the bridge interface name - * and the address DST Mac. + * and the address DST Mac. */ static int bridge_addrs_begemot_index_append(struct asn_oid *oid, uint sub, @@ -477,7 +477,7 @@ bridge_addrs_begemot_index_append(struct asn_oid *oid, uint sub, /* * Find a bridge address entry by the bridge interface name - * and the address DST Mac. + * and the address DST Mac. */ static struct tp_entry * bridge_addrs_begemot_get(const struct asn_oid *oid, uint sub) @@ -507,7 +507,7 @@ bridge_addrs_begemot_get(const struct asn_oid *oid, uint sub) /* * Find the next bridge address entry by the bridge interface name - * and the address DST Mac. + * and the address DST Mac. */ static struct tp_entry * bridge_addrs_begemot_getnext(const struct asn_oid *oid, uint sub) diff --git a/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c b/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c index e5f5c50..fd7fba0 100644 --- a/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c +++ b/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c @@ -433,7 +433,7 @@ bridge_update_bif(struct bridge_if *bif) } /* - * Update all bridge interfaces' ports only - + * Update all bridge interfaces' ports only - * make sure each bridge interface exists first. */ void diff --git a/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c b/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c index 0127cea..cbb8dc8 100644 --- a/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c +++ b/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c @@ -626,7 +626,7 @@ op_dot1d_stp_ext_port(struct snmp_context *ctx, struct snmp_value *val, return (SNMP_ERR_NOERROR); case LEAF_dot1dStpPortAdminPointToPoint: - if (val->v.integer < 0 || val->v.integer > + if (val->v.integer < 0 || val->v.integer > StpPortAdminPointToPointType_auto) return (SNMP_ERR_WRONG_VALUE); @@ -864,7 +864,7 @@ bridge_port_index_getnext(const struct asn_oid *oid, uint sub, int8_t status) for (i = 0; i < oid->subs[sub]; i++) bif_name[i] = oid->subs[sub + i + 1]; bif_name[i] = '\0'; - + port_no = oid->subs[sub + i + 1]; if ((bif = bridge_if_find_ifname(bif_name)) == NULL || @@ -937,7 +937,7 @@ bridge_port_set_status(struct snmp_context *ctx, ctx->scratch->int1 = bp->status; bp->status = RowStatus_active; break; - + case RowStatus_notInService: if (bp == NULL || bp->span_enable == 0 || bp->status == RowStatus_active) diff --git a/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c b/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c index f8644f4..9caa331 100644 --- a/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c +++ b/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c @@ -295,7 +295,7 @@ bridge_set_priority(struct bridge_if *bif, int32_t priority) /* * Re-fetching the data from the driver after that might be a good - * idea, since changing our bridge's priority should invoke + * idea, since changing our bridge's priority should invoke * recalculation of the active spanning tree topology in the network. */ bif->priority = priority; @@ -1319,7 +1319,7 @@ bridge_addrs_getinfo_ifalist(struct bridge_if *bif, struct ifbareq **buf) struct ifbaconf bac; struct ifdrv ifd; - *buf = NULL; + *buf = NULL; strlcpy(ifd.ifd_name, bif->bif_name, IFNAMSIZ); ifd.ifd_cmd = BRDGRTS; ifd.ifd_len = sizeof(bac); @@ -1449,8 +1449,8 @@ static struct { int32_t bridge_get_pfval(uint8_t which) { - if (which > sizeof(bridge_pf_sysctl) / sizeof(bridge_pf_sysctl[0]) - || which < 1) + + if (which > nitems(bridge_pf_sysctl) || which < 1) return (-1); return (bridge_pf_sysctl[which - 1].val); @@ -1472,7 +1472,7 @@ bridge_do_pfctl(int32_t bridge_ctl, enum snmp_op op, int32_t *val) } else s_len = 0; - len = sizeof(i); + len = sizeof(i); strcpy(mib_name, bridge_sysctl); diff --git a/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 b/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 index b77b5f7..39cb059 100644 --- a/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 +++ b/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 @@ -1,7 +1,7 @@ .\"- .\" Copyright (C) 2006 Shteryana Shopova <syrinx@FreeBSD.org> .\" All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -10,7 +10,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c index 1741502..8216acc 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c @@ -123,7 +123,7 @@ device_entry_create(const char *name, const char *location, const char *descr) if (map == NULL) { /* new object - get a new index */ if (next_device_index > INT_MAX) { - syslog(LOG_ERR, + syslog(LOG_ERR, "%s: hrDeviceTable index wrap", __func__); /* There isn't much we can do here. * If the next_swins_index is consumed diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c index 91505d5..9470677 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c @@ -131,7 +131,7 @@ static const struct { const struct asn_oid *oid; /* the OID to return */ } fs_type_map[] = { { "ufs", &OIDX_hrFSBerkeleyFFS_c }, - { "zfs", &OIDX_hrFSOther_c }, + { "zfs", &OIDX_hrFSOther_c }, { "cd9660", &OIDX_hrFSiso9660_c }, { "nfs", &OIDX_hrFSNFS_c }, { "ext2fs", &OIDX_hrFSLinuxExt2_c }, @@ -167,7 +167,7 @@ fs_entry_create(const char *name) /* new object - get a new index */ if (next_fs_index > INT_MAX) { /* Unrecoverable error - die clean and quicly*/ - syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__); + syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__); errx(EX_SOFTWARE, "hrFSTable index wrap"); } diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c index 65c0012..fa0d2bd 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c @@ -177,7 +177,7 @@ partition_entry_create(int32_t ds_index, const char *chunk_name) if (next_partition_index > INT_MAX) { /* Unrecoverable error - die clean and quicly*/ - syslog(LOG_ERR, "%s: hrPartitionTable index wrap", + syslog(LOG_ERR, "%s: hrPartitionTable index wrap", __func__); errx(EX_SOFTWARE, "hrPartitionTable index wrap"); } diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c index ee7d4b1..6634ae2 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c @@ -33,7 +33,7 @@ * Host Resources MIB scalars implementation for SNMPd. */ -#include <sys/types.h> +#include <sys/param.h> #include <sys/sysctl.h> #include <pwd.h> @@ -85,7 +85,7 @@ OS_getSystemUptime(uint32_t *ut) int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t len = sizeof(kernel_boot_timestamp); - if (sysctl(mib, 2, &kernel_boot_timestamp, + if (sysctl(mib, nitems(mib), &kernel_boot_timestamp, &len, NULL, 0) == -1) { syslog(LOG_ERR, "sysctl KERN_BOOTTIME failed: %m"); return (SNMP_ERR_GENERR); @@ -193,7 +193,7 @@ OS_getSystemInitialLoadParameters(u_char **params) syslog(LOG_ERR, "malloc failed"); return (SNMP_ERR_GENERR); } - if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) { + if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) { syslog(LOG_ERR, "sysctl({CTL_KERN,KERN_BOOTFILE}) failed: %m"); free(buf); @@ -296,7 +296,7 @@ OS_getMemorySize(uint32_t *ms) *ms = UINT32_MAX; else *ms = phys_mem_size; - return (SNMP_ERR_NOERROR); + return (SNMP_ERR_NOERROR); } /* @@ -360,7 +360,7 @@ OS_setSystemDate(const struct timeval *timeval_to_set) if (settimeofday(timeval_to_set, NULL) == -1) { syslog(LOG_ERR, "settimeofday failed: %m"); return (SNMP_ERR_GENERR); - } + } return (SNMP_ERR_NOERROR); } @@ -378,7 +378,7 @@ op_hrSystem(struct snmp_context *ctx, struct snmp_value *value, switch (curr_op) { - case SNMP_OP_GET: + case SNMP_OP_GET: switch (value->var.subs[sub - 1]) { case LEAF_hrSystemUptime: diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c index 26bd919..4709c9a 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c @@ -163,7 +163,7 @@ hostres_start(void) start_processor_tbl(hostres_module); start_network_tbl(); - HRDBG("done."); + HRDBG("done."); } /* this identifies the HOST RESOURCES mib module */ @@ -175,8 +175,8 @@ const struct snmp_module config = { NULL, NULL, hostres_start, - NULL, /* proxy a PDU */ - hostres_ctree, /* see the generated hostres_tree.h */ + NULL, /* proxy a PDU */ + hostres_ctree, /* see the generated hostres_tree.h */ hostres_CTREE_SIZE, /* see the generated hostres_tree.h */ NULL }; diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c index ced7e8d..f7b6537 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c @@ -153,7 +153,7 @@ storage_entry_create(const char *name) if (map == NULL) { /* new object - get a new index */ if (next_storage_index > INT_MAX) { - syslog(LOG_ERR, + syslog(LOG_ERR, "%s: hrStorageTable index wrap", __func__); errx(EX_SOFTWARE, "hrStorageTable index wrap"); } @@ -188,7 +188,7 @@ storage_entry_create(const char *name) syslog(LOG_WARNING, "%s: %m", __func__); return (NULL); } - memset(entry, 0, sizeof(*entry)); + memset(entry, 0, sizeof(*entry)); entry->index = map->hrIndex; @@ -374,10 +374,13 @@ storage_OS_get_memstat(void) static void storage_OS_get_swap(void) { - int nswapdev = 0; - size_t len = sizeof(nswapdev); struct storage_entry *entry; char swap_w_prefix[SE_DESC_MLEN]; + size_t len; + int nswapdev; + + len = sizeof(nswapdev); + nswapdev = 0; if (sysctlbyname("vm.nswapdev", &nswapdev, &len, NULL,0 ) < 0) { syslog(LOG_ERR, diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c index 5fa5b4c..c7eecc5 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c @@ -50,7 +50,7 @@ #include "hostres_oid.h" #include "hostres_tree.h" -#define CONTENTS_FNAME "+CONTENTS" +#define CONTENTS_FNAME "+CONTENTS" enum SWInstalledType { SWI_UNKNOWN = 1, @@ -136,7 +136,7 @@ swins_entry_create(const char *name) size_t name_len; /* new object - get a new index */ if (next_swins_index > INT_MAX) { - syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap", + syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap", __func__ ); /* There isn't much we can do here. * If the next_swins_index is consumed @@ -292,7 +292,7 @@ swins_get_packages(void) struct stat sb; DIR *p_dir; struct dirent *ent; - struct tm k_ts; + struct tm k_ts; char *pkg_file; struct swins_entry *entry; int ret = 0; @@ -327,7 +327,7 @@ swins_get_packages(void) return (-1); } - while (errno = 0, (ent = readdir(p_dir)) != NULL) { + while (errno = 0, (ent = readdir(p_dir)) != NULL) { HRDBG(" pkg file: %s", ent->d_name); /* check that the contents file is a regular file */ @@ -371,7 +371,7 @@ swins_get_packages(void) entry->type = (int32_t)SWI_APPLICATION; entry->date_len = make_date_time(entry->date, &k_ts, 0); - } + } if (errno != 0) { syslog(LOG_ERR, "hrSWInstalledTable: readdir_r(\"%s\") failed:" diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 b/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 index 774c027..1c7e295 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 @@ -2,7 +2,7 @@ .\" Copyright (C) 2005-2006 .\" The FreeBSD Project. .\" All rights reserved. -.\" +.\" .\" Author: Harti Brandt <harti@FreeBSD.org> .\" .\" Redistribution and use in source and binary forms, with or without @@ -13,7 +13,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c b/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c index d9d136a..4b1da05 100644 --- a/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c +++ b/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c @@ -173,7 +173,7 @@ ng_unregister_cookie(void *dd) * Register a function for hook data. */ void * -ng_register_hook(const struct lmodule *mod, const char *hook, +ng_register_hook(const struct lmodule *mod, const char *hook, ng_hook_f *func, void *arg) { struct datareg *d; @@ -893,7 +893,7 @@ ng_peer_hook_id(ng_ID_t node, const char *hook, char *peerhook) else strcpy(peerhook, hooklist->link[i].peerhook); - } else + } else strcpy(peerhook, hooklist->link[i].peerhook); free(resp); @@ -903,7 +903,7 @@ ng_peer_hook_id(ng_ID_t node, const char *hook, char *peerhook) /* - * Now the module is started. Select on the sockets, so that we can get + * Now the module is started. Select on the sockets, so that we can get * unsolicited input. */ static void @@ -926,7 +926,7 @@ ng_start(void) return; } - reg_index = or_register(&oid_begemotNg, + reg_index = or_register(&oid_begemotNg, "The MIB for the NetGraph access module for SNMP.", module); } diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt b/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt index d2b247f..d92b6ac 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt +++ b/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt @@ -1,4 +1,4 @@ --- +-- -- ---------------------------------------------------------------------------- -- "THE BEER-WARE LICENSE" (Revision 42): -- <philip@FreeBSD.org> wrote this file. As long as you retain this notice you @@ -7,7 +7,7 @@ -- ---------------------------------------------------------------------------- -- -- $FreeBSD$ --- +-- BEGEMOT-PF-MIB DEFINITIONS ::= BEGIN @@ -612,7 +612,7 @@ pfInterfacesIfIndex OBJECT-TYPE DESCRIPTION "A unique value, greater than zero, for each interface." ::= { pfInterfacesIfEntry 1 } - + pfInterfacesIfDescr OBJECT-TYPE SYNTAX OCTET STRING MAX-ACCESS read-only @@ -876,7 +876,7 @@ pfTablesTblTZero OBJECT-TYPE cleared or the time since this table was loaded, whichever is sooner." ::= { pfTablesTblEntry 4 } - + pfTablesTblRefsAnchor OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-only @@ -1294,7 +1294,7 @@ pfLabelsLblIndex OBJECT-TYPE STATUS current DESCRIPTION "A unique value, greater than zero, for each label." - ::= { pfLabelsLblEntry 1 } + ::= { pfLabelsLblEntry 1 } pfLabelsLblName OBJECT-TYPE SYNTAX OCTET STRING diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/Makefile b/usr.sbin/bsnmpd/modules/snmp_pf/Makefile index 6218932..efe2e95 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/Makefile +++ b/usr.sbin/bsnmpd/modules/snmp_pf/Makefile @@ -1,5 +1,5 @@ # $FreeBSD$ -# +# # Author: Philip Paeps <philip@freebsd.org> MOD= pf diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index 1048ffe..d8206ca 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -650,7 +650,7 @@ pf_iftable(struct snmp_context __unused *ctx, struct snmp_value *val, e->pfi.pfik_packets[IPV6][OUT][PASS]; break; case LEAF_pfInterfacesIf6PktsOutBlock: - val->v.counter64 = + val->v.counter64 = e->pfi.pfik_packets[IPV6][OUT][BLOCK]; break; @@ -932,7 +932,7 @@ pf_altq(struct snmp_context __unused *ctx, struct snmp_value *val, abort(); return (SNMP_ERR_GENERR); -} +} int pf_altqq(struct snmp_context __unused *ctx, struct snmp_value *val, @@ -987,7 +987,7 @@ pf_altqq(struct snmp_context __unused *ctx, struct snmp_value *val, case LEAF_pfAltqQueueLimit: val->v.integer = e->altq.qlimit; break; - + default: return (SNMP_ERR_NOSUCHNAME); } @@ -1225,7 +1225,7 @@ pfq_refresh(void) } bzero(&pa, sizeof(pa)); - + if (ioctl(dev, DIOCGETALTQS, &pa)) { syslog(LOG_ERR, "pfq_refresh: ioctl(DIOCGETALTQS): %s", strerror(errno)); @@ -1260,7 +1260,7 @@ pfq_refresh(void) INSERT_OBJECT_INT_LINK_INDEX(e, &pfq_table, link, index); } } - + pfq_table_age = time(NULL); pf_tick = this_tick; @@ -1640,20 +1640,20 @@ err: static int altq_is_enabled(int pfdev) { - struct pfioc_altq pa; + struct pfioc_altq pa; errno = 0; - if (ioctl(pfdev, DIOCGETALTQS, &pa)) { - if (errno == ENODEV) { + if (ioctl(pfdev, DIOCGETALTQS, &pa)) { + if (errno == ENODEV) { syslog(LOG_INFO, "No ALTQ support in kernel\n" "ALTQ related functions disabled\n"); - return (0); - } else - syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", + return (0); + } else + syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s", strerror(errno)); return (-1); - } - return (1); + } + return (1); } /* @@ -1674,7 +1674,7 @@ pf_init(struct lmodule *mod, int __unused argc, char __unused *argv[]) syslog(LOG_ERR, "pf_init(): altq test failed"); return (-1); } - + /* Prepare internal state */ TAILQ_INIT(&pfi_table); TAILQ_INIT(&pfq_table); @@ -1765,7 +1765,7 @@ pf_dump(void) (intmax_t)pfi_table_age); syslog(LOG_ERR, "Dump: pfi_table_count = %d", pfi_table_count); - + syslog(LOG_ERR, "Dump: pfq_table_age = %jd", (intmax_t)pfq_table_age); syslog(LOG_ERR, "Dump: pfq_table_count = %d", diff --git a/usr.sbin/bsnmpd/modules/snmp_target/Makefile b/usr.sbin/bsnmpd/modules/snmp_target/Makefile index 10141e5..e6216ea 100644 --- a/usr.sbin/bsnmpd/modules/snmp_target/Makefile +++ b/usr.sbin/bsnmpd/modules/snmp_target/Makefile @@ -15,6 +15,6 @@ CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -DSNMPTREE_TYPES CFLAGS+= -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY -DHAVE_SYS_TREE_H DEFS= ${MOD}_tree.def -BMIBS= +BMIBS= .include <bsd.snmpmod.mk> diff --git a/usr.sbin/bsnmpd/modules/snmp_usm/Makefile b/usr.sbin/bsnmpd/modules/snmp_usm/Makefile index 4ae818a..1c42245 100644 --- a/usr.sbin/bsnmpd/modules/snmp_usm/Makefile +++ b/usr.sbin/bsnmpd/modules/snmp_usm/Makefile @@ -17,6 +17,6 @@ CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -DSNMPTREE_TYPES CFLAGS+= -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY -DHAVE_SYS_TREE_H DEFS= ${MOD}_tree.def -BMIBS= +BMIBS= .include <bsd.snmpmod.mk> diff --git a/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile b/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile index 1be8d62..4a09cde 100644 --- a/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile +++ b/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile @@ -15,6 +15,6 @@ CFLAGS+= -I${CONTRIB}/lib -I${CONTRIB}/snmpd -DSNMPTREE_TYPES CFLAGS+= -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY -DHAVE_SYS_TREE_H DEFS= ${MOD}_tree.def -BMIBS= +BMIBS= .include <bsd.snmpmod.mk> diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c index ec94ac6..92091f0 100644 --- a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c @@ -1841,7 +1841,7 @@ op_wlan_wep_iface(struct snmp_context *ctx, struct snmp_value *val, default: abort(); } - + return (SNMP_ERR_NOERROR); } @@ -3435,7 +3435,7 @@ wlan_get_channel_type(struct ieee80211_channel *c) return (WlanChannelType_turbo); if (IEEE80211_IS_CHAN_HT(c)) return (WlanChannelType_ht); - + return (-1); } @@ -3740,7 +3740,7 @@ wlan_scan_add_result(struct wlan_iface *wif, struct wlan_scan_result *sr) SLIST_INSERT_HEAD(&wif->scanlist, sr, wsr); return (0); } - + SLIST_FOREACH(temp, &wif->scanlist, wsr) { if (wlan_scan_compare_result(sr, temp) < 0) break; diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h index 9e184f5..de6587f 100644 --- a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h +++ b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h @@ -182,7 +182,7 @@ struct wlan_iface { enum wlanHWMPRootMode hwmp_root_mode; uint32_t hwmp_max_hops; struct wlan_mesh_routes mesh_routelist; - + SLIST_ENTRY(wlan_iface) w_if; }; diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c index 739f11f..9db30ae 100644 --- a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c +++ b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c @@ -1,7 +1,7 @@ /*- * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. - + * This software was developed by Shteryana Sotirova Shopova under * sponsorship from the FreeBSD Foundation. * @@ -158,7 +158,7 @@ wlan_kmodules_load(void) syslog(LOG_NOTICE, "SNMP wlan loaded %s module", wmod_names[WLAN_KMOD_WEP]); - return (0); + return (0); } /* XXX: FIXME */ @@ -2387,7 +2387,7 @@ wlan_get_mac_policy(struct wlan_iface *wif) wif->mac_policy = wlanMACAccessControlPolicy_open; return (0); } - + } wif->macsupported = 1; diff --git a/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c b/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c index 28e2b58..2a214aa 100644 --- a/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c +++ b/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c @@ -394,7 +394,7 @@ snmptool_get(struct snmp_toolinfo *snmptoolctx) GET_NONREP(snmptoolctx)); if (snmp_dialog(&req, &resp) == -1) { - warnx("Snmp dialog - %s", strerror(errno)); + warn("Snmp dialog"); break; } @@ -521,7 +521,7 @@ snmptool_walk(struct snmp_toolinfo *snmptoolctx) snmp_pdu_free(&resp); } else - warnx("Snmp dialog - %s", strerror(errno)); + warn("Snmp dialog"); } if (snmp_object_remove(snmptoolctx, &root) < 0) { @@ -554,8 +554,7 @@ parse_oid_numeric(struct snmp_value *value, char *val) errno = 0; suboid = strtoul(val, &endptr, 10); if (errno != 0) { - warnx("Value %s not supported - %s", val, - strerror(errno)); + warn("Value %s not supported", val); errno = saved_errno; return (-1); } @@ -603,9 +602,9 @@ parse_oid_string(struct snmp_toolinfo *snmptoolctx, static int32_t parse_ip(struct snmp_value * value, char * val) { - uint32_t v; - int32_t i; char *endptr, *str; + int32_t i; + uint32_t v; str = val; for (i = 0; i < 4; i++) { @@ -617,8 +616,8 @@ parse_ip(struct snmp_value * value, char * val) str = endptr + 1; value->v.ipaddress[i] = (uint8_t) v; } - value->syntax = SNMP_SYNTAX_IPADDRESS; + return (0); } @@ -634,7 +633,7 @@ parse_int(struct snmp_value *value, char *val) v = strtol(val, &endptr, 10); if (errno != 0) { - warnx("Value %s not supported - %s", val, strerror(errno)); + warn("Value %s not supported", val); errno = saved_errno; return (-1); } @@ -682,7 +681,7 @@ parse_uint(struct snmp_value *value, char *val) v = strtoul(val, &endptr, 10); if (errno != 0) { - warnx("Value %s not supported - %s", val, strerror(errno)); + warn("Value %s not supported", val); errno = saved_errno; return (-1); } @@ -736,7 +735,7 @@ parse_uint64(struct snmp_value *value, char *val) v = strtoull(val, &endptr, 10); if (errno != 0) { - warnx("Value %s not supported - %s", val, strerror(errno)); + warnx("Value %s not supported", val); errno = saved_errno; return (-1); } @@ -777,7 +776,7 @@ parse_syntax_val(struct snmp_value *value, enum snmp_syntax syntax, char *val) } /* - * Parse a command line argument of type OID=syntax:value and fill in whatever + * Parse a command line argument of type OID=syntax:value and fill in whatever * fields can be derived from the input into snmp_value structure. Reads numeric * OIDs. */ @@ -821,7 +820,7 @@ parse_pair_numoid_val(char *str, struct snmp_value *snmp_val) break; if (ptr[cnt] != '\0') { - warnx("Value string too long - %s",ptr); + warnx("Value string too long - %s", ptr); return (-1); } @@ -830,7 +829,7 @@ parse_pair_numoid_val(char *str, struct snmp_value *snmp_val) * to know syntax to check value boundaries. */ if (snmp_parse_numoid(oid_str, &(snmp_val->var)) < 0) { - warnx("Error parsing OID %s",oid_str); + warnx("Error parsing OID %s", oid_str); return (-1); } @@ -840,10 +839,9 @@ parse_pair_numoid_val(char *str, struct snmp_value *snmp_val) return (1); } -/* XXX-BZ aruments should be swapped. */ static int32_t -parse_syntax_strval(struct snmp_toolinfo *snmptoolctx, char *str, - struct snmp_object *object) +parse_syntax_strval(struct snmp_toolinfo *snmptoolctx, + struct snmp_object *object, char *str) { uint32_t len; enum snmp_syntax syn; @@ -909,13 +907,13 @@ parse_pair_stroid_val(struct snmp_toolinfo *snmptoolctx, if ((ptr = snmptools_parse_stroid(snmptoolctx, obj, argv)) == NULL) return (-1); - + if (*ptr != '=') { warnx("Value to set expected after OID"); return (-1); } - if (parse_syntax_strval(snmptoolctx, ptr + 1, obj) < 0) + if (parse_syntax_strval(snmptoolctx, obj, ptr + 1) < 0) return (-1); return (1); @@ -956,7 +954,7 @@ static int32_t add_octstring_syntax(struct snmp_value *dst, struct snmp_value *src) { if (src->v.octetstring.len > ASN_MAXOCTETSTRING) { - warnx("OctetString len too big - %u",src->v.octetstring.len); + warnx("OctetString len too big - %u", src->v.octetstring.len); return (-1); } @@ -1084,7 +1082,7 @@ snmptool_set(struct snmp_toolinfo *snmptoolctx) while ((snmp_pdu_add_bindings(snmptoolctx, snmpset_verify_vbind, snmpset_add_vbind, &req, SNMP_MAX_BINDINGS)) > 0) { if (snmp_dialog(&req, &resp)) { - warnx("Snmp dialog - %s", strerror(errno)); + warn("Snmp dialog"); break; } @@ -1229,7 +1227,7 @@ main(int argc, char ** argv) } if (snmp_open(NULL, NULL, NULL, NULL)) { - warnx("Failed to open snmp session: %s.", strerror(errno)); + warn("Failed to open snmp session"); snmp_tool_freeall(&snmptoolctx); exit(1); } @@ -1239,7 +1237,7 @@ main(int argc, char ** argv) if (ISSET_EDISCOVER(&snmptoolctx) && snmp_discover_engine(snmptoolctx.passwd) < 0) { - warnx("Unknown SNMP Engine ID: %s.", strerror(errno)); + warn("Unknown SNMP Engine ID"); rc = 1; goto cleanup; } @@ -1255,7 +1253,7 @@ main(int argc, char ** argv) snmp_get_local_keys(&snmp_client.user, snmp_client.engine.engine_id, snmp_client.engine.engine_len) != SNMP_CODE_OK) { - warnx("Failed to get keys: %s.", strerror(errno)); + warn("Failed to get keys"); rc = 1; goto cleanup; } diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c index 09684ac..d4f305f 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c @@ -53,7 +53,7 @@ * subtype := STRING * * enum := ENUM '(' value ')' - * + * * bits := BITS '(' value ')' * * value := INT STRING | INT STRING value @@ -483,7 +483,7 @@ snmp_import_update_table(enum snmp_tbl_entry te, struct snmp_index_entry *tbl) switch (te) { case ENTRY_NONE: if (table_data.tbl_type == ENTRY_NONE) - return (NULL); + return (NULL); if (table_data.tbl_type == ENTRY_INDEX) table_data.table_idx = NULL; table_data.tbl_type--; @@ -539,7 +539,7 @@ parse_subtype(struct snmp_toolinfo *snmptoolctx, int32_t *tok, warnx("subtype expected after '|'"); return (-1); } - + *tc = snmp_get_tc(nexttok); *tok = gettoken(snmptoolctx); @@ -806,7 +806,7 @@ snmp_import_object(struct snmp_toolinfo *snmptoolctx) if (snmp_suboid_append(¤t_oid, (asn_subid_t) val) < 0) goto error; - /* + /* * Ignore the error for nodes since the .def files currently * contain different strings for 1.3.6.1.2.1 - mibII. Only make * sure the memory is freed and don't complain. diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c index 7e2b721..abee9c2 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c @@ -29,7 +29,7 @@ * $FreeBSD$ */ -#include <sys/param.h> +#include <sys/param.h> #include <sys/queue.h> #include <sys/uio.h> @@ -636,7 +636,7 @@ snmp_mapping_dumptable(struct snmp_table_index *headp) } } -void +void snmp_mapping_dump(struct snmp_toolinfo *snmptoolctx /* int bits */) { if (!_bsnmptools_debug) diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c index d945b89..dcc4361 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c @@ -31,7 +31,7 @@ * $FreeBSD$ */ -#include <sys/param.h> +#include <sys/param.h> #include <sys/queue.h> #include <sys/socket.h> #include <sys/uio.h> @@ -266,13 +266,13 @@ parse_octetstring(struct snmp_value *value, char *val) return (-1); } - value->v.octetstring.len = len; - - if((value->v.octetstring.octets = malloc(len)) == NULL) { - syslog(LOG_ERR,"malloc failed: %s", strerror(errno)); + if ((value->v.octetstring.octets = malloc(len)) == NULL) { + value->v.octetstring.len = 0; + syslog(LOG_ERR, "malloc failed: %s", strerror(errno)); return (-1); } + value->v.octetstring.len = len; memcpy(value->v.octetstring.octets, val, len); value->syntax = SNMP_SYNTAX_OCTETSTRING; @@ -570,7 +570,7 @@ parse_dateandtime(struct snmp_value *sv, char *val) date[10] = v; if ((sv->v.octetstring.octets = malloc(SNMP_DATETIME_OCTETS)) == NULL) { - warnx("malloc() failed - %s", strerror(errno)); + warn("malloc() failed"); return (-1); } @@ -626,7 +626,7 @@ snmp_addr2asn_oid(char *str, struct asn_oid *oid) return (NULL); } if (*endptr != ':') { - warnx("Failed adding oid - %s",str); + warnx("Failed adding oid - %s", str); return (NULL); } if (snmp_suboid_append(oid, (asn_subid_t) v) < 0) @@ -679,7 +679,7 @@ parse_physaddress(struct snmp_value *sv, char *val) phys_addr[5] = v; if ((sv->v.octetstring.octets = malloc(SNMP_PHYSADDR_OCTETS)) == NULL) { - syslog(LOG_ERR,"malloc failed: %s", strerror(errno)); + syslog(LOG_ERR, "malloc failed: %s", strerror(errno)); return (-1); } @@ -743,7 +743,7 @@ snmp_ntp_ts2asn_oid(char *str, struct asn_oid *oid) errno = saved_errno; if (*endptr != '.') { - warnx("Failed adding oid - %s",str); + warnx("Failed adding oid - %s", str); return (NULL); } @@ -824,7 +824,7 @@ parse_ntp_ts(struct snmp_value *sv, char *val) } if ((sv->v.octetstring.octets = malloc(SNMP_NTP_TS_OCTETS)) == NULL) { - syslog(LOG_ERR,"malloc failed: %s", strerror(errno)); + syslog(LOG_ERR, "malloc failed: %s", strerror(errno)); return (-1); } @@ -987,7 +987,7 @@ parse_bridge_id(struct snmp_value *sv, char *string) bridge_id[7] = v; if ((sv->v.octetstring.octets = malloc(SNMP_BRIDGEID_OCTETS)) == NULL) { - syslog(LOG_ERR,"malloc failed: %s", strerror(errno)); + syslog(LOG_ERR, "malloc failed: %s", strerror(errno)); return (-1); } @@ -1098,7 +1098,7 @@ parse_bport_id(struct snmp_value *value, char *string) bport_id[1] = v; if ((value->v.octetstring.octets = malloc(SNMP_BPORT_OCTETS)) == NULL) { - syslog(LOG_ERR,"malloc failed: %s", strerror(errno)); + syslog(LOG_ERR, "malloc failed: %s", strerror(errno)); return (-1); } @@ -1143,7 +1143,7 @@ parse_bport_id(struct snmp_value *value, char *string) ************************************************************** * TODO: FIXME!!! syrinx: Since we do not support checking the * consistency of a varbinding based on the value of a previous - * one, try to guess the type of address based on the + * one, try to guess the type of address based on the * OctetString SIZE - 4 for IPv4, 16 for IPv6, others currently * not supported. */ @@ -1178,7 +1178,7 @@ snmp_oct2inetaddr(uint32_t len, char *octets, char *buf) } if (inet_ntop(af, ip, buf, SNMP_INADDRS_STRSZ) == NULL) { - warnx("inet_ntop failed - %s", strerror(errno)); + warn("inet_ntop failed"); return (NULL); } @@ -1230,7 +1230,7 @@ snmp_bits2oct(char *str, struct asn_oid *oid) v = strtoull(str, &endptr, 16); if (errno != 0) { - warnx("Bad BITS value %s - %s", str, strerror(errno)); + warn("Bad BITS value %s", str); errno = saved_errno; return (NULL); } @@ -1270,7 +1270,7 @@ parse_bits(struct snmp_value *value, char *string) v = strtoull(string, &endptr, 16); if (errno != 0) { - warnx("Bad BITS value %s - %s", string, strerror(errno)); + warn("Bad BITS value %s", string); errno = saved_errno; return (-1); } diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c index 3e11bbc..36b9917 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c @@ -31,7 +31,7 @@ * $FreeBSD$ */ -#include <sys/param.h> +#include <sys/param.h> #include <sys/queue.h> #include <sys/uio.h> @@ -117,7 +117,7 @@ static const struct { { "Gauge", SNMP_SYNTAX_GAUGE }, { "TimeTicks", SNMP_SYNTAX_TIMETICKS }, { "Counter64", SNMP_SYNTAX_COUNTER64 }, - { "Unknown", SNMP_SYNTAX_UNKNOWN }, + { "Unknown", SNMP_SYNTAX_UNKNOWN }, }; int @@ -177,7 +177,7 @@ snmptool_init(struct snmp_toolinfo *snmptoolctx) if ((slen = strlen(str)) > MAXSTR) slen = MAXSTR - 1; if ((snmptoolctx->passwd = malloc(slen + 1)) == NULL) { - warnx("malloc() failed - %s", strerror(errno)); + warn("malloc() failed"); return (-1); } if (slen > 0) @@ -189,7 +189,7 @@ snmptool_init(struct snmp_toolinfo *snmptoolctx) #define OBJECT_IDX_LIST(o) o->info->table_idx->index_list -/* +/* * Walk through the file list and import string<->oid mappings from each file. */ int32_t @@ -252,12 +252,12 @@ add_filename(struct snmp_toolinfo *snmptoolctx, const char *filename, } if ((fstring = strdup(filename)) == NULL) { - warnx("strdup() failed - %s", strerror(errno)); + warn("strdup() failed"); return (-1); } if ((entry = calloc(1, sizeof(struct fname))) == NULL) { - warnx("calloc() failed - %s", strerror(errno)); + warn("calloc() failed"); free(fstring); return (-1); } @@ -287,7 +287,7 @@ free_filelist(struct snmp_toolinfo *snmptoolctx) } } -static char +static char isvalid_fchar(char c, int pos) { if (isalpha(c)|| c == '/'|| c == '_' || c == '.' || c == '~' || @@ -652,7 +652,7 @@ parse_user_security(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg) warnx("Suboption 'engine' - no argument"); return (-1); } - snmp_client.engine.engine_len = parse_ascii(val, + snmp_client.engine.engine_len = parse_ascii(val, snmp_client.engine.engine_id, SNMP_ENGINE_ID_SIZ); if ((int32_t)snmp_client.engine.engine_len == -1) { warnx("Bad EngineID - %s", val); @@ -668,8 +668,7 @@ parse_user_security(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg) errno = 0; snmp_client.engine.engine_boots = strtoul(val, NULL, 10); if (errno != 0) { - warnx("Bad 'engine-boots' value %s - %s", val, - strerror(errno)); + warn("Bad 'engine-boots' value %s", val); errno = saved_errno; return (-1); } @@ -684,8 +683,7 @@ parse_user_security(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg) errno = 0; snmp_client.engine.engine_time = strtoul(val, NULL, 10); if (errno != 0) { - warnx("Bad 'engine-time' value %s - %s", val, - strerror(errno)); + warn("Bad 'engine-time' value %s", val); errno = saved_errno; return (-1); } @@ -819,7 +817,7 @@ parse_timeout(char *opt_arg) v = strtol(opt_arg, NULL, 10); if (errno != 0) { - warnx( "Error parsing timeout value - %s", strerror(errno)); + warn("Error parsing timeout value"); errno = saved_errno; return (-1); } @@ -842,7 +840,7 @@ parse_retry(char *opt_arg) v = strtoul(opt_arg, NULL, 10); if (errno != 0) { - warnx("Error parsing retries count - %s", strerror(errno)); + warn("Error parsing retries count"); errno = saved_errno; return (-1); } @@ -865,7 +863,7 @@ parse_version(char *opt_arg) v = strtoul(opt_arg, NULL, 10); if (errno != 0) { - warnx("Error parsing version - %s", strerror(errno)); + warn("Error parsing version"); errno = saved_errno; return (-1); } @@ -917,7 +915,7 @@ parse_buflen(char *opt_arg) size = strtoul(opt_arg, NULL, 10); if (errno != 0) { - warnx("Error parsing buffer size - %s", strerror(errno)); + warn("Error parsing buffer size"); errno = saved_errno; return (-1); } @@ -1040,8 +1038,7 @@ snmp_int2asn_oid(char *str, struct asn_oid *oid) v = strtol(str, &endptr, 10); if (errno != 0) { - warnx("Integer value %s not supported - %s", str, - strerror(errno)); + warn("Integer value %s not supported", str); errno = saved_errno; return (NULL); } @@ -1093,6 +1090,7 @@ snmp_ip2asn_oid(char *str, struct asn_oid *oid) char *endptr, *ptr; ptr = str; + for (i = 0; i < 4; i++) { v = strtoul(ptr, &endptr, 10); if (v > 0xff) @@ -1120,8 +1118,7 @@ snmp_uint2asn_oid(char *str, struct asn_oid *oid) v = strtoul(str, &endptr, 10); if (errno != 0) { - warnx("Integer value %s not supported - %s\n", str, - strerror(errno)); + warn("Integer value %s not supported", str); errno = saved_errno; return (NULL); } @@ -1145,8 +1142,7 @@ snmp_cnt64_2asn_oid(char *str, struct asn_oid *oid) v = strtoull(str, &endptr, 10); if (errno != 0) { - warnx("Integer value %s not supported - %s", str, - strerror(errno)); + warn("Integer value %s not supported", str); errno = saved_errno; return (NULL); } @@ -1470,7 +1466,7 @@ snmp_pdu_add_bindings(struct snmp_toolinfo *snmptoolctx, /* Return 0 in case of no more work todo. */ if (SLIST_EMPTY(&snmptoolctx->snmp_objectlist)) return (0); - + if (maxcount < 0 || maxcount > SNMP_MAX_BINDINGS) { warnx("maxcount out of range: <0 || >SNMP_MAX_BINDINGS"); return (-1); @@ -2007,20 +2003,25 @@ snmp_output_object(struct snmp_toolinfo *snmptoolctx, struct snmp_object *o) void snmp_output_err_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu) { + struct snmp_object *object; char buf[ASN_OIDSTRLEN]; - struct snmp_object object; if (pdu == NULL || (pdu->error_index > (int32_t) pdu->nbindings)) { - fprintf(stdout,"Invalid error index in PDU\n"); + fprintf(stdout, "Invalid error index in PDU\n"); + return; + } + + if ((object = calloc(1, sizeof(struct snmp_object))) == NULL) { + fprintf(stdout, "calloc: %s", strerror(errno)); return; } fprintf(stdout, "Agent %s:%s returned error \n", snmp_client.chost, snmp_client.cport); - if (!ISSET_NUMERIC(snmptoolctx) && (snmp_fill_object(snmptoolctx, &object, + if (!ISSET_NUMERIC(snmptoolctx) && (snmp_fill_object(snmptoolctx, object, &(pdu->bindings[pdu->error_index - 1])) > 0)) - snmp_output_object(snmptoolctx, &object); + snmp_output_object(snmptoolctx, object); else { asn_oid2str_r(&(pdu->bindings[pdu->error_index - 1].var), buf); fprintf(stdout,"%s", buf); @@ -2032,16 +2033,22 @@ snmp_output_err_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu) fprintf(stdout, "%s\n", error_strings[pdu->error_status].str); else fprintf(stdout,"%s\n", error_strings[SNMP_ERR_UNKNOWN].str); + + free(object); + object = NULL; } int32_t snmp_output_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu, struct asn_oid *root) { - int32_t error; + struct snmp_object *object; char p[ASN_OIDSTRLEN]; + int32_t error; uint32_t i; - struct snmp_object object; + + if ((object = calloc(1, sizeof(struct snmp_object))) == NULL) + return (-1); i = error = 0; while (i < pdu->nbindings) { @@ -2051,18 +2058,22 @@ snmp_output_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu, if (GET_OUTPUT(snmptoolctx) != OUTPUT_QUIET) { if (!ISSET_NUMERIC(snmptoolctx) && - (snmp_fill_object(snmptoolctx, &object, + (snmp_fill_object(snmptoolctx, object, &(pdu->bindings[i])) > 0)) - snmp_output_object(snmptoolctx, &object); + snmp_output_object(snmptoolctx, object); else { asn_oid2str_r(&(pdu->bindings[i].var), p); fprintf(stdout, "%s", p); } } - error |= snmp_output_numval(snmptoolctx, &(pdu->bindings[i]), object.info); + error |= snmp_output_numval(snmptoolctx, &(pdu->bindings[i]), + object->info); i++; } + free(object); + object = NULL; + if (error) return (-1); diff --git a/usr.sbin/ctladm/ctladm.8 b/usr.sbin/ctladm/ctladm.8 index ebdd973..5be1ba1 100644 --- a/usr.sbin/ctladm/ctladm.8 +++ b/usr.sbin/ctladm/ctladm.8 @@ -35,7 +35,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd October 15, 2016 +.Dd December 21, 2016 .Dt CTLADM 8 .Os .Sh NAME @@ -859,9 +859,12 @@ Specifies LUN SCSI name string. Specifies LUN EUI-64 identifier. .It Va naa Specifies LUN NAA identifier. -Either EUI or NAA identifier should be set to UNIQUE value to allow +.It Va uuid +Specifies LUN locally assigned RFC 4122 UUID identifier. +EUI, NAA or UUID identifier should be set to UNIQUE value to allow EXTENDED COPY command access the LUN. Non-unique LUN identifiers may lead to data corruption. +Some initiators may not support later introduced UUID identifiers. .It Va ha_role Setting to "primary" or "secondary" overrides default role of the node in HA cluster, set by kern.cam.ctl.ha_role sysctl. diff --git a/usr.sbin/hyperv/Makefile b/usr.sbin/hyperv/Makefile index c11b341..d42817f4 100644 --- a/usr.sbin/hyperv/Makefile +++ b/usr.sbin/hyperv/Makefile @@ -2,6 +2,8 @@ .include <bsd.own.mk> -SUBDIR = tools +SUBDIR= \ + tools/kvp \ + tools/vss .include <bsd.subdir.mk> diff --git a/usr.sbin/hyperv/tools/Makefile.inc b/usr.sbin/hyperv/tools/Makefile.inc new file mode 100644 index 0000000..7e09f32 --- /dev/null +++ b/usr.sbin/hyperv/tools/Makefile.inc @@ -0,0 +1,4 @@ +# $FreeBSD$ + +CFLAGS.gcc+= -Wno-uninitialized +.include "../../Makefile.inc" diff --git a/usr.sbin/hyperv/tools/Makefile b/usr.sbin/hyperv/tools/kvp/Makefile index 3cfc001..e1bc47c 100644 --- a/usr.sbin/hyperv/tools/Makefile +++ b/usr.sbin/hyperv/tools/kvp/Makefile @@ -2,12 +2,12 @@ .include <bsd.own.mk> -HV_KVP_DAEMON_DISTDIR?= ${.CURDIR}/../../../contrib/hyperv/tools +HV_KVP_DAEMON_DISTDIR?= ${.CURDIR}/../../../../contrib/hyperv/tools .PATH: ${HV_KVP_DAEMON_DISTDIR} PROG= hv_kvp_daemon MAN= hv_kvp_daemon.8 -CFLAGS+= -I${.CURDIR}/../../../sys/dev/hyperv/utilities +CFLAGS+= -I${.CURDIR}/../../../../sys/dev/hyperv/utilities .include <bsd.prog.mk> diff --git a/usr.sbin/hyperv/tools/kvp/Makefile.depend b/usr.sbin/hyperv/tools/kvp/Makefile.depend new file mode 100644 index 0000000..54c1f6f --- /dev/null +++ b/usr.sbin/hyperv/tools/kvp/Makefile.depend @@ -0,0 +1,19 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/usr.sbin/hyperv/tools/vss/Makefile b/usr.sbin/hyperv/tools/vss/Makefile new file mode 100644 index 0000000..c9a2e6a --- /dev/null +++ b/usr.sbin/hyperv/tools/vss/Makefile @@ -0,0 +1,14 @@ +# $FreeBSD$ +DIRDEPS = lib/libc + +.include <bsd.own.mk> + +HV_VSS_DAEMON_DISTDIR?= ${.CURDIR}/../../../../contrib/hyperv/tools +.PATH: ${HV_VSS_DAEMON_DISTDIR} + +PROG= hv_vss_daemon +MAN= hv_vss_daemon.8 + +CFLAGS+= -I${.CURDIR}/../../../../sys/dev/hyperv/utilities + +.include <bsd.prog.mk> diff --git a/usr.sbin/hyperv/tools/vss/Makefile.depend b/usr.sbin/hyperv/tools/vss/Makefile.depend new file mode 100644 index 0000000..3646e2e --- /dev/null +++ b/usr.sbin/hyperv/tools/vss/Makefile.depend @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c index 82cd6ae..fb473f9 100644 --- a/usr.sbin/jail/jail.c +++ b/usr.sbin/jail/jail.c @@ -806,8 +806,7 @@ rdtun_params(struct cfjail *j, int dofail) if (jailparam_get(rtparams, nrt, bool_param(j->intparams[IP_ALLOW_DYING]) ? JAIL_DYING : 0) > 0) { rtjp = rtparams + 1; - for (jp = j->jp, rtjp = rtparams + 1; rtjp < rtparams + nrt; - jp++) { + for (jp = j->jp; rtjp < rtparams + nrt; jp++) { if (JP_RDTUN(jp) && strcmp(jp->jp_name, "jid")) { if (!((jp->jp_flags & (JP_BOOL | JP_NOBOOL)) && jp->jp_valuelen == 0 && diff --git a/usr.sbin/ntp/doc/ntp.conf.5 b/usr.sbin/ntp/doc/ntp.conf.5 index 8a79f67..22c0cd3 100644 --- a/usr.sbin/ntp/doc/ntp.conf.5 +++ b/usr.sbin/ntp/doc/ntp.conf.5 @@ -200,7 +200,7 @@ provided in .It Ic pool For type s addresses, this command mobilizes a persistent client mode association with a number of remote servers. -In this mode the local clock can synchronized to the +In this mode the local clock can be synchronized to the remote server, but the remote server can never be synchronized to the local clock. .It Ic server diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index 2017841..b5ceb2e 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -174,8 +174,6 @@ main(int argc, char *argv[]) default: usage(); } - argc -= optind; - argv += optind; /* * Initialize symbol names list. @@ -339,7 +337,7 @@ static void ttyprt(struct xtty *xt) { int i, j; - char *name; + const char *name; if (xt->xt_size != sizeof *xt) errx(1, "struct xtty size mismatch"); diff --git a/usr.sbin/pw/grupd.c b/usr.sbin/pw/grupd.c index 38d5e5b..5d0df02 100644 --- a/usr.sbin/pw/grupd.c +++ b/usr.sbin/pw/grupd.c @@ -77,6 +77,7 @@ gr_update(struct group * grp, char const * group) close(tfd); err(1, "gr_copy()"); } + fsync(tfd); close(tfd); if (gr_mkdb() == -1) { gr_fini(); diff --git a/usr.sbin/pw/pw_nis.c b/usr.sbin/pw/pw_nis.c index 35b26ea..087c946 100644 --- a/usr.sbin/pw/pw_nis.c +++ b/usr.sbin/pw/pw_nis.c @@ -67,6 +67,7 @@ pw_nisupdate(const char * path, struct passwd * pwd, char const * user) close(tfd); err(1, "pw_copy()"); } + fsync(tfd); close(tfd); if (chmod(pw_tempname(), 0644) == -1) err(1, "chmod()"); diff --git a/usr.sbin/pw/pwupd.c b/usr.sbin/pw/pwupd.c index 3bcb95f..87c3c99 100644 --- a/usr.sbin/pw/pwupd.c +++ b/usr.sbin/pw/pwupd.c @@ -114,6 +114,7 @@ pw_update(struct passwd * pwd, char const * user) close(tfd); err(1, "pw_copy()"); } + fsync(tfd); close(tfd); /* * in case of deletion of a user, the whole database |