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=EDa NET-SNMP.

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

sesion.

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

establece.

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

sesion.securityName =3D strdup(USRSIMSNMP); // Nombre del usuari=
o.

sesion.securityNameLen =3D strlen(sesion.securityName); // Longi=
tud =

del nombre.

sesion.securityLevel =3D SNMP_SEC_LEVEL_AUTHNOPRIV; // Nivel de =

seguridad.

sesion.securityAuthProto =3D usmHMACMD5AuthProtocol; // Protocolo d=
e =

seguridad MD5.

sesion.securityAuthProtoLen =3D =

sizeof(usmHMACMD5AuthProtocol)/sizeof(oid);

sesion.securityAuthKeyLen =3D USM_AUTH_KU_LEN;

if ( generate_Ku( sesion.securityAuthProto,

sesion.securityAuthProtoLen,

(u_char *) PWDSIMSNMP,

strlen(PWDSIMSNMP),

sesion.securityAuthKey,

&sesion.securityAuthKeyLen) !=3D SNMPERR_SUCCESS)

{

psesion =3D NULL;

}

else

{

SOCK_STARTUP;

psesion =3D 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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users