TRUE and FALSE

Bernd Petrovitsch bernd at firmix.at
Tue Apr 19 09:49:02 CEST 2005


On Mon, 2005-04-18 at 08:46 -0700, Ben wrote:
[...]
> Sorry, I'm too busy to go on a scavenger hunt. :) What do they do there?

Please, sit down before!

>From http://net-snmp.sourceforge.net/docs/mibs/IF-MIB.txt:
----  snip  ----
ifPromiscuousMode  OBJECT-TYPE
    SYNTAX      TruthValue
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
            "This object has a value of false(2) if this interface only
            accepts packets/frames that are addressed to this station.
            This object has a value of true(1) when the station accepts
            all packets/frames transmitted on the media.  The value
            true(1) is only legal on certain types of media.  If legal,
            setting this object to a value of true(1) may require the
            interface to be reset before becoming effective.

            The value of ifPromiscuousMode does not affect the reception
            of broadcast and multicast packets/frames by the interface."
    ::= { ifXEntry 16 }
----  snip  ----

This doesn't sound too bad.
The main reason may be that you are not allowed to have an index == 0 in
MIB tables (than it would be a scalar AFAIK).

>From http://rfc.net/rfc1471.html
----  snip  ----
pppLinkConfigMagicNumber   OBJECT-TYPE
               SYNTAX    INTEGER {false (1), true (2)}
               ACCESS    read-write
               STATUS    mandatory
               DESCRIPTION
                         "If true(2) then the local node will attempt to
                         perform Magic Number negotiation with the
                         remote node. If false(1) then this negotiation
                         is not performed. In any event, the local node
                         will comply with any magic number negotiations
                         attempted by the remote node, per the PPP
                         specification. Changing this object will have
                         effect when the link is next restarted."
               REFERENCE
                         "Section 7.6, Magic Number, of RFC1331."
               DEFVAL    { false }
               ::= { pppLinkConfigEntry 4 }
----  snip  ----

Have fun!

> And are you talking about the SNMP MIB itself, or the SNMP daemon? 

The SNMP-MIBs itself and *not* the deamon (actually which one do you
mean?).

> Because I would imagine SNMP might let you define true and false more 
> abstractly than non-zero and zero..... but we're talking C here.

Of course. And you want to define it to two values. But IMHO it does not
help if you define the same concept (numerical representation of boolean
values) in different ways depending on the phase of the moon ....

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services





-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728




More information about the Developers mailing list