Replies: 4 comments 1 reply
I'd be more than happy to take a look.
What functionality are you using here, is this something we could migrate over to Rust? |
|
I am sure the compiler should be redone in a better way. It reads the whole
file in to memory, then does text.split(keyword) for various keywords, then
populates some dictionaries with the results.
You could write Rust like that, but using nom is a better way.
I will grant access in a bit.
…On Tue, 25 Feb 2025, 04:56 XAMPPRocky, ***@***.***> wrote:
It is VERY early days, so for now, it is a private repository, and there
are no promises about API stability. If you want a look, ask and I will
give you access.
I'd be more than happy to take a look.
There is a wildly ugly bit of python which implements a matching MIB
compiler. In some cases, if you are lucky, it generates Rust that compiles
and superficially looks like it implements the MIB. Weirdly, this is
probably closer to usable maturity than the Rust library.
What functionality are you using here, is this something we could migrate
over to Rust?
—
Reply to this email directly, view it on GitHub
<#415 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC4N6MCOQK7TYOD2ENIC2M32RPZX5AVCNFSM6AAAAABXY22TQ2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMZQHA2DEOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Compiler now handles many MIBs. The main ones it can't do are those that use the AUGMENTS keyword. It generates stub structs, which just wrap dummy memory based implementations. So what is generated compiles and can be tested, but does nothing until the developer replaces the dummy impl code with something real. The compiler also ignores or hides some other information from the MIB, like MODULE-COMPLIANCE, DEFVAL, some description fields and the range constraints in textual conventions. These can be filled in as people need - just ask. The engine does not do GetBulk, or anything to do with traps. GetBulk looks easy enough, if lengthy. I would appreciate input about real world use cases for traps, as I have no experience with them. In particular, if a trap is supposed to be emitted in response to some event on the platform, is this something to be done say by periodic polling? Should trap condition monitoring and sending be a whole independent process, or should it be integrated into the Agent event loop? There are a few platform level MIBs that need to integrate with the engine, breaking the deliberate separation of the generated code. I think these will need to be very slightly special cased, but imagine, in time, that the agent will ship with default versions of these. |
|
Repository is now public. GetBulk works, compiler generates stubs that are clippy clean. DEFVAL now handled by compiler. AUGMENTS generates code that does the wrong thing. MODULE-COMPLIANCE is ignored, field descriptions are lost and range constraints are ignored. Still lots of corner cases that are not caught, or generate the wrong error at run time. Probably the biggest hole in the agent itself is the complete lack of a permissions model, followed by not having support for password changes. |
Uh oh!
There was an error while loading. Please reload this page.
I have just pushed a very rough start on an SNMP V3 agent that uses rasn for encode and decode.
It is VERY early days, so for now, it is a private repository, and there are no promises about API stability. If you want a look, ask and I will give you access. Once it has matured a bit, and implements a bit more of what you expect, I will publish it, and eventually, put it up on crates.io once it gets to some minimal level of maturity.
There is a wildly ugly bit of python which implements a matching MIB compiler. In some cases, if you are lucky, it generates Rust that compiles and superficially looks like it implements the MIB. Weirdly, this is probably closer to usable maturity than the Rust library.
I am still at a fairly early stage of my Rust journey, so advice and (polite) criticism are very welcome. Contributions would also be very welcome.
All reactions