

<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.net-snmp.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Template%3AFAQ%3ACoding_17</id>
		<title>Template:FAQ:Coding 17 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.net-snmp.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Template%3AFAQ%3ACoding_17"/>
		<link rel="alternate" type="text/html" href="http://www.net-snmp.org/wiki/index.php?title=Template:FAQ:Coding_17&amp;action=history"/>
		<updated>2026-06-14T20:38:43Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>http://www.net-snmp.org/wiki/index.php?title=Template:FAQ:Coding_17&amp;diff=1708&amp;oldid=prev</id>
		<title>Dts12 at 11:31, 23 October 2006</title>
		<link rel="alternate" type="text/html" href="http://www.net-snmp.org/wiki/index.php?title=Template:FAQ:Coding_17&amp;diff=1708&amp;oldid=prev"/>
				<updated>2006-10-23T11:31:04Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a problem (at least apparently) with the v4 UCD module&lt;br /&gt;
API, which uses a &amp;#039;&amp;#039;&amp;quot;magic number&amp;quot;&amp;#039;&amp;#039; to distinguish between the various&lt;br /&gt;
column objects implemented by a common variable handling routine.&lt;br /&gt;
Since this field is defined as an unsigned character, it can only&lt;br /&gt;
take values 0-255.   So at first sight, it would appear that the&lt;br /&gt;
agent cannot support tables (or scalar groups) with more than 256&lt;br /&gt;
objects, since this would start to duplicate these magic numbers.&lt;br /&gt;
&lt;br /&gt;
However, the agent doesn&amp;#039;t actually care which routine implements&lt;br /&gt;
a given object, and magic numbers only need to be unique within a&lt;br /&gt;
single variable handling routine.  So it is actually perfectly&lt;br /&gt;
possible to implement a larger table by splitting it between two&lt;br /&gt;
(or more) variable handling routines.  These can then re-use the&lt;br /&gt;
magic numbers quite safely:&lt;br /&gt;
&lt;br /&gt;
  struct variable1 [] = {&lt;br /&gt;
      {MAGIC1,   ASN_INTEGER, RWRITE, var_myfirst,  1, {  1}},&lt;br /&gt;
      {MAGIC2,   ASN_INTEGER, RWRITE, var_myfirst,  1, {  2}},&lt;br /&gt;
                :&lt;br /&gt;
      {MAGIC255, ASN_INTEGER, RWRITE, var_myfirst,  1, {255}},&lt;br /&gt;
      {MAGIC1,   ASN_INTEGER, RWRITE, var_mysecond, 1, {256}},&lt;br /&gt;
      {MAGIC2,   ASN_INTEGER, RWRITE, var_mysecond, 1, {257}},&lt;br /&gt;
                :&lt;br /&gt;
      {MAGIC255, ASN_INTEGER, RWRITE, var_mysecond, 1, {510}}&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
All that matters is that a given magic number isn&amp;#039;t re-used within&lt;br /&gt;
the same variable handling routine.  The v5 table handlers typically&lt;br /&gt;
use an integer variable for holding column information, so aren&amp;#039;t&lt;br /&gt;
subject to the same limitations.&lt;br /&gt;
&lt;br /&gt;
Though I&amp;#039;d have to question whether having such a wide table is&lt;br /&gt;
necessarily a particularly good design strategy!&lt;/div&gt;</summary>
		<author><name>Dts12</name></author>	</entry>

	</feed>