#if !KERNEL_LINUX
#error "No applicable input method."
#endif
static void serial_submit(const char *type_instance, derive_t rx, derive_t tx) {
#if !KERNEL_LINUX
#error "No applicable input method."
#endif
static void serial_submit(const char *type_instance, derive_t rx, derive_t tx) {
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)