Re: snmptranslate -IR -Tp reserved word problem
"飞飞" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Dear Dave, Mike and All: '--' work in a similar manner to the C-style comments is a perfect explaining. In my MIb(a very long .mib file) , the long '---------' and the short '----' just want to the mib file easy to read and simple for my boss to understand the mib file structure,so it is not a good idea because some specific reasons. I will use the good style you teaching me in my project now.Thank you. But I really think the reserved work problem in my mib has a another explain: Do the 'Space' and the 'Table' key between the myObject and 'OBJECT IDENTIFIER' have different effects on the current function? I replaced something between myObject and 'OBJECT IDENTIFIER' use 'Space' then the command run is OK. I donot know why the reason is,but it is worked. In my country,the prommer ususlly use four 'Space' instead 'Table' key,it is so do I. Thank you. Alex ------------------ Original ------------------ From: "Dave Shield"<[email protected]>; Date: Mon, Jan 4, 2010 06:55 PM To: "飞飞"<[email protected]>; Cc: "net-snmp-users"<[email protected]>; Subject: Re: snmptranslate -IR -Tp reserved word problem 2009/12/31 Mike Ayers <[email protected]>: > I do not believe you can place comment markers (--) inside a comment. > I believe you need to add a space after the comment markers. > I do not believe you can put a comment marker within a comment, That's not strictly true. The ASN.1 comment marker '--' works in a similar manner to the C-style /* */ comments (as well as C++-style // comments). I.e. double-dash denotes the start of a comment, and a second double-dash (or the end of the line) denotes the end of the comment. So myObject -- this is a comment -- OBJECT IDENTIFIER is perfectly valid syntax. This means that a line of dashes will work correctly, as long as there are an even number (or 4n-1) of dashes in the line. But if you have 4n+1 dashes, then the first 4n will be interpreted as n (empty) comments, and the final dash will be parsed as active syntax, and throw an error. So you *can* use lines of dashes to separate different sections of the MIB, and you've fot a 75% chance of getting away with it! But I would agree with Mike's advice: > i.e., don't do "----------------------". If you want to have horizontal rules in your MIB, try something like - - = = = = = = = = = = (without the spaces!) Dave ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users