version 1.32, 2021/03/03 09:06:20 |
version 1.33, 2021/03/23 22:07:36 |
|
|
if (clock_gettime(CLOCK_UPTIME, &ts) == -1) |
if (clock_gettime(CLOCK_UPTIME, &ts) == -1) |
err(1, "clock_gettime"); |
err(1, "clock_gettime"); |
} else { |
} else { |
lval = strtonum(argv[1], 0, LLONG_MAX, &errstr); |
lval = strtonum(argv[1], 0, UINT32_MAX, &errstr); |
if (errstr != NULL) |
if (errstr != NULL) |
errx(1, "Bad value notation (%s)", argv[1]); |
errx(1, "Bad value notation (%s)", argv[1]); |
ts.tv_sec = lval / 100; |
ts.tv_sec = lval / 100; |
|
|
*/ |
*/ |
goto pastestring; |
goto pastestring; |
case 'c': |
case 'c': |
lval = strtonum(argv[i + 2], INT32_MIN, INT32_MAX, |
lval = strtonum(argv[i + 2], 0, UINT32_MAX, |
&errstr); |
&errstr); |
if (errstr != NULL) |
if (errstr != NULL) |
errx(1, "%s: Bad value notation (%s)", argv[i], |
errx(1, "%s: Bad value notation (%s)", argv[i], |
|
|
tmpstr = endstr + 1; |
tmpstr = endstr + 1; |
} while (endstr[0] != '\0'); |
} while (endstr[0] != '\0'); |
goto pastestring; |
goto pastestring; |
case 'u': |
|
case 'i': |
case 'i': |
lval = strtonum(argv[i + 2], LLONG_MIN, LLONG_MAX, |
lval = strtonum(argv[i + 2], INT32_MIN, INT32_MAX, |
&errstr); |
&errstr); |
if (errstr != NULL) |
if (errstr != NULL) |
errx(1, "%s: Bad value notation (%s)", argv[i], |
errx(1, "%s: Bad value notation (%s)", argv[i], |
|
|
free(str); |
free(str); |
break; |
break; |
case 't': |
case 't': |
lval = strtonum(argv[i + 2], LLONG_MIN, LLONG_MAX, |
lval = strtonum(argv[i + 2], 0, UINT32_MAX, |
&errstr); |
&errstr); |
if (errstr != NULL) |
if (errstr != NULL) |
errx(1, "%s: Bad value notation (%s)", argv[i], |
errx(1, "%s: Bad value notation (%s)", argv[i], |
|
|
if ((varbind = ober_printf_elements(varbind, "{Oit}", |
if ((varbind = ober_printf_elements(varbind, "{Oit}", |
&oid, lval, BER_CLASS_APPLICATION, |
&oid, lval, BER_CLASS_APPLICATION, |
SNMP_T_TIMETICKS)) == NULL) |
SNMP_T_TIMETICKS)) == NULL) |
|
err(1, "ober_printf_elements"); |
|
break; |
|
case 'u': |
|
lval = strtonum(argv[i + 2], 0, UINT32_MAX, |
|
&errstr); |
|
if (errstr != NULL) |
|
errx(1, "%s: Bad value notation (%s)", argv[i], |
|
argv[i + 2]); |
|
if ((varbind = ober_printf_elements(varbind, "{Oit}", |
|
&oid, lval, BER_CLASS_APPLICATION, |
|
SNMP_T_GAUGE32)) == NULL) |
err(1, "ober_printf_elements"); |
err(1, "ober_printf_elements"); |
break; |
break; |
case 'x': |
case 'x': |