if (status == 0)
{
vl.time = TIME_T_TO_CDTIME_T (tmp);
- n.time = TIME_T_TO_CDTIME_T (tmp);
+ n.time = TIME_T_TO_CDTIME_T (tmp);
+ }
+ }
+ else if (pkg_type == TYPE_TIME_HR)
+ {
+ uint64_t tmp = 0;
+ status = parse_part_number (&buffer, &buffer_size,
+ &tmp);
+ if (status == 0)
+ {
+ vl.time = (cdtime_t) tmp;
+ n.time = (cdtime_t) tmp;
}
}
else if (pkg_type == TYPE_INTERVAL)
if (status == 0)
vl.interval = TIME_T_TO_CDTIME_T (tmp);
}
+ else if (pkg_type == TYPE_INTERVAL_HR)
+ {
+ uint64_t tmp = 0;
+ status = parse_part_number (&buffer, &buffer_size,
+ &tmp);
+ if (status == 0)
+ vl.interval = (cdtime_t) tmp;
+ }
else if (pkg_type == TYPE_HOST)
{
status = parse_part_string (&buffer, &buffer_size,
if (vl_def->time != vl->time)
{
- time_t tmp = CDTIME_T_TO_TIME_T (vl->time);
- if (write_part_number (&buffer, &buffer_size, TYPE_TIME,
- (uint64_t) tmp))
+ if (write_part_number (&buffer, &buffer_size, TYPE_TIME_HR,
+ (uint64_t) vl->time))
return (-1);
vl_def->time = vl->time;
}
if (vl_def->interval != vl->interval)
{
- /* TODO: Create a new type for sub-second intervals. */
- if (write_part_number (&buffer, &buffer_size, TYPE_INTERVAL,
- (uint64_t) CDTIME_T_TO_TIME_T (vl->interval)))
+ if (write_part_number (&buffer, &buffer_size, TYPE_INTERVAL_HR,
+ (uint64_t) vl->interval))
return (-1);
vl_def->interval = vl->interval;
}
char *buffer_ptr = buffer;
int buffer_free = sizeof (buffer);
int status;
- time_t tmp;
memset (buffer, '\0', sizeof (buffer));
-
- tmp = CDTIME_T_TO_TIME_T (n->time);
- status = write_part_number (&buffer_ptr, &buffer_free, TYPE_TIME,
- (uint64_t) tmp);
+ status = write_part_number (&buffer_ptr, &buffer_free, TYPE_TIME_HR,
+ (uint64_t) n->time);
if (status != 0)
return (-1);
#define TYPE_HOST 0x0000
#define TYPE_TIME 0x0001
+#define TYPE_TIME_HR 0x0008
#define TYPE_PLUGIN 0x0002
#define TYPE_PLUGIN_INSTANCE 0x0003
#define TYPE_TYPE 0x0004
#define TYPE_TYPE_INSTANCE 0x0005
#define TYPE_VALUES 0x0006
#define TYPE_INTERVAL 0x0007
+#define TYPE_INTERVAL_HR 0x0009
/* Types to transmit notifications */
#define TYPE_MESSAGE 0x0100