Re: [lisp-snmp] Patch to asn.1 to change from parsergen to a modified cl-yacc
Brought to you by:
binghe
From: Chun T. (binghe) <bin...@gm...> - 2009-02-09 07:00:24
|
On 2009-2-9, at 14:44, John Fremlin wrote: > Dear Chun Tian, > > "Chun Tian (binghe)" <bin...@gm...> writes: > [...] >>> To support the cool (oid ..) syntax you can easily add "asn.1/" to >>> the >>> start of the string processed by OID method. >> >> It's not so easy when you've found following syntax is also well >> supported: >> >> ASN.1 10 > (oid "SNMPv2-SMI::mib-2.SNMPv2-MIB::system") >> #<OBJECT-ID SNMPv2-MIB::system (1) [9]> > > This syntax can easily be supported as follows > > (defmethod oid-parse ((source string)) > (or > (with-input-from-string (s source) > (oid-parse s)) > (with-input-from-string (s (concatenate 'string *asn.1-package- > prefix* source)) > (oid-parse s)))) I'm afraid this function cannot work for (oid "SNMPv2- SMI::mib-2.SNMPv2-MIB::system") correctly, you just change it into: (oid "ASN.1/SNMPv2-SMI::mib-2.SNMPv2-MIB::system") How can you solve the second package name "SNMPv2-MIB" in that string? > > > However, *asn.1-package-prefix* cannot contain a "." because of your > strange readtable. So it must be changed to something other than > "ASN.1/", perhaps "ASN1/" The strange *oid-readtable* is my way to avoid the use of SPLIT- SEQUENCE, it just let #\. be treat as a separator. However, this method can cause unnecessary synbol intern in ASN.1 package, not the best way to read a OID string. Give me more time to think out a better solution please. > >> Well, contact me if you really found your customers use such a MIB >> module name, I think we can talk about this issue later:) > > It's kind of strange that you talk about making your package perfect > but > have it so arranged that by loading in an MIB file one can overwrite > your package itself . . . > > I guess it's not just C programmers who don't care about security ;-) The *asn.1-package-prefix* was learnt from Common Lisp's CORBA language mapping. I think you've persuaded me, but I cannot change it until I can solve the OID reader syntax issue above. -- Chun Tian (binghe) NetEase.com, Inc. P. R. China |