~ubuntu-branches/debian/sid/hplip/sid

« back to all changes in this revision

Viewing changes to io/hpmud/jd.c

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-05-05 21:09:24 UTC
  • mfrom: (1.7.1) (20.1.6 experimental)
  • Revision ID: package-import@ubuntu.com-20130505210924-cfpl0sn36p5sr436
Tags: 3.13.4-1
* New upstream release
* Removed "KDE from long description." (Closes: #706269)
* Clarified "[hpijs] short description" (Closes: #706057)

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
static int device_id(const char *ip, int port, char *buffer, int size)
83
83
{
84
84
   int len=0, maxSize, result, dt, status;
 
85
   int public_comunity_index = 4; //By default we need to pass community name = "public"
85
86
 
86
87
   maxSize = (size > 1024) ? 1024 : size;   /* RH8 has a size limit for device id */
87
88
 
88
 
   if ((len = GetSnmp(ip, port, (char *)kStatusOID, (unsigned char *)buffer, maxSize, &dt, &status, &result)) == 0)
89
 
      BUG("unable to read device-id\n");
 
89
   if ((len = GetSnmp(ip, public_comunity_index, (char *)kStatusOID, (unsigned char *)buffer, maxSize, &dt, &status, &result)) == 0)
 
90
   {
 
91
      if ((len = GetSnmp(ip, port, (char *)kStatusOID, (unsigned char *)buffer, maxSize, &dt, &status, &result)) == 0)
 
92
      {
 
93
        BUG("unable to read device-id\n");
 
94
      }
 
95
   }
90
96
 
91
97
   return len; /* length does not include zero termination */
92
98
}