~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to agent/mibgroup/ucd-snmp/pass.c

  • Committer: Bazaar Package Importer
  • Author(s): Jochen Friedrich
  • Date: 2010-06-10 18:02:54 UTC
  • mto: (1.4.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100610180254-6ezvupl2clicwdqf
ImportĀ upstreamĀ versionĀ 5.4.3~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
287
287
    oid             newname[MAX_OID_LEN];
288
288
    int             i, rtest, fd, newlen;
289
289
    static long     long_ret;
 
290
    static in_addr_t addr_ret;
290
291
    char            buf[SNMP_MAXBUF];
291
292
    static char     buf2[SNMP_MAXBUF];
292
293
    static oid      objid[MAX_OID_LEN];
412
413
                        *var_len = 0;
413
414
                        return (NULL);
414
415
                    }
415
 
                    long_ret =
 
416
                    addr_ret =
416
417
                        (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
417
418
                        (objid[2] << 8) + objid[3];
418
 
                    long_ret = htonl(long_ret);
419
 
                    *var_len = sizeof(long_ret);
 
419
                    addr_ret = htonl(addr_ret);
 
420
                    *var_len = sizeof(addr_ret);
420
421
                    vp->type = ASN_IPADDRESS;
421
 
                    return ((unsigned char *) &long_ret);
 
422
                    return ((unsigned char *) &addr_ret);
422
423
                }
423
424
            }
424
425
            *var_len = 0;
502
503
                buf[ sizeof(buf)-1 ] = 0;
503
504
                break;
504
505
            case ASN_OBJECT_ID:
505
 
                sprint_mib_oid(buf2, (oid *) var_val, var_val_len);
 
506
                sprint_mib_oid(buf2, (oid *) var_val, var_val_len/sizeof(oid));
506
507
                snprintf(buf, sizeof(buf), "objectid \"%s\"\n", buf2);
507
508
                buf[ sizeof(buf)-1 ] = 0;
508
509
                break;
509
510
            }
510
 
            strncat(passthru->command, buf, sizeof(passthru->command));
 
511
            strncat(passthru->command, buf, sizeof(passthru->command)-strlen(passthru->command)-1);
511
512
            passthru->command[ sizeof(passthru->command)-1 ] = 0;
512
513
            DEBUGMSGTL(("ucd-snmp/pass", "pass-running:  %s",
513
514
                        passthru->command));