2 * collectd - src/tcpconns.c
3 * Copyright (C) 2007,2008 Florian octo Forster
4 * Copyright (C) 2008 Michael Stapelberg
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; only version 2 of the License is applicable.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * Florian octo Forster <octo at verplant.org>
21 * Michael Stapelberg <michael+git at stapelberg.de>
25 * Code within `HAVE_LIBKVM_NLIST' blocks is provided under the following
28 * $collectd: parts of tcpconns.c, 2008/08/08 03:48:30 Michael Stapelberg $
29 * $OpenBSD: inet.c,v 1.100 2007/06/19 05:28:30 ray Exp $
30 * $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $
32 * Copyright (c) 1983, 1988, 1993
33 * The Regents of the University of California. All rights reserved.
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
38 * 1. Redistributions of source code must retain the above copyright
39 * notice, this list of conditions and the following disclaimer.
40 * 2. Redistributions in binary form must reproduce the above copyright
41 * notice, this list of conditions and the following disclaimer in the
42 * documentation and/or other materials provided with the distribution.
43 * 3. Neither the name of the University nor the names of its contributors
44 * may be used to endorse or promote products derived from this software
45 * without specific prior written permission.
47 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
48 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
50 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
51 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
53 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 #if defined(__OpenBSD__) || defined(__NetBSD__)
65 #undef HAVE_SYSCTLBYNAME /* force HAVE_LIBKVM_NLIST path */
68 #if !KERNEL_LINUX && !HAVE_SYSCTLBYNAME && !HAVE_LIBKVM_NLIST && !KERNEL_AIX
69 # error "No applicable input method."
73 # include <asm/types.h>
74 /* sys/socket.h is necessary to compile when using netlink on older systems. */
75 # include <sys/socket.h>
76 # include <linux/netlink.h>
77 # include <linux/inet_diag.h>
78 # include <sys/socket.h>
79 # include <arpa/inet.h>
80 /* #endif KERNEL_LINUX */
82 #elif HAVE_SYSCTLBYNAME
83 # include <sys/socketvar.h>
84 # include <sys/sysctl.h>
86 /* Some includes needed for compiling on FreeBSD */
89 # include <sys/types.h>
92 # include <sys/socket.h>
98 # include <net/route.h>
99 # include <netinet/in.h>
100 # include <netinet/in_systm.h>
101 # include <netinet/ip.h>
102 # include <netinet/ip6.h>
103 # include <netinet/in_pcb.h>
104 # include <netinet/ip_var.h>
105 # include <netinet/tcp.h>
106 # include <netinet/tcpip.h>
107 # include <netinet/tcp_seq.h>
108 # include <netinet/tcp_var.h>
109 /* #endif HAVE_SYSCTLBYNAME */
111 /* This is for OpenBSD and NetBSD. */
112 #elif HAVE_LIBKVM_NLIST
113 # include <sys/queue.h>
114 # include <sys/socket.h>
115 # include <net/route.h>
116 # include <netinet/in.h>
117 # include <netinet/in_systm.h>
118 # include <netinet/ip.h>
119 # include <netinet/ip_var.h>
120 # include <netinet/in_pcb.h>
121 # include <netinet/tcp.h>
122 # include <netinet/tcp_timer.h>
123 # include <netinet/tcp_var.h>
125 # include <arpa/inet.h>
126 # if !defined(HAVE_BSD_NLIST_H) || !HAVE_BSD_NLIST_H
128 # else /* HAVE_BSD_NLIST_H */
129 # include <bsd/nlist.h>
132 /* #endif HAVE_LIBKVM_NLIST */
135 # include <arpa/inet.h>
136 # include <sys/socketvar.h>
137 #endif /* KERNEL_AIX */
142 struct inet_diag_req r;
145 static const char *tcp_state[] =
161 # define TCP_STATE_LISTEN 10
162 # define TCP_STATE_MIN 1
163 # define TCP_STATE_MAX 11
164 /* #endif KERNEL_LINUX */
166 #elif HAVE_SYSCTLBYNAME
167 static const char *tcp_state[] =
182 # define TCP_STATE_LISTEN 1
183 # define TCP_STATE_MIN 0
184 # define TCP_STATE_MAX 10
185 /* #endif HAVE_SYSCTLBYNAME */
187 #elif HAVE_LIBKVM_NLIST
188 static const char *tcp_state[] =
204 static u_long inpcbtable_off = 0;
205 struct inpcbtable *inpcbtable_ptr = NULL;
207 # define TCP_STATE_LISTEN 1
208 # define TCP_STATE_MIN 1
209 # define TCP_STATE_MAX 10
210 /* #endif HAVE_LIBKVM_NLIST */
213 static const char *tcp_state[] =
228 # define TCP_STATE_LISTEN 1
229 # define TCP_STATE_MIN 0
230 # define TCP_STATE_MAX 10
232 struct netinfo_conn {
236 struct in6_addr dstaddr;
239 struct in6_addr srcaddr;
240 uint32_t unknow4[36];
245 struct netinfo_header {
250 # define NETINFO_TCP 3
251 extern int netinfo (int proto, void *data, int *size, int n);
252 #endif /* KERNEL_AIX */
254 #define PORT_COLLECT_LOCAL 0x01
255 #define PORT_COLLECT_REMOTE 0x02
256 #define PORT_IS_LISTENING 0x04
258 typedef struct port_entry_s
262 uint32_t count_local[TCP_STATE_MAX + 1];
263 uint32_t count_remote[TCP_STATE_MAX + 1];
264 struct port_entry_s *next;
267 static const char *config_keys[] =
273 static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
275 static int port_collect_listening = 0;
276 static port_entry_t *port_list_head = NULL;
279 static uint32_t sequence_number = 0;
286 } linux_source = SRC_DUNNO;
289 static void conn_submit_port_entry (port_entry_t *pe)
292 value_list_t vl = VALUE_LIST_INIT;
297 sstrncpy (vl.host, hostname_g, sizeof (vl.host));
298 sstrncpy (vl.plugin, "tcpconns", sizeof (vl.plugin));
299 sstrncpy (vl.type, "tcp_connections", sizeof (vl.type));
301 if (((port_collect_listening != 0) && (pe->flags & PORT_IS_LISTENING))
302 || (pe->flags & PORT_COLLECT_LOCAL))
304 ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
305 "%"PRIu16"-local", pe->port);
307 for (i = 1; i <= TCP_STATE_MAX; i++)
309 vl.values[0].gauge = pe->count_local[i];
311 sstrncpy (vl.type_instance, tcp_state[i], sizeof (vl.type_instance));
313 plugin_dispatch_values (&vl);
317 if (pe->flags & PORT_COLLECT_REMOTE)
319 ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
320 "%"PRIu16"-remote", pe->port);
322 for (i = 1; i <= TCP_STATE_MAX; i++)
324 vl.values[0].gauge = pe->count_remote[i];
326 sstrncpy (vl.type_instance, tcp_state[i], sizeof (vl.type_instance));
328 plugin_dispatch_values (&vl);
331 } /* void conn_submit */
333 static void conn_submit_all (void)
337 for (pe = port_list_head; pe != NULL; pe = pe->next)
338 conn_submit_port_entry (pe);
339 } /* void conn_submit_all */
341 static port_entry_t *conn_get_port_entry (uint16_t port, int create)
345 ret = port_list_head;
348 if (ret->port == port)
353 if ((ret == NULL) && (create != 0))
355 ret = (port_entry_t *) malloc (sizeof (port_entry_t));
358 memset (ret, '\0', sizeof (port_entry_t));
361 ret->next = port_list_head;
362 port_list_head = ret;
366 } /* port_entry_t *conn_get_port_entry */
368 /* Removes ports that were added automatically due to the `ListeningPorts'
369 * setting but which are no longer listening. */
370 static void conn_reset_port_entry (void)
372 port_entry_t *prev = NULL;
373 port_entry_t *pe = port_list_head;
377 /* If this entry was created while reading the files (ant not when handling
378 * the configuration) remove it now. */
379 if ((pe->flags & (PORT_COLLECT_LOCAL
380 | PORT_COLLECT_REMOTE
381 | PORT_IS_LISTENING)) == 0)
383 port_entry_t *next = pe->next;
385 DEBUG ("tcpconns plugin: Removing temporary entry "
386 "for listening port %"PRIu16, pe->port);
389 port_list_head = next;
399 memset (pe->count_local, '\0', sizeof (pe->count_local));
400 memset (pe->count_remote, '\0', sizeof (pe->count_remote));
401 pe->flags &= ~PORT_IS_LISTENING;
405 } /* void conn_reset_port_entry */
407 static int conn_handle_ports (uint16_t port_local, uint16_t port_remote, uint8_t state)
409 port_entry_t *pe = NULL;
411 if ((state > TCP_STATE_MAX)
412 #if TCP_STATE_MIN > 0
413 || (state < TCP_STATE_MIN)
417 NOTICE ("tcpconns plugin: Ignoring connection with "
418 "unknown state 0x%02"PRIx8".", state);
422 /* Listening sockets */
423 if ((state == TCP_STATE_LISTEN) && (port_collect_listening != 0))
425 pe = conn_get_port_entry (port_local, 1 /* create */);
427 pe->flags |= PORT_IS_LISTENING;
430 DEBUG ("tcpconns plugin: Connection %"PRIu16" <-> %"PRIu16" (%s)",
431 port_local, port_remote, tcp_state[state]);
433 pe = conn_get_port_entry (port_local, 0 /* no create */);
435 pe->count_local[state]++;
437 pe = conn_get_port_entry (port_remote, 0 /* no create */);
439 pe->count_remote[state]++;
442 } /* int conn_handle_ports */
445 /* Returns zero on success, less than zero on socket error and greater than
446 * zero on other errors. */
447 static int conn_read_netlink (void)
450 struct sockaddr_nl nladdr;
454 struct inet_diag_msg *r;
457 /* If this fails, it's likely a permission problem. We'll fall back to
458 * reading this information from files below. */
459 fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_INET_DIAG);
462 ERROR ("tcpconns plugin: conn_read_netlink: socket(AF_NETLINK, SOCK_RAW, "
463 "NETLINK_INET_DIAG) failed: %s",
464 sstrerror (errno, buf, sizeof (buf)));
468 memset(&nladdr, 0, sizeof(nladdr));
469 nladdr.nl_family = AF_NETLINK;
471 memset(&req, 0, sizeof(req));
472 req.nlh.nlmsg_len = sizeof(req);
473 req.nlh.nlmsg_type = TCPDIAG_GETSOCK;
474 /* NLM_F_ROOT: return the complete table instead of a single entry.
475 * NLM_F_MATCH: return all entries matching criteria (not implemented)
476 * NLM_F_REQUEST: must be set on all request messages */
477 req.nlh.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
478 req.nlh.nlmsg_pid = 0;
479 /* The sequence_number is used to track our messages. Since netlink is not
480 * reliable, we don't want to end up with a corrupt or incomplete old
481 * message in case the system is/was out of memory. */
482 req.nlh.nlmsg_seq = ++sequence_number;
483 req.r.idiag_family = AF_INET;
484 req.r.idiag_states = 0xfff;
487 memset(&iov, 0, sizeof(iov));
489 iov.iov_len = sizeof(req);
491 memset(&msg, 0, sizeof(msg));
492 msg.msg_name = (void*)&nladdr;
493 msg.msg_namelen = sizeof(nladdr);
497 if (sendmsg (fd, &msg, 0) < 0)
499 ERROR ("tcpconns plugin: conn_read_netlink: sendmsg(2) failed: %s",
500 sstrerror (errno, buf, sizeof (buf)));
506 iov.iov_len = sizeof(buf);
513 memset(&msg, 0, sizeof(msg));
514 msg.msg_name = (void*)&nladdr;
515 msg.msg_namelen = sizeof(nladdr);
519 status = recvmsg(fd, (void *) &msg, /* flags = */ 0);
522 if ((errno == EINTR) || (errno == EAGAIN))
525 ERROR ("tcpconns plugin: conn_read_netlink: recvmsg(2) failed: %s",
526 sstrerror (errno, buf, sizeof (buf)));
530 else if (status == 0)
533 DEBUG ("tcpconns plugin: conn_read_netlink: Unexpected zero-sized "
534 "reply from netlink socket.");
538 h = (struct nlmsghdr*)buf;
539 while (NLMSG_OK(h, status))
541 if (h->nlmsg_seq != sequence_number)
543 h = NLMSG_NEXT(h, status);
547 if (h->nlmsg_type == NLMSG_DONE)
552 else if (h->nlmsg_type == NLMSG_ERROR)
554 struct nlmsgerr *msg_error;
556 msg_error = NLMSG_DATA(h);
557 WARNING ("tcpconns plugin: conn_read_netlink: Received error %i.",
566 /* This code does not (need to) distinguish between IPv4 and IPv6. */
567 conn_handle_ports (ntohs(r->id.idiag_sport),
568 ntohs(r->id.idiag_dport),
571 h = NLMSG_NEXT(h, status);
572 } /* while (NLMSG_OK) */
575 /* Not reached because the while() loop above handles the exit condition. */
577 } /* int conn_read_netlink */
579 static int conn_handle_line (char *buffer)
586 char *port_local_str;
587 char *port_remote_str;
589 uint16_t port_remote;
593 int buffer_len = strlen (buffer);
595 while ((buffer_len > 0) && (buffer[buffer_len - 1] < 32))
596 buffer[--buffer_len] = '\0';
600 fields_len = strsplit (buffer, fields, STATIC_ARRAY_SIZE (fields));
603 DEBUG ("tcpconns plugin: Got %i fields, expected at least 12.", fields_len);
607 port_local_str = strchr (fields[1], ':');
608 port_remote_str = strchr (fields[2], ':');
610 if ((port_local_str == NULL) || (port_remote_str == NULL))
614 if ((*port_local_str == '\0') || (*port_remote_str == '\0'))
618 port_local = (uint16_t) strtol (port_local_str, &endptr, 16);
619 if ((endptr == NULL) || (*endptr != '\0'))
623 port_remote = (uint16_t) strtol (port_remote_str, &endptr, 16);
624 if ((endptr == NULL) || (*endptr != '\0'))
628 state = (uint8_t) strtol (fields[3], &endptr, 16);
629 if ((endptr == NULL) || (*endptr != '\0'))
632 return (conn_handle_ports (port_local, port_remote, state));
633 } /* int conn_handle_line */
635 static int conn_read_file (const char *file)
640 fh = fopen (file, "r");
644 while (fgets (buffer, sizeof (buffer), fh) != NULL)
646 conn_handle_line (buffer);
647 } /* while (fgets) */
652 } /* int conn_read_file */
653 /* #endif KERNEL_LINUX */
655 #elif HAVE_SYSCTLBYNAME
656 /* #endif HAVE_SYSCTLBYNAME */
658 #elif HAVE_LIBKVM_NLIST
659 #endif /* HAVE_LIBKVM_NLIST */
661 static int conn_config (const char *key, const char *value)
663 if (strcasecmp (key, "ListeningPorts") == 0)
666 port_collect_listening = 1;
668 port_collect_listening = 0;
670 else if ((strcasecmp (key, "LocalPort") == 0)
671 || (strcasecmp (key, "RemotePort") == 0))
674 int port = atoi (value);
676 if ((port < 1) || (port > 65535))
678 ERROR ("tcpconns plugin: Invalid port: %i", port);
682 pe = conn_get_port_entry ((uint16_t) port, 1 /* create */);
685 ERROR ("tcpconns plugin: conn_get_port_entry failed.");
689 if (strcasecmp (key, "LocalPort") == 0)
690 pe->flags |= PORT_COLLECT_LOCAL;
692 pe->flags |= PORT_COLLECT_REMOTE;
700 } /* int conn_config */
703 static int conn_init (void)
705 if (port_list_head == NULL)
706 port_collect_listening = 1;
709 } /* int conn_init */
711 static int conn_read (void)
715 conn_reset_port_entry ();
717 if (linux_source == SRC_NETLINK)
719 status = conn_read_netlink ();
721 else if (linux_source == SRC_PROC)
725 if (conn_read_file ("/proc/net/tcp") != 0)
727 if (conn_read_file ("/proc/net/tcp6") != 0)
735 else /* if (linux_source == SRC_DUNNO) */
737 /* Try to use netlink for getting this data, it is _much_ faster on systems
738 * with a large amount of connections. */
739 status = conn_read_netlink ();
742 INFO ("tcpconns plugin: Reading from netlink succeeded. "
743 "Will use the netlink method from now on.");
744 linux_source = SRC_NETLINK;
748 INFO ("tcpconns plugin: Reading from netlink failed. "
749 "Will read from /proc from now on.");
750 linux_source = SRC_PROC;
752 /* return success here to avoid the "plugin failed" message. */
763 } /* int conn_read */
764 /* #endif KERNEL_LINUX */
766 #elif HAVE_SYSCTLBYNAME
767 static int conn_read (void)
773 struct xinpgen *in_orig;
774 struct xinpgen *in_ptr;
776 conn_reset_port_entry ();
779 status = sysctlbyname ("net.inet.tcp.pcblist", NULL, &buffer_len, 0, 0);
782 ERROR ("tcpconns plugin: sysctlbyname failed.");
786 buffer = (char *) malloc (buffer_len);
789 ERROR ("tcpconns plugin: malloc failed.");
793 status = sysctlbyname ("net.inet.tcp.pcblist", buffer, &buffer_len, 0, 0);
796 ERROR ("tcpconns plugin: sysctlbyname failed.");
801 if (buffer_len <= sizeof (struct xinpgen))
803 ERROR ("tcpconns plugin: (buffer_len <= sizeof (struct xinpgen))");
808 in_orig = (struct xinpgen *) buffer;
809 for (in_ptr = (struct xinpgen *) (((char *) in_orig) + in_orig->xig_len);
810 in_ptr->xig_len > sizeof (struct xinpgen);
811 in_ptr = (struct xinpgen *) (((char *) in_ptr) + in_ptr->xig_len))
813 struct tcpcb *tp = &((struct xtcpcb *) in_ptr)->xt_tp;
814 struct inpcb *inp = &((struct xtcpcb *) in_ptr)->xt_inp;
815 struct xsocket *so = &((struct xtcpcb *) in_ptr)->xt_socket;
817 /* Ignore non-TCP sockets */
818 if (so->xso_protocol != IPPROTO_TCP)
821 /* Ignore PCBs which were freed during copyout. */
822 if (inp->inp_gencnt > in_orig->xig_gen)
825 if (((inp->inp_vflag & INP_IPV4) == 0)
826 && ((inp->inp_vflag & INP_IPV6) == 0))
829 conn_handle_ports (ntohs (inp->inp_lport), ntohs (inp->inp_fport),
840 } /* int conn_read */
841 /* #endif HAVE_SYSCTLBYNAME */
843 #elif HAVE_LIBKVM_NLIST
844 static int kread (u_long addr, void *buf, int size)
848 status = kvm_read (kvmd, addr, buf, size);
851 ERROR ("tcpconns plugin: kvm_read failed (got %i, expected %i): %s\n",
852 status, size, kvm_geterr (kvmd));
858 static int conn_init (void)
860 char buf[_POSIX2_LINE_MAX];
869 kvmd = kvm_openfiles (NULL, NULL, NULL, O_RDONLY, buf);
872 ERROR ("tcpconns plugin: kvm_openfiles failed: %s", buf);
876 status = kvm_nlist (kvmd, nl);
879 ERROR ("tcpconns plugin: kvm_nlist failed with status %i.", status);
883 if (nl[N_TCBTABLE].n_type == 0)
885 ERROR ("tcpconns plugin: Error looking up kernel's namelist: "
886 "N_TCBTABLE is invalid.");
890 inpcbtable_off = (u_long) nl[N_TCBTABLE].n_value;
891 inpcbtable_ptr = (struct inpcbtable *) nl[N_TCBTABLE].n_value;
894 } /* int conn_init */
896 static int conn_read (void)
898 struct inpcbtable table;
905 conn_reset_port_entry ();
907 /* Read the pcbtable from the kernel */
908 status = kread (inpcbtable_off, &table, sizeof (table));
912 /* Get the `head' pcb */
913 head = (struct inpcb *) &(inpcbtable_ptr->inpt_queue);
914 /* Get the first pcb */
915 next = (struct inpcb *)CIRCLEQ_FIRST (&table.inpt_queue);
919 /* Read the pcb pointed to by `next' into `inpcb' */
920 kread ((u_long) next, &inpcb, sizeof (inpcb));
923 next = (struct inpcb *)CIRCLEQ_NEXT (&inpcb, inp_queue);
925 /* Ignore sockets, that are not connected. */
927 if (inpcb.inp_af == AF_INET6)
928 continue; /* XXX see netbsd/src/usr.bin/netstat/inet6.c */
930 if (!(inpcb.inp_flags & INP_IPV6)
931 && (inet_lnaof(inpcb.inp_laddr) == INADDR_ANY))
933 if ((inpcb.inp_flags & INP_IPV6)
934 && IN6_IS_ADDR_UNSPECIFIED (&inpcb.inp_laddr6))
938 kread ((u_long) inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb));
939 conn_handle_ports (ntohs(inpcb.inp_lport), ntohs(inpcb.inp_fport), tcpcb.t_state);
940 } /* while (next != head) */
946 /* #endif HAVE_LIBKVM_NLIST */
950 static int conn_read (void)
956 struct netinfo_header *header;
957 struct netinfo_conn *conn;
959 conn_reset_port_entry ();
961 size = netinfo(NETINFO_TCP, 0, 0, 0);
964 ERROR ("tcpconns plugin: netinfo failed return: %i", size);
971 if ((size - sizeof (struct netinfo_header)) % sizeof (struct netinfo_conn))
973 ERROR ("tcpconns plugin: invalid buffer size");
980 ERROR ("tcpconns plugin: malloc failed");
984 if (netinfo(NETINFO_TCP, data, &size, 0) < 0)
986 ERROR ("tcpconns plugin: netinfo failed");
991 header = (struct netinfo_header *)data;
992 nconn = header->size;
993 conn = (struct netinfo_conn *)(data + sizeof(struct netinfo_header));
995 for (i=0; i < nconn; conn++, i++)
997 conn_handle_ports (conn->srcport, conn->dstport, conn->tcp_state);
1006 #endif /* KERNEL_AIX */
1008 void module_register (void)
1010 plugin_register_config ("tcpconns", conn_config,
1011 config_keys, config_keys_num);
1013 plugin_register_init ("tcpconns", conn_init);
1014 #elif HAVE_SYSCTLBYNAME
1015 /* no initialization */
1016 #elif HAVE_LIBKVM_NLIST
1017 plugin_register_init ("tcpconns", conn_init);
1019 /* no initialization */
1021 plugin_register_read ("tcpconns", conn_read);
1022 } /* void module_register */
1025 * vim: set shiftwidth=2 softtabstop=2 tabstop=8 fdm=marker :