Lines Matching refs:packet
29 static void print_packet(cups_snmp_t *packet, void *data);
121 * 'print_packet()' - Print the contents of the response packet.
125 print_packet(cups_snmp_t *packet, /* I - SNMP response packet */
134 printf("%s = ", _cupsSNMPOIDToString(packet->object_name, temp, sizeof(temp)));
136 switch (packet->object_type)
140 packet->object_value.boolean ? "TRUE" : "FALSE");
144 printf("INTEGER %d\n", packet->object_value.integer);
149 (char *)packet->object_value.string.bytes);
154 (char *)packet->object_value.string.bytes);
162 printf("OID %s\n", _cupsSNMPOIDToString(packet->object_value.oid,
168 for (i = 0; i < packet->object_value.string.num_bytes; i ++)
169 printf(" %02X", packet->object_value.string.bytes[i]);
174 printf("Counter %d\n", packet->object_value.counter);
178 printf("Gauge %u\n", packet->object_value.gauge);
183 packet->object_value.timeticks / 8640000,
184 (packet->object_value.timeticks / 360000) % 24,
185 (packet->object_value.timeticks / 6000) % 60,
186 (packet->object_value.timeticks / 100) % 60,
187 packet->object_value.timeticks % 100);
191 printf("Unknown-%X\n", packet->object_type);
210 cups_snmp_t packet; /* SNMP packet */
246 if (!_cupsSNMPRead(fd, &packet, 5.0))
252 if (!_cupsSNMPIsOID(&packet, oid))
254 printf("FAIL (bad OID %d", packet.object_name[0]);
255 for (i = 1; packet.object_name[i] >= 0; i ++)
256 printf(".%d", packet.object_name[i]);
261 if (packet.error)
263 printf("FAIL (%s)\n", packet.error);
269 print_packet(&packet, NULL);