From owner-svn-src-vendor@FreeBSD.ORG Sun Dec 14 15:43:00 2008 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3EC31065678; Sun, 14 Dec 2008 15:43:00 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C03678FC19; Sun, 14 Dec 2008 15:43:00 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEFh01U062628; Sun, 14 Dec 2008 15:43:00 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEFh0vu062627; Sun, 14 Dec 2008 15:43:00 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141543.mBEFh0vu062627@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 15:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186081 - in vendor/resolver/dist: include include/arpa lib/libc/include lib/libc/include/isc lib/libc/inet lib/libc/isc lib/libc/nameser lib/libc/resolv X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 15:43:00 -0000 Author: ume Date: Sun Dec 14 15:43:00 2008 New Revision: 186081 URL: http://svn.freebsd.org/changeset/base/186081 Log: Cleaning up Modified: vendor/resolver/dist/include/arpa/inet.h (props changed) vendor/resolver/dist/include/arpa/nameser.h (props changed) vendor/resolver/dist/include/arpa/nameser_compat.h (props changed) vendor/resolver/dist/include/res_update.h (props changed) vendor/resolver/dist/include/resolv.h (props changed) vendor/resolver/dist/lib/libc/include/isc/eventlib.h (props changed) vendor/resolver/dist/lib/libc/include/isc/list.h (props changed) vendor/resolver/dist/lib/libc/include/resolv_mt.h (props changed) vendor/resolver/dist/lib/libc/inet/inet_addr.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_cidr_ntop.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_cidr_pton.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_lnaof.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_makeaddr.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_net_ntop.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_net_pton.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_neta.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_netof.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_network.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_ntoa.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_ntop.c (props changed) vendor/resolver/dist/lib/libc/inet/inet_pton.c (props changed) vendor/resolver/dist/lib/libc/inet/nsap_addr.c (props changed) vendor/resolver/dist/lib/libc/isc/ev_streams.c (props changed) vendor/resolver/dist/lib/libc/isc/ev_timers.c (props changed) vendor/resolver/dist/lib/libc/isc/eventlib_p.h (props changed) vendor/resolver/dist/lib/libc/nameser/ns_name.c (props changed) vendor/resolver/dist/lib/libc/nameser/ns_netint.c (props changed) vendor/resolver/dist/lib/libc/nameser/ns_parse.c (props changed) vendor/resolver/dist/lib/libc/nameser/ns_print.c (props changed) vendor/resolver/dist/lib/libc/nameser/ns_samedomain.c (props changed) vendor/resolver/dist/lib/libc/nameser/ns_ttl.c (props changed) vendor/resolver/dist/lib/libc/resolv/herror.c (props changed) vendor/resolver/dist/lib/libc/resolv/mtctxres.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_comp.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_data.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_debug.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_debug.h (props changed) vendor/resolver/dist/lib/libc/resolv/res_findzonecut.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_init.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_mkquery.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_mkupdate.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_private.h (props changed) vendor/resolver/dist/lib/libc/resolv/res_query.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_send.c (props changed) vendor/resolver/dist/lib/libc/resolv/res_update.c (props changed) From owner-svn-src-vendor@FreeBSD.ORG Sun Dec 14 16:47:22 2008 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 143291065670; Sun, 14 Dec 2008 16:47:22 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3B878FC19; Sun, 14 Dec 2008 16:47:21 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEGlLxn063978; Sun, 14 Dec 2008 16:47:21 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEGlLEa063969; Sun, 14 Dec 2008 16:47:21 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141647.mBEGlLEa063969@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 16:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186083 - in vendor/resolver/dist: include include/arpa lib/libc/include/isc lib/libc/inet lib/libc/resolv X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 16:47:22 -0000 Author: ume Date: Sun Dec 14 16:47:21 2008 New Revision: 186083 URL: http://svn.freebsd.org/changeset/base/186083 Log: Import the resolver part of BIND 9.4.3. Modified: vendor/resolver/dist/include/arpa/nameser.h vendor/resolver/dist/include/resolv.h vendor/resolver/dist/lib/libc/include/isc/eventlib.h vendor/resolver/dist/lib/libc/inet/inet_net_pton.c vendor/resolver/dist/lib/libc/inet/inet_network.c vendor/resolver/dist/lib/libc/resolv/res_debug.c vendor/resolver/dist/lib/libc/resolv/res_mkquery.c vendor/resolver/dist/lib/libc/resolv/res_query.c vendor/resolver/dist/lib/libc/resolv/res_send.c Modified: vendor/resolver/dist/include/arpa/nameser.h ============================================================================== --- vendor/resolver/dist/include/arpa/nameser.h Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/include/arpa/nameser.h Sun Dec 14 16:47:21 2008 (r186083) @@ -49,7 +49,7 @@ */ /* - * $Id: nameser.h,v 1.7.18.1 2005/04/27 05:00:50 sra Exp $ + * $Id: nameser.h,v 1.7.18.2 2008/04/03 23:15:15 marka Exp $ */ #ifndef _ARPA_NAMESER_H_ @@ -427,9 +427,10 @@ typedef enum __ns_cert_types { #define NS_NXT_MAX 127 /*% - * EDNS0 extended flags, host order. + * EDNS0 extended flags and option codes, host order. */ #define NS_OPT_DNSSEC_OK 0x8000U +#define NS_OPT_NSID 3 /*% * Inline versions of get/put short/long. Pointer is advanced. Modified: vendor/resolver/dist/include/resolv.h ============================================================================== --- vendor/resolver/dist/include/resolv.h Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/include/resolv.h Sun Dec 14 16:47:21 2008 (r186083) @@ -50,7 +50,7 @@ /*% * @(#)resolv.h 8.1 (Berkeley) 6/2/93 - * $Id: resolv.h,v 1.19.18.3 2005/08/25 04:43:51 marka Exp $ + * $Id: resolv.h,v 1.19.18.4 2008/04/03 23:15:15 marka Exp $ */ #ifndef _RESOLV_H_ @@ -250,6 +250,7 @@ union res_sockaddr_union { #define RES_NOCHECKNAME 0x00008000 /*%< do not check names for sanity. */ #define RES_KEEPTSIG 0x00010000 /*%< do not strip TSIG records */ #define RES_BLAST 0x00020000 /*%< blast all recursive servers */ +#define RES_NSID 0x00040000 /*%< request name server ID */ #define RES_NOTLDQUERY 0x00100000 /*%< don't unqualified name as a tld */ #define RES_USE_DNSSEC 0x00200000 /*%< use DNSSEC using OK bit in OPT */ /* #define RES_DEBUG2 0x00400000 */ /* nslookup internal */ @@ -396,6 +397,7 @@ extern const struct res_sym __p_rcode_sy #define sym_ntos __sym_ntos #define sym_ston __sym_ston #define res_nopt __res_nopt +#define res_nopt_rdata __res_nopt_rdata #define res_ndestroy __res_ndestroy #define res_nametoclass __res_nametoclass #define res_nametotype __res_nametotype @@ -482,6 +484,8 @@ int res_findzonecut2 __P((res_state, co union res_sockaddr_union *, int)); void res_nclose __P((res_state)); int res_nopt __P((res_state, int, u_char *, int, int)); +int res_nopt_rdata __P((res_state, int, u_char *, int, u_char *, + u_short, u_short, u_char *)); void res_send_setqhook __P((res_send_qhook)); void res_send_setrhook __P((res_send_rhook)); int __res_vinit __P((res_state, int)); Modified: vendor/resolver/dist/lib/libc/include/isc/eventlib.h ============================================================================== --- vendor/resolver/dist/lib/libc/include/isc/eventlib.h Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/include/isc/eventlib.h Sun Dec 14 16:47:21 2008 (r186083) @@ -18,7 +18,7 @@ /* eventlib.h - exported interfaces for eventlib * vix 09sep95 [initial] * - * $Id: eventlib.h,v 1.3.18.2 2005/07/28 07:38:07 marka Exp $ + * $Id: eventlib.h,v 1.3.18.3 2008/01/23 02:12:01 marka Exp $ */ #ifndef _EVENTLIB_H @@ -29,6 +29,8 @@ #include #include +#include + #ifndef __P # define __EVENTLIB_P_DEFINED # ifdef __STDC__ Modified: vendor/resolver/dist/lib/libc/inet/inet_net_pton.c ============================================================================== --- vendor/resolver/dist/lib/libc/inet/inet_net_pton.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/inet/inet_net_pton.c Sun Dec 14 16:47:21 2008 (r186083) @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.1 2005/04/27 05:00:53 sra Exp $"; +static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.2 2008/08/26 04:42:43 marka Exp $"; #endif #include "port_before.h" @@ -133,11 +133,11 @@ inet_net_pton_ipv4(const char *src, u_ch INSIST(n >= 0 && n <= 9); bits *= 10; bits += n; + if (bits > 32) + goto enoent; } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch)); if (ch != '\0') goto enoent; - if (bits > 32) - goto emsgsize; } /* Firey death and destruction unless we prefetched EOS. */ Modified: vendor/resolver/dist/lib/libc/inet/inet_network.c ============================================================================== --- vendor/resolver/dist/lib/libc/inet/inet_network.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/inet/inet_network.c Sun Dec 14 16:47:21 2008 (r186083) @@ -84,9 +84,9 @@ again: } if (!digit) return (INADDR_NONE); + if (pp >= parts + 4 || val > 0xffU) + return (INADDR_NONE); if (*cp == '.') { - if (pp >= parts + 4 || val > 0xffU) - return (INADDR_NONE); *pp++ = val, cp++; goto again; } Modified: vendor/resolver/dist/lib/libc/resolv/res_debug.c ============================================================================== --- vendor/resolver/dist/lib/libc/resolv/res_debug.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/resolv/res_debug.c Sun Dec 14 16:47:21 2008 (r186083) @@ -95,7 +95,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_debug.c,v 1.10.18.5 2005/07/28 07:38:11 marka Exp $"; +static const char rcsid[] = "$Id: res_debug.c,v 1.10.18.6 2008/04/03 23:15:15 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -189,10 +189,56 @@ do_section(const res_state statp, p_type(ns_rr_type(rr)), p_class(ns_rr_class(rr))); else if (section == ns_s_ar && ns_rr_type(rr) == ns_t_opt) { + u_int16_t optcode, optlen, rdatalen = ns_rr_rdlen(rr); u_int32_t ttl = ns_rr_ttl(rr); + fprintf(file, "; EDNS: version: %u, udp=%u, flags=%04x\n", (ttl>>16)&0xff, ns_rr_class(rr), ttl&0xffff); + + while (rdatalen >= 4) { + const u_char *cp = ns_rr_rdata(rr); + int i; + + GETSHORT(optcode, cp); + GETSHORT(optlen, cp); + + if (optcode == NS_OPT_NSID) { + fputs("; NSID: ", file); + if (optlen == 0) { + fputs("; NSID\n", file); + } else { + fputs("; NSID: ", file); + for (i = 0; i < optlen; i++) + fprintf(file, "%02x ", + cp[i]); + fputs(" (",file); + for (i = 0; i < optlen; i++) + fprintf(file, "%c", + isprint(cp[i])? + cp[i] : '.'); + fputs(")\n", file); + } + } else { + if (optlen == 0) { + fprintf(file, "; OPT=%u\n", + optcode); + } else { + fprintf(file, "; OPT=%u: ", + optcode); + for (i = 0; i < optlen; i++) + fprintf(file, "%02x ", + cp[i]); + fputs(" (",file); + for (i = 0; i < optlen; i++) + fprintf(file, "%c", + isprint(cp[i]) ? + cp[i] : '.'); + fputs(")\n", file); + } + } + rdatalen -= 4 + optlen; + } } else { n = ns_sprintrr(handle, &rr, NULL, NULL, buf, buflen); @@ -204,7 +250,7 @@ do_section(const res_state statp, buf = malloc(buflen += 1024); if (buf == NULL) { fprintf(file, - ";; memory allocation failure\n"); + ";; memory allocation failure\n"); return; } continue; @@ -381,7 +427,7 @@ const struct res_sym __p_default_section {ns_s_an, "ANSWER", (char *)0}, {ns_s_ns, "AUTHORITY", (char *)0}, {ns_s_ar, "ADDITIONAL", (char *)0}, - {0, (char *)0, (char *)0} + {0, (char *)0, (char *)0} }; const struct res_sym __p_update_section_syms[] = { @@ -389,7 +435,7 @@ const struct res_sym __p_update_section_ {S_PREREQ, "PREREQUISITE", (char *)0}, {S_UPDATE, "UPDATE", (char *)0}, {S_ADDT, "ADDITIONAL", (char *)0}, - {0, (char *)0, (char *)0} + {0, (char *)0, (char *)0} }; const struct res_sym __p_key_syms[] = { @@ -617,6 +663,7 @@ p_option(u_long option) { case RES_USE_INET6: return "inet6"; #ifdef RES_USE_EDNS0 /*%< KAME extension */ case RES_USE_EDNS0: return "edns0"; + case RES_NSID: return "nsid"; #endif #ifdef RES_USE_DNAME case RES_USE_DNAME: return "dname"; Modified: vendor/resolver/dist/lib/libc/resolv/res_mkquery.c ============================================================================== --- vendor/resolver/dist/lib/libc/resolv/res_mkquery.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/resolv/res_mkquery.c Sun Dec 14 16:47:21 2008 (r186083) @@ -70,7 +70,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_mkquery.c,v 1.5.18.1 2005/04/27 05:01:11 sra Exp $"; +static const char rcsid[] = "$Id: res_mkquery.c,v 1.5.18.2 2008/04/03 23:15:15 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -203,9 +203,6 @@ res_nmkquery(res_state statp, #ifdef RES_USE_EDNS0 /* attach OPT pseudo-RR, as documented in RFC2671 (EDNS0). */ -#ifndef T_OPT -#define T_OPT 41 -#endif int res_nopt(res_state statp, @@ -230,13 +227,14 @@ res_nopt(res_state statp, if ((ep - cp) < 1 + RRFIXEDSZ) return (-1); - *cp++ = 0; /*%< "." */ - ns_put16(T_OPT, cp); /*%< TYPE */ + *cp++ = 0; /*%< "." */ + ns_put16(ns_t_opt, cp); /*%< TYPE */ cp += INT16SZ; - ns_put16(anslen & 0xffff, cp); /*%< CLASS = UDP payload size */ + ns_put16(anslen & 0xffff, cp); /*%< CLASS = UDP payload size */ cp += INT16SZ; - *cp++ = NOERROR; /*%< extended RCODE */ - *cp++ = 0; /*%< EDNS version */ + *cp++ = NOERROR; /*%< extended RCODE */ + *cp++ = 0; /*%< EDNS version */ + if (statp->options & RES_USE_DNSSEC) { #ifdef DEBUG if (statp->options & RES_DEBUG) @@ -246,12 +244,60 @@ res_nopt(res_state statp, } ns_put16(flags, cp); cp += INT16SZ; - ns_put16(0, cp); /*%< RDLEN */ + + ns_put16(0U, cp); /*%< RDLEN */ cp += INT16SZ; + hp->arcount = htons(ntohs(hp->arcount) + 1); return (cp - buf); } + +/* + * Construct variable data (RDATA) block for OPT psuedo-RR, append it + * to the buffer, then update the RDLEN field (previously set to zero by + * res_nopt()) with the new RDATA length. + */ +int +res_nopt_rdata(res_state statp, + int n0, /*%< current offset in buffer */ + u_char *buf, /*%< buffer to put query */ + int buflen, /*%< size of buffer */ + u_char *rdata, /*%< ptr to start of opt rdata */ + u_short code, /*%< OPTION-CODE */ + u_short len, /*%< OPTION-LENGTH */ + u_char *data) /*%< OPTION_DATA */ +{ + register u_char *cp, *ep; + +#ifdef DEBUG + if ((statp->options & RES_DEBUG) != 0U) + printf(";; res_nopt_rdata()\n"); +#endif + + cp = buf + n0; + ep = buf + buflen; + + if ((ep - cp) < (4 + len)) + return (-1); + + if (rdata < (buf + 2) || rdata >= ep) + return (-1); + + ns_put16(code, cp); + cp += INT16SZ; + + ns_put16(len, cp); + cp += INT16SZ; + + memcpy(cp, data, len); + cp += len; + + len = cp - rdata; + ns_put16(len, rdata - 2); /* Update RDLEN field */ + + return (cp - buf); +} #endif /*! \file */ Modified: vendor/resolver/dist/lib/libc/resolv/res_query.c ============================================================================== --- vendor/resolver/dist/lib/libc/resolv/res_query.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/resolv/res_query.c Sun Dec 14 16:47:21 2008 (r186083) @@ -70,7 +70,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_query.c,v 1.7.18.1 2005/04/27 05:01:11 sra Exp $"; +static const char rcsid[] = "$Id: res_query.c,v 1.7.18.2 2008/04/03 23:15:15 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -116,8 +116,9 @@ res_nquery(res_state statp, { u_char buf[MAXPACKET]; HEADER *hp = (HEADER *) answer; - int n; u_int oflags; + u_char *rdata; + int n; oflags = statp->_flags; @@ -132,8 +133,14 @@ again: buf, sizeof(buf)); #ifdef RES_USE_EDNS0 if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 && - (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC)) != 0U) + (statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) { n = res_nopt(statp, n, buf, sizeof(buf), anslen); + rdata = &buf[n]; + if (n > 0 && (statp->options & RES_NSID) != 0U) { + n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata, + NS_OPT_NSID, 0, NULL); + } + } #endif if (n <= 0) { #ifdef DEBUG @@ -143,6 +150,7 @@ again: RES_SET_H_ERRNO(statp, NO_RECOVERY); return (n); } + n = res_nsend(statp, buf, n, answer, anslen); if (n < 0) { #ifdef RES_USE_EDNS0 Modified: vendor/resolver/dist/lib/libc/resolv/res_send.c ============================================================================== --- vendor/resolver/dist/lib/libc/resolv/res_send.c Sun Dec 14 16:09:53 2008 (r186082) +++ vendor/resolver/dist/lib/libc/resolv/res_send.c Sun Dec 14 16:47:21 2008 (r186083) @@ -70,7 +70,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_send.c,v 1.9.18.8 2006/10/16 23:00:58 marka Exp $"; +static const char rcsid[] = "$Id: res_send.c,v 1.9.18.10 2008/01/27 02:06:26 marka Exp $"; #endif /* LIBC_SCCS and not lint */ /*! \file @@ -293,7 +293,7 @@ int res_nsend(res_state statp, const u_char *buf, int buflen, u_char *ans, int anssiz) { - int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; + int gotsomewhere, terrno, tries, v_circuit, resplen, ns, n; char abuf[NI_MAXHOST]; #ifdef USE_POLL @@ -405,7 +405,7 @@ res_nsend(res_state statp, /* * Send request, RETRY times, or until successful. */ - for (try = 0; try < statp->retry; try++) { + for (tries = 0; tries < statp->retry; tries++) { for (ns = 0; ns < statp->nscount; ns++) { struct sockaddr *nsap; int nsaplen; @@ -453,7 +453,7 @@ res_nsend(res_state statp, if (v_circuit) { /* Use VC; at most one attempt per server. */ - try = statp->retry; + tries = statp->retry; n = send_vc(statp, buf, buflen, ans, anssiz, &terrno, ns); if (n < 0) @@ -464,7 +464,7 @@ res_nsend(res_state statp, } else { /* Use datagrams. */ n = send_dg(statp, buf, buflen, ans, anssiz, &terrno, - ns, try, &v_circuit, &gotsomewhere); + ns, tries, &v_circuit, &gotsomewhere); if (n < 0) goto fail; if (n == 0) @@ -601,6 +601,9 @@ send_vc(res_state statp, u_short len; u_char *cp; void *tmp; +#ifdef SO_NOSIGPIPE + int on = 1; +#endif nsap = get_nsaddr(statp, ns); nsaplen = get_salen(nsap); @@ -646,6 +649,17 @@ send_vc(res_state statp, return (-1); } } +#ifdef SO_NOSIGPIPE + /* + * Disable generation of SIGPIPE when writing to a closed + * socket. Write should return -1 and set errno to EPIPE + * instead. + * + * Push on even if setsockopt(SO_NOSIGPIPE) fails. + */ + (void)setsockopt(statp->_vcsock, SOL_SOCKET, SO_NOSIGPIPE, &on, + sizeof(on)); +#endif errno = 0; if (connect(statp->_vcsock, nsap, nsaplen) < 0) { *terrno = errno; @@ -773,7 +787,7 @@ send_vc(res_state statp, static int send_dg(res_state statp, const u_char *buf, int buflen, u_char *ans, - int anssiz, int *terrno, int ns, int try, int *v_circuit, + int anssiz, int *terrno, int ns, int tries, int *v_circuit, int *gotsomewhere) { const HEADER *hp = (const HEADER *) buf; @@ -855,7 +869,7 @@ send_dg(res_state statp, const u_char *b /* * Wait for reply. */ - seconds = (statp->retrans << try); + seconds = (statp->retrans << tries); if (ns > 0) seconds /= statp->nscount; if (seconds <= 0) From owner-svn-src-vendor@FreeBSD.ORG Sun Dec 14 16:49:41 2008 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13FE81065670; Sun, 14 Dec 2008 16:49:41 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDA8E8FC16; Sun, 14 Dec 2008 16:49:40 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBEGneeO064058; Sun, 14 Dec 2008 16:49:40 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBEGne20064057; Sun, 14 Dec 2008 16:49:40 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200812141649.mBEGne20064057@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 14 Dec 2008 16:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186084 - vendor/resolver/9.4.3 X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 16:49:41 -0000 Author: ume Date: Sun Dec 14 16:49:40 2008 New Revision: 186084 URL: http://svn.freebsd.org/changeset/base/186084 Log: Tagging for 9.4.3 import. Added: vendor/resolver/9.4.3/ - copied from r186083, vendor/resolver/dist/ From owner-svn-src-vendor@FreeBSD.ORG Sat Dec 20 16:44:44 2008 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D3D1065673; Sat, 20 Dec 2008 16:44:44 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD6F28FC1E; Sat, 20 Dec 2008 16:44:44 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKGiir8008908; Sat, 20 Dec 2008 16:44:44 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKGiiMO008896; Sat, 20 Dec 2008 16:44:44 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <200812201644.mBKGiiMO008896@svn.freebsd.org> From: Hartmut Brandt Date: Sat, 20 Dec 2008 16:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186357 - in vendor/bsnmp: 1.10 1.10/contrib 1.10/gensnmpdef 1.10/gensnmptree 1.10/lib 1.10/snmp_mibII 1.10/snmp_ntp 1.10/snmpd 1.11 1.11/config 1.11/contrib 1.11/gensnmpdef 1.11/gensnm... X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 16:44:44 -0000 Author: harti Date: Sat Dec 20 16:44:43 2008 New Revision: 186357 URL: http://svn.freebsd.org/changeset/base/186357 Log: Flatten bsnmp vendor area. Added: vendor/bsnmp/1.10/NEWS - copied unchanged from r186355, vendor/bsnmp/1.10/contrib/bsnmp/NEWS vendor/bsnmp/1.10/README - copied unchanged from r186355, vendor/bsnmp/1.10/contrib/bsnmp/README vendor/bsnmp/1.10/TODO - copied unchanged from r186355, vendor/bsnmp/1.10/contrib/bsnmp/TODO vendor/bsnmp/1.10/VERSION - copied unchanged from r186355, vendor/bsnmp/1.10/contrib/bsnmp/VERSION vendor/bsnmp/1.10/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.10/gensnmptree/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.10/lib/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/lib/ vendor/bsnmp/1.10/oid-list - copied unchanged from r186355, vendor/bsnmp/1.10/contrib/bsnmp/oid-list vendor/bsnmp/1.10/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.10/snmp_ntp/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/1.10/snmpd/ - copied from r186355, vendor/bsnmp/1.10/contrib/bsnmp/snmpd/ vendor/bsnmp/1.11/Makefile.in - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/Makefile.in vendor/bsnmp/1.11/NEWS - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/NEWS vendor/bsnmp/1.11/README - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/README vendor/bsnmp/1.11/TODO - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/TODO vendor/bsnmp/1.11/VERSION - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/VERSION vendor/bsnmp/1.11/acinclude.m4 - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/acinclude.m4 vendor/bsnmp/1.11/aclocal.m4 - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/aclocal.m4 vendor/bsnmp/1.11/config/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/config/ vendor/bsnmp/1.11/configure - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/configure vendor/bsnmp/1.11/configure.ac - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/configure.ac vendor/bsnmp/1.11/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.11/gensnmptree/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.11/lib/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/lib/ vendor/bsnmp/1.11/oid-list - copied unchanged from r186355, vendor/bsnmp/1.11/contrib/bsnmp/oid-list vendor/bsnmp/1.11/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.11/snmp_ntp/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/1.11/snmpd/ - copied from r186355, vendor/bsnmp/1.11/contrib/bsnmp/snmpd/ vendor/bsnmp/1.12/NEWS - copied unchanged from r186355, vendor/bsnmp/1.12/contrib/bsnmp/NEWS vendor/bsnmp/1.12/README - copied unchanged from r186355, vendor/bsnmp/1.12/contrib/bsnmp/README vendor/bsnmp/1.12/TODO - copied unchanged from r186355, vendor/bsnmp/1.12/contrib/bsnmp/TODO vendor/bsnmp/1.12/VERSION - copied unchanged from r186355, vendor/bsnmp/1.12/contrib/bsnmp/VERSION vendor/bsnmp/1.12/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.12/gensnmptree/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.12/lib/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/lib/ vendor/bsnmp/1.12/oid-list - copied unchanged from r186355, vendor/bsnmp/1.12/contrib/bsnmp/oid-list vendor/bsnmp/1.12/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.12/snmp_ntp/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/1.12/snmpd/ - copied from r186355, vendor/bsnmp/1.12/contrib/bsnmp/snmpd/ vendor/bsnmp/1.4/NEWS - copied unchanged from r186355, vendor/bsnmp/1.4/contrib/bsnmp/NEWS vendor/bsnmp/1.4/README - copied unchanged from r186355, vendor/bsnmp/1.4/contrib/bsnmp/README vendor/bsnmp/1.4/TODO - copied unchanged from r186355, vendor/bsnmp/1.4/contrib/bsnmp/TODO vendor/bsnmp/1.4/VERSION - copied unchanged from r186355, vendor/bsnmp/1.4/contrib/bsnmp/VERSION vendor/bsnmp/1.4/gensnmptree/ - copied from r186355, vendor/bsnmp/1.4/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.4/lib/ - copied from r186355, vendor/bsnmp/1.4/contrib/bsnmp/lib/ vendor/bsnmp/1.4/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.4/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.4/snmpd/ - copied from r186355, vendor/bsnmp/1.4/contrib/bsnmp/snmpd/ vendor/bsnmp/1.5a/FREEBSD-upgrade - copied unchanged from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/FREEBSD-upgrade vendor/bsnmp/1.5a/NEWS - copied unchanged from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/NEWS vendor/bsnmp/1.5a/README - copied unchanged from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/README vendor/bsnmp/1.5a/TODO - copied unchanged from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/TODO vendor/bsnmp/1.5a/VERSION - copied unchanged from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/VERSION vendor/bsnmp/1.5a/gensnmptree/ - copied from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.5a/lib/ - copied from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/lib/ vendor/bsnmp/1.5a/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.5a/snmpd/ - copied from r186355, vendor/bsnmp/1.5a/contrib/bsnmp/snmpd/ vendor/bsnmp/1.6/NEWS - copied unchanged from r186355, vendor/bsnmp/1.6/contrib/bsnmp/NEWS vendor/bsnmp/1.6/README - copied unchanged from r186355, vendor/bsnmp/1.6/contrib/bsnmp/README vendor/bsnmp/1.6/TODO - copied unchanged from r186355, vendor/bsnmp/1.6/contrib/bsnmp/TODO vendor/bsnmp/1.6/VERSION - copied unchanged from r186355, vendor/bsnmp/1.6/contrib/bsnmp/VERSION vendor/bsnmp/1.6/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.6/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.6/gensnmptree/ - copied from r186355, vendor/bsnmp/1.6/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.6/lib/ - copied from r186355, vendor/bsnmp/1.6/contrib/bsnmp/lib/ vendor/bsnmp/1.6/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.6/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.6/snmpd/ - copied from r186355, vendor/bsnmp/1.6/contrib/bsnmp/snmpd/ vendor/bsnmp/1.7/NEWS - copied unchanged from r186355, vendor/bsnmp/1.7/contrib/bsnmp/NEWS vendor/bsnmp/1.7/README - copied unchanged from r186355, vendor/bsnmp/1.7/contrib/bsnmp/README vendor/bsnmp/1.7/TODO - copied unchanged from r186355, vendor/bsnmp/1.7/contrib/bsnmp/TODO vendor/bsnmp/1.7/VERSION - copied unchanged from r186355, vendor/bsnmp/1.7/contrib/bsnmp/VERSION vendor/bsnmp/1.7/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.7/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.7/gensnmptree/ - copied from r186355, vendor/bsnmp/1.7/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.7/lib/ - copied from r186355, vendor/bsnmp/1.7/contrib/bsnmp/lib/ vendor/bsnmp/1.7/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.7/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.7/snmpd/ - copied from r186355, vendor/bsnmp/1.7/contrib/bsnmp/snmpd/ vendor/bsnmp/1.8/NEWS - copied unchanged from r186355, vendor/bsnmp/1.8/contrib/bsnmp/NEWS vendor/bsnmp/1.8/README - copied unchanged from r186355, vendor/bsnmp/1.8/contrib/bsnmp/README vendor/bsnmp/1.8/TODO - copied unchanged from r186355, vendor/bsnmp/1.8/contrib/bsnmp/TODO vendor/bsnmp/1.8/VERSION - copied unchanged from r186355, vendor/bsnmp/1.8/contrib/bsnmp/VERSION vendor/bsnmp/1.8/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.8/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.8/gensnmptree/ - copied from r186355, vendor/bsnmp/1.8/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.8/lib/ - copied from r186355, vendor/bsnmp/1.8/contrib/bsnmp/lib/ vendor/bsnmp/1.8/oid-list - copied unchanged from r186355, vendor/bsnmp/1.8/contrib/bsnmp/oid-list vendor/bsnmp/1.8/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.8/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.8/snmpd/ - copied from r186355, vendor/bsnmp/1.8/contrib/bsnmp/snmpd/ vendor/bsnmp/1.9/NEWS - copied unchanged from r186355, vendor/bsnmp/1.9/contrib/bsnmp/NEWS vendor/bsnmp/1.9/README - copied unchanged from r186355, vendor/bsnmp/1.9/contrib/bsnmp/README vendor/bsnmp/1.9/TODO - copied unchanged from r186355, vendor/bsnmp/1.9/contrib/bsnmp/TODO vendor/bsnmp/1.9/VERSION - copied unchanged from r186355, vendor/bsnmp/1.9/contrib/bsnmp/VERSION vendor/bsnmp/1.9/gensnmpdef/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/1.9/gensnmptree/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/gensnmptree/ vendor/bsnmp/1.9/lib/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/lib/ vendor/bsnmp/1.9/oid-list - copied unchanged from r186355, vendor/bsnmp/1.9/contrib/bsnmp/oid-list vendor/bsnmp/1.9/snmp_mibII/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/1.9/snmp_ntp/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/1.9/snmpd/ - copied from r186355, vendor/bsnmp/1.9/contrib/bsnmp/snmpd/ vendor/bsnmp/dist/Makefile.in - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/Makefile.in vendor/bsnmp/dist/NEWS - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/NEWS vendor/bsnmp/dist/README - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/README vendor/bsnmp/dist/TODO - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/TODO vendor/bsnmp/dist/VERSION - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/VERSION vendor/bsnmp/dist/acinclude.m4 - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/acinclude.m4 vendor/bsnmp/dist/aclocal.m4 - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/aclocal.m4 vendor/bsnmp/dist/config/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/config/ vendor/bsnmp/dist/configure - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/configure vendor/bsnmp/dist/configure.ac - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/configure.ac vendor/bsnmp/dist/gensnmpdef/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/dist/gensnmptree/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/gensnmptree/ vendor/bsnmp/dist/lib/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/lib/ vendor/bsnmp/dist/oid-list - copied unchanged from r186355, vendor/bsnmp/dist/contrib/bsnmp/oid-list vendor/bsnmp/dist/snmp_mibII/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/dist/snmp_ntp/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/dist/snmpd/ - copied from r186355, vendor/bsnmp/dist/contrib/bsnmp/snmpd/ vendor/bsnmp/syrinx_20080307_bugfix/Makefile.in - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/Makefile.in vendor/bsnmp/syrinx_20080307_bugfix/NEWS - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/NEWS vendor/bsnmp/syrinx_20080307_bugfix/README - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/README vendor/bsnmp/syrinx_20080307_bugfix/TODO - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/TODO vendor/bsnmp/syrinx_20080307_bugfix/VERSION - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/VERSION vendor/bsnmp/syrinx_20080307_bugfix/acinclude.m4 - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/acinclude.m4 vendor/bsnmp/syrinx_20080307_bugfix/aclocal.m4 - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/aclocal.m4 vendor/bsnmp/syrinx_20080307_bugfix/config/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/config/ vendor/bsnmp/syrinx_20080307_bugfix/configure - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/configure vendor/bsnmp/syrinx_20080307_bugfix/configure.ac - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/configure.ac vendor/bsnmp/syrinx_20080307_bugfix/gensnmpdef/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/gensnmpdef/ vendor/bsnmp/syrinx_20080307_bugfix/gensnmptree/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/gensnmptree/ vendor/bsnmp/syrinx_20080307_bugfix/lib/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/lib/ vendor/bsnmp/syrinx_20080307_bugfix/oid-list - copied unchanged from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/oid-list vendor/bsnmp/syrinx_20080307_bugfix/snmp_mibII/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/snmp_mibII/ vendor/bsnmp/syrinx_20080307_bugfix/snmp_ntp/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/snmp_ntp/ vendor/bsnmp/syrinx_20080307_bugfix/snmpd/ - copied from r186355, vendor/bsnmp/syrinx_20080307_bugfix/contrib/bsnmp/snmpd/ Deleted: vendor/bsnmp/1.10/contrib/ vendor/bsnmp/1.11/contrib/ vendor/bsnmp/1.12/contrib/ vendor/bsnmp/1.4/contrib/ vendor/bsnmp/1.5a/contrib/ vendor/bsnmp/1.6/contrib/ vendor/bsnmp/1.7/contrib/ vendor/bsnmp/1.8/contrib/ vendor/bsnmp/1.9/contrib/ vendor/bsnmp/dist/contrib/ vendor/bsnmp/syrinx_20080307_bugfix/contrib/ Copied: vendor/bsnmp/1.10/NEWS (from r186355, vendor/bsnmp/1.10/contrib/bsnmp/NEWS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.10/NEWS Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.10/contrib/bsnmp/NEWS) @@ -0,0 +1,142 @@ +1.10 + Change all the tick handling in the daemon from 32-bit to 64-bit. + Bump the modules' major version number to 3. + + snmp_dialog: make the syntax of the variable bindings in the outgoing + message SNMP_SYNTAX_NULL regardless of the syntax given by the user. + + Fix an error in timer handling in the LIBBEGEMOT case. + + snmpd/main.c: Fix a 64-bit warning. + + lib/snmpclient: Add snmp_parse_server(). + +1.9 + tcpwrapper support from glebius@freebsd.org. + + crude interface to NTP: snmp_ntp + +1.8 + many man page fixes from ru@freebsd.org and tobez@freebsd.org + + snmpd/main.c: fix a problem which resulted in the daemon exiting + when a local socket was closed. + + snmpd/trans_lsock.c: include stdio.h to get a prototype for remove. + + gensnmptree/gensnmptree.c: fix a compile error + + snmp_mibII: add new field spec_oid to ifmib. This allows ifType + specific modules to insert the value to be returned for ifSpecific. + +1.7a + fix core dump when config file cannot be opened (submitted by + Maxim Konovalov) + +1.7 + snmpd: Move event library initialisation before reading of + config file (thanks to phk). + + gensnmptree: can now read more than one tree and merge them. + + some support for compilation on older systems + + use standard C fixed width integer types [u]intNN_t + +1.6 + New gensnmpdef tool. Needs libsmi. + + Make build infrastructure more intelligent. + + Fix a typo in the mibII counter retrival code. + + Add a new field to struct snmp_node for snmp agents: tree_data. + This field can be used by the application. + + Fix a syntax error in the example configuration file (thanks to + David J Duchscher). + + Fix a long standing problem with the module loading code + and a memory leak. When a module could not be loaded usually + a core dump was generated. This was caused by wrong handling + of malloced memory in the module table dependency. While + fixing this problem it became obvious that dynamic allocated + data which was held in a dependency could be lost, because + there was no guarantee that the dependency handler ever was + call (in case of an error in a SET handler or an earlier + dependency in the same PDU) thus causing this memory to leak. + To fix this a third dependency operation is introduced + SNMP_DEPOP_FINISH which is invoked just before a dependency + is freed at the very end of the SET PDU handling. This + means also that finalizers (set_atfinish) can be converted + to DEPOP_FINISH handler in almost all cases. The only case + where this is not so easy is when a finializer was registered + for a simple SET operation. In this case an artifical dependency + would be needed. Because this seems to occure very seldom the + snmp_set_atfinish() call is removed. Thanks to Paul-Henning Kamp + for an initial fix for the core dump. + +09-Dec-2003 + First step on factoring out the transport mapping stuff into + loadable modules. + + Local stream sockets that check the clients privileges. + +03-Dec-2003 + Bump version to 1.5 but leave library version intact. + +03-Dec-2003 + Now works with libbegemot polling stuff instead of libisc. + Use --with-libbegemot[=path] to configure. + +03-Dec-2003 + Fix parsing of non-minimal ASN.1 integers. They are now disallowed. + Non-minimal lengths are allowed. + + Remove copyright clause 3 everywhere. + + Make an autoconf build infrastructure. + +08-Nov-2003 + WARNS=6 fixed. + +28-Jan-2003 + WARNS=5 fixes. + +09-Jan-2003 + snmpd: remove local socket in case of an error to fully initialize it. + Use chmod instead of fchmod. The latter seems not really to change + the mode of the socket. + + lib: at program exit remove the local socket in the library. + +11-Dec-2002 + Implement listening on unix domain sockets. The client must bind + its socket, or the server cannot send back its response. These + sockets are considered to be more secure, because it is much + harder for an intruder to listen on them. + + This requires changes in snmpmod.h and snmpclient.h. + +04-Dec-2002 + Sparc fixes. + +15-Aug-2002 + Use inttypes.h instead of limits.h to get integer limits. This + seems to be the Posix way. + + First drafts of an snmpd, gensnmptree, asn1, bsnmplib, + bsnmpclient, bsnmpagent, snmpmod, snmp_mibII, snmp_netgraph man pages. + + snmpd/main.c: reorder getopt options according to style(9). Implement + a -h option to print a short help. + +25-Jun-2002 + Makefiles rewritten to not use bsnmpmod.mk. The BSD makefiles are + really hard to use, because a) they are not documented and b) they + change much too often. + + Make the patch a context diff instead of a unified one. + +28-Feb-2002 + Library code for SNMP clients. Copied: vendor/bsnmp/1.10/README (from r186355, vendor/bsnmp/1.10/contrib/bsnmp/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.10/README Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.10/contrib/bsnmp/README) @@ -0,0 +1,65 @@ +Fri Dec 5 15:01:16 CET 2003 + +This is a mini-SNMP daemon. The basic daemon implements the system group +and a number of private extensions to manage the UDP transport mapping, +communities, trap destinations and loadable modules. In this form it can +be used to provide remote access to arbitrary data that can be described in +the form as required by the SMI. The daemon speaks both SNMPv1 and SNMPv2c. + +One basic loadable module is provided together with the daemon: + +- snmp_mibII provides the information groups for ip, tcp, and udp. + +Installation +------------ + +As usual by doing: + + configure [--with-libbegemot[=path]] + make + make install + +This does not install a configuration file. The standard location for the +configuration is /etc/snmpd.config, but can be overwritten on the command +line. An example configuration file is provided. Use --with-libbegemot +to use libbegemot instead of libisc. + +Running +------- + + snmpd [-m name[=value]] [-p pid-file] [-c config-file] [-d] [-l prefix] + [-D debug-flags] [-I path] + + -m defines a configuration macro. If no value is given it + is set to the empty string. + + -p specify the file where to store the PID. Default is + /var/run/{prefix}.pid. + + -c specify the configuration file. Default is /etc/{prefix}.config. + + -d don't go into daemon mode. + + -l specify the prefix. This is used for the default config and + pid file names and for the syslog. Default is "snmpd". + + -D specify debug flags: + + d dump all PDUs. + + e debug event library. + + -I specify the include path for system configuration files. + Default is /etc:/usr/etc:/usr/local/etc. + +The directory snmpd contains a snmpd.sh script, which can be copied to +/usr/local/etc/rc.d to automatically start and stop the daemon. snmpd.config +is an example config script. + +Bug reports: +----------- + +Please report bugs to harti@freebsd.org. + +Happy hacking, +harti Copied: vendor/bsnmp/1.10/TODO (from r186355, vendor/bsnmp/1.10/contrib/bsnmp/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.10/TODO Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.10/contrib/bsnmp/TODO) @@ -0,0 +1,17 @@ +snmpd_mibII: + - handle HC counters by periodically polling the kernel counters. + +snmpd: + - rethink transports a little bit: make them loadable and make + a private subtree for transports: + OK. Table not writeable yet. + + There should be a transport table that is indexed by the transport name. + This table can be used to load/unload transports at run time. + OK. Table not writeable yet. + + Then there can be a port table that is indexed by transport name and + port name. Plus a transport-specific table indexed by port name only. + + The transport table could contain a column of type OID that points + to the transport-specific table. Copied: vendor/bsnmp/1.10/VERSION (from r186355, vendor/bsnmp/1.10/contrib/bsnmp/VERSION) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.10/VERSION Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.10/contrib/bsnmp/VERSION) @@ -0,0 +1 @@ +1.10 Copied: vendor/bsnmp/1.10/oid-list (from r186355, vendor/bsnmp/1.10/contrib/bsnmp/oid-list) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.10/oid-list Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.10/contrib/bsnmp/oid-list) @@ -0,0 +1,23 @@ +$Begemot: bsnmp/oid-list,v 1.3 2005/05/23 09:03:22 brandt_h Exp $ + +This file documents the OID assignments under BSNMP's private OID. + +While I was at Fraunhofer Fokus (www.fokus.fraunhofer.de) I registered +an official OID for Fokus: enterprises 12325 and assigned the sub-OID 1 +to the software I develop. Under this OID there are: + +enterprises + 12325 FOKUS + 1 BEGEMOT + 1 BEGEMOT-SNMPD + 2 BEGEMOT-NETGRAPH snmpd netgraph module + 100 BEGEMOT-ILMID snmpd ILMID module + 101 BEGEMOT-ATM snmpd ATM module + 200 BEGEMOT-PF snmpd PF module (phillip@freebsd.org) + 201 BEGEMOT-NTP snmpd NTP module + 300 BEGEMOT-ACM DLR ACM project + +If you need an OID and don't know where to stuck it in, I can assign you one - +just drop me a mail. + +harti Copied: vendor/bsnmp/1.11/Makefile.in (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/Makefile.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/Makefile.in Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/Makefile.in) @@ -0,0 +1,38 @@ +# Copyright (c) 2001-2003 +# Fraunhofer Institute for Open Communication Systems (FhG Fokus). +# All rights reserved. +# +# Author: Harti Brandt +# +# $Begemot: bsnmp/Makefile.in,v 1.4 2005/10/04 11:21:22 brandt_h Exp $ +# + +SUBDIR= lib gensnmptree snmpd snmp_mibII snmp_ntp + +ifeq "$(HAVE_LIBSMI)" "yes" +SUBDIR += gensnmpdef +endif + +all: + +@for f in $(SUBDIR) ; do \ + echo "==> $$f" ; \ + if ! $(SUBMAKE) -C $$f all ; then \ + break ; \ + fi ; \ + done + +install: + +@for f in $(SUBDIR) ; do \ + echo "==> $$f" ; \ + if ! $(SUBMAKE) -C $$f install ; then \ + break ; \ + fi ; \ + done + +clean: + +@for f in $(SUBDIR) ; do \ + echo "==> $$f" ; \ + if ! $(SUBMAKE) -C $$f clean ; then \ + break ; \ + fi ; \ + done Copied: vendor/bsnmp/1.11/NEWS (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/NEWS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/NEWS Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/NEWS) @@ -0,0 +1,164 @@ +1.11 Make the Mib2 routing table use red-black tree. This vastly + reduces loading and access time. Load the table only every 10 + minutes. In the meantime process message from the routing socket + to update the table. + + Lot of man-page fixes from ru@freebsd.org. + + Fixes to command line macros and macro redefinition. + + Trap variables for ntp (still need trap definition and code). + + Periodic timers from Victor Cruceru. + + Man-page fixes from Christian Brueffer. + + Lots of spelling fixes from Giorgios Keramidas. + + A number of changes to facilitate building on FreeBSD-4 from + Andrey Elsukov. + + Add repeatable timers. + +1.10 + Change all the tick handling in the daemon from 32-bit to 64-bit. + Bump the modules' major version number to 3. + + snmp_dialog: make the syntax of the variable bindings in the outgoing + message SNMP_SYNTAX_NULL regardless of the syntax given by the user. + + Fix an error in timer handling in the LIBBEGEMOT case. + + snmpd/main.c: Fix a 64-bit warning. + + lib/snmpclient: Add snmp_parse_server(). + +1.9 + tcpwrapper support from glebius@freebsd.org. + + crude interface to NTP: snmp_ntp + +1.8 + many man page fixes from ru@freebsd.org and tobez@freebsd.org + + snmpd/main.c: fix a problem which resulted in the daemon exiting + when a local socket was closed. + + snmpd/trans_lsock.c: include stdio.h to get a prototype for remove. + + gensnmptree/gensnmptree.c: fix a compile error + + snmp_mibII: add new field spec_oid to ifmib. This allows ifType + specific modules to insert the value to be returned for ifSpecific. + +1.7a + fix core dump when config file cannot be opened (submitted by + Maxim Konovalov) + +1.7 + snmpd: Move event library initialization before reading of + config file (thanks to phk). + + gensnmptree: can now read more than one tree and merge them. + + some support for compilation on older systems + + use standard C fixed width integer types [u]intNN_t + +1.6 + New gensnmpdef tool. Needs libsmi. + + Make build infrastructure more intelligent. + + Fix a typo in the mibII counter retrival code. + + Add a new field to struct snmp_node for snmp agents: tree_data. + This field can be used by the application. + + Fix a syntax error in the example configuration file (thanks to + David J Duchscher). + + Fix a long standing problem with the module loading code + and a memory leak. When a module could not be loaded usually + a core dump was generated. This was caused by wrong handling + of malloced memory in the module table dependency. While + fixing this problem it became obvious that dynamic allocated + data which was held in a dependency could be lost, because + there was no guarantee that the dependency handler ever was + call (in case of an error in a SET handler or an earlier + dependency in the same PDU) thus causing this memory to leak. + To fix this a third dependency operation is introduced + SNMP_DEPOP_FINISH which is invoked just before a dependency + is freed at the very end of the SET PDU handling. This + means also that finalizers (set_atfinish) can be converted + to DEPOP_FINISH handler in almost all cases. The only case + where this is not so easy is when a finializer was registered + for a simple SET operation. In this case an artifical dependency + would be needed. Because this seems to occure very seldom the + snmp_set_atfinish() call is removed. Thanks to Paul-Henning Kamp + for an initial fix for the core dump. + +09-Dec-2003 + First step on factoring out the transport mapping stuff into + loadable modules. + + Local stream sockets that check the clients privileges. + +03-Dec-2003 + Bump version to 1.5 but leave library version intact. + +03-Dec-2003 + Now works with libbegemot polling stuff instead of libisc. + Use --with-libbegemot[=path] to configure. + +03-Dec-2003 + Fix parsing of non-minimal ASN.1 integers. They are now disallowed. + Non-minimal lengths are allowed. + + Remove copyright clause 3 everywhere. + + Make an autoconf build infrastructure. + +08-Nov-2003 + WARNS=6 fixed. + +28-Jan-2003 + WARNS=5 fixes. + +09-Jan-2003 + snmpd: remove local socket in case of an error to fully initialize it. + Use chmod instead of fchmod. The latter seems not really to change + the mode of the socket. + + lib: at program exit remove the local socket in the library. + +11-Dec-2002 + Implement listening on unix domain sockets. The client must bind + its socket, or the server cannot send back its response. These + sockets are considered to be more secure, because it is much + harder for an intruder to listen on them. + + This requires changes in snmpmod.h and snmpclient.h. + +04-Dec-2002 + Sparc fixes. + +15-Aug-2002 + Use inttypes.h instead of limits.h to get integer limits. This + seems to be the Posix way. + + First drafts of an snmpd, gensnmptree, asn1, bsnmplib, + bsnmpclient, bsnmpagent, snmpmod, snmp_mibII, snmp_netgraph man pages. + + snmpd/main.c: reorder getopt options according to style(9). Implement + a -h option to print a short help. + +25-Jun-2002 + Makefiles rewritten to not use bsnmpmod.mk. The BSD makefiles are + really hard to use, because a) they are not documented and b) they + change much too often. + + Make the patch a context diff instead of a unified one. + +28-Feb-2002 + Library code for SNMP clients. Copied: vendor/bsnmp/1.11/README (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/README Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/README) @@ -0,0 +1,65 @@ +Fri Dec 5 15:01:16 CET 2003 + +This is a mini-SNMP daemon. The basic daemon implements the system group +and a number of private extensions to manage the UDP transport mapping, +communities, trap destinations and loadable modules. In this form it can +be used to provide remote access to arbitrary data that can be described in +the form as required by the SMI. The daemon speaks both SNMPv1 and SNMPv2c. + +One basic loadable module is provided together with the daemon: + +- snmp_mibII provides the information groups for ip, tcp, and udp. + +Installation +------------ + +As usual by doing: + + configure [--with-libbegemot[=path]] + make + make install + +This does not install a configuration file. The standard location for the +configuration is /etc/snmpd.config, but can be overwritten on the command +line. An example configuration file is provided. Use --with-libbegemot +to use libbegemot instead of libisc. + +Running +------- + + snmpd [-m name[=value]] [-p pid-file] [-c config-file] [-d] [-l prefix] + [-D debug-flags] [-I path] + + -m defines a configuration macro. If no value is given it + is set to the empty string. + + -p specify the file where to store the PID. Default is + /var/run/{prefix}.pid. + + -c specify the configuration file. Default is /etc/{prefix}.config. + + -d don't go into daemon mode. + + -l specify the prefix. This is used for the default config and + pid file names and for the syslog. Default is "snmpd". + + -D specify debug flags: + + d dump all PDUs. + + e debug event library. + + -I specify the include path for system configuration files. + Default is /etc:/usr/etc:/usr/local/etc. + +The directory snmpd contains a snmpd.sh script, which can be copied to +/usr/local/etc/rc.d to automatically start and stop the daemon. snmpd.config +is an example config script. + +Bug reports: +----------- + +Please report bugs to harti@freebsd.org. + +Happy hacking, +harti Copied: vendor/bsnmp/1.11/TODO (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/TODO Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/TODO) @@ -0,0 +1,17 @@ +snmpd_mibII: + - handle HC counters by periodically polling the kernel counters. + +snmpd: + - rethink transports a little bit: make them loadable and make + a private subtree for transports: + OK. Table not writeable yet. + + There should be a transport table that is indexed by the transport name. + This table can be used to load/unload transports at run time. + OK. Table not writeable yet. + + Then there can be a port table that is indexed by transport name and + port name. Plus a transport-specific table indexed by port name only. + + The transport table could contain a column of type OID that points + to the transport-specific table. Copied: vendor/bsnmp/1.11/VERSION (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/VERSION) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/VERSION Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/VERSION) @@ -0,0 +1 @@ +1.11 Copied: vendor/bsnmp/1.11/acinclude.m4 (from r186355, vendor/bsnmp/1.11/contrib/bsnmp/acinclude.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bsnmp/1.11/acinclude.m4 Sat Dec 20 16:44:43 2008 (r186357, copy of r186355, vendor/bsnmp/1.11/contrib/bsnmp/acinclude.m4) @@ -0,0 +1,5867 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +## Copyright 1996, 1997, 1998, 1999, 2000, 2001 +## Free Software Foundation, Inc. +## Originally by Gordon Matzigkeit , 1996 +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +## +## As a special exception to the GNU General Public License, if you +## distribute this file as part of a program that contains a +## configuration script generated by Autoconf, you may include it under +## the same distribution terms that you use for the rest of that program. + +# serial 47 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Sat Dec 20 17:15:57 2008 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C562106564A; Sat, 20 Dec 2008 17:15:57 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 490CE8FC0C; Sat, 20 Dec 2008 17:15:57 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKHFue5009489; Sat, 20 Dec 2008 17:15:56 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKHFucC009488; Sat, 20 Dec 2008 17:15:56 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <200812201715.mBKHFucC009488@svn.freebsd.org> From: Hartmut Brandt Date: Sat, 20 Dec 2008 17:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186358 - in vendor/bsnmp/dist: . config gensnmpdef gensnmptree lib snmp_mibII snmp_ntp snmpd X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 17:15:57 -0000 Author: harti Date: Sat Dec 20 17:15:56 2008 New Revision: 186358 URL: http://svn.freebsd.org/changeset/base/186358 Log: Remove the svn:keywords property. Modified: vendor/bsnmp/dist/Makefile.in (props changed) vendor/bsnmp/dist/NEWS (props changed) vendor/bsnmp/dist/README (props changed) vendor/bsnmp/dist/TODO (props changed) vendor/bsnmp/dist/VERSION (props changed) vendor/bsnmp/dist/acinclude.m4 (props changed) vendor/bsnmp/dist/aclocal.m4 (props changed) vendor/bsnmp/dist/config/Makefile.build (props changed) vendor/bsnmp/dist/config/Makefile.post (props changed) vendor/bsnmp/dist/config/Makefile.pre (props changed) vendor/bsnmp/dist/config/config.guess (props changed) vendor/bsnmp/dist/config/config.sub (props changed) vendor/bsnmp/dist/config/install.sh (props changed) vendor/bsnmp/dist/config/ltmain.sh (props changed) vendor/bsnmp/dist/config/mkinstalldirs (props changed) vendor/bsnmp/dist/configure (props changed) vendor/bsnmp/dist/configure.ac (props changed) vendor/bsnmp/dist/gensnmpdef/Makefile.in (props changed) vendor/bsnmp/dist/gensnmpdef/gensnmpdef.1 (props changed) vendor/bsnmp/dist/gensnmpdef/gensnmpdef.c (props changed) vendor/bsnmp/dist/gensnmptree/Makefile.in (props changed) vendor/bsnmp/dist/gensnmptree/gensnmptree.1 (props changed) vendor/bsnmp/dist/gensnmptree/gensnmptree.c (props changed) vendor/bsnmp/dist/lib/Makefile.in (props changed) vendor/bsnmp/dist/lib/asn1.3 (props changed) vendor/bsnmp/dist/lib/asn1.c (props changed) vendor/bsnmp/dist/lib/asn1.h (props changed) vendor/bsnmp/dist/lib/bsnmpagent.3 (props changed) vendor/bsnmp/dist/lib/bsnmpclient.3 (props changed) vendor/bsnmp/dist/lib/bsnmplib.3 (props changed) vendor/bsnmp/dist/lib/snmp.c (props changed) vendor/bsnmp/dist/lib/snmp.h (props changed) vendor/bsnmp/dist/lib/snmpagent.c (props changed) vendor/bsnmp/dist/lib/snmpagent.h (props changed) vendor/bsnmp/dist/lib/snmpclient.c (props changed) vendor/bsnmp/dist/lib/snmpclient.h (props changed) vendor/bsnmp/dist/lib/snmppriv.h (props changed) vendor/bsnmp/dist/lib/support.c (props changed) vendor/bsnmp/dist/lib/support.h (props changed) vendor/bsnmp/dist/oid-list (props changed) vendor/bsnmp/dist/snmp_mibII/BEGEMOT-IP-MIB.txt (props changed) vendor/bsnmp/dist/snmp_mibII/BEGEMOT-MIB2-MIB.txt (props changed) vendor/bsnmp/dist/snmp_mibII/mibII.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII.h (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_begemot.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_ifmib.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_ifstack.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_interfaces.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_ip.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_ipaddr.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_nettomedia.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_rcvaddr.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_route.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_tcp.c (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_tree.def (props changed) vendor/bsnmp/dist/snmp_mibII/mibII_udp.c (props changed) vendor/bsnmp/dist/snmp_mibII/snmp_mibII.3 (props changed) vendor/bsnmp/dist/snmp_mibII/snmp_mibII.h (props changed) vendor/bsnmp/dist/snmp_ntp/BEGEMOT-NTP-MIB.txt (props changed) vendor/bsnmp/dist/snmp_ntp/Makefile.in (props changed) vendor/bsnmp/dist/snmp_ntp/NTP-MIB.txt (props changed) vendor/bsnmp/dist/snmp_ntp/NTP-PROXY-MIB.txt (props changed) vendor/bsnmp/dist/snmp_ntp/ntp_tree.def (props changed) vendor/bsnmp/dist/snmp_ntp/snmp_ntp.c (props changed) vendor/bsnmp/dist/snmpd/.gdbinit (props changed) vendor/bsnmp/dist/snmpd/BEGEMOT-MIB.txt (props changed) vendor/bsnmp/dist/snmpd/BEGEMOT-SNMPD.txt (props changed) vendor/bsnmp/dist/snmpd/FOKUS-MIB.txt (props changed) vendor/bsnmp/dist/snmpd/Makefile.in (props changed) vendor/bsnmp/dist/snmpd/action.c (props changed) vendor/bsnmp/dist/snmpd/bsnmpd.1 (props changed) vendor/bsnmp/dist/snmpd/config.c (props changed) vendor/bsnmp/dist/snmpd/export.c (props changed) vendor/bsnmp/dist/snmpd/main.c (props changed) vendor/bsnmp/dist/snmpd/snmpd.config (props changed) vendor/bsnmp/dist/snmpd/snmpd.h (props changed) vendor/bsnmp/dist/snmpd/snmpd.sh (props changed) vendor/bsnmp/dist/snmpd/snmpmod.3 (props changed) vendor/bsnmp/dist/snmpd/snmpmod.h (props changed) vendor/bsnmp/dist/snmpd/trans_lsock.c (props changed) vendor/bsnmp/dist/snmpd/trans_lsock.h (props changed) vendor/bsnmp/dist/snmpd/trans_udp.c (props changed) vendor/bsnmp/dist/snmpd/trans_udp.h (props changed) vendor/bsnmp/dist/snmpd/trap.c (props changed) vendor/bsnmp/dist/snmpd/tree.def (props changed) From owner-svn-src-vendor@FreeBSD.ORG Sat Dec 20 17:30:32 2008 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 635461065674; Sat, 20 Dec 2008 17:30:32 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8EF8FC2A; Sat, 20 Dec 2008 17:30:32 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKHUWXw009826; Sat, 20 Dec 2008 17:30:32 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKHUWM5009821; Sat, 20 Dec 2008 17:30:32 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <200812201730.mBKHUWM5009821@svn.freebsd.org> From: Hartmut Brandt Date: Sat, 20 Dec 2008 17:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186360 - in vendor/libbegemot: 1.1.1 1.1.1/contrib dist dist/contrib X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 17:30:32 -0000 Author: harti Date: Sat Dec 20 17:30:32 2008 New Revision: 186360 URL: http://svn.freebsd.org/changeset/base/186360 Log: Flatten the libbegemot vendor area. Added: vendor/libbegemot/1.1.1/rpoll.c - copied unchanged from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.c vendor/libbegemot/1.1.1/rpoll.h - copied unchanged from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.h vendor/libbegemot/1.1.1/rpoll.man - copied unchanged from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.man vendor/libbegemot/dist/rpoll.c - copied unchanged from r186358, vendor/libbegemot/dist/contrib/libbegemot/rpoll.c vendor/libbegemot/dist/rpoll.h - copied unchanged from r186358, vendor/libbegemot/dist/contrib/libbegemot/rpoll.h vendor/libbegemot/dist/rpoll.man - copied unchanged from r186358, vendor/libbegemot/dist/contrib/libbegemot/rpoll.man Deleted: vendor/libbegemot/1.1.1/contrib/ vendor/libbegemot/dist/contrib/ Copied: vendor/libbegemot/1.1.1/rpoll.c (from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libbegemot/1.1.1/rpoll.c Sat Dec 20 17:30:32 2008 (r186360, copy of r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.c) @@ -0,0 +1,714 @@ +/* + * Copyright (c)1996-2002 by Hartmut Brandt + * All rights reserved. + * + * Author: Hartmut Brandt + * + * Redistribution of this software and documentation and use in source and + * binary forms, with or without modification, are permitted provided that + * the following conditions are met: + * + * 1. Redistributions of source code or documentation must retain the above + * copyright notice, this list of conditions and the following disclaimer. + * 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 AND DOCUMENTATION IS PROVIDED BY THE AUTHOR + * AND ITS 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 ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT 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. + */ +/* + * These functions try to hide the poll/select/setitimer interface from the + * user. You associate callback functions with file descriptors and timers. + * + * $Begemot: libbegemot/rpoll.c,v 1.14 2004/09/21 15:59:00 brandt Exp $ + */ +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +/* + * There happens to be linuxes which read siginfo.h when including + * signal.h, which, for no appearent reason, defines these symbols. + */ +# ifdef POLL_IN +# undef POLL_IN +# endif +# ifdef POLL_OUT +# undef POLL_OUT +# endif + +# include "rpoll.h" + +/* +# define DEBUG +*/ + +# ifdef USE_POLL +# ifdef NEED_POLL_XOPEN_TWIDDLE +# define __USE_XOPEN +# endif +# include +# ifdef NEED_POLL_XOPEN_TWIDDLE +# undef __USE_XOPEN +# endif +# include +# endif + +/* + * the second define is for Linux, which sometimes fails to + * declare INFTIM. + */ +# if defined(USE_SELECT) || !defined(INFTIM) +# define INFTIM (-1) +# endif + +# if defined(SIGPOLL) +# define SIGNAL SIGPOLL +# else +# if defined(SIGIO) +# define SIGNAL SIGIO +# endif +# endif + +# ifdef USE_POLL +# define poll_in (POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI) +# define poll_out (POLLOUT | POLLWRNORM | POLLWRBAND) +# define poll_except (POLLERR | POLLHUP) +# endif + +# ifdef BROKEN_SELECT_PROTO +# define SELECT_CAST(P) (int *)P +# else +# define SELECT_CAST(P) P +# endif + + +typedef signed long long tval_t; + +static inline tval_t GETMSECS(void); + +static inline tval_t +GETMSECS(void) { + struct timeval tval; + + (void)gettimeofday(&tval, NULL); + return (tval_t)tval.tv_sec*1000+tval.tv_usec/1000; +} + +/* + * Simple fatal exit. + */ +static void +_panic(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + fprintf(stderr, "panic: "); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); + + exit(1); +} + +static void * +_xrealloc(void *p, size_t s) +{ + void *ptr; + + if(p == NULL) { + if((ptr=malloc(s)) == NULL && (s!=0 || (ptr=malloc(1)) == NULL)) + _panic("out of memory: xrealloc(%lx, %lu)", + (unsigned long)p, (unsigned long)s); + } else if(s == 0) { + free(p); + if((ptr=malloc(s)) == NULL && (ptr=malloc(1)) == NULL) + _panic("out of memory: xrealloc(%lx, %lu)", + (unsigned long)p, (unsigned long)s); + } else { + if((ptr = realloc(p, s)) == NULL) + _panic("out of memory: xrealloc(%lx, %lu)", + (unsigned long)p, (unsigned long)s); + } + + return ptr; +} + +/* + * This structure holds one registration record for files + */ +typedef struct { + int fd; /* file descriptor (-1 if struct unused) */ + int mask; /* event flags */ + void * arg; /* client arg */ + poll_f func; /* handler */ +# ifdef USE_POLL + struct pollfd *pfd; /* pointer to corresponding poll() structure */ +# endif +} PollReg_t; + +/* + * Now for timers + */ +typedef struct { + u_int msecs; /* millisecond value of the timer */ + int repeat; /* one shot or repeat? */ + void *arg; /* client arg */ + timer_f func; /* handler, 0 means disfunct */ + tval_t when; /* next time to trigger in msecs! */ +} PollTim_t; + +/* how many records should our table grow at once? */ +# define POLL_REG_GROW 100 + +# ifdef USE_POLL +static struct pollfd * pfd; /* fd list for poll() */ +# endif + +# ifdef USE_SELECT +static fd_set rset, wset, xset; /* file descriptor sets for select() */ +static int maxfd; /* maximum fd number */ +# endif + +static int in_dispatch; + +static PollReg_t * regs; /* registration records */ +static u_int regs_alloc; /* how many are allocated */ +static u_int regs_used; /* upper used limit */ +static sigset_t bset; /* blocked signals */ +static int rebuild; /* rebuild table on next dispatch() */ + +static int * tfd; /* sorted entries */ +static u_int tfd_alloc; /* number of entries allocated */ +static u_int tfd_used; /* number of entries used */ +static PollTim_t * tims; /* timer registration records */ +static u_int tims_alloc; /* how many are allocated */ +static u_int tims_used; /* how many are used */ +static int resort; /* resort on next dispatch */ + +int rpoll_trace; +int rpoll_policy; /* if 0 start sched callbacks from 0 else try round robin */ + +static void poll_build(void); +static void poll_blocksig(void); +static void poll_unblocksig(void); +static void sort_timers(void); + + +/* + * Private function to block SIGPOLL or SIGIO for a short time. + * Don't forget to call poll_unblock before return from the calling function. + * Don't change the mask between this calls (your changes will be lost). + */ +static void +poll_blocksig(void) +{ + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGNAL); + + if(sigprocmask(SIG_BLOCK, &set, &bset)) + _panic("sigprocmask(SIG_BLOCK): %s", strerror(errno)); +} + +/* + * unblock the previously blocked signal + */ +static void +poll_unblocksig(void) +{ + if(sigprocmask(SIG_SETMASK, &bset, NULL)) + _panic("sigprocmask(SIG_SETMASK): %s", strerror(errno)); +} + +/* + * Register the file descriptor fd. If the event corresponding to + * mask arrives func is called with arg. + * If fd is already registered with that func and arg, only the mask + * is changed. + * We block the IO-signal, so the dispatch function can be called from + * within the signal handler. + */ +int +poll_register(int fd, poll_f func, void *arg, int mask) +{ + PollReg_t * p; + + poll_blocksig(); + + /* already registered? */ + for(p = regs; p < ®s[regs_alloc]; p++) + if(p->fd == fd && p->func == func && p->arg == arg) { + p->mask = mask; + break; + } + + if(p == ®s[regs_alloc]) { + /* no - register */ + + /* find a free slot */ + for(p = regs; p < ®s[regs_alloc]; p++) + if(p->fd == -1) + break; + + if(p == ®s[regs_alloc]) { + size_t newsize = regs_alloc + POLL_REG_GROW; + regs = _xrealloc(regs, sizeof(regs[0]) * newsize); + for(p = ®s[regs_alloc]; p < ®s[newsize]; p++) { + p->fd = -1; +# ifdef USE_POLL + p->pfd = NULL; +# endif + } + p = ®s[regs_alloc]; + regs_alloc = newsize; + } + + p->fd = fd; + p->arg = arg; + p->mask = mask; + p->func = func; + + regs_used++; + rebuild = 1; + } + + poll_unblocksig(); + + if(rpoll_trace) + fprintf(stderr, "poll_register(%d, %#lx, %#lx, %#x)->%d", + fd, (u_long)func, (u_long)arg, mask, p - regs); + return p - regs; +} + +/* + * remove registration + */ +void +poll_unregister(int handle) +{ + if(rpoll_trace) + fprintf(stderr, "poll_unregister(%d)", handle); + + poll_blocksig(); + + regs[handle].fd = -1; +# ifdef USE_POLL + regs[handle].pfd = NULL; +# endif + rebuild = 1; + regs_used--; + + poll_unblocksig(); +} + +/* + * Build the structures used by poll() or select() + */ +static void +poll_build(void) +{ + PollReg_t * p; + +# ifdef USE_POLL + struct pollfd * f; + + f = pfd = _xrealloc(pfd, sizeof(pfd[0]) * regs_used); + + for(p = regs; p < ®s[regs_alloc]; p++) + if(p->fd >= 0) { + f->fd = p->fd; + f->events = 0; + if(p->mask & POLL_IN) + f->events |= poll_in; + if(p->mask & POLL_OUT) + f->events |= poll_out; + if(p->mask & POLL_EXCEPT) + f->events |= poll_except; + f->revents = 0; + p->pfd = f++; + } + assert(f == &pfd[regs_used]); +# endif + +# ifdef USE_SELECT + FD_ZERO(&rset); + FD_ZERO(&wset); + FD_ZERO(&xset); + maxfd = -1; + for(p = regs; p < ®s[regs_alloc]; p++) + if(p->fd >= 0) { + if(p->fd > maxfd) + maxfd = p->fd; + if(p->mask & POLL_IN) + FD_SET(p->fd, &rset); + if(p->mask & POLL_OUT) + FD_SET(p->fd, &wset); + if(p->mask & POLL_EXCEPT) + FD_SET(p->fd, &xset); + } +# endif +} + +int +poll_start_timer(u_int msecs, int repeat, timer_f func, void *arg) +{ + PollTim_t *p; + + /* find unused entry */ + for(p = tims; p < &tims[tims_alloc]; p++) + if(p->func == NULL) + break; + + if(p == &tims[tims_alloc]) { + if(tims_alloc == tims_used) { + size_t newsize = tims_alloc + POLL_REG_GROW; + tims = _xrealloc(tims, sizeof(tims[0]) * newsize); + for(p = &tims[tims_alloc]; p < &tims[newsize]; p++) + p->func = NULL; + p = &tims[tims_alloc]; + tims_alloc = newsize; + } + } + + /* create entry */ + p->msecs = msecs; + p->repeat = repeat; + p->arg = arg; + p->func = func; + p->when = GETMSECS() + msecs; + + tims_used++; + + resort = 1; + + if(rpoll_trace) + fprintf(stderr, "poll_start_timer(%u, %d, %#lx, %#lx)->%u", + msecs, repeat, (u_long)func, (u_long)arg, p - tims); + + return p - tims; +} + +/* + * Here we have to look into the sorted table, whether any entry there points + * into the registration table for the deleted entry. This is needed, + * because a unregistration can occure while we are scanning through the + * table in dispatch(). Do this only, if we are really there - resorting + * will sort out things if we are called from outside the loop. + */ +void +poll_stop_timer(int handle) +{ + u_int i; + + if(rpoll_trace) + fprintf(stderr, "poll_stop_timer(%d)", handle); + + tims[handle].func = NULL; + tims_used--; + + resort = 1; + + if(!in_dispatch) + return; + + for(i = 0; i < tfd_used; i++) + if(tfd[i] == handle) { + tfd[i] = -1; + break; + } +} + +/* + * Squeeze and sort timer table. + * Should perhaps use a custom sort. + */ +static int +tim_cmp(const void *p1, const void *p2) +{ + int t1 = *(const int *)p1; + int t2 = *(const int *)p2; + + return tims[t1].when < tims[t2].when ? -1 + : tims[t1].when > tims[t2].when ? +1 + : 0; +} + +/* + * Reconstruct the tfd-array. This will be an sorted array of indexes + * to the used entries in tims. The next timer to expire will be infront + * of the array. tfd_used is the number of used entries. The array is + * re-allocated if needed. + */ +static void +sort_timers(void) +{ + int *pp; + u_int i; + + if(tims_used > tfd_alloc) { + tfd_alloc = tims_used; + tfd = _xrealloc(tfd, sizeof(int *) * tfd_alloc); + } + + pp = tfd; + + for(i = 0; i < tims_alloc; i++) + if(tims[i].func) + *pp++ = i; + assert(pp - tfd == (ptrdiff_t)tims_used); + + tfd_used = tims_used; + if(tfd_used > 1) + qsort(tfd, tfd_used, sizeof(int), tim_cmp); +} + +/* + * Poll the file descriptors and dispatch to the right function + * If wait is true the poll blocks until somewhat happens. + * Don't use a pointer here, because the called function may cause + * a reallocation! The check for pfd != NULL is required, because + * a sequence of unregister/register could make the wrong callback + * to be called. So we clear pfd in unregister and check here. + */ +void +poll_dispatch(int wait) +{ + u_int i, idx; + int ret; + tval_t now; + int tout; + static u_int last_index; + +# ifdef USE_SELECT + fd_set nrset, nwset, nxset; + struct timeval tv; +# endif + + in_dispatch = 1; + + if(rebuild) { + rebuild = 0; + poll_build(); + } + if(resort) { + resort = 0; + sort_timers(); + } + + /* in wait mode - compute the timeout */ + if(wait) { + if(tfd_used) { + now = GETMSECS(); +# ifdef DEBUG + { + fprintf(stderr, "now=%"QUADFMT"u", now); + for(i = 0; i < tims_used; i++) + fprintf(stderr, "timers[%2d] = %"QUADFMT"d", i, tfd[i]->when - now); + } +# endif + if((tout = tims[tfd[0]].when - now) < 0) + tout = 0; + } else + tout = INFTIM; + } else + tout = 0; + +# ifdef DEBUG + fprintf(stderr, "rpoll -- selecting with tout=%u", tout); +# endif + +# ifdef USE_POLL + ret = poll(pfd, regs_used, tout); +# endif + +# ifdef USE_SELECT + nrset = rset; + nwset = wset; + nxset = xset; + if(tout != INFTIM) { + tv.tv_sec = tout / 1000; + tv.tv_usec = (tout % 1000) * 1000; + } + ret = select(maxfd+1, + SELECT_CAST(&nrset), + SELECT_CAST(&nwset), + SELECT_CAST(&nxset), (tout==INFTIM) ? 0 : &tv); +# endif + + if(ret == -1) { + if(errno == EINTR) + return; + _panic("poll/select: %s", strerror(errno)); + } + + /* dispatch files */ + if(ret > 0) { + for(i = 0; i < regs_alloc; i++) { + idx = rpoll_policy ? ((last_index+i) % regs_alloc) : i; + + assert(idx < regs_alloc); + + if(regs[idx].fd >= 0) { + int mask = 0; + +# ifdef USE_POLL + if(regs[idx].pfd) { + if(regs[idx].pfd->revents & poll_in) + mask |= POLL_IN; + if(regs[idx].pfd->revents & poll_out) + mask |= POLL_OUT; + if(regs[idx].pfd->revents & poll_except) + mask |= POLL_EXCEPT; + } +# endif +# ifdef USE_SELECT + if(FD_ISSET(regs[idx].fd, &nrset)) + mask |= POLL_IN; + if(FD_ISSET(regs[idx].fd, &nwset)) + mask |= POLL_OUT; + if(FD_ISSET(regs[idx].fd, &nxset)) + mask |= POLL_EXCEPT; +# endif + assert(idx < regs_alloc); + + if(mask) { + if(rpoll_trace) + fprintf(stderr, "poll_dispatch() -- " + "file %d/%d", + regs[idx].fd, idx); + (*regs[idx].func)(regs[idx].fd, mask, regs[idx].arg); + } + } + + } + last_index++; + } + + /* dispatch timeouts */ + if(tfd_used) { + now = GETMSECS(); + for(i = 0; i < tfd_used; i++) { + if(tfd[i] < 0) + continue; + if(tims[tfd[i]].when > now) + break; + if(rpoll_trace) + fprintf(stderr, "rpoll_dispatch() -- timeout %d",tfd[i]); + (*tims[tfd[i]].func)(tfd[i], tims[tfd[i]].arg); + if(tfd[i] < 0) + continue; + if(tims[tfd[i]].repeat) + tims[tfd[i]].when = now + tims[tfd[i]].msecs; + else { + tims[tfd[i]].func = NULL; + tims_used--; + tfd[i] = -1; + } + resort = 1; + } + } + in_dispatch = 0; +} + + +# ifdef TESTME +struct timeval start, now; +int t0, t1; + +double elaps(void); +void infunc(int fd, int mask, void *arg); + +double +elaps(void) +{ + gettimeofday(&now, NULL); + + return (double)(10 * now.tv_sec + now.tv_usec / 100000 - 10 * start.tv_sec - start.tv_usec / 100000) + / 10; +} + +void +infunc(int fd, int mask, void *arg) +{ + char buf[1024]; + int ret; + + mask = mask; + arg = arg; + if((ret = read(fd, buf, sizeof(buf))) < 0) + _panic("read: %s", strerror(errno)); + write(1, "stdin:", 6); + write(1, buf, ret); +} + +void tfunc0(int tid, void *arg); +void tfunc1(int tid, void *arg); + +void +tfunc0(int tid, void *arg) +{ + printf("%4.1f -- %d: %s\n", elaps(), tid, (char *)arg); +} +void +tfunc1(int tid, void *arg) +{ + printf("%4.1f -- %d: %s\n", elaps(), tid, (char *)arg); +} + +void first(int tid, void *arg); +void second(int tid, void *arg); + +void +second(int tid, void *arg) +{ + printf("%4.1f -- %d: %s\n", elaps(), tid, (char *)arg); + poll_start_timer(5500, 0, first, "first"); + poll_stop_timer(t1); + t0 = poll_start_timer(1000, 1, tfunc0, "1 second"); +} +void +first(int tid, void *arg) +{ + printf("%4.1f -- %d: %s\n", elaps(), tid, (char *)arg); + poll_start_timer(3700, 0, second, "second"); + poll_stop_timer(t0); + t1 = poll_start_timer(250, 1, tfunc1, "1/4 second"); +} + +int +main(int argc, char *argv[]) +{ + argc = argc; + argv = argv; + gettimeofday(&start, NULL); + poll_register(0, infunc, NULL, POLL_IN); + t0 = poll_start_timer(1000, 1, tfunc0, "1 second"); + poll_start_timer(2500, 0, first, "first"); + + while(1) + poll_dispatch(1); + + return 0; +} +# endif Copied: vendor/libbegemot/1.1.1/rpoll.h (from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libbegemot/1.1.1/rpoll.h Sat Dec 20 17:30:32 2008 (r186360, copy of r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.h) @@ -0,0 +1,66 @@ +/* + * Copyright (c)1996-2002 by Hartmut Brandt + * All rights reserved. + * + * Author: Hartmut Brandt + * + * Redistribution of this software and documentation and use in source and + * binary forms, with or without modification, are permitted provided that + * the following conditions are met: + * + * 1. Redistributions of source code or documentation must retain the above + * copyright notice, this list of conditions and the following disclaimer. + * 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 AND DOCUMENTATION IS PROVIDED BY THE AUTHOR + * AND ITS 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 ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT 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. + */ +/* + * $Begemot: libbegemot/rpoll.h,v 1.5 2004/09/21 15:49:26 brandt Exp $ + */ +# ifndef rpoll_h_ +# define rpoll_h_ + +# ifdef __cplusplus +extern "C" { +# endif + +typedef void (*poll_f)(int fd, int mask, void *arg); +typedef void (*timer_f)(int, void *); + +int poll_register(int fd, poll_f func, void *arg, int mask); +void poll_unregister(int); +void poll_dispatch(int wait); +int poll_start_timer(u_int msecs, int repeat, timer_f func, void *arg); +void poll_stop_timer(int); + +# if defined(POLL_IN) +# undef POLL_IN +# endif +# if defined(POLL_OUT) +# undef POLL_OUT +# endif + +# define POLL_IN 1 +# define POLL_OUT 2 +# define POLL_EXCEPT 4 + +extern int rpoll_policy; +extern int rpoll_trace; + +# ifdef __cplusplus +} +# endif + +# endif Copied: vendor/libbegemot/1.1.1/rpoll.man (from r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.man) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libbegemot/1.1.1/rpoll.man Sat Dec 20 17:30:32 2008 (r186360, copy of r186358, vendor/libbegemot/1.1.1/contrib/libbegemot/rpoll.man) @@ -0,0 +1,188 @@ +'\" +'\" Copyright (c)1996-2002 by Hartmut Brandt +'\" All rights reserved. +'\" +'\" Author: Hartmut Brandt +'\" +'\" Redistribution of this software and documentation and use in source and +'\" binary forms, with or without modification, are permitted provided that +'\" the following conditions are met: +'\" +'\" 1. Redistributions of source code or documentation must retain the above +'\" copyright notice, this list of conditions and the following disclaimer. +'\" 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 AND DOCUMENTATION IS PROVIDED BY THE AUTHOR +'\" AND ITS 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 ARE DISCLAIMED. IN NO EVENT SHALL +'\" THE AUTHOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +'\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +'\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +'\" OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +'\" LIABILITY, WHETHER IN CONTRACT, STRICT 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. +'\" +'\" $Begemot: libbegemot/rpoll.man,v 1.4 2004/09/21 15:59:00 brandt Exp $ +'\" +.TH rpoll l "21 Oct 1996" "BEGEMOT" "BEGEMOT Library" +.SH NAME +rpoll - callback functions for file descriptors and timers +.SH SYNOPSIS +.LP +.B "# include " +.LP +.BR "typedef void (*poll_f)(int " "fd" ", int " "mask" ", void *" "arg);" +.br +.BR "typedef void (*timer_f)(int " "tid" ", void *" "arg);" +.LP +.BR "int poll_register(int " "fd" ", poll_f " +.RB "func" ", void *" "arg" ", int " "mask" ");" +.LP +.BR "void poll_unregister(int " "handle" ");" +.LP +.BR "int poll_start_timer(u_int " "msecs" ", int " "repeat" ", timer_f " "func," +.if n .ti +.5i +.BR "void *" "arg);" +.LP +.BR "void poll_stop_timer(int " "handle" ");" +.LP +.BR "void poll_dispatch(int " "wait" ");" +.SH DESCRIPTION +Many programs need to read from several file descriptors at the same time. +Typically in these programs one of +.BR select (3c) +or +.BR poll (2) +is used. +These calls are however clumsy to use and the usage of one of these calls is +probably not portable to other systems - not all systems support both calls. +.LP +The +.BR rpoll (l) +family of functions is designed to overcome these restrictions. +They support the well known and understood technique of event driven +programing and, in addition to +.BR select (3c) +and +.BR poll (2) +also support timers. +.LP +Each event on a file descriptor or each timer event is translated into a call to a user +defined callback function. These functions need to be registered. +A file descriptor is registered with +.BR poll_register . +.I fd +is the file descriptor to watch, +.I mask +is an event mask. +It may be any combination of +.B POLL_IN +to get informed, when input on the file descriptor is possible, +.B POLL_OUT +to get informed, when output is possible or +.B POLL_EXCEPT +to get informed, when an exceptional condition occures. +An example of an exceptional condition is the arrival of urgent data. +(Note, that an end of file condition is signaled via POLL_IN). +.I func +is the user function to be called and +.I arg +is a user supplied argument for this function. +The callback functions is called with the file descriptor, a mask +describing the actual events (from the set supplied in the registration) and +the user argument. +.B poll_register +returns a handle, which may be used later to de-register the file descriptor. +A file descriptor may be registered more than once, if the function, the user arguments +or both differ in the call to +.BR poll_register . +If +.I func +and +.I arg +are the same, then no new registration is done, instead the event mask of the registration +is changed to reflect the new mask. +.LP +A registered file descriptor may be de-registered by calling +.B poll_unregister +with the handle returned by +.BR poll_register . +.LP +A timer is created with +.BR poll_start_timer . +.I msecs +is the number of milliseconds, after which the timer event will be generated. +.I repeat +selects one-short behavior (if 0) or a repeatable timer (if not 0). A one-short timer +will automatically unregistered after expiry. +.I func +is the user function which will be called with a timer id and the user supplied +.IR arg . +.B poll_start_timer +returnes a timer id, which may be used to cancel the timer with +.BR poll_stop_timer . +A one-short timer should be canceled only if it has not yet fired. +.LP +.B poll_dispatch +must be called to actually dispatch events. +.I wait +is a flag, which should be 0, if only a poll should be done. In this case, the function returns, +after polling the registered file descriptors and timers. If +.I wait +is not 0, +.B poll_dispatch +waits until an event occures. All events are dispatch (i.e. callback functions called) and +.B poll_dispatch returns. +.LP +Typical use is: +.LP +.RS +.nf +.ft 3 +while(1) + poll_dispatch(1); +.ft 1 +.fi +.RE +.SH "SEE ALSO" +.BR poll (2), select (3C) +.SH "RETURN VALUES" +.B poll_register +and +.B poll_start_timer +return a handle which may be used to unregister the file descriptor or cancel the timer. +.LP +Both functions and +.B poll_dispatch +call +.BR xrealloc (l) +and can end in +.BR panic (l). +.SH "ERRORS" +System call or memory allocation errors are fatal and are handle by calling +.BR panic (l). +The one exception is a return of EINTR from +.BR select (3c) +or +.BR poll (2) +in +.BR poll_dispatch . +In this case +.B poll_dispatch +simply returns. +.SH "BUGS" +Obscure sequences of +.B poll_start_timer +and +.B poll_stop_timer +in callback functions may probably break the code. +.LP +The semantics of +.B POLL_EXCEPT +are not clear. +.SH AUTHORS +Hartmut Brandt, harti@freebsd.org Copied: vendor/libbegemot/dist/rpoll.c (from r186358, vendor/libbegemot/dist/contrib/libbegemot/rpoll.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libbegemot/dist/rpoll.c Sat Dec 20 17:30:32 2008 (r186360, copy of r186358, vendor/libbegemot/dist/contrib/libbegemot/rpoll.c) @@ -0,0 +1,740 @@ +/* + * Copyright (c)1996-2002 by Hartmut Brandt + * All rights reserved. + * + * Author: Hartmut Brandt + * + * Redistribution of this software and documentation and use in source and + * binary forms, with or without modification, are permitted provided that + * the following conditions are met: + * + * 1. Redistributions of source code or documentation must retain the above + * copyright notice, this list of conditions and the following disclaimer. + * 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 AND DOCUMENTATION IS PROVIDED BY THE AUTHOR + * AND ITS 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 ARE DISCLAIMED. IN NO EVENT SHALL *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Sat Dec 20 17:31:58 2008 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 552051065674; Sat, 20 Dec 2008 17:31:58 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A59E8FC29; Sat, 20 Dec 2008 17:31:58 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBKHVw1U009889; Sat, 20 Dec 2008 17:31:58 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBKHVwLK009888; Sat, 20 Dec 2008 17:31:58 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <200812201731.mBKHVwLK009888@svn.freebsd.org> From: Hartmut Brandt Date: Sat, 20 Dec 2008 17:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186361 - vendor/libbegemot/dist X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2008 17:31:58 -0000 Author: harti Date: Sat Dec 20 17:31:57 2008 New Revision: 186361 URL: http://svn.freebsd.org/changeset/base/186361 Log: Remove the svn:keywords property from the vendor files. Modified: vendor/libbegemot/dist/rpoll.c (props changed) vendor/libbegemot/dist/rpoll.h (props changed) vendor/libbegemot/dist/rpoll.man (props changed)