On Tue, 2011-03-22 at 14:38 -0700, Wes Hardaker wrote:
> >>>>> On Tue, 22 Mar 2011 21:53:05 +0100, Magnus Fromreide 
> >>>>> <[email protected]> said:
> 
> MF> * How should features that affect the ABI/API be handled?
> 
> Can I get an example of what you want to do?

Yes. The patch I am thinking of adding was attached to the mail you
replied to, but here it is again.

> MF> * Looking at REMOVE_STATISTICS it seems it is ok to include the feature
> MF> header from a .h file, is that correct?
> 
> Well, I struggled with that one for a while.  I didn't *want* to do that
> but in the end I didn't see a way around it in some cases.  So, um,
> "yes" he says tentatively.

Ah, ok, then it wasn't just me that had qualms about that.
Index: include/net-snmp/library/snmp_transport.h
===================================================================
--- include/net-snmp/library/snmp_transport.h	(revision 20150)
+++ include/net-snmp/library/snmp_transport.h	(working copy)
@@ -12,6 +12,8 @@
 
 #include <net-snmp/library/asn1.h>
 
+#include <net-snmp/net-snmp-features.h>
+
 #ifdef __cplusplus
 extern          "C" {
 #endif
@@ -185,11 +187,13 @@
     size_t          name_length;
     const char    **prefix;
 
+#ifndef NETSNMP_FEATURE_REMOVE_TDOMAIN_CREATE_FROM_TSTRING
     /*
      * The f_create_from_tstring field is deprecated, please do not use it
      * for new code and try to migrate old code away from using it.
      */
     netsnmp_transport *(*f_create_from_tstring) (const char *, int);
+#endif
 
     netsnmp_transport *(*f_create_from_ostring) (const u_char *, size_t, int);
 
Index: snmplib/snmp_transport.c
===================================================================
--- snmplib/snmp_transport.c	(revision 20150)
+++ snmplib/snmp_transport.c	(working copy)
@@ -71,6 +71,7 @@
 #include <net-snmp/library/snmp_service.h>
 #include <net-snmp/library/read_config.h>
 
+netsnmp_feature_child_of(tdomain_create_from_tstring, netsnmp_unused)
 netsnmp_feature_child_of(transport_all, libnetsnmp)
 
 netsnmp_feature_child_of(tdomain_support, transport_all)
@@ -628,9 +629,11 @@
                         "default address \"%s\"\n",
                         match->prefix[0], addr ? addr : "[NIL]",
                         addr2 ? addr2 : "[NIL]"));
+#ifndef NETSNMP_FEATURE_REMOVE_TDOMAIN_CREATE_FROM_TSTRING
             if (match->f_create_from_tstring)
                 t = match->f_create_from_tstring(addr, local);
             else
+#endif
                 t = match->f_create_from_tstring_new(addr, local, addr2);
             if (t) {
                 curfilename = prev_curfilename;
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to