<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.network.quagga.devel">
    <title>gmane.network.quagga.devel</title>
    <link>http://blog.gmane.org/gmane.network.quagga.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9404"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9403"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9402"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9401"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9400"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9399"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9398"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9397"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9395"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9394"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9393"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9392"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9391"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9390"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9389"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9388"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9387"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9386"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9385"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.network.quagga.devel/9384"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9404">
    <title>[quagga-dev 9384] [RFC] AgentX support for Quagga (including trapsupport)</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9404</link>
    <description>&lt;pre&gt;Hi!

Here are the appropriate followup patches to complete AgentX support
with trap handling and documentation.

I had to modify smux_trap() signature since I need the appropriate
enterprise OID and I need a way to walk the MIB registry. There are
two cleanup patches which removes unused bits in smux_trap() signature
and trap_object struct.

&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-25T10:22:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9403">
    <title>[quagga-dev 9383] [PATCH 2/4] smux: drop findVar element from trapobject struct</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9403</link>
    <description>&lt;pre&gt;This element was not unused.
---
 bgpd/bgp_snmp.c   |    4 ++--
 lib/smux.h        |    3 +--
 ospfd/ospf_snmp.c |   32 ++++++++++++++++----------------
 3 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c
index a995ff6..73406d5 100644
--- a/bgpd/bgp_snmp.c
+++ b/bgpd/bgp_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -833,8 +833,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bgp4PathAttrTable (struct variable *v, oid name[], size_t *length,
 /* BGP Traps. */
 struct trap_object bgpTrapList[] =
 {
-  {bgpPeerTable, 3, {3, 1, BGPPEERLASTERROR}},
-  {bgpPeerTable, 3, {3, 1, BGPPEERSTATE}}
+  {3, {3, 1, BGPPEERLASTERROR}},
+  {3, {3, 1, BGPPEERSTATE}}
 };
 
 void
diff --git a/lib/smux.h b/lib/smux.h
index 78460e6..b7d5096 100644
--- a/lib/smux.h
+++ b/lib/smux.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -47,8 +47,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 struct trap_object
 {
-  FindVarMethod *findVar;
-  int namelen;
+  int namelen; /* Negative if the object is not indexed */
   oid name[MAX_OID_LEN];
 };
 
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index 409153b..b2d5686 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2568,35 +2568,35 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ospfAreaAggregateEntry (struct variable *v, oid *name, size_t *length,
 
 struct trap_object ospfNbrTrapList[] =
 {
-  {ospfGeneralGroup, -2, {1, OSPFROUTERID}},
-  {ospfNbrEntry, 3, {10, 1, OSPFNBRIPADDR}},
-  {ospfNbrEntry, 3, {10, 1, OSPFNBRRTRID}},
-  {ospfNbrEntry, 3, {10, 1, OSPFNBRSTATE}}
+  {-2, {1, OSPFROUTERID}},
+  {3, {10, 1, OSPFNBRIPADDR}},
+  {3, {10, 1, OSPFNBRRTRID}},
+  {3, {10, 1, OSPFNBRSTATE}}
 };
 
 
 struct trap_object ospfVirtNbrTrapList[] =
 {
-  {ospfGeneralGroup, -2, {1, 1}},
-  {ospfVirtNbrEntry, 3, {11, 1, OSPFVIRTNBRAREA}},
-  {ospfVirtNbrEntry, 3, {11, 1, OSPFVIRTNBRRTRID}},
-  {ospfVirtNbrEntry, 3, {11, 1, OSPFVIRTNBRSTATE}}
+  {-2, {1, 1}},
+  {3, {11, 1, OSPFVIRTNBRAREA}},
+  {3, {11, 1, OSPFVIRTNBRRTRID}},
+  {3, {11, 1, OSPFVIRTNBRSTATE}}
 };
 
 struct trap_object ospfIfTrapList[] =
 {
-  {ospfGeneralGroup, -2, {1, OSPFROUTERID}},
-  {ospfIfEntry, 3, {7, 1, OSPFIFIPADDRESS}},
-  {ospfIfEntry, 3, {7, 1, OSPFADDRESSLESSIF}},
-  {ospfIfEntry, 3, {7, 1, OSPFIFSTATE}}
+  {-2, {1, OSPFROUTERID}},
+  {3, {7, 1, OSPFIFIPADDRESS}},
+  {3, {7, 1, OSPFADDRESSLESSIF}},
+  {3, {7, 1, OSPFIFSTATE}}
 };
 
 struct trap_object ospfVirtIfTrapList[] =
 {
-  {ospfGeneralGroup, -2, {1, OSPFROUTERID}},
-  {ospfVirtIfEntry, 3, {9, 1, OSPFVIRTIFAREAID}},
-  {ospfVirtIfEntry, 3, {9, 1, OSPFVIRTIFNEIGHBOR}},
-  {ospfVirtIfEntry, 3, {9, 1, OSPFVIRTIFSTATE}}
+  {-2, {1, OSPFROUTERID}},
+  {3, {9, 1, OSPFVIRTIFAREAID}},
+  {3, {9, 1, OSPFVIRTIFNEIGHBOR}},
+  {3, {9, 1, OSPFVIRTIFSTATE}}
 };
 
 void
&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-25T10:22:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9402">
    <title>[quagga-dev 9382] [PATCH 4/4] agentx: add appropriate documentation</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9402</link>
    <description>&lt;pre&gt;---
 doc/overview.texi |    5 ++-
 doc/snmp.texi     |   89 +++++++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 83 insertions(+), 11 deletions(-)

diff --git a/doc/overview.texi b/doc/overview.texi
index 435834b..7acfc0e 100644
--- a/doc/overview.texi
+++ b/doc/overview.texi
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -7,7 +7,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; provides TCP/IP based routing services with routing protocols support such
 as RIPv1, RIPv2, RIPng, OSPFv2, OSPFv3, BGP-4, and BGP-4+ (&amp;lt; at &amp;gt;pxref{Supported
 RFCs}). Quagga also supports special BGP Route Reflector and Route Server
 behavior.  In addition to traditional IPv4 routing protocols, Quagga also
-supports IPv6 routing protocols.  With SNMP daemon which supports SMUX
+supports IPv6 routing protocols.  With SNMP daemon which supports SMUX and AgentX
 protocol, Quagga provides routing protocol MIBs (&amp;lt; at &amp;gt;pxref{SNMP Support}).
 
   Quagga uses an advanced software architecture to provide you with a high
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -238,6 +238,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; J. Chu, Editor. July 1994.}
 &amp;lt; at &amp;gt;cite{OSPF Version 2 Management Information Base. F. Baker, R. Coltun.
 November 1995.}
 
+&amp;lt; at &amp;gt;item &amp;lt; at &amp;gt;asis{RFC2741}
+&amp;lt; at &amp;gt;cite{Agent Extensibility (AgentX) Protocol. M. Daniele, B. Wijnen. January 2000.}
+
 &amp;lt; at &amp;gt;end table
 
 &amp;lt; at &amp;gt;node How to get Quagga
diff --git a/doc/snmp.texi b/doc/snmp.texi
index 3f80cc5..0918a46 100644
--- a/doc/snmp.texi
+++ b/doc/snmp.texi
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -5,11 +5,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 feature for collecting network information from router and/or host.
 Quagga itself does not support SNMP agent (server daemon) functionality
 but is able to connect to a SNMP agent using the SMUX protocol
-(&amp;lt; at &amp;gt;cite{RFC1227}) and make the routing protocol MIBs available through
-it.
+(&amp;lt; at &amp;gt;cite{RFC1227}) or the AgentX protocol (&amp;lt; at &amp;gt;cite{RFC2741}) and make the
+routing protocol MIBs available through it.
 
 &amp;lt; at &amp;gt;menu
 * Getting and installing an SNMP agent::
+* AgentX configuration::
 * SMUX configuration::
 * MIB and command reference::
 * Handling SNMP Traps::
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -18,20 +19,82 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; it.
 &amp;lt; at &amp;gt;node Getting and installing an SNMP agent
 &amp;lt; at &amp;gt;section Getting and installing an SNMP agent
 
-There are several SNMP agent which support SMUX. We recommend to use the latest
+There are several SNMP agent which support SMUX or AgentX. We recommend to use the latest
 version of &amp;lt; at &amp;gt;code{net-snmp} which was formerly known as &amp;lt; at &amp;gt;code{ucd-snmp}.
 It is free and open software and available at &amp;lt; at &amp;gt;uref{http://www.net-snmp.org/}
 and as binary package for most Linux distributions.
-&amp;lt; at &amp;gt;code{net-snmp} has to be compiled with &amp;lt; at &amp;gt;code{--with-mib-modules=smux} to
-be able to accept connections from Quagga.
+&amp;lt; at &amp;gt;code{net-snmp} has to be compiled with &amp;lt; at &amp;gt;code{--with-mib-modules=agentx} to
+be able to accept connections from Quagga using AgentX protocol or with
+&amp;lt; at &amp;gt;code{--with-mib-modules=smux} to use SMUX protocol.
+
+Nowadays, SMUX is a legacy protocol. The AgentX protocol should be
+preferred for any new deployment. Both protocols have the same coverage.
+
+&amp;lt; at &amp;gt;node AgentX configuration
+&amp;lt; at &amp;gt;section AgentX configuration
+
+To enable AgentX protocol support, Quagga must have been build with the
+&amp;lt; at &amp;gt;code{--enable-snmp} or &amp;lt; at &amp;gt;code{--enable-snmp=agentx} option. Both the
+master SNMP agent (snmpd) and each of the Quagga daemons must be
+configured. In &amp;lt; at &amp;gt;code{/etc/snmp/snmpd.conf}, &amp;lt; at &amp;gt;code{master agentx}
+directive should be added. In each of the Quagga daemons, &amp;lt; at &amp;gt;code{agentx}
+command will enable AgentX support.
+
+&amp;lt; at &amp;gt;example
+/etc/snmp/snmpd.conf:
+#
+# example access restrictions setup
+#
+com2sec readonly default public
+group MyROGroup v1 readonly
+view all included .1 80
+access MyROGroup "" any noauth exact all none none
+#
+# enable master agent for AgentX subagents
+#
+master agentx
+
+/etc/quagga/ospfd.conf:
+! ... the rest of ospfd.conf has been omitted for clarity ...
+!
+agentx
+!
+&amp;lt; at &amp;gt;end example
+
+Upon successful connection, you should get something like this in the
+log of each Quagga daemons:
+
+&amp;lt; at &amp;gt;example
+2012/05/25 11:39:08 ZEBRA: snmp[info]: NET-SNMP version 5.4.3 AgentX subagent connected
+&amp;lt; at &amp;gt;end example
+
+Then, you can use the following command to check everything works as expected:
+
+&amp;lt; at &amp;gt;example
+# snmpwalk -c public -v1 localhost .1.3.6.1.2.1.14.1.1
+OSPF-MIB::ospfRouterId.0 = IpAddress: 192.168.42.109
+[...]
+&amp;lt; at &amp;gt;end example
+
+The AgentX protocol can be transported over a Unix socket or using TCP
+or UDP. It usually defaults to a Unix socket and depends on how NetSNMP
+was built. If need to configure Quagga to use another transport, you can
+configure it through &amp;lt; at &amp;gt;code{/etc/snmp/quagga.conf}:
+
+&amp;lt; at &amp;gt;example
+/etc/snmp/quagga.conf:
+[snmpd]
+# Use a remote master agent
+agentXSocket tcp:192.168.15.12:705
+&amp;lt; at &amp;gt;end example
 
 &amp;lt; at &amp;gt;node SMUX configuration
 &amp;lt; at &amp;gt;section SMUX configuration
 
 To enable SMUX protocol support, Quagga must have been build with the
-&amp;lt; at &amp;gt;code{--enable-snmp} option.
+&amp;lt; at &amp;gt;code{--enable-snmp=smux} option.
 
-A separate connection has then to be established between between the
+A separate connection has then to be established between the
 SNMP agent (snmpd) and each of the Quagga daemons. This connections
 each use different OID numbers and passwords. Be aware that this OID
 number is not the one that is used in queries by clients, it is solely
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -85,7 +148,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; troublesome &amp;lt; at &amp;gt;code{snmp_log()} line in the function
 &amp;lt; at &amp;gt;section MIB and command reference
 
 The following OID numbers are used for the interprocess communication of snmpd and
-the Quagga daemons. Sadly, SNMP has not been implemented in all daemons yet.
+the Quagga daemons with SMUX only.
 &amp;lt; at &amp;gt;example
             (OIDs below .iso.org.dod.internet.private.enterprises)
 zebra.1.3.6.1.4.1.3317.1.2.1 .gnome.gnomeProducts.zebra.zserv
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -95,7 +158,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ospfd.1.3.6.1.4.1.3317.1.2.5 .gnome.gnomeProducts.zebra.ospfd
 ospf6d.1.3.6.1.4.1.3317.1.2.6 .gnome.gnomeProducts.zebra.ospf6d
 &amp;lt; at &amp;gt;end example
 
-The following OID numbers are used for querying the SNMP daemon by a client:
+Sadly, SNMP has not been implemented in all daemons yet. The following
+OID numbers are used for querying the SNMP daemon by a client:
 &amp;lt; at &amp;gt;example
 zebra.1.3.6.1.2.1.4.24   .iso.org.dot.internet.mgmt.mib-2.ip.ipForward
 ospfd.1.3.6.1.2.1.14    .iso.org.dot.internet.mgmt.mib-2.ospf
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -104,7 +168,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ripd.1.3.6.1.2.1.23    .iso.org.dot.internet.mgmt.mib-2.rip2
 ospf6d.1.3.6.1.3.102    .iso.org.dod.internet.experimental.ospfv3
 &amp;lt; at &amp;gt;end example
 
-The following syntax is understood by the Quagga daemons for configuring SNMP:
+The following syntax is understood by the Quagga daemons for configuring SNMP using SMUX:
 &amp;lt; at &amp;gt;deffn {Command} {smux peer &amp;lt; at &amp;gt;var{oid}} {}
 &amp;lt; at &amp;gt;deffnx {Command} {no smux peer &amp;lt; at &amp;gt;var{oid}} {}
 &amp;lt; at &amp;gt;end deffn
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -113,4 +177,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; The following syntax is understood by the Quagga daemons for configuring SNMP:
 &amp;lt; at &amp;gt;deffnx {Command} {no smux peer &amp;lt; at &amp;gt;var{oid} &amp;lt; at &amp;gt;var{password}} {}
 &amp;lt; at &amp;gt;end deffn
 
+Here is the syntax for using AgentX:
+&amp;lt; at &amp;gt;deffn {Command} {agentx} {}
+&amp;lt; at &amp;gt;deffnx {Command} {no agentx} {}
+&amp;lt; at &amp;gt;end deffn
+
 &amp;lt; at &amp;gt;include snmptrap.texi
&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-25T10:22:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9401">
    <title>[quagga-dev 9381] [PATCH 3/4] agentx: handle SNMP traps</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9401</link>
    <description>&lt;pre&gt;smux_trap() signature has been changed to provide appropriate level
information to send SNMPv2 notifications. This includes the addition
of the enterprise OID to use (from which is derived the SNMP trap OID)
and the MIB registry to locate the appropriate function for variable
bindings provided by the trap.

The SMUX implementation has been updated but ignore the provided
enterprise OID. Instead, it still uses the SMUX peer OID to keep
compatibility with previous versions of Quagga. The SMUX
implementation also ignores the provided MIB registry since it uses
smux_get() function to grab the appropriate values. This is not
possible with the AgentX implementation since there is no such
function provided by NetSNMP.
---
 bgpd/bgp_snmp.c   |    9 ++++--
 lib/agentx.c      |   82 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 lib/smux.c        |    9 +++++-
 lib/smux.h        |   31 ++++++++++++++++++--
 ospfd/ospf_snmp.c |   17 ++++++++---
 5 files changed, 137 insertions(+), 11 deletions(-)

diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c
index 73406d5..36fd4ef 100644
--- a/bgpd/bgp_snmp.c
+++ b/bgpd/bgp_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -118,6 +118,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; SNMP_LOCAL_VARIABLES
 
 /* BGP-MIB instances. */
 oid bgp_oid [] = { BGP4MIB };
+oid bgp_trap_oid [] = { BGP4MIB, 0 };
 
 /* IP address 0.0.0.0. */
 static struct in_addr bgp_empty_addr = {0};
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -850,7 +851,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bgpTrapEstablished (struct peer *peer)
 
   oid_copy_addr (index, &amp;amp;addr, IN_ADDR_SIZE);
 
-  smux_trap (bgp_oid, sizeof bgp_oid / sizeof (oid),
+  smux_trap (bgp_variables, sizeof bgp_variables / sizeof (struct variable),
+     bgp_trap_oid, sizeof bgp_trap_oid / sizeof (oid),
+     bgp_oid, sizeof bgp_oid / sizeof (oid),
      index, IN_ADDR_SIZE,
      bgpTrapList, sizeof bgpTrapList / sizeof (struct trap_object),
      BGPESTABLISHED);
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -869,7 +872,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bgpTrapBackwardTransition (struct peer *peer)
 
   oid_copy_addr (index, &amp;amp;addr, IN_ADDR_SIZE);
 
-  smux_trap (bgp_oid, sizeof bgp_oid / sizeof (oid),
+  smux_trap (bgp_variables, sizeof bgp_variables / sizeof (struct variable),
+     bgp_trap_oid, sizeof bgp_trap_oid / sizeof (oid),
+     bgp_oid, sizeof bgp_oid / sizeof (oid),
      index, IN_ADDR_SIZE,
      bgpTrapList, sizeof bgpTrapList / sizeof (struct trap_object),
      BGPBACKWARDTRANSITION);
diff --git a/lib/agentx.c b/lib/agentx.c
index 9b82355..4f91ff9 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -121,11 +121,91 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; smux_register_mib (const char *descr, struct variable *var,
 }
 
 int
-smux_trap (const oid *name, size_t namelen,
+smux_trap (struct variable *vp, size_t vp_len,
+   const oid *ename, size_t enamelen,
+   const oid *name, size_t namelen,
    const oid *iname, size_t inamelen,
    const struct trap_object *trapobj, size_t trapobjlen,
    u_char sptrap)
 {
+  oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+  size_t objid_snmptrap_len = sizeof objid_snmptrap / sizeof (oid);
+  oid notification_oid[MAX_OID_LEN];
+  size_t notification_oid_len;
+  unsigned int i;
+
+  netsnmp_variable_list *notification_vars = NULL;
+  if (!agentx_enabled) return 0;
+
+  /* snmpTrapOID */
+  oid_copy (notification_oid, ename, enamelen);
+  notification_oid[enamelen] = sptrap;
+  notification_oid_len = enamelen + 1;
+  snmp_varlist_add_variable (&amp;amp;notification_vars,
+     objid_snmptrap, objid_snmptrap_len,
+     ASN_OBJECT_ID,
+     (u_char *) notification_oid,
+     notification_oid_len * sizeof(oid));
+
+  /* Provided bindings */
+  for (i = 0; i &amp;lt; trapobjlen; i++)
+    {
+      unsigned int j;
+      oid oid[MAX_OID_LEN];
+      size_t oid_len, onamelen;
+      u_char *val;
+      size_t val_len;
+      WriteMethod *wm = NULL;
+      struct variable cvp;
+
+      /* Make OID. */
+      if (trapobj[i].namelen &amp;gt; 0)
+        {
+  /* Columnar object */
+  onamelen = trapobj[i].namelen;
+          oid_copy (oid, name, namelen);
+          oid_copy (oid + namelen, trapobj[i].name, onamelen);
+          oid_copy (oid + namelen + onamelen, iname, inamelen);
+          oid_len = namelen + onamelen + inamelen;
+        }
+      else
+        {
+  /* Scalar object */
+  onamelen = trapobj[i].namelen * (-1);
+          oid_copy (oid, name, namelen);
+          oid_copy (oid + namelen, trapobj[i].name, onamelen);
+  oid[onamelen + namelen] = 0;
+          oid_len = namelen + onamelen + 1;
+        }
+
+      /* Locate the appropriate function and type in the MIB registry. */
+      for (j = 0; j &amp;lt; vp_len; j++)
+{
+  if (oid_compare (trapobj[i].name, onamelen, vp[j].name, vp[j].namelen) != 0)
+    continue;
+  /* We found the appropriate variable in the MIB registry. */
+  oid_copy(cvp.name, name, namelen);
+  oid_copy(cvp.name + namelen, vp[j].name, vp[j].namelen);
+  cvp.namelen = namelen + vp[j].namelen;
+  cvp.type = vp[j].type;
+  cvp.magic = vp[j].magic;
+  cvp.acl = vp[j].acl;
+  cvp.findVar = vp[j].findVar;
+  /* Grab the result. */
+  val = cvp.findVar (&amp;amp;cvp, oid, &amp;amp;oid_len, 1, &amp;amp;val_len, &amp;amp;wm);
+  if (!val) break;
+  snmp_varlist_add_variable (&amp;amp;notification_vars,
+     oid, oid_len,
+     vp[j].type,
+     val,
+     val_len);
+  break;
+}
+    }
+
+
+  send_v2trap (notification_vars);
+  snmp_free_varbind (notification_vars);
   return 1;
 }
 
diff --git a/lib/smux.c b/lib/smux.c
index 38c7018..3ac053d 100644
--- a/lib/smux.c
+++ b/lib/smux.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -968,8 +968,15 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; smux_open (int sock)
   return send (sock, buf, (ptr - buf), 0);
 }
 
+/* `ename` is ignored. Instead of using the provided enterprise OID,
+   the SMUX peer is used. This keep compatibility with the previous
+   versions of Quagga.
+
+   All other fields are used as they are intended. */
 int
-smux_trap (const oid *name, size_t namelen,
+smux_trap (struct variable *vp, size_t vp_len,
+   const oid *ename, size_t namelen,
+   const oid *name, size_t namelen,
    const oid *iname, size_t inamelen,
    const struct trap_object *trapobj, size_t trapobjlen,
    u_char sptrap)
diff --git a/lib/smux.h b/lib/smux.h
index b7d5096..b29fdc7 100644
--- a/lib/smux.h
+++ b/lib/smux.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -75,9 +75,34 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; extern void smux_register_mib(const char *, struct variable *,
                               size_t, int, oid [], size_t);
 extern int smux_header_generic (struct variable *, oid [], size_t *, 
                                 int, size_t *, WriteMethod **);
-extern int smux_trap (const oid *, size_t, const oid *, size_t, 
-      const struct trap_object *, 
-                      size_t, u_char);
+
+/* For traps, three OID are provided:
+
+ 1. The enterprise OID to use (the last argument will be appended to
+    it to form the SNMP trap OID)
+
+ 2. The base OID for objects to be sent in traps.
+
+ 3. The index OID for objects to be sent in traps. This index is used
+    to designate a particular instance of a column.
+
+ The provided trap object contains the bindings to be sent with the
+ trap. The base OID will be prefixed to the provided OID and, if the
+ length is positive, the requested OID is assumed to be a columnar
+ object and the index OID will be appended.
+
+ The two first arguments are the MIB registry used to locate the trap
+ objects.
+
+ The use of the arguments may differ depending on the implementation
+ used.
+*/
+extern int smux_trap (struct variable *, size_t,
+      const oid *, size_t,
+      const oid *, size_t,
+      const oid *, size_t,
+      const struct trap_object *, size_t,
+      u_char);
 
 extern int oid_compare (oid *, int, oid *, int);
 extern void oid2in_addr (oid [], int, struct in_addr *);
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index b2d5686..c8416de 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -210,6 +210,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; SNMP_LOCAL_VARIABLES
 
 /* OSPF-MIB instances. */
 oid ospf_oid [] = { OSPF2MIB };
+oid ospf_trap_oid [] = { OSPF2MIB, 16, 2 }; /* Not reverse mappable! */
 
 /* IP address 0.0.0.0. */
 static struct in_addr ospf_empty_addr = {0};
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2612,7 +2613,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ospfTrapNbrStateChange (struct ospf_neighbor *on)
   oid_copy_addr (index, &amp;amp;(on-&amp;gt;address.u.prefix4), IN_ADDR_SIZE);
   index[IN_ADDR_SIZE] = 0;
 
-  smux_trap (ospf_oid, sizeof ospf_oid / sizeof (oid),
+  smux_trap (ospf_variables, sizeof ospf_variables / sizeof (struct variable),
+     ospf_trap_oid, sizeof ospf_trap_oid / sizeof (oid),
+     ospf_oid, sizeof ospf_oid / sizeof (oid),
              index,  IN_ADDR_SIZE + 1,
              ospfNbrTrapList, 
              sizeof ospfNbrTrapList / sizeof (struct trap_object),
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2629,7 +2632,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ospfTrapVirtNbrStateChange (struct ospf_neighbor *on)
   oid_copy_addr (index, &amp;amp;(on-&amp;gt;address.u.prefix4), IN_ADDR_SIZE);
   index[IN_ADDR_SIZE] = 0;
 
-  smux_trap (ospf_oid, sizeof ospf_oid / sizeof (oid),
+  smux_trap (ospf_variables, sizeof ospf_variables / sizeof (struct variable),
+     ospf_trap_oid, sizeof ospf_trap_oid / sizeof (oid),
+     ospf_oid, sizeof ospf_oid / sizeof (oid),
              index,  IN_ADDR_SIZE + 1,
              ospfVirtNbrTrapList, 
              sizeof ospfVirtNbrTrapList / sizeof (struct trap_object),
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2648,7 +2653,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ospfTrapIfStateChange (struct ospf_interface *oi)
   oid_copy_addr (index, &amp;amp;(oi-&amp;gt;address-&amp;gt;u.prefix4), IN_ADDR_SIZE);
   index[IN_ADDR_SIZE] = 0;
 
-  smux_trap (ospf_oid, sizeof ospf_oid / sizeof (oid),
+  smux_trap (ospf_variables, sizeof ospf_variables / sizeof (struct variable),
+     ospf_trap_oid, sizeof ospf_trap_oid / sizeof (oid),
+     ospf_oid, sizeof ospf_oid / sizeof (oid),
              index, IN_ADDR_SIZE + 1,
              ospfIfTrapList, 
              sizeof ospfIfTrapList / sizeof (struct trap_object),
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2665,7 +2672,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ospfTrapVirtIfStateChange (struct ospf_interface *oi)
   oid_copy_addr (index, &amp;amp;(oi-&amp;gt;address-&amp;gt;u.prefix4), IN_ADDR_SIZE);
   index[IN_ADDR_SIZE] = 0;
 
-  smux_trap (ospf_oid, sizeof ospf_oid / sizeof (oid),
+  smux_trap (ospf_variables, sizeof ospf_variables / sizeof (struct variable),
+     ospf_trap_oid, sizeof ospf_trap_oid / sizeof (oid),
+     ospf_oid, sizeof ospf_oid / sizeof (oid),
              index, IN_ADDR_SIZE + 1,
              ospfVirtIfTrapList,
              sizeof ospfVirtIfTrapList / sizeof (struct trap_object),
&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-25T10:22:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9400">
    <title>[quagga-dev 9380] [PATCH 1/4] smux: remove `tick` argument fromsmux_trap()</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9400</link>
    <description>&lt;pre&gt;smux_trap() contains an argument whose use appears to be to set
sysUpTime.0/timestamp field in SNMP trap. However, this value is not
used in smux_trap(). Moreover, it is expected that this field is the
value of sysUpTime.0 when the trap was sent and not any other time
related to the trap. To avoid any confusion, we remove this field from
the signature of the function.
---
 bgpd/bgp_snmp.c   |    4 ++--
 lib/agentx.c      |    2 +-
 lib/smux.c        |    2 +-
 lib/smux.h        |    2 +-
 ospfd/ospf_snmp.c |    8 ++++----
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c
index f6b1056..a995ff6 100644
--- a/bgpd/bgp_snmp.c
+++ b/bgpd/bgp_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -853,7 +853,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bgpTrapEstablished (struct peer *peer)
   smux_trap (bgp_oid, sizeof bgp_oid / sizeof (oid),
      index, IN_ADDR_SIZE,
      bgpTrapList, sizeof bgpTrapList / sizeof (struct trap_object),
-     bm-&amp;gt;start_time - bgp_clock (), BGPESTABLISHED);
+     BGPESTABLISHED);
 }
 
 void
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -872,7 +872,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; bgpTrapBackwardTransition (struct peer *peer)
   smux_trap (bgp_oid, sizeof bgp_oid / sizeof (oid),
      index, IN_ADDR_SIZE,
      bgpTrapList, sizeof bgpTrapList / sizeof (struct trap_object),
-     bm-&amp;gt;start_time - bgp_clock (), BGPBACKWARDTRANSITION);
+     BGPBACKWARDTRANSITION);
 }
 
 void
diff --git a/lib/agentx.c b/lib/agentx.c
index 06664df..9b82355 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -124,7 +124,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int
 smux_trap (const oid *name, size_t namelen,
    const oid *iname, size_t inamelen,
    const struct trap_object *trapobj, size_t trapobjlen,
-   unsigned int tick, u_char sptrap)
+   u_char sptrap)
 {
   return 1;
 }
diff --git a/lib/smux.c b/lib/smux.c
index 2937005..38c7018 100644
--- a/lib/smux.c
+++ b/lib/smux.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -972,7 +972,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int
 smux_trap (const oid *name, size_t namelen,
    const oid *iname, size_t inamelen,
    const struct trap_object *trapobj, size_t trapobjlen,
-   unsigned int tick, u_char sptrap)
+   u_char sptrap)
 {
   unsigned int i;
   u_char buf[BUFSIZ];
diff --git a/lib/smux.h b/lib/smux.h
index 83ae56c..78460e6 100644
--- a/lib/smux.h
+++ b/lib/smux.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -78,7 +78,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; extern int smux_header_generic (struct variable *, oid [], size_t *,
                                 int, size_t *, WriteMethod **);
 extern int smux_trap (const oid *, size_t, const oid *, size_t, 
       const struct trap_object *, 
-                      size_t, unsigned int, u_char);
+                      size_t, u_char);
 
 extern int oid_compare (oid *, int, oid *, int);
 extern void oid2in_addr (oid [], int, struct in_addr *);
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index 739dcae..409153b 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2616,7 +2616,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ospfTrapNbrStateChange (struct ospf_neighbor *on)
              index,  IN_ADDR_SIZE + 1,
              ospfNbrTrapList, 
              sizeof ospfNbrTrapList / sizeof (struct trap_object),
-             time (NULL), NBRSTATECHANGE);
+             NBRSTATECHANGE);
 }
 
 void
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2633,7 +2633,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ospfTrapVirtNbrStateChange (struct ospf_neighbor *on)
              index,  IN_ADDR_SIZE + 1,
              ospfVirtNbrTrapList, 
              sizeof ospfVirtNbrTrapList / sizeof (struct trap_object),
-             time (NULL), VIRTNBRSTATECHANGE);
+             VIRTNBRSTATECHANGE);
 }
 
 void
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2652,7 +2652,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ospfTrapIfStateChange (struct ospf_interface *oi)
              index, IN_ADDR_SIZE + 1,
              ospfIfTrapList, 
              sizeof ospfIfTrapList / sizeof (struct trap_object),
-             time (NULL), IFSTATECHANGE);
+             IFSTATECHANGE);
 }
 
 void
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2669,7 +2669,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; ospfTrapVirtIfStateChange (struct ospf_interface *oi)
              index, IN_ADDR_SIZE + 1,
              ospfVirtIfTrapList,
              sizeof ospfVirtIfTrapList / sizeof (struct trap_object),
-             time (NULL), VIRTIFSTATECHANGE);
+             VIRTIFSTATECHANGE);
 }
 /* Register OSPF2-MIB. */
 void
&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-25T10:22:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9399">
    <title>[quagga-dev 9379] OSPFv2 / receiving Ack</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9399</link>
    <description>&lt;pre&gt;Hi.

On Receiving Ack with ospfd,
one more check is necessary.

When a ls-update packet with non-MaxAge LSA has appeared,
the LSA is registerred on retransmit list.
and if the LSA is overwritten with MaxAge &amp;amp; same-seqnum,
LSA on retransmit list is also replaced with MaxAge one.

when an neighbor slowly receives non-MaxAge LSA and
send back an Ack,  current ospfd detects this is
"same instance" and delete the MaxAge LSA from retrans list.

This causes LSDB inconsistency.





melody(15:00:47):~/work/quagga-0.99.20.1/ospfd$ diff -U10 ospf_packet.c
ospf_packet.2.c
--- ospf_packet.c2012-05-25 15:00:41.000000000 +0900
+++ ospf_packet.2.c2012-05-25 15:00:26.000000000 +0900
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2077,21 +2077,22 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;

       if (lsa-&amp;gt;data-&amp;gt;type &amp;lt; OSPF_MIN_LSA || lsa-&amp;gt;data-&amp;gt;type &amp;gt;=
OSPF_MAX_LSA)
 {
   lsa-&amp;gt;data = NULL;
   ospf_lsa_discard (lsa);
   continue;
 }

       lsr = ospf_ls_retransmit_lookup (nbr, lsa);

-      if (lsr != NULL &amp;amp;&amp;amp; lsr-&amp;gt;data-&amp;gt;ls_seqnum == lsa-&amp;gt;data-&amp;gt;ls_seqnum)
+      if (lsr != NULL &amp;amp;&amp;amp; lsr-&amp;gt;data-&amp;gt;ls_seqnum == lsa-&amp;gt;data-&amp;gt;ls_seqnum
+  &amp;amp;&amp;amp; (ntohs (lsr-&amp;gt;data-&amp;gt;ls_age) &amp;gt;= OSPF_LSA_MAXAGE) == (ntohs
(lsr-&amp;gt;data-&amp;gt;ls_age) &amp;gt;= OSPF_LSA_MAXAGE))
         {
 #ifdef HAVE_OPAQUE_LSA
           if (IS_OPAQUE_LSA (lsr-&amp;gt;data-&amp;gt;type))
             ospf_opaque_ls_ack_received (nbr, lsr);
 #endif /* HAVE_OPAQUE_LSA */

           ospf_ls_retransmit_delete (nbr, lsr);
         }

       lsa-&amp;gt;data = NULL;
melody(15:00:58):~/work/quagga-0.99.20.1/ospfd$

Thanks.
--
kashima&amp;lt; at &amp;gt;jp.fujitsu.com

&lt;/pre&gt;</description>
    <dc:creator>KASHIMA Hiroaki</dc:creator>
    <dc:date>2012-05-25T06:15:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9398">
    <title>[quagga-dev 9378] Re: [PATCH 2/5] build: only define HAVE_SNMP</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9398</link>
    <description>&lt;pre&gt;OoO En ce  début d'après-midi nuageux du jeudi 24  mai 2012, vers 14:33,
Michael H Lambert &amp;lt;lambert&amp;lt; at &amp;gt;psc.edu&amp;gt; disait :



configure.ac checks  for net-snmp/net-snmp-config.h and  issues an error
if it is not usable. It also tries to link with libnetsnmp and issues an
error if  it is  not available.  But  maybe FreeBSD  SNMP implementation
includes the compatibility bits for this. Dunno.

The original configure.ac snippet is the following:

dnl ------------------
dnl check Net-SNMP library
dnl ------------------
if test "${enable_snmp}" = "yes"; then
    if test "$with_crypto" != "no"; then
        LIBS="${LIBS} -lcrypto";
    fi
    AC_CHECK_LIB(netsnmp, asn_parse_int,
        [AC_DEFINE(HAVE_NETSNMP,,Net SNMP) 
         AC_DEFINE(HAVE_SNMP,,SNMP)
         LIBS="${LIBS} -lnetsnmp"],
        [AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])])

    AC_CHECK_HEADER([net-snmp/net-snmp-config.h],
        [],
        [AC_MSG_ERROR([--enable-snmp given, but cannot find net-snmp-config.h])],
        QUAGGA_INCLUDES)
    AC_SUBST(SNMP_INCLUDES)
fi

&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-24T17:02:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9397">
    <title>[quagga-dev 9377] Re: [PATCH 2/5] build: only define HAVE_SNMP</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9397</link>
    <description>&lt;pre&gt;

Can you (or somebody else who might have tried) state with certainty that, for example, /usr/include/bsnmp on FreeBSD does not work with quagga?

Thanks,

Michael


&lt;/pre&gt;</description>
    <dc:creator>Michael H Lambert</dc:creator>
    <dc:date>2012-05-24T12:33:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9395">
    <title>[quagga-dev 9376] Segmentation fault while running Quagga on Octeon</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9395</link>
    <description>&lt;pre&gt;Hi ,
                I am trying to cross compile quagga 0.99.18 routing suite for octeon .
After setting "ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes" in configure my cross compilation was successful . But when I tried to run the zebra daemon on the octeon board I got a segmentation fault.
please suggest a way to go about this issue.
Also please provide a solution to  get statically linked quagga daemons as the -static flag is ineffective.


Thanks &amp;amp; Regards,
Harini Gopalakrishnan


________________________________
The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&amp;amp;T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"
&lt;/pre&gt;</description>
    <dc:creator>Harini Gopalakrishnan</dc:creator>
    <dc:date>2012-05-24T09:53:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9394">
    <title>[quagga-dev 9375] [RFC] AgentX support for Quagga</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9394</link>
    <description>&lt;pre&gt;Hi!

Here is a serie of patches adding AgentX support to Quagga.

The first patch is not related to AgentX support. It just fixes Quagge
compilation when using a separate build directory.

The second patch removes some cruft left from a migration from
UCD-SNMP (I think). This is just a small cleanup.

The third patch makes use of "net-snmp-config" in place of linking to
-lnetsnmp. It removes explicit link to -lcrypto. If needed, this will
be added by "net-snmp-config". "net-snmp-config" exists since at least
NetSNMP 4.2.

The fourth patch separates SMUX specific stuff from generic SNMP
stuff. smux.h now only contains the interface to SMUX for the
daemons. Everything else has been moved to smux.c. The idea is for
another SNMP implementation to provide the appropriate smux_*
functions. snmp.c is a new file containing oid_* functions (they are
independant of the SNMP implementation).

The last patch adds AgentX support by providing the appropriate smux_*
functions. This patch does not modify daemons. Because Net-SNMP hides
its internals, it is not possible to disable AgentX support once
enabled. This should not be a problem, because, like with SMUX, the
commands are not exported to vtysh and therefore, I suppose there is
no way to call "no agentx".

Also, the event loop is modified (in thread.c). NetSNMP hides the
appropriate file descriptors and timers.

The documentation has not been updated. This should be easy enough
once I am done with the other details.

The big problem now is traps. Currently, I do not send any trap with
AgentX. The SMUX implementation only sends SNMPv1 traps using the SMUX
peer OID as an enterprise OID. I think this is not the right way to do
it. Both OSPF-MIB (through OSPF-TRAP-MIB) and BGP-MIB defines
notifications. A notification is some kind of SNMPv2 TRAP. Let me
explain. With a SNMPv1 trap, you have: an enterprise OID, a generic
trap code (always 6 in our case) and a specific trap code. With a
notification, all those are replaced by a snmptrap OID.

It is possible to transform SNMPv1 trap to SNMPv2 trap and
vice-versa. However, if I just do this, I will continue to use
inappropriate enterprise OID (the SMUX peer OID). I should use the
appropriate notification objects, as defined in MIB.

My first proposition was to change smux_trap() signature to include
the appropriate enterprise OID (used to build snmp trap OID). Then, I
will also update the SMUX implementation. There are two drawbacks:

 - daemons maintained outside of Quagga will also need to update (if
   they use traps)
 - people receiving traps will need to update their configuration to
   use the correct OID instead of the previous ones.

Another proposition will be to just keep the SMUX peer OID. People may
change it to the appropriate value (since I will not use it as a SMUX
peer OID) to get correct snmp trap OID. For BGP and OSPF, this will
work because all traps are rooted at the same OID. I can however
provide a "smux_inform()" function allowing to override the enterprise
OID.

Any though? And any comment on the patches in general?

&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-24T08:56:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9393">
    <title>[quagga-dev 9374] [PATCH 5/5] agentx: add AgentX support to Quagga.</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9393</link>
    <description>&lt;pre&gt;--enable-snmp will enable AgentX support in Quagga. SMUX is still here
and can be enabled with --enable-snmp=smux. AgentX support can be
enabled with "agentx" in configuration file. As for SMUX, this command
is not understood by vtysh. It can be disabled with "no agentx",
though there is no real use of this since this command cannot be used
with vtysh.

If "agentx" and "no agentx" command were added to vtysh, it would not
be possible to disable agentx support after enabling it because
NetSNMP does not expose the appropriate methods for this.

The internals of AgentX are hidden by NetSNMP. Therefore, we don't
have a file descriptor to add to the threading system. We do not have
the timers to set either. Therefore, the event loop is modified to
make use of snmp_select_info() from NetSNMP.

Traps are not supported yet.
---
 configure.ac    |   18 +++++++-
 lib/Makefile.am |    2 +-
 lib/agentx.c    |  132 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/smux.c      |    2 +-
 lib/thread.c    |   45 +++++++++++++++++++
 5 files changed, 195 insertions(+), 4 deletions(-)
 create mode 100644 lib/agentx.c

diff --git a/configure.ac b/configure.ac
index 1ad2b75..7fbdc44 100755
--- a/configure.ac
+++ b/configure.ac
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -222,7 +222,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; AC_ARG_ENABLE(netlink,
 AC_ARG_ENABLE(broken-aliases,
 [  --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
 AC_ARG_ENABLE(snmp,
-[  --enable-snmp           enable SNMP support])
+[  --enable-snmp=ARG       enable SNMP support (smux or agentx)])
 AC_ARG_WITH(libpam,
 [  --with-libpam           use libpam for PAM support in vtysh])
 AC_ARG_ENABLE(tcp-zebra,
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1363,7 +1363,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; AC_SUBST(LIB_REGEX)
 dnl ------------------
 dnl check Net-SNMP library
 dnl ------------------
-if test "${enable_snmp}" = "yes"; then
+if test "${enable_snmp}" != ""; then
    AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], [no])
    if test x"$NETSNMP_CONFIG" = x"no"; then
       AC_MSG_ERROR([--enable-snmp given but unable to find net-snmp-config])
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1382,6 +1382,20 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int main(void);
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([--enable-snmp given but not usable])])
    AC_DEFINE(HAVE_SNMP,,SNMP)
+   case "${enable_snmp}" in
+     yes)
+      SNMP_METHOD=agentx
+      ;;
+     smux|agentx)
+      SNMP_METHOD="${enable_snmp}"
+      ;;
+     *)
+      AC_MSG_ERROR([--enable-snmp given with an unknown method (${enable_snmp}). Use smux or agentx])
+      ;;
+   esac
+   AH_TEMPLATE([SNMP_SMUX], [Use SNMP SMUX to interface with snmpd])
+   AH_TEMPLATE([SNMP_AGENTX], [Use SNMP AgentX to interface with snmpd])
+   AC_DEFINE_UNQUOTED(AS_TR_CPP(SNMP_${SNMP_METHOD}),,SNMP method to interface with snmpd)
 fi
 
 dnl ---------------------------
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 73417ad..e00ad54 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -11,7 +11,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; libzebra_la_SOURCES = \
 checksum.c vector.c linklist.c vty.c command.c \
 sockunion.c prefix.c thread.c if.c memory.c buffer.c table.c hash.c \
 filter.c routemap.c distribute.c stream.c str.c log.c plist.c \
-zclient.c sockopt.c smux.c snmp.c md5.c if_rmap.c keychain.c privs.c \
+zclient.c sockopt.c smux.c agentx.c snmp.c md5.c if_rmap.c keychain.c privs.c \
 sigevent.c pqueue.c jhash.c memtypes.c workqueue.c
 
 BUILT_SOURCES = memtypes.h route_types.h
diff --git a/lib/agentx.c b/lib/agentx.c
new file mode 100644
index 0000000..06664df
--- /dev/null
+++ b/lib/agentx.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,132 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/* SNMP support
+ * Copyright (C) 2012 Vincent Bernat &amp;lt;bernat&amp;lt; at &amp;gt;luffy.cx&amp;gt;
+ *
+ * This file is part of GNU Zebra.
+ *
+ * GNU Zebra 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, or (at your option) any
+ * later version.
+ *
+ * GNU Zebra 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 GNU Zebra; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.  
+ */
+
+#include &amp;lt;zebra.h&amp;gt;
+
+#if defined HAVE_SNMP &amp;amp;&amp;amp; defined SNMP_AGENTX
+#include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;
+#include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;
+
+#include "command.h"
+#include "smux.h"
+
+int agentx_enabled = 0;
+
+/* AgentX node. */
+static struct cmd_node agentx_node =
+{
+  SMUX_NODE,
+  ""                            /* AgentX has no interface. */
+};
+
+/* Logging NetSNMP messages */
+static int
+agentx_log_callback(int major, int minor,
+    void *serverarg, void *clientarg)
+{
+  struct snmp_log_message *slm = (struct snmp_log_message *)serverarg;
+  char *msg = strdup(slm-&amp;gt;msg);
+  (void)major; (void)minor; (void)clientarg;
+  if (msg) msg[strlen(msg)-1] = '\0';
+  switch (slm-&amp;gt;priority) {
+  case LOG_EMERG:   zlog_err   ("snmp[emerg]: %s",   msg?msg:slm-&amp;gt;msg); break;
+  case LOG_ALERT:   zlog_err   ("snmp[alert]: %s",   msg?msg:slm-&amp;gt;msg); break;
+  case LOG_CRIT:    zlog_err   ("snmp[crit]: %s",    msg?msg:slm-&amp;gt;msg); break;
+  case LOG_ERR:     zlog_err   ("snmp[err]: %s",     msg?msg:slm-&amp;gt;msg); break;
+  case LOG_WARNING: zlog_warn  ("snmp[warning]: %s", msg?msg:slm-&amp;gt;msg); break;
+  case LOG_NOTICE:  zlog_notice("snmp[notice]: %s",  msg?msg:slm-&amp;gt;msg); break;
+  case LOG_INFO:    zlog_info  ("snmp[info]: %s",    msg?msg:slm-&amp;gt;msg); break;
+  case LOG_DEBUG:   zlog_debug ("snmp[debug]: %s",   msg?msg:slm-&amp;gt;msg); break;
+  }
+  free(msg);
+  return SNMP_ERR_NOERROR;
+}
+
+static int
+config_write_agentx (struct vty *vty)
+{
+  if (agentx_enabled)
+      vty_out (vty, "agentx%s", VTY_NEWLINE);
+  return 0;
+}
+
+DEFUN (agentx_enable,
+       agentx_enable_cmd,
+       "agentx",
+       "SNMP AgentX protocol settings\n"
+       "SNMP AgentX settings\n")
+{
+  if (!agentx_enabled) {
+    init_snmp("quagga");
+    agentx_enabled = 1;
+    return CMD_SUCCESS;
+  }
+  vty_out (vty, "SNMP AgentX already enabled%s", VTY_NEWLINE);
+  return CMD_WARNING;
+}
+
+DEFUN (no_agentx,
+       no_agentx_cmd,
+       "no agentx",
+       NO_STR
+       "SNMP AgentX protocol settings\n"
+       "SNMP AgentX settings\n")
+{
+  if (!agentx_enabled) return CMD_SUCCESS;
+  vty_out (vty, "SNMP AgentX support cannot be disabled once enabled%s", VTY_NEWLINE);
+  return CMD_WARNING;
+}
+
+void
+smux_init (struct thread_master *tm)
+{
+  netsnmp_enable_subagent();
+  snmp_disable_log();
+  snmp_enable_calllog();
+  snmp_register_callback (SNMP_CALLBACK_LIBRARY,
+  SNMP_CALLBACK_LOGGING,
+  agentx_log_callback,
+  NULL);
+  init_agent ("quagga");
+
+  install_node (&amp;amp;agentx_node, config_write_agentx);
+  install_element (CONFIG_NODE, &amp;amp;agentx_enable_cmd);
+  install_element (CONFIG_NODE, &amp;amp;no_agentx_cmd);
+}
+
+void
+smux_register_mib (const char *descr, struct variable *var, 
+                   size_t width, int num, 
+   oid name[], size_t namelen)
+{
+  register_mib (descr, var, width, num, name, namelen);
+}
+
+int
+smux_trap (const oid *name, size_t namelen,
+   const oid *iname, size_t inamelen,
+   const struct trap_object *trapobj, size_t trapobjlen,
+   unsigned int tick, u_char sptrap)
+{
+  return 1;
+}
+
+#endif /* HAVE_SNMP */
diff --git a/lib/smux.c b/lib/smux.c
index a5d84a8..2937005 100644
--- a/lib/smux.c
+++ b/lib/smux.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -21,7 +21,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 #include &amp;lt;zebra.h&amp;gt;
 
-#ifdef HAVE_SNMP
+#if defined HAVE_SNMP &amp;amp;&amp;amp; defined SNMP_SMUX
 #include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;
 #include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;
 
diff --git a/lib/thread.c b/lib/thread.c
index dd0413b..cbe8fed 100644
--- a/lib/thread.c
+++ b/lib/thread.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -29,6 +29,16 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "hash.h"
 #include "command.h"
 #include "sigevent.h"
+
+#if defined HAVE_SNMP &amp;amp;&amp;amp; defined SNMP_AGENTX
+#include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;
+#include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;
+#include &amp;lt;net-snmp/agent/net-snmp-agent-includes.h&amp;gt;
+#include &amp;lt;net-snmp/agent/snmp_vars.h&amp;gt;
+
+extern int agentx_enabled;
+#endif
+
 
 /* Recent absolute time of day */
 struct timeval recent_time;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1042,6 +1052,11 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; thread_fetch (struct thread_master *m, struct thread *fetch)
   while (1)
     {
       int num = 0;
+#if defined HAVE_SNMP &amp;amp;&amp;amp; defined SNMP_AGENTX
+      struct timeval snmp_timer_wait;
+      int snmpblock = 0;
+      int fdsetsize;
+#endif
       
       /* Signals pre-empt everything */
       quagga_sigevent_process ();
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1077,6 +1092,24 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; thread_fetch (struct thread_master *m, struct thread *fetch)
             timer_wait = timer_wait_bg;
         }
       
+#if defined HAVE_SNMP &amp;amp;&amp;amp; defined SNMP_AGENTX
+      /* When SNMP is enabled, we may have to select() on additional
+ FD. snmp_select_info() will add them to `readfd'. The trick
+ with this function is its last argument. We need to set it to
+ 0 if timer_wait is not NULL and we need to use the provided
+ new timer only if it is still set to 0. */
+      if (agentx_enabled) {
+fdsetsize = FD_SETSIZE;
+snmpblock = 1;
+if (timer_wait) {
+  snmpblock = 0;
+  memcpy(&amp;amp;snmp_timer_wait, timer_wait, sizeof(struct timeval));
+}
+snmp_select_info(&amp;amp;fdsetsize, &amp;amp;readfd, &amp;amp;snmp_timer_wait, &amp;amp;snmpblock);
+if (snmpblock == 0)
+  timer_wait = &amp;amp;snmp_timer_wait;
+      }
+#endif
       num = select (FD_SETSIZE, &amp;amp;readfd, &amp;amp;writefd, &amp;amp;exceptfd, timer_wait);
       
       /* Signals should get quick treatment */
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1088,6 +1121,18 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; thread_fetch (struct thread_master *m, struct thread *fetch)
             return NULL;
         }
 
+#if defined HAVE_SNMP &amp;amp;&amp;amp; defined SNMP_AGENTX
+      if (agentx_enabled) {
+if (num &amp;gt; 0)
+snmp_read(&amp;amp;readfd);
+else if (num == 0) {
+snmp_timeout();
+run_alarms();
+}
+netsnmp_check_outstanding_agent_requests();
+      }
+#endif
+
       /* Check foreground timers.  Historically, they have had higher
          priority than I/O threads, so let's push them onto the ready
  list in front of the I/O threads. */
&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-24T08:56:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9392">
    <title>[quagga-dev 9373] [PATCH 4/5] smux: isolate SMUX implementationfrom SNMP implementation</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9392</link>
    <description>&lt;pre&gt;lib/snmp.c gets OID related helper functions that can be used with
another SNMP interface. smux.h is cleaned of SMUX specific bits to
only expose functions that may be used by an alternative
implementation. We also do not redefine functions already present in
NetSNMP. Just use the appropriate headers.
---
 lib/Makefile.am |    2 +-
 lib/smux.c      |  123 ++++++++++++++++++-------------------------------------
 lib/smux.h      |   81 ++----------------------------------
 lib/snmp.c      |  113 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 158 insertions(+), 161 deletions(-)
 create mode 100644 lib/snmp.c

diff --git a/lib/Makefile.am b/lib/Makefile.am
index d01cf72..73417ad 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -11,7 +11,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; libzebra_la_SOURCES = \
 checksum.c vector.c linklist.c vty.c command.c \
 sockunion.c prefix.c thread.c if.c memory.c buffer.c table.c hash.c \
 filter.c routemap.c distribute.c stream.c str.c log.c plist.c \
-zclient.c sockopt.c smux.c md5.c if_rmap.c keychain.c privs.c \
+zclient.c sockopt.c smux.c snmp.c md5.c if_rmap.c keychain.c privs.c \
 sigevent.c pqueue.c jhash.c memtypes.c workqueue.c
 
 BUILT_SOURCES = memtypes.h route_types.h
diff --git a/lib/smux.c b/lib/smux.c
index 145ec90..a5d84a8 100644
--- a/lib/smux.c
+++ b/lib/smux.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -34,6 +34,45 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include "sockunion.h"
 #include "smux.h"
 
+#define SMUX_PORT_DEFAULT 199
+
+#define SMUXMAXPKTSIZE    1500
+#define SMUXMAXSTRLEN      256
+
+#define SMUX_OPEN       (ASN_APPLICATION | ASN_CONSTRUCTOR | 0)
+#define SMUX_CLOSE      (ASN_APPLICATION | ASN_PRIMITIVE | 1)
+#define SMUX_RREQ       (ASN_APPLICATION | ASN_CONSTRUCTOR | 2)
+#define SMUX_RRSP       (ASN_APPLICATION | ASN_PRIMITIVE | 3)
+#define SMUX_SOUT       (ASN_APPLICATION | ASN_PRIMITIVE | 4)
+
+#define SMUX_GET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0)
+#define SMUX_GETNEXT    (ASN_CONTEXT | ASN_CONSTRUCTOR | 1)
+#define SMUX_GETRSP     (ASN_CONTEXT | ASN_CONSTRUCTOR | 2)
+#define SMUX_SET(ASN_CONTEXT | ASN_CONSTRUCTOR | 3)
+#define SMUX_TRAP(ASN_CONTEXT | ASN_CONSTRUCTOR | 4)
+
+#define SMUX_MAX_FAILURE 3
+
+/* SNMP tree. */
+struct subtree
+{
+  /* Tree's oid. */
+  oid name[MAX_OID_LEN];
+  u_char name_len;
+
+  /* List of the variables. */
+  struct variable *variables;
+
+  /* Length of the variables list. */
+  int variables_num;
+
+  /* Width of the variables list. */
+  int variables_width;
+
+  /* Registered flag. */
+  int registered;
+};
+
 #define min(A,B) ((A) &amp;lt; (B) ? (A) : (B))
 
 enum smux_event {SMUX_SCHEDULE, SMUX_CONNECT, SMUX_READ};
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -76,62 +115,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct cmd_node smux_node =
 /* thread master */
 static struct thread_master *master;
 
-void *
-oid_copy (void *dest, const void *src, size_t size)
-{
-  return memcpy (dest, src, size * sizeof (oid));
-}
-
-void
-oid2in_addr (oid oid[], int len, struct in_addr *addr)
-{
-  int i;
-  u_char *pnt;
-  
-  if (len == 0)
-    return;
-
-  pnt = (u_char *) addr;
-
-  for (i = 0; i &amp;lt; len; i++)
-    *pnt++ = oid[i];
-}
-
-void
-oid_copy_addr (oid oid[], struct in_addr *addr, int len)
-{
-  int i;
-  u_char *pnt;
-  
-  if (len == 0)
-    return;
-
-  pnt = (u_char *) addr;
-
-  for (i = 0; i &amp;lt; len; i++)
-    oid[i] = *pnt++;
-}
-
-int
-oid_compare (oid *o1, int o1_len, oid *o2, int o2_len)
-{
-  int i;
-
-  for (i = 0; i &amp;lt; min (o1_len, o2_len); i++)
-    {
-      if (o1[i] &amp;lt; o2[i])
-return -1;
-      else if (o1[i] &amp;gt; o2[i])
-return 1;
-    }
-  if (o1_len &amp;lt; o2_len)
-    return -1;
-  if (o1_len &amp;gt; o2_len)
-    return 1;
-
-  return 0;
-}
-
 static int
 oid_compare_part (oid *o1, int o1_len, oid *o2, int o2_len)
 {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -473,7 +456,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; smux_set (oid *reqid, size_t *reqid_len,
                   if (write_method)
                     {
                       return (*write_method)(action, val, val_type, val_len,
-     statP, suffix, suffix_len, v);
+     statP, suffix, suffix_len);
                     }
                   else
                     {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1354,32 +1337,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; smux_peer_oid (struct vty *vty, const char *oid_str, const char *passwd_str)
   return 0;
 }
 
-int
-smux_header_generic (struct variable *v, oid *name, size_t *length, int exact,
-     size_t *var_len, WriteMethod **write_method)
-{
-  oid fulloid[MAX_OID_LEN];
-  int ret;
-
-  oid_copy (fulloid, v-&amp;gt;name, v-&amp;gt;namelen);
-  fulloid[v-&amp;gt;namelen] = 0;
-  /* Check against full instance. */
-  ret = oid_compare (name, *length, fulloid, v-&amp;gt;namelen + 1);
-
-  /* Check single instance. */
-  if ((exact &amp;amp;&amp;amp; (ret != 0)) || (!exact &amp;amp;&amp;amp; (ret &amp;gt;= 0)))
-return MATCH_FAILED;
-
-  /* In case of getnext, fill in full instance. */
-  memcpy (name, fulloid, (v-&amp;gt;namelen + 1) * sizeof (oid));
-  *length = v-&amp;gt;namelen + 1;
-
-  *write_method = 0;
-  *var_len = sizeof(long);    /* default to 'long' results */
-
-  return MATCH_SUCCEEDED;
-}
-
 static int
 smux_peer_default (void)
 {
diff --git a/lib/smux.h b/lib/smux.h
index f5754ed..83ae56c 100644
--- a/lib/smux.h
+++ b/lib/smux.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -22,24 +22,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #ifndef _ZEBRA_SNMP_H
 #define _ZEBRA_SNMP_H
 
-#define SMUX_PORT_DEFAULT 199
-
-#define SMUXMAXPKTSIZE    1500
-#define SMUXMAXSTRLEN      256
-
-#define SMUX_OPEN       (ASN_APPLICATION | ASN_CONSTRUCTOR | 0)
-#define SMUX_CLOSE      (ASN_APPLICATION | ASN_PRIMITIVE | 1)
-#define SMUX_RREQ       (ASN_APPLICATION | ASN_CONSTRUCTOR | 2)
-#define SMUX_RRSP       (ASN_APPLICATION | ASN_PRIMITIVE | 3)
-#define SMUX_SOUT       (ASN_APPLICATION | ASN_PRIMITIVE | 4)
-
-#define SMUX_GET        (ASN_CONTEXT | ASN_CONSTRUCTOR | 0)
-#define SMUX_GETNEXT    (ASN_CONTEXT | ASN_CONSTRUCTOR | 1)
-#define SMUX_GETRSP     (ASN_CONTEXT | ASN_CONSTRUCTOR | 2)
-#define SMUX_SET(ASN_CONTEXT | ASN_CONSTRUCTOR | 3)
-#define SMUX_TRAP(ASN_CONTEXT | ASN_CONSTRUCTOR | 4)
-
-#define SMUX_MAX_FAILURE 3
+#include &amp;lt;net-snmp/agent/net-snmp-agent-includes.h&amp;gt;
+#include &amp;lt;net-snmp/agent/snmp_vars.h&amp;gt;
 
 /* Structures here are mostly compatible with UCD SNMP 4.1.1 */
 #define MATCH_FAILED     (-1)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -55,69 +39,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 #define IN_ADDR_SIZE sizeof(struct in_addr)
 
-struct variable;
-
+#undef REGISTER_MIB
 #define REGISTER_MIB(descr, var, vartype, theoid)\
     smux_register_mib(descr, (struct variable *)var, sizeof(struct vartype), \
     sizeof(var)/sizeof(struct vartype),\
     theoid, sizeof(theoid)/sizeof(oid))
 
-typedef int (WriteMethod)(int action,
-  u_char  *var_val,
-  u_char   var_val_type,
-  size_t   var_val_len,
-  u_char  *statP,
-  oid     *name,
-  size_t   length,
-  struct variable *v);
-
-typedef u_char *(FindVarMethod)(struct variable *v,
-oid     *name,
-size_t  *length,
-int      exact,
-size_t  *var_len,
-WriteMethod   **write_method);
-
-/* SNMP variable */
-struct variable
-{
-  /* Index of the MIB.*/
-  u_char magic;
-
-  /* Type of variable. */
-  char type;
-
-  /* Access control list. */
-  u_short acl;
-
-  /* Callback function. */
-  FindVarMethod *findVar;
-
-  /* Suffix of the MIB. */
-  int namelen;
-  oid name[MAX_OID_LEN];
-};
-
-/* SNMP tree. */
-struct subtree
-{
-  /* Tree's oid. */
-  oid name[MAX_OID_LEN];
-  u_char name_len;
-
-  /* List of the variables. */
-  struct variable *variables;
-
-  /* Length of the variables list. */
-  int variables_num;
-
-  /* Width of the variables list. */
-  int variables_width;
-
-  /* Registered flag. */
-  int registered;
-};
-
 struct trap_object
 {
   FindVarMethod *findVar;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -145,7 +72,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct trap_object
   )
 
 extern void smux_init (struct thread_master *tm);
-extern void smux_start (void);
 extern void smux_register_mib(const char *, struct variable *, 
                               size_t, int, oid [], size_t);
 extern int smux_header_generic (struct variable *, oid [], size_t *, 
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -153,6 +79,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; extern int smux_header_generic (struct variable *, oid [], size_t *,
 extern int smux_trap (const oid *, size_t, const oid *, size_t, 
       const struct trap_object *, 
                       size_t, unsigned int, u_char);
+
 extern int oid_compare (oid *, int, oid *, int);
 extern void oid2in_addr (oid [], int, struct in_addr *);
 extern void *oid_copy (void *, const void *, size_t);
diff --git a/lib/snmp.c b/lib/snmp.c
new file mode 100644
index 0000000..d7b1d95
--- /dev/null
+++ b/lib/snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,113 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/* SNMP support
+ * Copyright (C) 1999 Kunihiro Ishiguro &amp;lt;kunihiro&amp;lt; at &amp;gt;zebra.org&amp;gt;
+ *
+ * This file is part of GNU Zebra.
+ *
+ * GNU Zebra 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, or (at your option) any
+ * later version.
+ *
+ * GNU Zebra 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 GNU Zebra; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.  
+ */
+
+#include &amp;lt;zebra.h&amp;gt;
+
+#ifdef HAVE_SNMP
+#include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;
+#include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;
+
+#include "smux.h"
+
+#define min(A,B) ((A) &amp;lt; (B) ? (A) : (B))
+
+int
+oid_compare (oid *o1, int o1_len, oid *o2, int o2_len)
+{
+  int i;
+
+  for (i = 0; i &amp;lt; min (o1_len, o2_len); i++)
+    {
+      if (o1[i] &amp;lt; o2[i])
+return -1;
+      else if (o1[i] &amp;gt; o2[i])
+return 1;
+    }
+  if (o1_len &amp;lt; o2_len)
+    return -1;
+  if (o1_len &amp;gt; o2_len)
+    return 1;
+
+  return 0;
+}
+
+void *
+oid_copy (void *dest, const void *src, size_t size)
+{
+  return memcpy (dest, src, size * sizeof (oid));
+}
+
+void
+oid2in_addr (oid oid[], int len, struct in_addr *addr)
+{
+  int i;
+  u_char *pnt;
+  
+  if (len == 0)
+    return;
+
+  pnt = (u_char *) addr;
+
+  for (i = 0; i &amp;lt; len; i++)
+    *pnt++ = oid[i];
+}
+
+void
+oid_copy_addr (oid oid[], struct in_addr *addr, int len)
+{
+  int i;
+  u_char *pnt;
+  
+  if (len == 0)
+    return;
+
+  pnt = (u_char *) addr;
+
+  for (i = 0; i &amp;lt; len; i++)
+    oid[i] = *pnt++;
+}
+
+int
+smux_header_generic (struct variable *v, oid *name, size_t *length, int exact,
+     size_t *var_len, WriteMethod **write_method)
+{
+  oid fulloid[MAX_OID_LEN];
+  int ret;
+
+  oid_copy (fulloid, v-&amp;gt;name, v-&amp;gt;namelen);
+  fulloid[v-&amp;gt;namelen] = 0;
+  /* Check against full instance. */
+  ret = oid_compare (name, *length, fulloid, v-&amp;gt;namelen + 1);
+
+  /* Check single instance. */
+  if ((exact &amp;amp;&amp;amp; (ret != 0)) || (!exact &amp;amp;&amp;amp; (ret &amp;gt;= 0)))
+return MATCH_FAILED;
+
+  /* In case of getnext, fill in full instance. */
+  memcpy (name, fulloid, (v-&amp;gt;namelen + 1) * sizeof (oid));
+  *length = v-&amp;gt;namelen + 1;
+
+  *write_method = 0;
+  *var_len = sizeof(long);    /* default to 'long' results */
+
+  return MATCH_SUCCEEDED;
+}
+#endif /* HAVE_SNMP */
&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-24T08:56:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9391">
    <title>[quagga-dev 9372] [PATCH 3/5] build: use net-snmp-config toconfigure NetSNMP</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9391</link>
    <description>&lt;pre&gt;The correct method to link to NetSNMP is to use net-snmp-config (which
is like pkg-config). Explicit link to libcrypto is also dropped
(NetSNMP libs are linked to libcrypto, no need to link Quagga to
it). Moreover, &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt; is dropped because useless. Due to a
bug in configure.ac, it was properly populated.
---
 babeld/Makefile.am  |    2 +-
 bgpd/Makefile.am    |    2 +-
 configure.ac        |   35 +++++++++++++++++++----------------
 lib/Makefile.am     |    2 +-
 ospf6d/Makefile.am  |    2 +-
 ospfd/Makefile.am   |    2 +-
 ripd/Makefile.am    |    2 +-
 ripngd/Makefile.am  |    2 +-
 vtysh/extract.pl.in |    2 +-
 zebra/Makefile.am   |    2 +-
 10 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/babeld/Makefile.am b/babeld/Makefile.am
index 81f6612..af1201a 100644
--- a/babeld/Makefile.am
+++ b/babeld/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/bgpd/Makefile.am b/bgpd/Makefile.am
index e5ee893..9928734 100644
--- a/bgpd/Makefile.am
+++ b/bgpd/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/configure.ac b/configure.ac
index c3c651f..1ad2b75 100755
--- a/configure.ac
+++ b/configure.ac
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -221,8 +221,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; AC_ARG_ENABLE(netlink,
 [  --enable-netlink        force to use Linux netlink interface])
 AC_ARG_ENABLE(broken-aliases,
 [  --enable-broken-aliases enable aliases as distinct interfaces for Linux 2.2.X])
-AC_ARG_WITH(crypto,
-[  --without-crypto        do not use libcrypto in SNMP])
 AC_ARG_ENABLE(snmp,
 [  --enable-snmp           enable SNMP support])
 AC_ARG_WITH(libpam,
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1366,19 +1364,24 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; dnl ------------------
 dnl check Net-SNMP library
 dnl ------------------
 if test "${enable_snmp}" = "yes"; then
-    if test "$with_crypto" != "no"; then
-        LIBS="${LIBS} -lcrypto";
-    fi
-    AC_CHECK_LIB(netsnmp, asn_parse_int,
-    [AC_DEFINE(HAVE_SNMP,,SNMP)
-     LIBS="${LIBS} -lnetsnmp"],
-    [AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])])
-
-    AC_CHECK_HEADER([net-snmp/net-snmp-config.h],
-        [],
-        [AC_MSG_ERROR([--enable-snmp given, but cannot find net-snmp-config.h])],
-QUAGGA_INCLUDES)
-    AC_SUBST(SNMP_INCLUDES)
+   AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], [no])
+   if test x"$NETSNMP_CONFIG" = x"no"; then
+      AC_MSG_ERROR([--enable-snmp given but unable to find net-snmp-config])
+   fi
+   LIBS="$LIBS `${NETSNMP_CONFIG} --agent-libs`"
+   CFLAGS="$CFLAGS `${NETSNMP_CONFIG} --base-cflags`"
+   AC_MSG_CHECKING([whether we can link to Net-SNMP])
+   AC_LINK_IFELSE([AC_LANG_PROGRAM([
+int main(void);
+],
+[
+{
+  return 0;
+}
+])],[AC_MSG_RESULT(yes)],[
+     AC_MSG_RESULT(no)
+     AC_MSG_ERROR([--enable-snmp given but not usable])])
+   AC_DEFINE(HAVE_SNMP,,SNMP)
 fi
 
 dnl ---------------------------
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1624,7 +1627,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; source code location    : ${srcdir}
 compiler                : ${CC}
 compiler flags          : ${CFLAGS}
 make                    : ${MAKE-make}
-includes                : ${INCLUDES} ${SNMP_INCLUDES}
+includes                : ${INCLUDES}
 linker flags            : ${LDFLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
 state file directory    : ${quagga_statedir}
 config file directory   : `eval echo \`echo ${sysconfdir}\``
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 4c67858..d01cf72 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 
 lib_LTLIBRARIES = libzebra.la
diff --git a/ospf6d/Makefile.am b/ospf6d/Makefile.am
index d05b020..726ce54 100644
--- a/ospf6d/Makefile.am
+++ b/ospf6d/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/ospfd/Makefile.am b/ospfd/Makefile.am
index d0b4ae8..f968d7d 100644
--- a/ospfd/Makefile.am
+++ b/ospfd/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; $(LOCAL_OPTS) -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/ripd/Makefile.am b/ripd/Makefile.am
index 3196090..b0bc7a8 100644
--- a/ripd/Makefile.am
+++ b/ripd/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/ripngd/Makefile.am b/ripngd/Makefile.am
index 83ddca0..de5beba 100644
--- a/ripngd/Makefile.am
+++ b/ripngd/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index 99224f8..2dbaf0a 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -63,7 +63,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; $ignore{'"show history"'} = "ignore";
 foreach (&amp;lt; at &amp;gt;ARGV) {
     $file = $_;
 
-    open (FH, "cpp -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I&amp;lt; at &amp;gt;top_builddir&amp;lt; at &amp;gt; -I&amp;lt; at &amp;gt;srcdir&amp;lt; at &amp;gt;/ -I&amp;lt; at &amp;gt;srcdir&amp;lt; at &amp;gt;/.. -I&amp;lt; at &amp;gt;top_srcdir&amp;lt; at &amp;gt;/lib -I&amp;lt; at &amp;gt;top_builddir&amp;lt; at &amp;gt;/lib -I&amp;lt; at &amp;gt;top_srcdir&amp;lt; at &amp;gt;/isisd/topology &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt; &amp;lt; at &amp;gt;CPPFLAGS&amp;lt; at &amp;gt; $file |");
+    open (FH, "cpp -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I&amp;lt; at &amp;gt;top_builddir&amp;lt; at &amp;gt; -I&amp;lt; at &amp;gt;srcdir&amp;lt; at &amp;gt;/ -I&amp;lt; at &amp;gt;srcdir&amp;lt; at &amp;gt;/.. -I&amp;lt; at &amp;gt;top_srcdir&amp;lt; at &amp;gt;/lib -I&amp;lt; at &amp;gt;top_builddir&amp;lt; at &amp;gt;/lib -I&amp;lt; at &amp;gt;top_srcdir&amp;lt; at &amp;gt;/isisd/topology &amp;lt; at &amp;gt;CPPFLAGS&amp;lt; at &amp;gt; $file |");
     local $/; undef $/;
     $line = &amp;lt;FH&amp;gt;;
     close (FH);
diff --git a/zebra/Makefile.am b/zebra/Makefile.am
index e5b749a..9ac90f8 100644
--- a/zebra/Makefile.am
+++ b/zebra/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\" -DMULTIPATH_NUM=&amp;lt; at &amp;gt;MULTIPATH_NUM&amp;lt; at &amp;gt;
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-24T08:56:33</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9390">
    <title>[quagga-dev 9371] [PATCH 2/5] build: only define HAVE_SNMP</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9390</link>
    <description>&lt;pre&gt;NetSNMP is the only SNMP implementation for Quagga. We don't need two
different symbols.
---
 bgpd/bgp_snmp.c     |    6 ------
 configure.ac        |    3 +--
 lib/smux.c          |    6 ------
 ospf6d/ospf6_snmp.c |    6 ------
 ospfd/ospf_snmp.c   |    6 ------
 ripd/rip_snmp.c     |    6 ------
 zebra/zebra_snmp.c  |    6 ------
 7 files changed, 1 insertion(+), 38 deletions(-)

diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c
index 86cc087..f6b1056 100644
--- a/bgpd/bgp_snmp.c
+++ b/bgpd/bgp_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -21,14 +21,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #include &amp;lt;zebra.h&amp;gt;
 
 #ifdef HAVE_SNMP
-#ifdef HAVE_NETSNMP
 #include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;
 #include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;
-#else
-#include &amp;lt;asn1.h&amp;gt;
-#include &amp;lt;snmp.h&amp;gt;
-#include &amp;lt;snmp_impl.h&amp;gt;
-#endif
 
 #include "if.h"
 #include "log.h"
diff --git a/configure.ac b/configure.ac
index 80f65b9..c3c651f 100755
--- a/configure.ac
+++ b/configure.ac
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1370,8 +1370,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; if test "${enable_snmp}" = "yes"; then
         LIBS="${LIBS} -lcrypto";
     fi
     AC_CHECK_LIB(netsnmp, asn_parse_int,
-    [AC_DEFINE(HAVE_NETSNMP,,Net SNMP) 
-     AC_DEFINE(HAVE_SNMP,,SNMP)
+    [AC_DEFINE(HAVE_SNMP,,SNMP)
      LIBS="${LIBS} -lnetsnmp"],
     [AC_MSG_ERROR([--enable-snmp given, but cannot find support for SNMP])])
 
diff --git a/lib/smux.c b/lib/smux.c
index b7cd18d..145ec90 100644
--- a/lib/smux.c
+++ b/lib/smux.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -22,14 +22,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;zebra.h&amp;gt;
 
 #ifdef HAVE_SNMP
-#ifdef HAVE_NETSNMP
 #include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;
 #include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;
-#else
-#include &amp;lt;asn1.h&amp;gt;
-#include &amp;lt;snmp.h&amp;gt;
-#include &amp;lt;snmp_impl.h&amp;gt;
-#endif
 
 #include "log.h"
 #include "thread.h"
diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c
index 5ac7846..11b733b 100644
--- a/ospf6d/ospf6_snmp.c
+++ b/ospf6d/ospf6_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -23,14 +23,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 
 #ifdef HAVE_SNMP
 
-#ifdef HAVE_NETSNMP
 #include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;
 #include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;
-#else
-#include &amp;lt;asn1.h&amp;gt;
-#include &amp;lt;snmp.h&amp;gt;
-#include &amp;lt;snmp_impl.h&amp;gt;
-#endif
 
 #include "log.h"
 #include "vty.h"
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index 9c9dd47..739dcae 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -25,14 +25,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;zebra.h&amp;gt;
 
 #ifdef HAVE_SNMP
-#ifdef HAVE_NETSNMP
 #include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;
 #include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;
-#else
-#include &amp;lt;asn1.h&amp;gt;
-#include &amp;lt;snmp.h&amp;gt;
-#include &amp;lt;snmp_impl.h&amp;gt;
-#endif
 
 #include "if.h"
 #include "log.h"
diff --git a/ripd/rip_snmp.c b/ripd/rip_snmp.c
index 61c47c7..803ac85 100644
--- a/ripd/rip_snmp.c
+++ b/ripd/rip_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -22,14 +22,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;zebra.h&amp;gt;
 
 #ifdef HAVE_SNMP
-#ifdef HAVE_NETSNMP
 #include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;
 #include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;
-#else
-#include &amp;lt;asn1.h&amp;gt;
-#include &amp;lt;snmp.h&amp;gt;
-#include &amp;lt;snmp_impl.h&amp;gt;
-#endif
 
 #include "if.h"
 #include "log.h"
diff --git a/zebra/zebra_snmp.c b/zebra/zebra_snmp.c
index 0fde4bb..3dbfb58 100644
--- a/zebra/zebra_snmp.c
+++ b/zebra/zebra_snmp.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -22,14 +22,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;zebra.h&amp;gt;
 
 #ifdef HAVE_SNMP
-#ifdef HAVE_NETSNMP
 #include &amp;lt;net-snmp/net-snmp-config.h&amp;gt;
 #include &amp;lt;net-snmp/net-snmp-includes.h&amp;gt;
-#else
-#include &amp;lt;asn1.h&amp;gt;
-#include &amp;lt;snmp.h&amp;gt;
-#include &amp;lt;snmp_impl.h&amp;gt;
-#endif
 
 #include "if.h"
 #include "log.h"
&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-24T08:56:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9389">
    <title>[quagga-dev 9370] [PATCH 1/5] build: allow configure and build in aseparate directory</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9389</link>
    <description>&lt;pre&gt;Some .h files in lib/ are autogenerated. The search path should
include the build directory and the source directory. They usually
match but sometimes, they may be different. For example:

 $ mkdir build
 $ cd build
 $ ../configure
 $ make
---
 babeld/Makefile.am         |    2 +-
 bgpd/Makefile.am           |    2 +-
 guile/Makefile.am          |    2 +-
 isisd/Makefile.am          |    2 +-
 isisd/topology/Makefile.am |    2 +-
 lib/Makefile.am            |    2 +-
 ospf6d/Makefile.am         |    2 +-
 ospfclient/Makefile.am     |    2 +-
 ospfd/Makefile.am          |    2 +-
 ripd/Makefile.am           |    2 +-
 ripngd/Makefile.am         |    2 +-
 tests/Makefile.am          |    2 +-
 vtysh/Makefile.am          |    2 +-
 vtysh/extract.pl.in        |    2 +-
 watchquagga/Makefile.am    |    2 +-
 zebra/Makefile.am          |    2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/babeld/Makefile.am b/babeld/Makefile.am
index 8703de0..81f6612 100644
--- a/babeld/Makefile.am
+++ b/babeld/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/bgpd/Makefile.am b/bgpd/Makefile.am
index 3051555..e5ee893 100644
--- a/bgpd/Makefile.am
+++ b/bgpd/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/guile/Makefile.am b/guile/Makefile.am
index 5beb71c..8d7008e 100644
--- a/guile/Makefile.am
+++ b/guile/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with Automake to create Makefile.in
 
-INCLUDES = &amp;lt; at &amp;gt;GUILE_CFLAGS&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib
+INCLUDES = &amp;lt; at &amp;gt;GUILE_CFLAGS&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -I. -I$(srcdir)
 
 AM_CFLAGS = $(PICFLAGS)
diff --git a/isisd/Makefile.am b/isisd/Makefile.am
index 26b8ee7..4e9b244 100644
--- a/isisd/Makefile.am
+++ b/isisd/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib \
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib \
    &amp;lt; at &amp;gt;ISIS_TOPOLOGY_INCLUDES&amp;lt; at &amp;gt;
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
diff --git a/isisd/topology/Makefile.am b/isisd/topology/Makefile.am
index b25497c..ccd2e71 100644
--- a/isisd/topology/Makefile.am
+++ b/isisd/topology/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 
 AM_CFLAGS = $(PICFLAGS)
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 890cc5c..4c67858 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 
 lib_LTLIBRARIES = libzebra.la
diff --git a/ospf6d/Makefile.am b/ospf6d/Makefile.am
index 01bc6fe..d05b020 100644
--- a/ospf6d/Makefile.am
+++ b/ospf6d/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/ospfclient/Makefile.am b/ospfclient/Makefile.am
index b8aae84..607bbed 100644
--- a/ospfclient/Makefile.am
+++ b/ospfclient/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Automake.am for OSPF API client
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 
 lib_LTLIBRARIES = libospfapiclient.la
 libospfapiclient_la_LDFLAGS = -version 0:0:0
diff --git a/ospfd/Makefile.am b/ospfd/Makefile.am
index 2e4d5c8..d0b4ae8 100644
--- a/ospfd/Makefile.am
+++ b/ospfd/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; $(LOCAL_OPTS) -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/ripd/Makefile.am b/ripd/Makefile.am
index 2fa2665..3196090 100644
--- a/ripd/Makefile.am
+++ b/ripd/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/ripngd/Makefile.am b/ripngd/Makefile.am
index c6bd486..83ddca0 100644
--- a/ripngd/Makefile.am
+++ b/ripngd/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2e98ff7..0c262a4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,4 +1,4 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; $(LOCAL_OPTS) -DSYSCONFDIR=\"$(sysconfdir)/\"
 
 AM_CFLAGS = $(PICFLAGS)
diff --git a/vtysh/Makefile.am b/vtysh/Makefile.am
index 0fd2f14..7550173 100644
--- a/vtysh/Makefile.am
+++ b/vtysh/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with Automake to create Makefile.in
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I$(top_srcdir) -I$(top_srcdir)/lib
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\"
 
 LIBS = &amp;lt; at &amp;gt;LIBS&amp;lt; at &amp;gt; &amp;lt; at &amp;gt;CURSES&amp;lt; at &amp;gt; &amp;lt; at &amp;gt;LIBPAM&amp;lt; at &amp;gt;
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index 61b2d2a..99224f8 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -63,7 +63,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; $ignore{'"show history"'} = "ignore";
 foreach (&amp;lt; at &amp;gt;ARGV) {
     $file = $_;
 
-    open (FH, "cpp -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I&amp;lt; at &amp;gt;top_builddir&amp;lt; at &amp;gt; -I&amp;lt; at &amp;gt;srcdir&amp;lt; at &amp;gt;/ -I&amp;lt; at &amp;gt;srcdir&amp;lt; at &amp;gt;/.. -I&amp;lt; at &amp;gt;top_srcdir&amp;lt; at &amp;gt;/lib -I&amp;lt; at &amp;gt;top_srcdir&amp;lt; at &amp;gt;/isisd/topology &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt; &amp;lt; at &amp;gt;CPPFLAGS&amp;lt; at &amp;gt; $file |");
+    open (FH, "cpp -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I&amp;lt; at &amp;gt;top_builddir&amp;lt; at &amp;gt; -I&amp;lt; at &amp;gt;srcdir&amp;lt; at &amp;gt;/ -I&amp;lt; at &amp;gt;srcdir&amp;lt; at &amp;gt;/.. -I&amp;lt; at &amp;gt;top_srcdir&amp;lt; at &amp;gt;/lib -I&amp;lt; at &amp;gt;top_builddir&amp;lt; at &amp;gt;/lib -I&amp;lt; at &amp;gt;top_srcdir&amp;lt; at &amp;gt;/isisd/topology &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt; &amp;lt; at &amp;gt;CPPFLAGS&amp;lt; at &amp;gt; $file |");
     local $/; undef $/;
     $line = &amp;lt;FH&amp;gt;;
     close (FH);
diff --git a/watchquagga/Makefile.am b/watchquagga/Makefile.am
index a49f62e..badaa5b 100644
--- a/watchquagga/Makefile.am
+++ b/watchquagga/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with Automake to create Makefile.in
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I$(top_srcdir) -I$(top_srcdir)/lib
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSTATEDIR=\"$(localstatedir)/\"
 
 AM_CFLAGS = $(PICFLAGS)
diff --git a/zebra/Makefile.am b/zebra/Makefile.am
index 542f36f..e5b749a 100644
--- a/zebra/Makefile.am
+++ b/zebra/Makefile.am
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,6 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ## Process this file with automake to produce Makefile.in.
 
-INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
+INCLUDES = &amp;lt; at &amp;gt;INCLUDES&amp;lt; at &amp;gt; -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib &amp;lt; at &amp;gt;SNMP_INCLUDES&amp;lt; at &amp;gt;
 DEFS = &amp;lt; at &amp;gt;DEFS&amp;lt; at &amp;gt; -DSYSCONFDIR=\"$(sysconfdir)/\" -DMULTIPATH_NUM=&amp;lt; at &amp;gt;MULTIPATH_NUM&amp;lt; at &amp;gt;
 INSTALL_SDATA=&amp;lt; at &amp;gt;INSTALL&amp;lt; at &amp;gt; -m 600
 
&lt;/pre&gt;</description>
    <dc:creator>Vincent Bernat</dc:creator>
    <dc:date>2012-05-24T08:56:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9388">
    <title>[quagga-dev 9369] Re: [PATCH] bgpd: fix for leaked struct bgp_adj_[in|out] on peer shutdown</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9388</link>
    <description>&lt;pre&gt;
Hm.  It seems to me that Jorge's patch is more complete and fixes the
same issue in a more consistent way in the proper place.  Comments?  If
I don't hear anything I'll pick up Jorge's patch and consider Stephen's
as superseded.


-David
&lt;/pre&gt;</description>
    <dc:creator>David Lamparter</dc:creator>
    <dc:date>2012-05-22T23:16:29</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9387">
    <title>[quagga-dev 9368] Re: [PATCH 25/25] lib: optimize IPV4_ADDR_[SAME|COPY]()</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9387</link>
    <description>&lt;pre&gt;
Actually, that ends up being the idea of "bgpd: don't advertise routes
with peer address as nexthop";  I'll go respin that using peer-&amp;gt;nexthop
as I've commented already.  After reading RFC4271 5.1.3 I'm confident
that's actually the correct thing to do.

-David
&lt;/pre&gt;</description>
    <dc:creator>David Lamparter</dc:creator>
    <dc:date>2012-05-22T22:46:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9386">
    <title>[quagga-dev 9367] Re: [RFC PATCH 00/25] Mostly bgpd optimizations</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9386</link>
    <description>&lt;pre&gt;[...]

Merged 22 of 25, Thanks!

Not merged werre:


-David
&lt;/pre&gt;</description>
    <dc:creator>David Lamparter</dc:creator>
    <dc:date>2012-05-22T22:34:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9385">
    <title>[quagga-dev 9366] Re: [PATCH 25/25] lib: optimize IPV4_ADDR_[SAME|COPY]()</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9385</link>
    <description>&lt;pre&gt;
I'll pick it up after rechecking the BGP remote ID thing.  I think the
check is actually 100% wrong and removing it was the correct fix in the
first place, but I'll recheck.

Dropping Jorge's 25/25 for now; remainder inbound on master.

-David
&lt;/pre&gt;</description>
    <dc:creator>David Lamparter</dc:creator>
    <dc:date>2012-05-22T22:29:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9384">
    <title>[quagga-dev 9365] Re: [PATCH 24/25] lib: do not allocate/free thread funcnames</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9384</link>
    <description>&lt;pre&gt;El 22/05/2012 20:52, David Lamparter escribió:

Sure! That's why the series was a RFC one :-)

&lt;/pre&gt;</description>
    <dc:creator>Jorge Boncompte [DTI2]</dc:creator>
    <dc:date>2012-05-22T19:01:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.network.quagga.devel/9383">
    <title>[quagga-dev 9364] Re: [PATCH 24/25] lib: do not allocate/free thread funcnames</title>
    <link>http://permalink.gmane.org/gmane.network.quagga.devel/9383</link>
    <description>&lt;pre&gt;

Changing this to 64 since the maximum function name length specified by
ISO C99 is 63.  Also makes the value less arbitrary ;)


-David
&lt;/pre&gt;</description>
    <dc:creator>David Lamparter</dc:creator>
    <dc:date>2012-05-22T18:52:25</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.network.quagga.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.network.quagga.devel</link>
  </textinput>
</rdf:RDF>

