5aaa25bd3c3d9b43c5de51f183c110cd2215e950
1 /**
2 * collectd - src/netlink.c
3 * Copyright (C) 2007-2010 Florian octo Forster
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; only version 2 of the License is applicable.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 *
18 * Authors:
19 * Florian octo Forster <octo at collectd.org>
20 **/
22 #include "collectd.h"
23 #include "plugin.h"
24 #include "common.h"
26 #include <asm/types.h>
27 #include <sys/socket.h>
29 #include <linux/netlink.h>
30 #include <linux/rtnetlink.h>
31 #if HAVE_LINUX_GEN_STATS_H
32 # include <linux/gen_stats.h>
33 #endif
34 #if HAVE_LINUX_PKT_SCHED_H
35 # include <linux/pkt_sched.h>
36 #endif
38 #include <time.h>
39 #include <libmnl/libmnl.h>
40 //#include <linux/if.h>
41 //#include <linux/if_link.h>
43 typedef struct ir_ignorelist_s
44 {
45 char *device;
46 char *type;
47 char *inst;
48 struct ir_ignorelist_s *next;
49 } ir_ignorelist_t;
51 static int ir_ignorelist_invert = 1;
52 static ir_ignorelist_t *ir_ignorelist_head = NULL;
54 static struct mnl_socket *nl;
56 static char **iflist = NULL;
57 static size_t iflist_len = 0;
59 static const char *config_keys[] =
60 {
61 "Interface",
62 "VerboseInterface",
63 "QDisc",
64 "Class",
65 "Filter",
66 "IgnoreSelected"
67 };
68 static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
70 static int add_ignorelist (const char *dev, const char *type,
71 const char *inst)
72 {
73 ir_ignorelist_t *entry;
75 entry = (ir_ignorelist_t *) malloc (sizeof (ir_ignorelist_t));
76 if (entry == NULL)
77 return (-1);
79 memset (entry, '\0', sizeof (ir_ignorelist_t));
81 if (strcasecmp (dev, "All") != 0)
82 {
83 entry->device = strdup (dev);
84 if (entry->device == NULL)
85 {
86 sfree (entry);
87 return (-1);
88 }
89 }
91 entry->type = strdup (type);
92 if (entry->type == NULL)
93 {
94 sfree (entry->device);
95 sfree (entry);
96 return (-1);
97 }
99 if (inst != NULL)
100 {
101 entry->inst = strdup (inst);
102 if (entry->inst == NULL)
103 {
104 sfree (entry->type);
105 sfree (entry->device);
106 sfree (entry);
107 return (-1);
108 }
109 }
111 entry->next = ir_ignorelist_head;
112 ir_ignorelist_head = entry;
114 return (0);
115 } /* int add_ignorelist */
117 /*
118 * Checks wether a data set should be ignored. Returns `true' is the value
119 * should be ignored, `false' otherwise.
120 */
121 static int check_ignorelist (const char *dev,
122 const char *type, const char *type_instance)
123 {
124 ir_ignorelist_t *i;
126 assert ((dev != NULL) && (type != NULL));
128 if (ir_ignorelist_head == NULL)
129 return (ir_ignorelist_invert ? 0 : 1);
131 for (i = ir_ignorelist_head; i != NULL; i = i->next)
132 {
133 /* i->device == NULL => match all devices */
134 if ((i->device != NULL)
135 && (strcasecmp (i->device, dev) != 0))
136 continue;
138 if (strcasecmp (i->type, type) != 0)
139 continue;
141 if ((i->inst != NULL) && (type_instance != NULL)
142 && (strcasecmp (i->inst, type_instance) != 0))
143 continue;
145 DEBUG ("netlink plugin: check_ignorelist: "
146 "(dev = %s; type = %s; inst = %s) matched "
147 "(dev = %s; type = %s; inst = %s)",
148 dev, type,
149 type_instance == NULL ? "(nil)" : type_instance,
150 i->device == NULL ? "(nil)" : i->device,
151 i->type,
152 i->inst == NULL ? "(nil)" : i->inst);
154 return (ir_ignorelist_invert ? 0 : 1);
155 } /* for i */
157 return (ir_ignorelist_invert);
158 } /* int check_ignorelist */
160 static void submit_one (const char *dev, const char *type,
161 const char *type_instance, derive_t value)
162 {
163 value_t values[1];
164 value_list_t vl = VALUE_LIST_INIT;
166 values[0].derive = value;
168 vl.values = values;
169 vl.values_len = 1;
170 sstrncpy (vl.host, hostname_g, sizeof (vl.host));
171 sstrncpy (vl.plugin, "netlink", sizeof (vl.plugin));
172 sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
173 sstrncpy (vl.type, type, sizeof (vl.type));
175 if (type_instance != NULL)
176 sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
178 plugin_dispatch_values (&vl);
179 } /* void submit_one */
181 static void submit_two (const char *dev, const char *type,
182 const char *type_instance,
183 derive_t rx, derive_t tx)
184 {
185 value_t values[2];
186 value_list_t vl = VALUE_LIST_INIT;
188 values[0].derive = rx;
189 values[1].derive = tx;
191 vl.values = values;
192 vl.values_len = 2;
193 sstrncpy (vl.host, hostname_g, sizeof (vl.host));
194 sstrncpy (vl.plugin, "netlink", sizeof (vl.plugin));
195 sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
196 sstrncpy (vl.type, type, sizeof (vl.type));
198 if (type_instance != NULL)
199 sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
201 plugin_dispatch_values (&vl);
202 } /* void submit_two */
204 static int update_iflist(struct ifinfomsg *msg, const char *dev)
205 {
206 /* Update the `iflist'. It's used to know which interfaces exist and query
207 * them later for qdiscs and classes. */
208 if ((msg->ifi_index >= 0) && ((size_t) msg->ifi_index >= iflist_len))
209 {
210 char **temp;
212 temp = (char **) realloc (iflist, (msg->ifi_index + 1) * sizeof (char *));
213 if (temp == NULL)
214 {
215 ERROR ("netlink plugin: update_iflist: realloc failed.");
216 return (-1);
217 }
219 memset (temp + iflist_len, '\0',
220 (msg->ifi_index + 1 - iflist_len) * sizeof (char *));
221 iflist = temp;
222 iflist_len = msg->ifi_index + 1;
223 }
224 if ((iflist[msg->ifi_index] == NULL)
225 || (strcmp (iflist[msg->ifi_index], dev) != 0))
226 {
227 sfree (iflist[msg->ifi_index]);
228 iflist[msg->ifi_index] = strdup (dev);
229 }
231 return (0);
232 }
235 static void check_ignorelist_and_submit(const char *dev,
236 struct rtnl_link_stats *stats)
237 {
239 if (check_ignorelist (dev, "interface", NULL) == 0)
240 {
241 submit_two (dev, "if_octets", NULL, stats->rx_bytes, stats->tx_bytes);
242 submit_two (dev, "if_packets", NULL, stats->rx_packets, stats->tx_packets);
243 submit_two (dev, "if_errors", NULL, stats->rx_errors, stats->tx_errors);
244 }
245 else
246 {
247 DEBUG ("netlink plugin: Ignoring %s/interface.", dev);
248 }
250 if (check_ignorelist (dev, "if_detail", NULL) == 0)
251 {
252 submit_two (dev, "if_dropped", NULL, stats->rx_dropped, stats->tx_dropped);
253 submit_one (dev, "if_multicast", NULL, stats->multicast);
254 submit_one (dev, "if_collisions", NULL, stats->collisions);
256 submit_one (dev, "if_rx_errors", "length", stats->rx_length_errors);
257 submit_one (dev, "if_rx_errors", "over", stats->rx_over_errors);
258 submit_one (dev, "if_rx_errors", "crc", stats->rx_crc_errors);
259 submit_one (dev, "if_rx_errors", "frame", stats->rx_frame_errors);
260 submit_one (dev, "if_rx_errors", "fifo", stats->rx_fifo_errors);
261 submit_one (dev, "if_rx_errors", "missed", stats->rx_missed_errors);
263 submit_one (dev, "if_tx_errors", "aborted", stats->tx_aborted_errors);
264 submit_one (dev, "if_tx_errors", "carrier", stats->tx_carrier_errors);
265 submit_one (dev, "if_tx_errors", "fifo", stats->tx_fifo_errors);
266 submit_one (dev, "if_tx_errors", "heartbeat", stats->tx_heartbeat_errors);
267 submit_one (dev, "if_tx_errors", "window", stats->tx_window_errors);
268 }
269 else
270 {
271 DEBUG ("netlink plugin: Ignoring %s/if_detail.", dev);
272 }
274 }
276 static int link_filter_cb (const struct nlmsghdr *nlh,
277 void __attribute__((unused)) *args)
278 {
279 struct ifinfomsg *ifm = mnl_nlmsg_get_payload (nlh);
280 struct nlattr *attr;
281 struct rtnl_link_stats *stats = NULL;
282 const char *dev = NULL;
284 if (nlh->nlmsg_type != RTM_NEWLINK)
285 {
286 ERROR ("netlink plugin: link_filter_cb: Don't know how to handle type %i.",
287 nlh->nlmsg_type);
288 return MNL_CB_ERROR;
289 }
291 mnl_attr_for_each (attr, nlh, sizeof (*ifm))
292 {
293 if (mnl_attr_get_type (attr) != IFLA_IFNAME)
294 continue;
296 if (mnl_attr_validate (attr, MNL_TYPE_STRING) < 0)
297 {
298 ERROR ("netlink plugin: link_filter_cb: IFLA_IFNAME mnl_attr_validate failed.");
299 return MNL_CB_ERROR;
300 }
302 dev = mnl_attr_get_str (attr);
303 if (update_iflist (ifm, dev) < 0)
304 return MNL_CB_ERROR;
305 break;
306 }
308 if (dev == NULL)
309 {
310 ERROR ("netlink plugin: link_filter_cb: dev == NULL");
311 return MNL_CB_ERROR;
312 }
314 mnl_attr_for_each (attr, nlh, sizeof (*ifm))
315 {
316 if (mnl_attr_get_type (attr) != IFLA_STATS)
317 continue;
319 if (mnl_attr_validate2 (attr, MNL_TYPE_UNSPEC, sizeof(*stats)) < 0)
320 {
321 ERROR ("netlink plugin: link_filter_cb: IFLA_STATS mnl_attr_validate2 failed.");
322 return MNL_CB_ERROR;
323 }
324 stats = mnl_attr_get_payload(attr);
326 check_ignorelist_and_submit(dev, stats);
327 break;
328 }
330 if (stats == NULL)
331 {
332 DEBUG ("netlink plugin: link_filter: No statistics for interface %s.", dev);
333 return MNL_CB_OK;
334 }
336 return MNL_CB_OK;
337 } /* int link_filter_cb */
339 #if HAVE_TCA_STATS2
340 static int qos_attr_cb (const struct nlattr *attr, void *data)
341 {
342 struct gnet_stats_basic *bs = *(struct gnet_stats_basic **)data;
344 /* skip unsupported attribute in user-space */
345 if (mnl_attr_type_valid(attr, TCA_STATS_MAX) < 0)
346 return MNL_CB_OK;
348 if (mnl_attr_get_type(attr) == TCA_STATS_BASIC)
349 {
350 if (mnl_attr_validate2 (attr, MNL_TYPE_UNSPEC, sizeof (*bs)) < 0)
351 {
352 ERROR ("netlink plugin: qos_attr_cb: TCA_STATS_BASIC mnl_attr_validate2 failed.");
353 return MNL_CB_ERROR;
354 }
355 bs = mnl_attr_get_payload(attr);
356 return MNL_CB_STOP;
357 }
359 return MNL_CB_OK;
360 } /* qos_attr_cb */
361 #endif
363 static int qos_filter_cb (const struct nlmsghdr *nlh, void *args)
364 {
365 struct tcmsg *tm = mnl_nlmsg_get_payload(nlh);
366 struct nlattr *attr;
368 int wanted_ifindex = *((int *) args);
370 const char *dev;
371 const char *kind = NULL;
372 struct gnet_stats_basic *bs = NULL;
373 struct tc_stats *ts = NULL;
375 /* char *type_instance; */
376 char *tc_type;
377 char tc_inst[DATA_MAX_NAME_LEN];
379 if (tm->tcm_ifindex != wanted_ifindex)
380 {
381 DEBUG ("netlink plugin: qos_filter_cb: Got %s for interface #%i, "
382 "but expected #%i.",
383 tc_type, msg->tcm_ifindex, wanted_ifindex);
384 return MNL_CB_OK;
385 }
387 if (nlh->nlmsg_type == RTM_NEWQDISC)
388 tc_type = "qdisc";
389 else if (nlh->nlmsg_type == RTM_NEWTCLASS)
390 tc_type = "class";
391 else if (nlh->nlmsg_type == RTM_NEWTFILTER)
392 tc_type = "filter";
393 else
394 {
395 ERROR ("netlink plugin: qos_filter_cb: Don't know how to handle type %i.",
396 nlh->nlmsg_type);
397 return MNL_CB_ERROR;
398 }
400 if ((tm->tcm_ifindex >= 0)
401 && ((size_t) tm->tcm_ifindex >= iflist_len))
402 {
403 ERROR ("netlink plugin: qos_filter_cb: tm->tcm_ifindex = %i "
404 ">= iflist_len = %zu",
405 tm->tcm_ifindex, iflist_len);
406 return MNL_CB_ERROR;
407 }
409 dev = iflist[tm->tcm_ifindex];
410 if (dev == NULL)
411 {
412 ERROR ("netlink plugin: qos_filter_cb: iflist[%i] == NULL",
413 tm->tcm_ifindex);
414 return MNL_CB_ERROR;
415 }
417 mnl_attr_for_each (attr, nlh, sizeof (*tm))
418 {
419 if (mnl_attr_get_type(attr) != TCA_KIND)
420 continue;
422 if (mnl_attr_validate (attr, MNL_TYPE_STRING) < 0)
423 {
424 ERROR ("netlink plugin: qos_filter_cb: TCA_KIND mnl_attr_validate failed.");
425 return MNL_CB_ERROR;
426 }
428 kind = mnl_attr_get_str(attr);
429 break;
430 }
432 if (kind == NULL)
433 {
434 ERROR ("netlink plugin: qos_filter_cb: kind == NULL");
435 return (-1);
436 }
438 { /* The the ID */
439 uint32_t numberic_id;
441 numberic_id = tm->tcm_handle;
442 if (strcmp (tc_type, "filter") == 0)
443 numberic_id = tm->tcm_parent;
445 ssnprintf (tc_inst, sizeof (tc_inst), "%s-%x:%x",
446 kind,
447 numberic_id >> 16,
448 numberic_id & 0x0000FFFF);
449 }
451 DEBUG ("netlink plugin: qos_filter_cb: got %s for %s (%i).",
452 tc_type, dev, msg->tcm_ifindex);
454 if (check_ignorelist (dev, tc_type, tc_inst))
455 return MNL_CB_OK;
457 #if HAVE_TCA_STATS2
458 mnl_attr_for_each (attr, nlh, sizeof (*tm))
459 {
460 if (mnl_attr_get_type(attr) != TCA_STATS2)
461 continue;
463 if (mnl_attr_validate(attr, MNL_TYPE_NESTED) < 0)
464 {
465 ERROR ("netlink plugin: qos_filter_cb: TCA_STATS2 mnl_attr_validate failed.");
466 return MNL_CB_ERROR;
467 }
469 mnl_attr_parse_nested(attr, qos_attr_cb, &bs);
471 break;
472 }
474 if (bs != NULL)
475 {
476 char type_instance[DATA_MAX_NAME_LEN];
478 ssnprintf (type_instance, sizeof (type_instance), "%s-%s",
479 tc_type, tc_inst);
481 submit_one (dev, "ipt_bytes", type_instance, bs->bytes);
482 submit_one (dev, "ipt_packets", type_instance, bs->packets);
483 }
484 #endif /* TCA_STATS2 */
486 #if HAVE_TCA_STATS
487 mnl_attr_for_each (attr, nlh, sizeof (*tm))
488 {
489 if (mnl_attr_get_type(attr) != TCA_STATS)
490 continue;
492 if (mnl_attr_validate2 (attr, MNL_TYPE_UNSPEC, sizeof (*ts)) < 0)
493 {
494 ERROR ("netlink plugin: qos_filter_cb: TCA_STATS mnl_attr_validate2 failed.");
495 return MNL_CB_ERROR;
496 }
497 ts = mnl_attr_get_payload(attr);
498 break;
499 }
501 if (bs == NULL && ts != NULL)
502 {
503 char type_instance[DATA_MAX_NAME_LEN];
505 ssnprintf (type_instance, sizeof (type_instance), "%s-%s",
506 tc_type, tc_inst);
508 submit_one (dev, "ipt_bytes", type_instance, ts->bytes);
509 submit_one (dev, "ipt_packets", type_instance, ts->packets);
510 }
511 #endif /* TCA_STATS */
513 #if !(HAVE_TCA_STATS && HAVE_TCA_STATS2)
514 DEBUG ("netlink plugin: qos_filter_cb: Have neither TCA_STATS2 nor "
515 "TCA_STATS.");
516 #endif
518 return MNL_CB_OK;
519 } /* int qos_filter_cb */
521 static int ir_config (const char *key, const char *value)
522 {
523 char *new_val;
524 char *fields[8];
525 int fields_num;
526 int status = 1;
528 new_val = strdup (value);
529 if (new_val == NULL)
530 return (-1);
532 fields_num = strsplit (new_val, fields, STATIC_ARRAY_SIZE (fields));
533 if ((fields_num < 1) || (fields_num > 8))
534 {
535 sfree (new_val);
536 return (-1);
537 }
539 if ((strcasecmp (key, "Interface") == 0)
540 || (strcasecmp (key, "VerboseInterface") == 0))
541 {
542 if (fields_num != 1)
543 {
544 ERROR ("netlink plugin: Invalid number of fields for option "
545 "`%s'. Got %i, expected 1.", key, fields_num);
546 status = -1;
547 }
548 else
549 {
550 add_ignorelist (fields[0], "interface", NULL);
551 if (strcasecmp (key, "VerboseInterface") == 0)
552 add_ignorelist (fields[0], "if_detail", NULL);
553 status = 0;
554 }
555 }
556 else if ((strcasecmp (key, "QDisc") == 0)
557 || (strcasecmp (key, "Class") == 0)
558 || (strcasecmp (key, "Filter") == 0))
559 {
560 if ((fields_num < 1) || (fields_num > 2))
561 {
562 ERROR ("netlink plugin: Invalid number of fields for option "
563 "`%s'. Got %i, expected 1 or 2.", key, fields_num);
564 return (-1);
565 }
566 else
567 {
568 add_ignorelist (fields[0], key,
569 (fields_num == 2) ? fields[1] : NULL);
570 status = 0;
571 }
572 }
573 else if (strcasecmp (key, "IgnoreSelected") == 0)
574 {
575 if (fields_num != 1)
576 {
577 ERROR ("netlink plugin: Invalid number of fields for option "
578 "`IgnoreSelected'. Got %i, expected 1.", fields_num);
579 status = -1;
580 }
581 else
582 {
583 if (IS_TRUE (fields[0]))
584 ir_ignorelist_invert = 0;
585 else
586 ir_ignorelist_invert = 1;
587 status = 0;
588 }
589 }
591 sfree (new_val);
593 return (status);
594 } /* int ir_config */
596 static int ir_init (void)
597 {
598 nl = mnl_socket_open(NETLINK_ROUTE);
599 if (nl == NULL)
600 {
601 ERROR ("netlink plugin: ir_init: mnl_socket_open failed.");
602 return (-1);
603 }
605 if (mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0)
606 {
607 ERROR ("netlink plugin: ir_init: mnl_socket_bind failed.");
608 return (-1);
609 }
611 return (0);
612 } /* int ir_init */
614 static int ir_read (void)
615 {
616 char buf[MNL_SOCKET_BUFFER_SIZE];
617 struct nlmsghdr *nlh;
618 struct rtgenmsg *rt;
619 int ret;
620 unsigned int seq, portid;
622 size_t ifindex;
624 static const int type_id[] = { RTM_GETQDISC, RTM_GETTCLASS, RTM_GETTFILTER };
625 static const char *type_name[] = { "qdisc", "class", "filter" };
627 portid = mnl_socket_get_portid(nl);
629 nlh = mnl_nlmsg_put_header (buf);
630 nlh->nlmsg_type = RTM_GETLINK;
631 nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
632 nlh->nlmsg_seq = seq = time (NULL);
633 rt = mnl_nlmsg_put_extra_header (nlh, sizeof (*rt));
634 rt->rtgen_family = AF_PACKET;
636 if (mnl_socket_sendto (nl, nlh, nlh->nlmsg_len) < 0)
637 {
638 ERROR ("netlink plugin: ir_read: rtnl_wilddump_request failed.");
639 return (-1);
640 }
642 ret = mnl_socket_recvfrom (nl, buf, sizeof (buf));
643 while (ret > 0)
644 {
645 ret = mnl_cb_run (buf, ret, seq, portid, link_filter_cb, NULL);
646 if (ret <= MNL_CB_STOP)
647 break;
648 ret = mnl_socket_recvfrom (nl, buf, sizeof(buf));
649 }
650 if (ret < 0)
651 {
652 ERROR ("netlink plugin: ir_read: mnl_socket_recvfrom failed.");
653 return (-1);
654 }
656 /* `link_filter_cb' will update `iflist' which is used here to iterate
657 * over all interfaces. */
658 for (ifindex = 0; ifindex < iflist_len; ifindex++)
659 {
660 struct tcmsg *tm;
661 int ifindex;
662 size_t type_index;
664 if (iflist[ifindex] == NULL)
665 continue;
667 for (type_index = 0; type_index < STATIC_ARRAY_SIZE (type_id); type_index++)
668 {
669 if (check_ignorelist (iflist[ifindex], type_name[type_index], NULL))
670 {
671 DEBUG ("netlink plugin: ir_read: check_ignorelist (%s, %s, (nil)) "
672 "== TRUE", iflist[ifindex], type_name[type_index]);
673 continue;
674 }
676 DEBUG ("netlink plugin: ir_read: querying %s from %s (%i).",
677 type_name[type_index], iflist[ifindex], ifindex);
679 nlh = mnl_nlmsg_put_header (buf);
680 nlh->nlmsg_type = type_id[type_index];
681 nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
682 nlh->nlmsg_seq = seq = time (NULL);
683 tm = mnl_nlmsg_put_extra_header (nlh, sizeof (*tm));
684 tm->tcm_family = AF_PACKET;
685 tm->tcm_ifindex = ifindex;
687 if (mnl_socket_sendto (nl, nlh, nlh->nlmsg_len) < 0)
688 {
689 ERROR ("netlink plugin: ir_read: mnl_socket_sendto failed.");
690 continue;
691 }
693 ret = mnl_socket_recvfrom (nl, buf, sizeof (buf));
694 while (ret > 0)
695 {
696 ret = mnl_cb_run (buf, ret, seq, portid, qos_filter_cb, &ifindex);
697 if (ret <= MNL_CB_STOP)
698 break;
699 ret = mnl_socket_recvfrom (nl, buf, sizeof (buf));
700 }
701 if (ret < 0)
702 {
703 ERROR ("netlink plugin: ir_read:mnl_socket_recvfrom failed.");
704 continue;
705 }
707 } /* for (type_index) */
708 } /* for (if_index) */
710 return (0);
711 } /* int ir_read */
713 static int ir_shutdown (void)
714 {
715 if (nl)
716 {
717 mnl_socket_close(nl);
718 nl = NULL;
719 }
721 return (0);
722 } /* int ir_shutdown */
724 void module_register (void)
725 {
726 plugin_register_config ("netlink", ir_config, config_keys, config_keys_num);
727 plugin_register_init ("netlink", ir_init);
728 plugin_register_read ("netlink", ir_read);
729 plugin_register_shutdown ("netlink", ir_shutdown);
730 } /* void module_register */
732 /*
733 * vim: set shiftwidth=2 softtabstop=2 tabstop=8 :
734 */