sstrncpy(vl.plugin, "serial", sizeof(vl.plugin));
sstrncpy(vl.type, "serial_octets", sizeof(vl.type));
sstrncpy(vl.type_instance, type_instance, sizeof(vl.type_instance));
sstrncpy(vl.plugin, "serial", sizeof(vl.plugin));
sstrncpy(vl.type, "serial_octets", sizeof(vl.type));
sstrncpy(vl.type_instance, type_instance, sizeof(vl.type_instance));
/* there are a variety of names for the serial device */
if ((fh = fopen("/proc/tty/driver/serial", "r")) == NULL &&
(fh = fopen("/proc/tty/driver/ttyS", "r")) == NULL) {
/* there are a variety of names for the serial device */
if ((fh = fopen("/proc/tty/driver/serial", "r")) == NULL &&
(fh = fopen("/proc/tty/driver/ttyS", "r")) == NULL) {
if (strncmp(fields[i], "tx:", 3) == 0) {
if (strtoderive(fields[i] + 3, &tx) == 0)
if (strncmp(fields[i], "tx:", 3) == 0) {
if (strtoderive(fields[i] + 3, &tx) == 0)
} else if (strncmp(fields[i], "rx:", 3) == 0) {
if (strtoderive(fields[i] + 3, &rx) == 0)
} else if (strncmp(fields[i], "rx:", 3) == 0) {
if (strtoderive(fields[i] + 3, &rx) == 0)