Changeset d659a9d1a9285c0627fb0b3114abefade0b0730b

Show
Ignore:
Timestamp:
02/04/12 14:38:51 (2 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1328366331 -0500
git-parent:

[2f57254c51d39834f9304b51e4b361bd19b5d713]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1328366331 -0500
Message:

add the version to reporting

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/snmp.c

    ra5df09d rd659a9d  
    127127  char *target; 
    128128  eventer_t timeoutevent; 
     129  int version; 
    129130  int fd; 
    130131  int in_table; 
     
    191192    ts = calloc(1, sizeof(*ts)); 
    192193    ts->self = self; 
     194    ts->version = version; 
    193195    ts->fd = -1; 
    194196    ts->refcnt = 0; 
     
    10701072  char fd[32]; 
    10711073  struct timeval now, diff; 
     1074  const char *snmpvers = "v(unknown)"; 
    10721075  gettimeofday(&now, NULL); 
    10731076  sub_timeval(now, ts->last_open, &diff); 
     
    10761079  else 
    10771080    snprintf(fd, sizeof(fd), "%d", ts->fd); 
    1078   nc_printf(ncct, "[%s]\n\topened: %0.3fs ago\n\tFD: %s\n\trefcnt: %d\n", 
    1079             ts->target, diff.tv_sec + (float)diff.tv_usec/1000000, 
     1081  switch(ts->version) { 
     1082    case SNMP_VERSION_1: snmpvers = "v1"; break; 
     1083    case SNMP_VERSION_2c: snmpvers = "v2c"; break; 
     1084    case SNMP_VERSION_3: snmpvers = "v3"; break; 
     1085  } 
     1086  nc_printf(ncct, "[%s %s]\n\topened: %0.3fs ago\n\tFD: %s\n\trefcnt: %d\n", 
     1087            ts->target, snmpvers, diff.tv_sec + (float)diff.tv_usec/1000000, 
    10801088            fd, ts->refcnt); 
    10811089}