security model

Gemma Sánchez <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi all !!!



I have the next code to open an SNMP session. I am doubting about the 
security model I am using. Is it SBSM or USM? Is SBSM implemented yet?



Thanks a lot.



Gemma S Anton



netsnmp_session *abre_sesion (char *IP_agente)

{

      FILE *flog;

      netsnmp_session *psesion;

      netsnmp_session sesion;



      init_snmp("centrodecontrol"); // Inicializa la librería NET-SNMP.

      snmp_sess_init(&sesion);     // *sesion* guarda todos los datos de la 
sesion.

      sesion.peername = strdup(IP_agente);     // Extremo con el que se 
establece.

      sesion.version=SNMP_VERSION_3;           // Version 3 de SNMP.

      sesion.securityName = strdup(USRSIMSNMP);      // Nombre del usuario.

      sesion.securityNameLen = strlen(sesion.securityName);      // Longitud 
del nombre.

      sesion.securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;    // Nivel de 
seguridad.

      sesion.securityAuthProto = usmHMACMD5AuthProtocol;   // Protocolo de 
seguridad MD5.

      sesion.securityAuthProtoLen = 
sizeof(usmHMACMD5AuthProtocol)/sizeof(oid);

      sesion.securityAuthKeyLen = USM_AUTH_KU_LEN;

      if (  generate_Ku(      sesion.securityAuthProto,

                        sesion.securityAuthProtoLen,

                        (u_char *) PWDSIMSNMP,

                        strlen(PWDSIMSNMP),

                        sesion.securityAuthKey,

                        &sesion.securityAuthKeyLen) != SNMPERR_SUCCESS)

      {

                  psesion = NULL;

      }

      else

      {

            SOCK_STARTUP;

            psesion = snmp_open(&sesion);

      }

      return psesion;

}


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.