06.01.2015 Views

universidad autónoma metropolitana unidad azcapotzalco una ...

universidad autónoma metropolitana unidad azcapotzalco una ...

universidad autónoma metropolitana unidad azcapotzalco una ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

APÉNDICE A. CODIGO FUENTE DE LA HERRAMIENTA DE GESTION DE REDES VIRTUALES<br />

session->securityAuthProtoLen,<br />

(u_char *)Xpsz, strlen(Xpsz),<br />

session->securityPrivKey,<br />

&session->securityPrivKeyLen) != SNMPERR_SUCCESS) {<br />

snmp_perror(argv[0]);<br />

fprintf(stderr,"Error generating Ku from privacy pass phrase. \n");<br />

return(-2);<br />

}<br />

}<br />

/*obtien el nombre del host*/<br />

if (optind == argc) {<br />

fprintf(stderr,"No hostname specified.\n");<br />

return(-1);<br />

}<br />

session->peername = argv[optind++]; /* hostname */<br />

/* get community */<br />

if ((session->version == SNMP_VERSION_1) ||<br />

(session->version == SNMP_VERSION_2c)) {<br />

/* v1 and v2c - so get community string */<br />

if (!Cpsz) {<br />

if ((Cpsz = ds_get_string(DS_LIBRARY_ID, DS_LIB_COMMUNITY)) != NULL)<br />

;<br />

else if (optind == argc) {<br />

fprintf(stderr,"No community name specified.\n");<br />

return(-1);<br />

}<br />

else<br />

Cpsz = argv[optind++];<br />

}<br />

session->community = (unsigned char *)Cpsz;<br />

session->community_len = strlen(Cpsz);<br />

}<br />

return optind;<br />

}<br />

/* snmp_parse_args.c(Fin) */<br />

Las pantallas de compilación para cada <strong>una</strong> de estas primitivas se muestran a<br />

continuación.<br />

150

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!