libnl 1.1.4
classifier-modules.h
1/*
2 * netlink/route/classifier-modules.h Classifier Module API
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation version 2.1
7 * of the License.
8 *
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10 */
11
12#ifndef NETLINK_CLASS_MODULES_H_
13#define NETLINK_CLASS_MODULES_H_
14
15#include <netlink/netlink.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21/**
22 * Classifier operations
23 * @ingroup cls_api
24 */
26{
27 /**
28 * Kind/Name of classifier
29 */
30 char co_kind[32];
31
32 /**
33 * Dump callbacks
34 */
35 int (*co_dump[NL_DUMP_MAX+1])(struct rtnl_cls *,
36 struct nl_dump_params *, int);
37 /**
38 * Must return the contents supposed to be in TCA_OPTIONS
39 */
40 struct nl_msg *(*co_get_opts)(struct rtnl_cls *);
41
42 /**
43 * TCA_OPTIONS message parser
44 */
45 int (*co_msg_parser)(struct rtnl_cls *);
46
47 /**
48 * Called before a class object gets destroyed
49 */
50 void (*co_free_data)(struct rtnl_cls *);
51
52 /**
53 * Called whenever a classifier object needs to be cloned
54 */
55 int (*co_clone)(struct rtnl_cls *, struct rtnl_cls *);
56
57 /**
58 * INTERNAL (Do not use)
59 */
61};
62
63extern int rtnl_cls_register(struct rtnl_cls_ops *);
64extern int rtnl_cls_unregister(struct rtnl_cls_ops *);
65extern struct rtnl_cls_ops * rtnl_cls_lookup_ops(struct rtnl_cls *);
66extern struct rtnl_cls_ops * __rtnl_cls_lookup_ops(const char *kind);
67
68#ifdef __cplusplus
69}
70#endif
71
72#endif
int rtnl_cls_unregister(struct rtnl_cls_ops *)
Unregister a classifier module.
Definition: cls_api.c:59
int rtnl_cls_register(struct rtnl_cls_ops *)
Register a classifier module.
Definition: cls_api.c:38
struct rtnl_cls_ops * rtnl_cls_lookup_ops(struct rtnl_cls *)
Lookup classifier operations for a classifier object.
Definition: cls_api.c:92
Dumping parameters.
Definition: types.h:37
Classifier operations.
int(* co_dump[NL_DUMP_MAX+1])(struct rtnl_cls *, struct nl_dump_params *, int)
Dump callbacks.
struct rtnl_cls_ops * co_next
INTERNAL (Do not use)
int(* co_msg_parser)(struct rtnl_cls *)
TCA_OPTIONS message parser.
int(* co_clone)(struct rtnl_cls *, struct rtnl_cls *)
Called whenever a classifier object needs to be cloned.
char co_kind[32]
Kind/Name of classifier.
void(* co_free_data)(struct rtnl_cls *)
Called before a class object gets destroyed.