scli moving to glib-2.0 and modularization
I changed my scli sources yesterday to use the glib-2.0. Since glib-2.0 has some nice new features, it might be possible to simplify some of the internals by reusing more glib stuff. If someone sees a problem with moving to glib-2.0, please let me know.
I also played some time with the idea to separate out the SNMP implementation. I did just that yesterday by creating a package tentatively called gsnmp. The idea here would be that others can reuse the glib-based SNMP library easily. Now, making this split would imply that scli has another dependency. If you think this is a problem, please let me know.
There is another open question: Should the scli stubs also become a reusable separate package? It would make sense if there are people who are interested to develop other applications that make use of the stubs. One could package this as gsnmpietf (stubs for the IETF MIBs), gsnmpnortel, gsnmpcisco, ...
Having stub packages would allow to write simple programs such as the one below without having to deal with all the nasty SNMP/MIB things. But perhaps I am starting to overdo modularization? Comments are welcome.
/js
#include <gsnmp.h> #include <ietf/snmpv2-mib.h>
static void ping(GSnmpSession *s) { snmpv2_mib_system_t *system;
snmpv2_mib_get_system(s, &system, SNMPV2_MIB_SYSDESCR); if (! s->error_status && system) { g_print("%.*s\n", system->_sysDescrLength, system->sysDescr); }
if (system) snmpv2_mib_free_system(system); }
int main(int argc, char **argv) { GSnmpSession *s;
if (! g_snmp_init(FALSE)) { exit(1); }
s = g_snmp_session_new(G_SNMP_TDOMAIN_UDP_IPV4, "localhost", 161); if (! s) { exit(1); } s->rcomm = "public"; s->version = G_SNMP_V1;
ping(s);
g_snmp_session_destroy(s);
return 0; }
Juergen Schoenwaelder wrote, back in November last year :
I changed my scli sources yesterday to use the glib-2.0. Since glib-2.0 has some nice new features, it might be possible to simplify some of the internals by reusing more glib stuff. If someone sees a problem with moving to glib-2.0, please let me know.
I also played some time with the idea to separate out the SNMP implementation. I did just that yesterday by creating a package tentatively called gsnmp. The idea here would be that others can reuse the glib-based SNMP library easily. Now, making this split would imply that scli has another dependency. If you think this is a problem, please let me know.
Is there anything available already that can be used or tested?
Neither myself nor Google didn't anything. (Also, the website seems to be a bit out of date, stating in the 'Download' section that the "latest release of scli is scli-0.2.9.tar.gz" -- while in fact it is 0.2.12....)
Cheers, Kurt
Kurt Pfeifle writes:
Kurt> Is there anything available already that can be used or tested?
Some time ago, I made a snapshot available on our ftp server:
ftp://ftp.ibr.cs.tu-bs.de/pub/local/gsnmp/
Note that this is already quite a bit outdated. Right now, I am trying to get the glib based SNMP code cleaned up and probably merged into the gnet package. If this succeeds, then I will just drop again the idea to ship a package which contains stub libraries - it turns out that even scli needs some special versions to be happy and I more or less fail to see the benefit.
Kurt> Neither myself nor Google didn't anything. (Also, the website Kurt> seems to be a bit out of date, stating in the 'Download' section Kurt> that the "latest release of scli is scli-0.2.9.tar.gz" -- while Kurt> in fact it is 0.2.12....)
I will update things when I make the next release (hopefully).
/js
participants (2)
-
Juergen Schoenwaelder
-
Kurt Pfeifle