e1bc88209569b7e8bf1f0ac8d4c69abe59d3321e
[collectd.git] / src / tcpconns.c
1 /**
2  * collectd - src/tcpconns.c
3  * Copyright (C) 2007,2008  Florian octo Forster
4  * Copyright (C) 2008       Michael Stapelberg
5  *
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.
9  *
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.
14  *
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
18  *
19  * Author:
20  *   Florian octo Forster <octo at verplant.org>
21  *   Michael Stapelberg <michael+git at stapelberg.de>
22  **/
23
24 /**
25  * Code within `HAVE_LIBKVM_NLIST' blocks is provided under the following
26  * license:
27  *
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 $
31  *
32  * Copyright (c) 1983, 1988, 1993
33  *      The Regents of the University of California.  All rights reserved.
34  *
35  * Redistribution and use in source and binary forms, with or without
36  * modification, are permitted provided that the following conditions
37  * are met:
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.
46  *
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
57  * SUCH DAMAGE.
58  */
59
60 #include "collectd.h"
61 #include "common.h"
62 #include "plugin.h"
63
64 #if !KERNEL_LINUX && !HAVE_SYSCTLBYNAME && !HAVE_LIBKVM_NLIST
65 # error "No applicable input method."
66 #endif
67
68 #if KERNEL_LINUX
69 /* #endif KERNEL_LINUX */
70
71 #elif HAVE_SYSCTLBYNAME
72 # include <sys/socketvar.h>
73 # include <sys/sysctl.h>
74
75 /* Some includes needed for compiling on FreeBSD */
76 #include <sys/time.h>
77 #if HAVE_SYS_TYPES_H
78 # include <sys/types.h>
79 #endif
80 #if HAVE_SYS_SOCKET_H
81 # include <sys/socket.h>
82 #endif
83 #if HAVE_NET_IF_H
84 # include <net/if.h>
85 #endif
86
87 # include <net/route.h>
88 # include <netinet/in.h>
89 # include <netinet/in_systm.h>
90 # include <netinet/ip.h>
91 # include <netinet/ip6.h>
92 # include <netinet/in_pcb.h>
93 # include <netinet/ip_var.h>
94 # include <netinet/tcp.h>
95 # include <netinet/tcpip.h>
96 # include <netinet/tcp_seq.h>
97 # include <netinet/tcp_var.h>
98 /* #endif HAVE_SYSCTLBYNAME */
99
100 /* This is for OpenBSD and possibly NetBSD. */
101 #elif HAVE_LIBKVM_NLIST
102 # include <sys/queue.h>
103 # include <sys/socket.h>
104 # include <net/route.h>
105 # include <netinet/in.h>
106 # include <netinet/in_systm.h>
107 # include <netinet/ip.h>
108 # include <netinet/in_pcb.h>
109 # include <netinet/tcp.h>
110 # include <netinet/tcp_timer.h>
111 # include <netinet/tcp_var.h>
112 # include <netdb.h>
113 # include <arpa/inet.h>
114 # include <nlist.h>
115 # include <kvm.h>
116 #endif /* HAVE_LIBKVM_NLIST */
117
118 #if KERNEL_LINUX
119 static const char *tcp_state[] =
120 {
121   "", /* 0 */
122   "ESTABLISHED",
123   "SYN_SENT",
124   "SYN_RECV",
125   "FIN_WAIT1",
126   "FIN_WAIT2",
127   "TIME_WAIT",
128   "CLOSED",
129   "CLOSE_WAIT",
130   "LAST_ACK",
131   "LISTEN", /* 10 */
132   "CLOSING"
133 };
134
135 # define TCP_STATE_LISTEN 10
136 # define TCP_STATE_MIN 1
137 # define TCP_STATE_MAX 11
138 /* #endif KERNEL_LINUX */
139
140 #elif HAVE_SYSCTLBYNAME
141 static const char *tcp_state[] =
142 {
143   "CLOSED",
144   "LISTEN",
145   "SYN_SENT",
146   "SYN_RECV",
147   "ESTABLISHED",
148   "CLOSE_WAIT",
149   "FIN_WAIT1",
150   "CLOSING",
151   "LAST_ACK",
152   "FIN_WAIT2",
153   "TIME_WAIT"
154 };
155
156 # define TCP_STATE_LISTEN 1
157 # define TCP_STATE_MIN 0
158 # define TCP_STATE_MAX 10
159 /* #endif HAVE_SYSCTLBYNAME */
160
161 #elif HAVE_LIBKVM_NLIST
162 static const char *tcp_state[] =
163 {
164   "CLOSED",
165   "LISTEN",
166   "SYN_SENT",
167   "SYN_RECV",
168   "ESTABLISHED",
169   "CLOSE_WAIT",
170   "FIN_WAIT1",
171   "CLOSING",
172   "LAST_ACK",
173   "FIN_WAIT2",
174   "TIME_WAIT"
175 };
176
177 static kvm_t *kvmd;
178 static u_long      inpcbtable_off = 0;
179 struct inpcbtable *inpcbtable_ptr = NULL;
180
181 # define TCP_STATE_LISTEN 1
182 # define TCP_STATE_MIN 1
183 # define TCP_STATE_MAX 10
184 #endif /* HAVE_LIBKVM_NLIST */
185
186 #define PORT_COLLECT_LOCAL  0x01
187 #define PORT_COLLECT_REMOTE 0x02
188 #define PORT_IS_LISTENING   0x04
189
190 typedef struct port_entry_s
191 {
192   uint16_t port;
193   uint16_t flags;
194   uint32_t count_local[TCP_STATE_MAX + 1];
195   uint32_t count_remote[TCP_STATE_MAX + 1];
196   struct port_entry_s *next;
197 } port_entry_t;
198
199 static const char *config_keys[] =
200 {
201   "ListeningPorts",
202   "LocalPort",
203   "RemotePort"
204 };
205 static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
206
207 static int port_collect_listening = 0;
208 static port_entry_t *port_list_head = NULL;
209
210 static void conn_submit_port_entry (port_entry_t *pe)
211 {
212   value_t values[1];
213   value_list_t vl = VALUE_LIST_INIT;
214   int i;
215
216   vl.values = values;
217   vl.values_len = 1;
218   vl.time = time (NULL);
219   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
220   sstrncpy (vl.plugin, "tcpconns", sizeof (vl.plugin));
221   sstrncpy (vl.type, "tcp_connections", sizeof (vl.type));
222
223   if (((port_collect_listening != 0) && (pe->flags & PORT_IS_LISTENING))
224       || (pe->flags & PORT_COLLECT_LOCAL))
225   {
226     ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
227         "%"PRIu16"-local", pe->port);
228
229     for (i = 1; i <= TCP_STATE_MAX; i++)
230     {
231       vl.values[0].gauge = pe->count_local[i];
232
233       sstrncpy (vl.type_instance, tcp_state[i], sizeof (vl.type_instance));
234
235       plugin_dispatch_values (&vl);
236     }
237   }
238
239   if (pe->flags & PORT_COLLECT_REMOTE)
240   {
241     ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
242         "%"PRIu16"-remote", pe->port);
243
244     for (i = 1; i <= TCP_STATE_MAX; i++)
245     {
246       vl.values[0].gauge = pe->count_remote[i];
247
248       sstrncpy (vl.type_instance, tcp_state[i], sizeof (vl.type_instance));
249
250       plugin_dispatch_values (&vl);
251     }
252   }
253 } /* void conn_submit */
254
255 static void conn_submit_all (void)
256 {
257   port_entry_t *pe;
258
259   for (pe = port_list_head; pe != NULL; pe = pe->next)
260     conn_submit_port_entry (pe);
261 } /* void conn_submit_all */
262
263 static port_entry_t *conn_get_port_entry (uint16_t port, int create)
264 {
265   port_entry_t *ret;
266
267   ret = port_list_head;
268   while (ret != NULL)
269   {
270     if (ret->port == port)
271       break;
272     ret = ret->next;
273   }
274
275   if ((ret == NULL) && (create != 0))
276   {
277     ret = (port_entry_t *) malloc (sizeof (port_entry_t));
278     if (ret == NULL)
279       return (NULL);
280     memset (ret, '\0', sizeof (port_entry_t));
281
282     ret->port = port;
283     ret->next = port_list_head;
284     port_list_head = ret;
285   }
286
287   return (ret);
288 } /* port_entry_t *conn_get_port_entry */
289
290 /* Removes ports that were added automatically due to the `ListeningPorts'
291  * setting but which are no longer listening. */
292 static void conn_reset_port_entry (void)
293 {
294   port_entry_t *prev = NULL;
295   port_entry_t *pe = port_list_head;
296
297   while (pe != NULL)
298   {
299     /* If this entry was created while reading the files (ant not when handling
300      * the configuration) remove it now. */
301     if ((pe->flags & (PORT_COLLECT_LOCAL
302             | PORT_COLLECT_REMOTE
303             | PORT_IS_LISTENING)) == 0)
304     {
305       port_entry_t *next = pe->next;
306
307       DEBUG ("tcpconns plugin: Removing temporary entry "
308           "for listening port %"PRIu16, pe->port);
309
310       if (prev == NULL)
311         port_list_head = next;
312       else
313         prev->next = next;
314
315       sfree (pe);
316       pe = next;
317
318       continue;
319     }
320
321     memset (pe->count_local, '\0', sizeof (pe->count_local));
322     memset (pe->count_remote, '\0', sizeof (pe->count_remote));
323     pe->flags &= ~PORT_IS_LISTENING;
324
325     pe = pe->next;
326   }
327 } /* void conn_reset_port_entry */
328
329 static int conn_handle_ports (uint16_t port_local, uint16_t port_remote, uint8_t state)
330 {
331   port_entry_t *pe = NULL;
332
333   if ((state > TCP_STATE_MAX)
334 #if TCP_STATE_MIN > 0
335       || (state < TCP_STATE_MIN)
336 #endif
337      )
338   {
339     NOTICE ("tcpconns plugin: Ignoring connection with "
340         "unknown state 0x%02"PRIx8".", state);
341     return (-1);
342   }
343
344   /* Listening sockets */
345   if ((state == TCP_STATE_LISTEN) && (port_collect_listening != 0))
346   {
347     pe = conn_get_port_entry (port_local, 1 /* create */);
348     if (pe != NULL)
349       pe->flags |= PORT_IS_LISTENING;
350   }
351
352   DEBUG ("tcpconns plugin: Connection %"PRIu16" <-> %"PRIu16" (%s)",
353       port_local, port_remote, tcp_state[state]);
354
355   pe = conn_get_port_entry (port_local, 0 /* no create */);
356   if (pe != NULL)
357     pe->count_local[state]++;
358
359   pe = conn_get_port_entry (port_remote, 0 /* no create */);
360   if (pe != NULL)
361     pe->count_remote[state]++;
362
363   return (0);
364 } /* int conn_handle_ports */
365
366 #if KERNEL_LINUX
367 static int conn_handle_line (char *buffer)
368 {
369   char *fields[32];
370   int   fields_len;
371
372   char *endptr;
373
374   char *port_local_str;
375   char *port_remote_str;
376   uint16_t port_local;
377   uint16_t port_remote;
378
379   uint8_t state;
380
381   int buffer_len = strlen (buffer);
382
383   while ((buffer_len > 0) && (buffer[buffer_len - 1] < 32))
384     buffer[--buffer_len] = '\0';
385   if (buffer_len <= 0)
386     return (-1);
387
388   fields_len = strsplit (buffer, fields, STATIC_ARRAY_SIZE (fields));
389   if (fields_len < 12)
390   {
391     DEBUG ("tcpconns plugin: Got %i fields, expected at least 12.", fields_len);
392     return (-1);
393   }
394
395   port_local_str  = strchr (fields[1], ':');
396   port_remote_str = strchr (fields[2], ':');
397
398   if ((port_local_str == NULL) || (port_remote_str == NULL))
399     return (-1);
400   port_local_str++;
401   port_remote_str++;
402   if ((*port_local_str == '\0') || (*port_remote_str == '\0'))
403     return (-1);
404
405   endptr = NULL;
406   port_local = (uint16_t) strtol (port_local_str, &endptr, 16);
407   if ((endptr == NULL) || (*endptr != '\0'))
408     return (-1);
409
410   endptr = NULL;
411   port_remote = (uint16_t) strtol (port_remote_str, &endptr, 16);
412   if ((endptr == NULL) || (*endptr != '\0'))
413     return (-1);
414
415   endptr = NULL;
416   state = (uint8_t) strtol (fields[3], &endptr, 16);
417   if ((endptr == NULL) || (*endptr != '\0'))
418     return (-1);
419
420   return (conn_handle_ports (port_local, port_remote, state));
421 } /* int conn_handle_line */
422
423 static int conn_read_file (const char *file)
424 {
425   FILE *fh;
426   char buffer[1024];
427
428   fh = fopen (file, "r");
429   if (fh == NULL)
430     return (-1);
431
432   while (fgets (buffer, sizeof (buffer), fh) != NULL)
433   {
434     conn_handle_line (buffer);
435   } /* while (fgets) */
436
437   fclose (fh);
438
439   return (0);
440 } /* int conn_read_file */
441 /* #endif KERNEL_LINUX */
442
443 #elif HAVE_SYSCTLBYNAME
444 /* #endif HAVE_SYSCTLBYNAME */
445
446 #elif HAVE_LIBKVM_NLIST
447 #endif /* HAVE_LIBKVM_NLIST */
448
449 static int conn_config (const char *key, const char *value)
450 {
451   if (strcasecmp (key, "ListeningPorts") == 0)
452   {
453     if ((strcasecmp (value, "Yes") == 0)
454         || (strcasecmp (value, "True") == 0)
455         || (strcasecmp (value, "On") == 0))
456       port_collect_listening = 1;
457     else
458       port_collect_listening = 0;
459   }
460   else if ((strcasecmp (key, "LocalPort") == 0)
461       || (strcasecmp (key, "RemotePort") == 0))
462   {
463       port_entry_t *pe;
464       int port = atoi (value);
465
466       if ((port < 1) || (port > 65535))
467       {
468         ERROR ("tcpconns plugin: Invalid port: %i", port);
469         return (1);
470       }
471
472       pe = conn_get_port_entry ((uint16_t) port, 1 /* create */);
473       if (pe == NULL)
474       {
475         ERROR ("tcpconns plugin: conn_get_port_entry failed.");
476         return (1);
477       }
478
479       if (strcasecmp (key, "LocalPort") == 0)
480         pe->flags |= PORT_COLLECT_LOCAL;
481       else
482         pe->flags |= PORT_COLLECT_REMOTE;
483   }
484   else
485   {
486     return (-1);
487   }
488
489   return (0);
490 } /* int conn_config */
491
492 #if KERNEL_LINUX
493 static int conn_init (void)
494 {
495   if (port_list_head == NULL)
496     port_collect_listening = 1;
497
498   return (0);
499 } /* int conn_init */
500
501 static int conn_read (void)
502 {
503   int errors_num = 0;
504
505   conn_reset_port_entry ();
506
507   if (conn_read_file ("/proc/net/tcp") != 0)
508     errors_num++;
509   if (conn_read_file ("/proc/net/tcp6") != 0)
510     errors_num++;
511
512   if (errors_num < 2)
513   {
514     conn_submit_all ();
515   }
516   else
517   {
518     ERROR ("tcpconns plugin: Neither /proc/net/tcp nor /proc/net/tcp6 "
519         "coult be read.");
520     return (-1);
521   }
522
523   return (0);
524 } /* int conn_read */
525 /* #endif KERNEL_LINUX */
526
527 #elif HAVE_SYSCTLBYNAME
528 static int conn_read (void)
529 {
530   int status;
531   char *buffer;
532   size_t buffer_len;;
533
534   struct xinpgen *in_orig;
535   struct xinpgen *in_ptr;
536
537   conn_reset_port_entry ();
538
539   buffer_len = 0;
540   status = sysctlbyname ("net.inet.tcp.pcblist", NULL, &buffer_len, 0, 0);
541   if (status < 0)
542   {
543     ERROR ("tcpconns plugin: sysctlbyname failed.");
544     return (-1);
545   }
546
547   buffer = (char *) malloc (buffer_len);
548   if (buffer == NULL)
549   {
550     ERROR ("tcpconns plugin: malloc failed.");
551     return (-1);
552   }
553
554   status = sysctlbyname ("net.inet.tcp.pcblist", buffer, &buffer_len, 0, 0);
555   if (status < 0)
556   {
557     ERROR ("tcpconns plugin: sysctlbyname failed.");
558     sfree (buffer);
559     return (-1);
560   }
561
562   if (buffer_len <= sizeof (struct xinpgen))
563   {
564     ERROR ("tcpconns plugin: (buffer_len <= sizeof (struct xinpgen))");
565     sfree (buffer);
566     return (-1);
567   }
568
569   in_orig = (struct xinpgen *) buffer;
570   for (in_ptr = (struct xinpgen *) (((char *) in_orig) + in_orig->xig_len);
571       in_ptr->xig_len > sizeof (struct xinpgen);
572       in_ptr = (struct xinpgen *) (((char *) in_ptr) + in_ptr->xig_len))
573   {
574     struct tcpcb *tp = &((struct xtcpcb *) in_ptr)->xt_tp;
575     struct inpcb *inp = &((struct xtcpcb *) in_ptr)->xt_inp;
576     struct xsocket *so = &((struct xtcpcb *) in_ptr)->xt_socket;
577
578     /* Ignore non-TCP sockets */
579     if (so->xso_protocol != IPPROTO_TCP)
580       continue;
581
582     /* Ignore PCBs which were freed during copyout. */
583     if (inp->inp_gencnt > in_orig->xig_gen)
584       continue;
585
586     if (((inp->inp_vflag & INP_IPV4) == 0)
587         && ((inp->inp_vflag & INP_IPV6) == 0))
588       continue;
589
590     conn_handle_ports (ntohs (inp->inp_lport), ntohs (inp->inp_fport),
591         tp->t_state);
592   } /* for (in_ptr) */
593
594   in_orig = NULL;
595   in_ptr = NULL;
596   sfree (buffer);
597
598   conn_submit_all ();
599
600   return (0);
601 } /* int conn_read */
602 /* #endif HAVE_SYSCTLBYNAME */
603
604 #elif HAVE_LIBKVM_NLIST
605 static int kread (u_long addr, void *buf, int size)
606 {
607   int status;
608
609   status = kvm_read (kvmd, addr, buf, size);
610   if (status != size)
611   {
612     ERROR ("tcpconns plugin: kvm_read failed (got %i, expected %i): %s\n",
613         status, size, kvm_geterr (kvmd));
614     return (-1);
615   }
616   return (0);
617 } /* int kread */
618
619 static int conn_init (void)
620 {
621   char buf[_POSIX2_LINE_MAX];
622   struct nlist nl[] =
623   {
624 #define N_TCBTABLE 0
625     { "_tcbtable" },
626     { "" }
627   };
628   int status;
629
630   kvmd = kvm_openfiles (NULL, NULL, NULL, O_RDONLY, buf);
631   if (kvmd == NULL)
632   {
633     ERROR ("tcpconns plugin: kvm_openfiles failed: %s", buf);
634     return (-1);
635   }
636
637   status = kvm_nlist (kvmd, nl);
638   if (status < 0)
639   {
640     ERROR ("tcpconns plugin: kvm_nlist failed with status %i.", status);
641     return (-1);
642   }
643
644   if (nl[N_TCBTABLE].n_type == 0)
645   {
646     ERROR ("tcpconns plugin: Error looking up kernel's namelist: "
647         "N_TCBTABLE is invalid.");
648     return (-1);
649   }
650
651   inpcbtable_off = (u_long) nl[N_TCBTABLE].n_value;
652   inpcbtable_ptr = (struct inpcbtable *) nl[N_TCBTABLE].n_value;
653
654   return (0);
655 } /* int conn_init */
656
657 static int conn_read (void)
658 {
659   struct inpcbtable table;
660   struct inpcb *head;
661   struct inpcb *next;
662   struct inpcb inpcb;
663   struct tcpcb tcpcb;
664   int status;
665
666   conn_reset_port_entry ();
667
668   /* Read the pcbtable from the kernel */
669   status = kread (inpcbtable_off, &table, sizeof (table));
670   if (status != 0)
671     return (-1);
672
673   /* Get the `head' pcb */
674   head = (struct inpcb *) &(inpcbtable_ptr->inpt_queue);
675   /* Get the first pcb */
676   next = CIRCLEQ_FIRST (&table.inpt_queue);
677
678   while (next != head)
679   {
680     /* Read the pcb pointed to by `next' into `inpcb' */
681     kread ((u_long) next, &inpcb, sizeof (inpcb));
682
683     /* Advance `next' */
684     next = CIRCLEQ_NEXT (&inpcb, inp_queue);
685
686     /* Ignore sockets, that are not connected. */
687     if (!(inpcb.inp_flags & INP_IPV6)
688         && (inet_lnaof(inpcb.inp_laddr) == INADDR_ANY))
689       continue;
690     if ((inpcb.inp_flags & INP_IPV6)
691         && IN6_IS_ADDR_UNSPECIFIED (&inpcb.inp_laddr6))
692       continue;
693
694     kread ((u_long) inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb));
695     conn_handle_ports (ntohs(inpcb.inp_lport), ntohs(inpcb.inp_fport), tcpcb.t_state);
696   } /* while (next != head) */
697
698   conn_submit_all ();
699
700   return (0);
701 }
702 #endif /* HAVE_LIBKVM_NLIST */
703
704 void module_register (void)
705 {
706         plugin_register_config ("tcpconns", conn_config,
707                         config_keys, config_keys_num);
708 #if KERNEL_LINUX
709         plugin_register_init ("tcpconns", conn_init);
710 #elif HAVE_SYSCTLBYNAME
711         /* no initialization */
712 #elif HAVE_LIBKVM_NLIST
713         plugin_register_init ("tcpconns", conn_init);
714 #endif
715         plugin_register_read ("tcpconns", conn_read);
716 } /* void module_register */
717
718 /*
719  * vim: set shiftwidth=2 softtabstop=2 tabstop=8 fdm=marker :
720  */