Friday, July 1, 2011

SNMP on Windows Phone 7.1 (Mango) Update.

NetToolWorks is almost ready to take requests for the BETA version of their SNMP library for Windows Phone 7.1 (Mango). Here is a taste of what it’s going to be like to use the library.
Requesting a variable using SNMPv1:
ManagerBase manager = ManagerFactory.CreateVersion1Manager("public");

manager.GetAsync(_Address, 161, "1.3.6.1.2.1.1.1.0", (variables, remoteEndpoint) =>
{
    if (variables.Count > 0)
    {
        MessageBox.Show("Response: " + variables[0].ToString());
    }

    manager.Close();
});
with SNMPv3:
SnmpUser user = new SnmpUser()
{
    Username = "test",
    SecurityLevel = SnmpUserSecurityLevel.AuthenticationAndPrivacy,
    AuthenticationAlgorithm = SnmpAuthenticationAlgorithm.SHA,
    AuthenticationPassword = "SHAPassword",
    PrivacyAlgorithm = SnmpPrivacyAlgorithm.AES,
    PrivacyPassword = "AESPassword"
};

ManagerBase manager = ManagerFactory.CreateVersion1Manager("public");

manager.GetAsync(_Address, 161, "1.3.6.1.2.1.1.1.0", (variables, remoteEndpoint) =>
{
    if (variables.Count > 0)
    {
        MessageBox.Show("Response: " + variables[0].ToString());
    }

    manager.Close();
});


Stay tuned for information on how you can get your hands on the BETA. Mmmmmmm juicy mangos.